filesystem: enable swap after adding to fstab
This commit is contained in:
parent
d18482236a
commit
f7e9e7befb
@ -234,7 +234,7 @@ blkid | grep /dev/sd | while read line; do
|
||||
case $devfstype in
|
||||
linux-swap|swap) # Linux swap
|
||||
[ "$FS_SWAP_UPDATE" = "yes" ] || continue
|
||||
mount_point="swap"
|
||||
mount_point="swap "
|
||||
fstype="swap"
|
||||
options="pri=1"
|
||||
let "swapon = 1" ;;
|
||||
@ -288,9 +288,6 @@ blkid | grep /dev/sd | while read line; do
|
||||
;;
|
||||
esac
|
||||
|
||||
logmsg "$me" $"\
|
||||
added device \`$dev' (${uuid}) mount point:\`$mount_point'"
|
||||
|
||||
# note: if 'mount_point' is yet undefined there is a bug
|
||||
if [[ "$mount_point" ]]; then
|
||||
# default values: fstype="auto", options="noauto,user"
|
||||
@ -299,16 +296,20 @@ added device \`$dev' (${uuid}) mount point:\`$mount_point'"
|
||||
echo "\
|
||||
UUID=${uuid} $mount_point \
|
||||
${fstype:-"auto"} ${options:-"noauto,user"}${extra_options} ${check_options}" >> $fstab
|
||||
[ "$fstype" = "swap" ] && /sbin/swapon -p 1 ${uuid}
|
||||
else
|
||||
echo "\
|
||||
$dev $mount_point \
|
||||
${fstype:-"auto"} ${options:-"noauto,user"}${extra_options} ${check_options}" >> $fstab
|
||||
[ "$fstype" = "swap" ] && /sbin/swapon -p 1 ${dev}
|
||||
fi
|
||||
# create the mount point and mount the new device
|
||||
[ "${mount_point:0:${#rootmp}}" = "${rootmp}" ] && {
|
||||
mkdir -p "$mount_point"
|
||||
mount "$mount_point"
|
||||
}
|
||||
logmsg "$me" $"\
|
||||
added device \`$dev' (${uuid}) mount point:\`$mount_point'"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
@ -2,7 +2,7 @@
|
||||
Description=openmamba system configuration script
|
||||
DefaultDependencies=no
|
||||
After=systemd-udev-trigger.service systemd-remount-fs.service
|
||||
Before=swap.target sysinit.target
|
||||
Before=sysinit.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
|
Loading…
Reference in New Issue
Block a user