diff options
Diffstat (limited to 'experiments/03_20251130_leaving_initramfs/init')
| -rw-r--r-- | experiments/03_20251130_leaving_initramfs/init | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/experiments/03_20251130_leaving_initramfs/init b/experiments/03_20251130_leaving_initramfs/init new file mode 100644 index 0000000..27fcc61 --- /dev/null +++ b/experiments/03_20251130_leaving_initramfs/init @@ -0,0 +1,23 @@ +#!/bin/sh + +echo "creating new root..." +busybox mkdir /new_root +busybox mount -t tmpfs tmpfs /new_root + +busybox cp -r bin etc init lib lib64 sbin usr var /new_root + +busybox mkdir /new_root/dev +busybox mkdir /new_root/proc +busybox mkdir /new_root/sys + +echo "mounting special filesystems..." +busybox mount -t devtmpfs udev /new_root/dev +busybox mount -t proc proc /new_root/proc +busybox mount -t sysfs sysfs /new_root/sys + +echo "the cake is a lie!" > /new_root/cake + +echo "it's time to try 'switch_root' command and enter new_root" +echo "look for /cake to verify it worked" + +exec busybox switch_root /new_root /bin/busybox sh |
