From 63c48afe9b4461b803b910216094a520f71b7727 Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Tue, 9 Feb 2016 01:18:09 +0100 Subject: liveinit: if "toram" was specified, increase the size of the RAM filesystem. Also, make sure that we do not try and make any persistent writes when 'toram' was specified as a boot parameter, since 'toram' means that the user intends to remove the boot media afterwards. --- liveinit | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'liveinit') diff --git a/liveinit b/liveinit index 68beec6..b20a2e7 100755 --- a/liveinit +++ b/liveinit @@ -43,6 +43,8 @@ PERSISTENCE="@PERSISTENCE@" LIVEMEDIA="" # By default, let the media determine if we can write persistent changes: +# However, if we define TORAM=1, we will also set VIRGIN=1 since we want +# to avoid anything that writes to disk after we copy the OS to RAM. VIRGIN=0 # Used for debugging the init; set to '1' to enable explicit pauses> @@ -135,6 +137,7 @@ for ARG in $(cat /proc/cmdline); do ;; toram) TORAM=1 + VIRGIN=1 # prevent writes to disk since we are supposed to run from RAM ;; tz=*) TZ=$(echo $ARG | cut -f2 -d=) @@ -291,7 +294,12 @@ if [ "$RESCUE" = "" ]; then # We need a mounted filesystem here to be able to do a switch_root later, # so we create one in RAM: - mount -t tmpfs -o defaults none /mnt + if [ $TORAM -eq 1 ]; then + RAMSIZE=90% # need to be able to load the entire OS in RAM + else + RAMSIZE=50% # the default value. + fi + mount -t tmpfs -o defaults,size=${RAMSIZE}% none /mnt # Find the Slackware Live media. # TIP: Increase WAIT to give USB devices a chance to be seen by the kernel. -- cgit v1.2.3