mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +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=*)
|
||||||
disk="${arg#*=}"
|
disk="${arg#*=}"
|
||||||
|
case $disk in
|
||||||
|
CIFS=*|SMB=*|ISCSI=*|NBD=*|NFS=*)
|
||||||
|
STORAGE_NETBOOT=yes
|
||||||
|
;;
|
||||||
|
esac
|
||||||
;;
|
;;
|
||||||
textmode)
|
textmode)
|
||||||
INIT_ARGS="$INIT_ARGS --unit=textmode.target"
|
INIT_ARGS="$INIT_ARGS --unit=textmode.target"
|
||||||
@ -615,6 +620,10 @@
|
|||||||
if [ "$UPDATE_DISABLED" = "yes" ] ; then
|
if [ "$UPDATE_DISABLED" = "yes" ] ; then
|
||||||
echo "" > /sysroot/dev/.update_disabled
|
echo "" > /sysroot/dev/.update_disabled
|
||||||
fi
|
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
|
# switch to new sysroot and start real init
|
||||||
exec /bin/busybox switch_root /sysroot /lib/systemd/systemd $INIT_ARGS
|
exec /bin/busybox switch_root /sysroot /lib/systemd/systemd $INIT_ARGS
|
||||||
|
|
||||||
|
@ -20,11 +20,17 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
. /etc/swap.conf
|
. /etc/swap.conf
|
||||||
|
. /etc/profile
|
||||||
|
|
||||||
if [ -f /storage/.config/swap.conf ]; then
|
if [ -f /storage/.config/swap.conf ]; then
|
||||||
. /storage/.config/swap.conf
|
. /storage/.config/swap.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -e /dev/.storage_netboot ] ; then
|
||||||
|
logger -t Boot "### netbooting... swap disabled ###"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
SWAP=`blkid -t TYPE="swap" -o device`
|
SWAP=`blkid -t TYPE="swap" -o device`
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user