forked from tfgrid/zosbuilder
ix init script duplication and CPIO creation issues
- Remove duplicate /sbin/init copying from initramfs_setup_zinit() - Only /init should be config/init (initramfs setup script) - No /sbin/init needed - config/init calls 'switch_root /mnt/root /sbin/zinit init' - Remove unsupported cpio --owner option that broke CPIO creation - Fix validation to not expect /sbin/init file - Correct boot flow: /init → switch_root → /sbin/zinit init - Remove strip and UPX compression from zinit binary copying - UPX compression was corrupting the zinit binary causing segfaults after switch_root - Keep zinit unmodified as it's
This commit is contained in:
19
config/init
19
config/init
@@ -1,20 +1,31 @@
|
||||
#!/bin/sh
|
||||
#!/bin/sh -x
|
||||
# Alpine-based Zero-OS Init Script
|
||||
# Maintains identical flow to original busybox version
|
||||
|
||||
if [ ! -c /dev/console ]; then
|
||||
mknod /dev/console c 5 1
|
||||
fi
|
||||
|
||||
# Redirect output to console explicitly
|
||||
exec > /dev/console 2>&1
|
||||
|
||||
echo ""
|
||||
echo "============================================"
|
||||
echo "== ZERO-OS ALPINE INITRAMFS =="
|
||||
echo "============================================"
|
||||
|
||||
echo "[+] creating ram filesystem"
|
||||
target="/mnt/root"
|
||||
mkdir -p $target
|
||||
mount -t proc proc /proc
|
||||
mount -t sysfs sysfs /sys
|
||||
mount -t tmpfs tmpfs /mnt/root -o size=1536M
|
||||
mount -t devtmpfs devtmpfs /dev
|
||||
mkdir -p /dev/pts
|
||||
mount -t devpts devpts /dev/pts
|
||||
|
||||
echo "[+] building ram filesystem"
|
||||
target="/mnt/root"
|
||||
|
||||
|
||||
# Copy Alpine filesystem to tmpfs (same as original)
|
||||
echo " copying /bin..."
|
||||
@@ -101,4 +112,6 @@ fi
|
||||
|
||||
echo "[+] switching root"
|
||||
echo " exec switch_root /mnt/root /sbin/zinit init"
|
||||
exec switch_root /mnt/root /sbin/zinit init
|
||||
exec switch_root /mnt/root /sbin/zinit init
|
||||
|
||||
##
|
||||
Reference in New Issue
Block a user