dp not enable swap when /storage is on net (nfs/iscsi/cifs)

closes #1916
This commit is contained in:
Stefan Saraev 2013-10-18 19:43:12 +03:00
parent 7252991e44
commit 58b80606f6
2 changed files with 15 additions and 0 deletions

View File

@ -80,6 +80,11 @@
;;
disk=*)
disk="${arg#*=}"
case $disk in
CIFS=*|SMB=*|ISCSI=*|NBD=*|NFS=*)
STORAGE_NETBOOT=yes
;;
esac
;;
textmode)
INIT_ARGS="$INIT_ARGS --unit=textmode.target"
@ -615,6 +620,10 @@
if [ "$UPDATE_DISABLED" = "yes" ] ; then
echo "" > /sysroot/dev/.update_disabled
fi
# swap can not be used over nfs.(see scripts/mount-swap)
if [ "$STORAGE_NETBOOT" = "yes" ] ; then
echo "" > /sysroot/dev/.storage_netboot
fi
# switch to new sysroot and start real init
exec /bin/busybox switch_root /sysroot /lib/systemd/systemd $INIT_ARGS

View File

@ -20,11 +20,17 @@
################################################################################
. /etc/swap.conf
. /etc/profile
if [ -f /storage/.config/swap.conf ]; then
. /storage/.config/swap.conf
fi
if [ -e /dev/.storage_netboot ] ; then
logger -t Boot "### netbooting... swap disabled ###"
exit 0
fi
SWAP=`blkid -t TYPE="swap" -o device`
case $1 in