diff options
-rwxr-xr-x | draklive-install | 12 | ||||
-rwxr-xr-x | draklive-install-lock-storage | 3 |
2 files changed, 11 insertions, 4 deletions
diff --git a/draklive-install b/draklive-install index 26a6550..a319249 100755 --- a/draklive-install +++ b/draklive-install @@ -76,14 +76,16 @@ sub install_live() { } sub umount_all { - my ($fstab) = @_; + my ($fstab, $o_except_swap) = @_; #- make sure nothing is mounted in the new root foreach (sort { $b cmp $a } grep { /^$::prefix/ } map { (split)[1] } cat_('/proc/mounts')) { system('umount', $_); } #- make sure selected devices aren't mounted, and swap isn't used - foreach (grep { isSwap($_) } @$fstab) { - eval { fs::mount::swapoff($_->{device}) }; + if (!$o_except_swap) { + foreach (grep { isSwap($_) } @$fstab) { + eval { fs::mount::swapoff($_->{device}) }; + } } foreach (map { $_->{isMounted} && !isSwap($_) ? "/dev/$_->{device}" : () } @$fstab) { system('umount', $_); @@ -362,7 +364,9 @@ sub finish_installation { run_program::rooted($::prefix, 'sed', '-i', '/for draklive-install/d', '/etc/pam.d/polkit-1'); sync_logs(); #- cleanly umount here, it will avoid fs journals to be corrupted after a hackish reboot - umount_all($fstab); + #- but leave swap space, to avoid out-of-memory error on machines with little memory + #- draklive-install-lock-storage will unmount swap after we exit and free up some memory + umount_all($fstab, 1); clean_live_system_hds(); } diff --git a/draklive-install-lock-storage b/draklive-install-lock-storage index 8d42a5b..a580705 100755 --- a/draklive-install-lock-storage +++ b/draklive-install-lock-storage @@ -10,3 +10,6 @@ else fi # run without udisks lock if it fails [ "$?" != 0 ] && $CMD + +# draklive-install will leave swap partitions mounted. Unmount them now. +swapoff -a |