From 180d38f596c643db182823983c03c14456ed66af Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 29 Jun 2005 03:30:48 +0000 Subject: - don't save /home and want a size <1GB (since it will be grown to fit disk) - fix keeping the small size of the existing windows partition (otherwise the filesystem is small in a (much) bigger partition) - remove "windows" entry from lilo.conf if windows not there --- rescue/partimage_whole_disk | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'rescue/partimage_whole_disk') diff --git a/rescue/partimage_whole_disk b/rescue/partimage_whole_disk index 8e68d8492..5c5ce214a 100755 --- a/rescue/partimage_whole_disk +++ b/rescue/partimage_whole_disk @@ -53,12 +53,15 @@ sub save_all { my $part_list = [ partition_table::get_normal_parts($hd) ]; foreach (@$part_list) { - $_->{saved} = !member($_->{fs_type}, 'ntfs', 'vfat', 'swap'); + $_->{saved} = !member($_->{fs_type}, 'ntfs', 'vfat', 'swap') && $_->{mntpoint} ne '/home'; if ($_->{saved}) { run_or_die(@partimage_cmd, '-V', 0, '--nombr', '--nodesc', '--nocheck', '-b', '-o', 'save', devices::make($_->{device}), "$dir/$_->{device}"); } + if ($_->{mntpoint} eq '/home') { + $_->{size} = min($_->{size}, 1024 * 1024 * 2); # not greater than 1GB + } } save_part_list($dir, $hd->{geom}, $part_list); } @@ -141,7 +144,8 @@ sub rest_all { my $resize = $resize_pkg->new($_->{device}, devices::make($_->{device})); $resize->resize($_->{size}); } else { - log::l("no need to resize $_->{device} since $_->{size} >= $part->{size}"); + log::l("no need to resize, instead setting $_->{device}'s size to $part->{size} instead of $_->{size}"); + $_->{size} = $part->{size}; } } @@ -194,15 +198,23 @@ sub rest_all { foreach (@{$h{created}}) { fs::format::part_raw($_, undef); } - - run_program::run('install_bootloader'); + + run_program::run('guessmounts'); if (my @missing = grep { $_->{missing} } @{$h{part_list}}) { my $missing = join('|', map { quotemeta($_->{device}) } @missing); - log::l("drop missing devices from fstab: $missing"); + log::l("drop missing devices from fstab and lilo.conf: $missing"); $::prefix = '/mnt'; substInFile { $_ = '' if m!^/dev/($missing)\s! } "$::prefix/etc/fstab"; + + my $match; + substInFile { + /^\S/ and $match = m!^other=/dev/($missing)$!; + $_ = '' if $match; + } "$::prefix/etc/lilo.conf"; } + + run_program::run('install_bootloader'); } sub lst_fields() { qw(device size fs_type saved) } -- cgit v1.2.1