From ab710e99bbbacdcb445776393ef627d8cb2d3574 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Fri, 22 Apr 2016 22:43:20 -0400 Subject: mount seed layers when booting with RAM option --- old-school/menu-select | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'old-school') diff --git a/old-school/menu-select b/old-school/menu-select index 55360b6..e661079 100755 --- a/old-school/menu-select +++ b/old-school/menu-select @@ -64,8 +64,19 @@ case "$1" in boot-ram) mkdir /cdrom /btrfs bootwait samizdat-cdrom - mount -t btrfs -o loop,subvol=ROOT /cdrom/live/filesystem.btrfs /btrfs - modprobe brd rd_size=$((256 * 1024 * 2)) # TODO: choose intelligently + + losetup_layers || error + modprobe btrfs || error + btrfs device scan || error + uuid=$(choose_uuid) || error + [ "$uuid" ] || error + + mount -t btrfs -o loop,subvol=ROOT UUID="$uuid" /btrfs + memtotal=$(sed -ne 's/MemTotal: *//p' /proc/meminfo) + ramdisk=$((1024 * ${memtotal% *} / 2)) + [ $ramdisk -ge 256 ] || ramdisk=256 + modprobe brd rd_size=$ramdisk + btrfs device add /dev/ram0 /btrfs mount -o rw,remount /btrfs mount -o move /btrfs /root -- cgit v1.2.3