summaryrefslogtreecommitdiff
path: root/old-school/menu-select
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2016-04-28 09:11:41 -0400
committerAndrew Cady <d@jerkface.net>2016-04-28 09:11:41 -0400
commit6ef6e4fa6d49b27f30a6d332cc346f6dd96bbc28 (patch)
tree97dcbed12c3fec102cfa877611f73e4fa1ce6c58 /old-school/menu-select
parentd0c64cb0a0d6673e7f17363d77c31f17c3aed4ce (diff)
boot-ram was using erroneous math to calculate ramdisk size
Diffstat (limited to 'old-school/menu-select')
-rwxr-xr-xold-school/menu-select9
1 files changed, 5 insertions, 4 deletions
diff --git a/old-school/menu-select b/old-school/menu-select
index 9b340ac..d8c9d6e 100755
--- a/old-school/menu-select
+++ b/old-school/menu-select
@@ -62,10 +62,11 @@ hwclock_to_system()
62 62
63case "$1" in 63case "$1" in
64 boot-ram) 64 boot-ram)
65 memtotal=$(sed -ne 's/MemTotal: *//p' /proc/meminfo) 65 read _ memtotal_kb _ < /proc/meminfo
66 ramdisk=$((1024 * ${memtotal% *} / 2)) 66 memtotal_mb=$((memtotal_kb / 1024))
67 [ $ramdisk -ge 256 ] || ramdisk=256 67 ramdisk_mb=$((memtotal_mb / 2))
68 modprobe brd rd_size=$ramdisk 68 [ "$ramdisk_mb" -ge 256 ] || ramdisk_mb=256
69 modprobe brd rd_size=$((ramdisk_mb * 1024))
69 70
70 init_gpg || error 71 init_gpg || error
71 init_samizdat /dev/ram0 '' || { 72 init_samizdat /dev/ram0 '' || {