From 12d038c4ab011007fd58bb41cf2e3d57d68c4f19 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 10 May 2005 00:58:48 +0000 Subject: - handle multiple data dirs - choose a free data dir if the given one already exists --- rescue/make_rescue_img | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'rescue/make_rescue_img') diff --git a/rescue/make_rescue_img b/rescue/make_rescue_img index 2b7a9e611..bf9e9c1d7 100755 --- a/rescue/make_rescue_img +++ b/rescue/make_rescue_img @@ -125,26 +125,32 @@ installown("../mdk-stage1/dhcp-client", "/usr/sbin"); #- note that on biarch systems, we may need to have both /lib and /lib64 __ "strip $tmp/{lib,$lib,bin,sbin}/* $tmp/usr/{bin,sbin}/* 2>/dev/null"; -if ($ENV{PARTIMAGE_DIR}) { +if ($ENV{PARTIMAGE_RPM}) { install_perl_script('partimage_whole_disk', '/usr/sbin'); _ "rpm2cpio $ENV{PARTIMAGE_RPM} | (cd $tmp ; cpio -idu ./usr/sbin/partimage)"; my $server = 'partimaged'; $server = 'leia'; + + my $default_dir = '/data/box'; + my $partimage_dir = $ENV{PARTIMAGE_DIR} || $default_dir; + my @local_dirs = map { "/tmp/image$_" } split(' ', $partimage_dir); + my $local_dir = $local_dirs[0]; + my $local_dirs = join(' ', @local_dirs); + substInFile { $_ = <