mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-10 19:12:33 +08:00
base-files: try to activate hotplugged partitions as swap and fall back to lazy mount (#6517)
SVN-Revision: 19300
This commit is contained in:
parent
1089b3213d
commit
3634de3b80
@ -1,6 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2009 OpenWrt.org
|
||||
# Copyright (C) 2009-2010 OpenWrt.org
|
||||
|
||||
blkdev=`dirname $DEVPATH`
|
||||
if [ `basename $blkdev` != "block" ]; then
|
||||
@ -8,8 +7,10 @@ if [ `basename $blkdev` != "block" ]; then
|
||||
device=`basename $DEVPATH`
|
||||
case "$ACTION" in
|
||||
add)
|
||||
mkdir -p /mnt/$device
|
||||
mount /dev/$device /mnt/$device
|
||||
swapon /dev/$device >/dev/null 2>/dev/null || (
|
||||
mkdir -p /mnt/$device
|
||||
mount /dev/$device /mnt/$device
|
||||
)
|
||||
;;
|
||||
remove)
|
||||
umount /dev/$device
|
||||
|
Loading…
x
Reference in New Issue
Block a user