mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
dp not enable swap when /storage is on net (nfs/iscsi/cifs)
closes #1916
This commit is contained in:
parent
7252991e44
commit
58b80606f6
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user