changes to the initramfs. very specific changes to included kernel modules.

This commit is contained in:
Matt Knoop
2025-12-09 17:17:07 -07:00
parent 09eb3c54ba
commit e914ac9619
9 changed files with 113 additions and 33 deletions

View File

@@ -1,20 +1,23 @@
#!/bin/busybox sh
/bin/busybox echo 'mounting filesystems and devices..'
/bin/busybox mount -t devtmpfs devtmpfs /dev
set -e
/bin/busybox echo 'mounting /proc..'
/bin/busybox mount -t proc proc /proc
/bin/busybox mount -t sysfs none /sys
/bin/busybox mount -t sysfs none /run
/bin/busybox echo 'mounting /sys..'
/bin/busybox mount -t sysfs sysfs /sys
/bin/busybox echo 'mounting /dev..'
/bin/busybox mount -t devtmpfs devtmpfs /dev
/bin/busybox echo 'creating root..'
/bin/busybox mkdir -p /newroot
/bin/busybox mount /dev/sda2 /newroot
#/bin/busybox mount --move /sys /newroot
#/bin/busybox mount --move /dev /newroot
#/bin/busybox mount --move /proc /newroot
#exec /bin/busybox sh
#/bin/busybox ln -s "/lib/modules/" "/lib/modules/$(uname -r)"
#depmod -a
#/bin/busybox modprobe nbd max_part=2
/bin/busybox echo 'switching root.'
exec switch_root /newroot /bin/systemd
/bin/busybox echo 'mounting root..'
/bin/busybox mount $(/bin/busybox findfs LABEL=ROOT) /newroot
#/bin/busybox echo 'moving /sys..'
#/bin/busybox mount --move /sys /newroot/sys
#/bin/busybox echo 'moving /dev..'
#/bin/busybox mount --move /dev /newroot/dev
#/bin/busybox echo 'moving /proc..'
#/bin/busybox mount --move /proc /newroot/proc
#/bin/busybox modprobe encryptfs
#/bin/busybox modprobe dm-crypt
/bin/busybox echo 'switching root..'
exec switch_root /newroot /lib/systemd/systemd --system