summaryrefslogtreecommitdiffstats
path: root/rescue/partimage_whole_disk
diff options
context:
space:
mode:
Diffstat (limited to 'rescue/partimage_whole_disk')
-rwxr-xr-xrescue/partimage_whole_disk10
1 files changed, 10 insertions, 0 deletions
diff --git a/rescue/partimage_whole_disk b/rescue/partimage_whole_disk
index 15878505e..2fcd2ee25 100755
--- a/rescue/partimage_whole_disk
+++ b/rescue/partimage_whole_disk
@@ -37,6 +37,11 @@ my @partimage_cmd = ('partimage', if_($server, '-s', $server));
@ARGV == 1 or usage();
+if ($server && !is_network_configured()) {
+ run_program::run('drvinst', 'NETWORK');
+ run_program::run('dhcp-client');
+}
+
run_program::run('drvinst', 'STORAGE_SCSI', 'STORAGE_IDE');
my $all_hds = fsedit::get_hds({});
@@ -255,3 +260,8 @@ sub error {
log::l($msg);
die "$msg\n";
}
+
+sub is_network_configured() {
+ my (undef, @l) = cat_('/proc/net/route');
+ find { /^(\S+)/ && $1 ne 'lo' } @l;
+}