summaryrefslogtreecommitdiffstats
path: root/draklive-install
diff options
context:
space:
mode:
Diffstat (limited to 'draklive-install')
-rwxr-xr-xdraklive-install12
1 files changed, 8 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();
}