summaryrefslogtreecommitdiffstats
path: root/rescue/make_rescue_img
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-05-10 00:58:48 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-05-10 00:58:48 +0000
commit12d038c4ab011007fd58bb41cf2e3d57d68c4f19 (patch)
treef12dec07c1506e8ed7041e02d5a515405a080ad3 /rescue/make_rescue_img
parent2b7bdddc118215d51f99b82d3b0d17edcee1a760 (diff)
downloaddrakx-12d038c4ab011007fd58bb41cf2e3d57d68c4f19.tar
drakx-12d038c4ab011007fd58bb41cf2e3d57d68c4f19.tar.gz
drakx-12d038c4ab011007fd58bb41cf2e3d57d68c4f19.tar.bz2
drakx-12d038c4ab011007fd58bb41cf2e3d57d68c4f19.tar.xz
drakx-12d038c4ab011007fd58bb41cf2e3d57d68c4f19.zip
- handle multiple data dirs
- choose a free data dir if the given one already exists
Diffstat (limited to 'rescue/make_rescue_img')
-rwxr-xr-xrescue/make_rescue_img18
1 files changed, 12 insertions, 6 deletions
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 {
$_ = <<EOF if /^\s*rescue-gui/;
if grep -q save_all /proc/cmdline; then
- drvinst NETWORK ; dhcp-client ; partimage_whole_disk save_all $ENV{PARTIMAGE_DIR} $server
+ drvinst NETWORK ; dhcp-client ; partimage_whole_disk -s $server save_all $default_dir
echo "Press enter"
read
fi
if grep -q rest_all /proc/cmdline; then
- local=/tmp/image$ENV{PARTIMAGE_DIR}
- if [ -d \$local ]; then
- partimage_whole_disk rest_all \$local
+ if [ -d $local_dir ]; then
+ partimage_whole_disk rest_all $local_dirs
else
- drvinst NETWORK ; dhcp-client ; partimage_whole_disk rest_all $ENV{PARTIMAGE_DIR} $server
+ drvinst NETWORK ; dhcp-client ; partimage_whole_disk -s $server rest_all $partimage_dir
fi
echo "Press enter"
read