From 09503e583c3730be7a2489b67c2c1c0a3717fe5c Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Thu, 30 Jan 2025 15:03:51 -0700 Subject: [PATCH] Don't mount /run during wwinit - Fixes: #1566 Signed-off-by: Jonathon Anderson --- CHANGELOG.md | 4 ++++ overlays/wwinit/rootfs/init | 14 +++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d30a797..a845caa9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Document defining kernel args that include commas. #1679 +### Changes + +- Don't mount /run during wwinit. #1566 + ### Fixed - Fix default nodes.conf to use the new kernel command line list format. #1670 diff --git a/overlays/wwinit/rootfs/init b/overlays/wwinit/rootfs/init index 42d07a4d..3982ae7d 100755 --- a/overlays/wwinit/rootfs/init +++ b/overlays/wwinit/rootfs/init @@ -5,13 +5,9 @@ # # Edit at your own risk! DANGER DANGER. -echo -n "Mounting kernel file systems:" -mkdir /proc /dev /sys /run 2>/dev/null -mount -t proc proc /proc && echo -n " /proc" -mount -t devtmpfs devtmpfs /dev && echo -n " /dev" -mount -t sysfs sysfs /sys && echo -n " /sys" -mount -t tmpfs tmpfs /run && echo -n " /run" -echo +mountpoint -q /proc || (mkdir -p /proc && mount -t proc proc /proc && echo "Mounted /proc") +mountpoint -q /dev || (mkdir -p /dev && mount -t devtmpfs devtmpfs /dev && echo "Mounted /dev") +mountpoint -q /sys || (mkdir -p /sys && mount -t sysfs sysfs /sys && echo "Mounted /sys") if [ -f "/warewulf/config" ]; then . /warewulf/config @@ -35,8 +31,8 @@ elif [ "${WWROOT}" = "ramfs" -o "${WWROOT}" = "tmpfs" ]; then echo "Setting up new ${WWROOT} rootfs..." mkdir /newroot mount wwroot /newroot -t ${WWROOT} -o mpol=interleave # mpol ignored for ramfs - tar -cf - --exclude ./proc --exclude ./sys --exclude ./dev --exclude ./run --exclude ./newroot . | tar -xf - -C /newroot - mkdir /newroot/proc /newroot/dev /newroot/sys /newroot/run 2>/dev/null + tar -cf - --exclude ./proc --exclude ./sys --exclude ./dev --exclude --exclude ./newroot . | tar -xf - -C /newroot + mkdir /newroot/proc /newroot/dev /newroot/sys 2>/dev/null echo "Switching to new rootfs and invoking /warewulf/wwinit..." exec /sbin/switch_root /newroot /warewulf/wwinit else