summaryrefslogtreecommitdiffstats
path: root/rescue
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-06-29 03:30:48 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-06-29 03:30:48 +0000
commit180d38f596c643db182823983c03c14456ed66af (patch)
treeb688c864665e5b0b0d2099f9874a30ae4477ee68 /rescue
parentbf0d59363994a33df2128417fc6d965375f05a26 (diff)
downloaddrakx-180d38f596c643db182823983c03c14456ed66af.tar
drakx-180d38f596c643db182823983c03c14456ed66af.tar.gz
drakx-180d38f596c643db182823983c03c14456ed66af.tar.bz2
drakx-180d38f596c643db182823983c03c14456ed66af.tar.xz
drakx-180d38f596c643db182823983c03c14456ed66af.zip
- 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
Diffstat (limited to 'rescue')
-rwxr-xr-xrescue/partimage_whole_disk22
1 files changed, 17 insertions, 5 deletions
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) }