From 73f39a96c8786cf9491c06e8ba60edd63863dac1 Mon Sep 17 00:00:00 2001 From: wrzosik Date: Sun, 30 Nov 2025 15:21:08 +0100 Subject: experiment: Leave initramfs Added experiment on booting past initramfs. It uses Makefile to build initramfs. --- experiments/03_20251130_leaving_initramfs/init | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 experiments/03_20251130_leaving_initramfs/init (limited to 'experiments/03_20251130_leaving_initramfs/init') 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 -- cgit v1.2.3