Upload files to "/"

This commit is contained in:
2025-10-31 08:45:25 -06:00
parent 24dbc38792
commit 601ee1739f
2 changed files with 21 additions and 0 deletions

BIN
busybox Normal file

Binary file not shown.

21
initrd_build.sh Normal file
View File

@@ -0,0 +1,21 @@
dir=$(dirname "$0")
echo "$dir"
cd "$dir"
rm -rf initram/
mkdir -p initram
mkdir -p initram/{bin,dev,etc,lib,proc,sbin,sys,tmp,usr}
mkdir -p initram/usr/{bin,sbin}
mkdir -p initram/etc/{bin,sbin}
mkdir -p initram/lib/modules/
cp busybox ./initram/bin/
cp /mnt/tmpfs/linux/drivers/block/nbd.ko initram/lib/modules/
cp /mnt/tmpfs/linux/modules.builtin initram/lib/modules/
cp /mnt/tmpfs/linux/modules.order initram/lib/modules/
cd initram/bin/
chmod +x busybox
busybox --install -s "$(dirname "$0")/initram/bin/"
printf '%s\n' "#!/bin/busybox sh" "/bin/busybox mount -t devtmpfs devtmpfs /dev" "/bin/busybox mount -t proc none /proc" "/bin/busybox mount -t sysfs none /sys" "ln -s /lib/modules/ /lib/modules/6.17.0-g98906f9d850e" "depmod -a" "/bin/busybox modprobe nbd max_part=2" "exec /bin/busybox sh" > "$dir/initram/init"
chmod +x $dir/initram/init
cd $dir/initram/
find . -print0 | cpio --null -ov --format=newc | gzip -9 > $dir/initramfs.cpio.gz