summaryrefslogtreecommitdiffstats
path: root/rescue
diff options
context:
space:
mode:
Diffstat (limited to 'rescue')
-rwxr-xr-xrescue/partimage_whole_disk22
1 files changed, 14 insertions, 8 deletions
diff --git a/rescue/partimage_whole_disk b/rescue/partimage_whole_disk
index a35c374ca..6a4ea0463 100755
--- a/rescue/partimage_whole_disk
+++ b/rescue/partimage_whole_disk
@@ -15,6 +15,8 @@ use Carp::Heavy;
#- help getting the file in make_rescue_img
BEGIN { partition_table::raw::default_type() }
+my %options;
+
my ($server);
if ($ARGV[0] eq '-s') {
(undef, $server, @ARGV) = @ARGV;
@@ -27,16 +29,18 @@ $ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}";
$ENV{HOME} = '/';
log::openLog("/var/log/partimage_whole_disk.log");
my @partimage_cmd = ('partimage', if_($server, '-s', $server));
+
+$action eq 'save_all' && @ARGV == 1 ||
+ $action eq 'rest_all' && @ARGV or usage();
+
+run_program::run('drvinst', 'STORAGE_SCSI', 'STORAGE_IDE');
+
my $all_hds = fsedit::get_hds({});
if ($action eq 'save_all') {
- @ARGV == 1 or usage();
save_all($ARGV[0]);
} elsif ($action eq 'rest_all') {
- @ARGV or usage();
rest_all(@ARGV);
-} else {
- usage();
}
sub save_all {
@@ -56,10 +60,12 @@ sub save_all {
$_->{saved} = !member($_->{fs_type}, 'ntfs', 'vfat', 'swap');
}
- #- shrink and don't save the last ext3 partition (which is the /home partition)
- if (my $part = find { isTrueLocalFS($_) } reverse @$part_list) {
- $part->{size} = min($part->{size}, 1024 * 1024 * 2); # not greater than 1GB
- $part->{saved} = 0;
+ if ($options{save_home_directory}) {
+ #- shrink and don't save the last ext3 partition (which is the /home partition)
+ if (my $part = find { isTrueLocalFS($_) } reverse @$part_list) {
+ $part->{size} = min($part->{size}, 1024 * 1024 * 2); # not greater than 1GB
+ $part->{saved} = 0;
+ }
}
foreach (grep { $_->{saved} } @$part_list) {