POSIX fixes for #1464

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Ian Kaufman
2024-10-30 14:15:40 -07:00
committed by Jonathon Anderson
parent 795c44e650
commit f3a1b43360
5 changed files with 35 additions and 17 deletions

View File

@@ -28,10 +28,10 @@ echo
chmod 755 /warewulf/wwinit
if [ -z "${WWROOT}" -o "${WWROOT}" == "initramfs" ]; then
if [ -z "${WWROOT}" -o "${WWROOT}" = "initramfs" ]; then
echo "Retaining initramfs and invoking /warewulf/wwinit..."
exec /warewulf/wwinit
elif [ "${WWROOT}" == "ramfs" -o "${WWROOT}" == "tmpfs" ]; then
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

18
overlays/wwinit/rootfs/warewulf/wwinit Normal file → Executable file
View File

@@ -4,14 +4,22 @@ echo "Hello from WWINIT"
. /warewulf/config
for i in /warewulf/init.d/*; do
NAME=`basename $i`
echo "Launching: $NAME"
sh "$i"
done
myPATH=/warewulf/init.d
while read -r NAME; do
# if [ -x $myPATH/$NAME ]
# then
echo "Launching: $NAME"
sh "$myPATH/$NAME"
# fi
done <<EOF
# `ls $myPATH/*.sh`
`ls $myPATH/`
EOF
echo "Calling $WWINIT..."
echo
sleep 2
exec $WWINIT