Add kernel command line flags, nonet and shredos_nonet that disable the network

This commit is contained in:
PartialVolume
2025-12-05 20:00:19 +00:00
parent f56ff5e12a
commit b190567aa1

View File

@@ -13,6 +13,15 @@ ifdown -f -a
# Bring up loopback device
ifup lo
# ------------------------------------------------------------
# Option: completely disable networking
# Kernel cmdline flags: "nonet" or "shredos_nonet"
# ------------------------------------------------------------
if grep -Eq '(^| )nonet(=| |$)|(^| )shredos_nonet(=| |$)' /proc/cmdline 2>/dev/null; then
echo "[INFO] Network disabled via kernel cmdline (nonet/shredos_nonet)."
exit 0
fi
# delete the existing non populated interfaces file
rm /etc/network/interfaces