diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2023-05-10 18:05:37 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2023-05-10 18:05:37 +0200 |
commit | 5992b78501ab76dc77449f5e638da0dae061a84b (patch) | |
tree | 0899725e6340573586b3ce5aa9549ad17d354637 /local | |
parent | ca0e8f54b76e66aa5f8770a495873ad2399cae8f (diff) | |
download | i486tcc-linux-5992b78501ab76dc77449f5e638da0dae061a84b.tar.gz i486tcc-linux-5992b78501ab76dc77449f5e638da0dae061a84b.tar.bz2 |
fixes around low memory and NBD root
Diffstat (limited to 'local')
-rwxr-xr-x | local/etc/rc.init | 5 | ||||
-rwxr-xr-x | local/init | 11 |
2 files changed, 9 insertions, 7 deletions
diff --git a/local/etc/rc.init b/local/etc/rc.init index 5d6e34f..50468f1 100755 --- a/local/etc/rc.init +++ b/local/etc/rc.init @@ -2,10 +2,9 @@ echo "Starting.." +# TODO: unmount old root, free ramdisk + echo "Mounting pseudo-filesystems.." -mount -n -t proc -o nosuid,noexec,nodev proc /proc -mount -n -t sysfs -o nosuid,noexec,nodev,ro sys /sys -mount -n -t devtmpfs -o mode=0755,nosuid udev /dev mkdir /dev/pts mount -n -t devpts -o mode=0620,gid=5,nosuid,noexec devpts /dev/pts @@ -1,4 +1,4 @@ -#!/bin/oksh -x +#!/bin/oksh echo "Starting in ramdisk.." @@ -26,14 +26,17 @@ insmod /lib/modules/crypto/crc32c_generic.ko insmod /lib/modules/fs/ext4/ext4.ko insmod /lib/modules/drivers/block/nbd.ko nbd-client -N ROOT 10.0.0.2 /dev/nbd0 -mkdir /newroot -mount -t ext4 /dev/nbd0 /newroot +mkdir /mnt +mount -t ext4 /dev/nbd0 /mnt echo "Loading additional modules.." insmod /lib/modules/net/unix/unix.ko echo "Mounting new root.." -exec switch_root /newroot /bin/sinit +mount -M /proc /mnt/proc +mount -M /sys /mnt/sys +mount -M /dev /mnt/dev +exec switch_root -c /dev/console /mnt /bin/sinit echo "Failed to mount NBD root..falling back to shell.." exec /bin/sh |