From 9536d08153ea7d840c8e7dc44eeecaf090180015 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Thu, 20 Mar 2008 15:58:57 +0000 Subject: sync /var/log in installed root when needed --- draklive-install | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'draklive-install') diff --git a/draklive-install b/draklive-install index 4282234..53d89c4 100755 --- a/draklive-install +++ b/draklive-install @@ -175,6 +175,10 @@ sub get_total_size { $total{$source} = first(split(/\s+/, `du -sbx $source 2>/dev/null`)); } +sub sync_logs() { + cp_af('/var/log', $::prefix . '/var'); +} + sub copy_root { my ($in, $copy_source) = @_; my $total = get_total_size($in, $copy_source); @@ -199,6 +203,7 @@ sub copy_root { $in->ask_warn(N("Error"), N("Unable to copy files to new root")); $in->exit(1); } + sync_logs(); } sub complete_install { @@ -250,6 +255,8 @@ sub complete_install { # enable back some disabled services require services; services::start_service_on_boot($_) foreach qw(dkms crond); + + sync_logs(); } sub setup_bootloader { @@ -259,10 +266,12 @@ sub setup_bootloader { any::setupBootloaderBeforeStandalone($in->do_pkgs, $bootloader, $all_hds, $fstab); local $::Wizard_no_previous = 0; any::setupBootloaderUntilInstalled($in, $bootloader, $all_hds, $fstab, $ENV{SECURE_LEVEL}); + sync_logs(); } sub finish_installation { my ($fstab) = @_; + sync_logs(); #- cleanly umount here, it will avoid fs journals to be corrupted after a hackish reboot umount_all($fstab); } -- cgit v1.2.1