diff options
author | Eric Hameleers <alien@slackware.com> | 2016-02-09 01:18:09 +0100 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2016-02-09 01:18:09 +0100 |
commit | 63c48afe9b4461b803b910216094a520f71b7727 (patch) | |
tree | 9408627f7f99d3e89a4aa58bf6a0c6595c88125f /liveinit | |
parent | 9cdbfd7bad759454e81f78006b2fd0649caa1137 (diff) | |
download | liveslak-63c48afe9b4461b803b910216094a520f71b7727.tar.gz liveslak-63c48afe9b4461b803b910216094a520f71b7727.tar.xz |
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.
Diffstat (limited to 'liveinit')
-rwxr-xr-x | liveinit | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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. |