summaryrefslogtreecommitdiffstats
path: root/rescue/make_rescue_img
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-04-13 15:37:58 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-04-13 15:37:58 +0000
commitd3d3730f906d315710712d131a1997d244ef856a (patch)
tree06618a4ba88bc60bb9cf4debe83423bd8007b4fc /rescue/make_rescue_img
parentc57cb059d3493f665b415412f3bd93330f727e60 (diff)
downloaddrakx-backup-do-not-use-d3d3730f906d315710712d131a1997d244ef856a.tar
drakx-backup-do-not-use-d3d3730f906d315710712d131a1997d244ef856a.tar.gz
drakx-backup-do-not-use-d3d3730f906d315710712d131a1997d244ef856a.tar.bz2
drakx-backup-do-not-use-d3d3730f906d315710712d131a1997d244ef856a.tar.xz
drakx-backup-do-not-use-d3d3730f906d315710712d131a1997d244ef856a.zip
we now use script partimage_whole_disk around partimage
Diffstat (limited to 'rescue/make_rescue_img')
-rwxr-xr-xrescue/make_rescue_img29
1 files changed, 24 insertions, 5 deletions
diff --git a/rescue/make_rescue_img b/rescue/make_rescue_img
index 32a5f1417..871a0c1ff 100755
--- a/rescue/make_rescue_img
+++ b/rescue/make_rescue_img
@@ -41,9 +41,9 @@ sub install_l {
sub installown($$) {
my ($own, $dir) = @_;
- return if -e "$tmp$dir$own";
+ return if -e "$tmp$dir/" . basename($own);
mkdir_p("$tmp$dir");
- _ "cp -a $own $tmp$dir";
+ _ "cp $own $tmp$dir";
}
_ "$sudo rm -rf $tmp" if -e $tmp;
@@ -113,20 +113,39 @@ installown("../mdk-stage1/dhcp-client", "/usr/sbin");
__ "strip $tmp/{lib,$lib,bin,sbin}/* $tmp/usr/{bin,sbin}/* 2>/dev/null";
if ($ENV{PARTIMAGE_DIR}) {
+
+ my $perl_install = "../perl-install";
+ foreach (`strace -efile perl -cw -I $perl_install partimage_whole_disk 2>&1`) {
+ my ($f) = /^open\("(.*?)",.*\)\s*=\s*\d+$/ or next;
+ if ($f =~ s!^\Q$perl_install/!!) {
+ installown("$perl_install/$f", dirname("/usr/lib/libDrakX/$f"));
+ } elsif ($f =~ m!^/dev/! || $f eq 'partimage_all_disk') {
+ # skip
+ } else {
+ installown($f, dirname($f));
+ }
+ }
+ installown('partimage_whole_disk', '/usr/sbin');
+
_ "rpm2cpio $ENV{PARTIMAGE_RPM} | (cd $tmp ; cpio -idu ./usr/sbin/partimage)";
my $server = 'partimaged';
+ $server = 'leia';
substInFile {
$_ = <<EOF if /^\s*rescue-gui/;
if grep -q save_all /proc/cmdline; then
- drvinst ; dhcp-client ; partimage -s $server -b save_all $ENV{PARTIMAGE_DIR}; reboot
+ drvinst ; dhcp-client ; partimage_whole_disk save_all $ENV{PARTIMAGE_DIR} $server
+ echo "Press enter"
+ read
fi
if grep -q rest_all /proc/cmdline; then
local=/tmp/image$ENV{PARTIMAGE_DIR}
if [ -d \$local ]; then
- partimage -b rest_all \$local; reboot
+ partimage_whole_disk rest_all \$local
else
- drvinst ; dhcp-client ; partimage -s $server -b rest_all $ENV{PARTIMAGE_DIR}; reboot
+ drvinst ; dhcp-client ; partimage_whole_disk rest_all $ENV{PARTIMAGE_DIR} $server
fi
+ echo "Press enter"
+ read
fi
EOF
} "$tmp/etc/rc.sysinit";