summaryrefslogtreecommitdiffstats
path: root/rescue/make_rescue_img
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-04-21 15:30:37 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-04-21 15:30:37 +0000
commitbd004a83961a4f4cd895f7d631b12ac97cf1f2f4 (patch)
tree8d4eb6fdeb5c55f6f6a53a218f2b67d6d6a4f864 /rescue/make_rescue_img
parent355364810e8894928457589b5b56cccfb112cd81 (diff)
downloaddrakx-backup-do-not-use-bd004a83961a4f4cd895f7d631b12ac97cf1f2f4.tar
drakx-backup-do-not-use-bd004a83961a4f4cd895f7d631b12ac97cf1f2f4.tar.gz
drakx-backup-do-not-use-bd004a83961a4f4cd895f7d631b12ac97cf1f2f4.tar.bz2
drakx-backup-do-not-use-bd004a83961a4f4cd895f7d631b12ac97cf1f2f4.tar.xz
drakx-backup-do-not-use-bd004a83961a4f4cd895f7d631b12ac97cf1f2f4.zip
use get-needed-drakx-modules to handle perl scripts using DrakX modules
Diffstat (limited to 'rescue/make_rescue_img')
-rwxr-xr-xrescue/make_rescue_img38
1 files changed, 20 insertions, 18 deletions
diff --git a/rescue/make_rescue_img b/rescue/make_rescue_img
index 871a0c1ff..db046625b 100755
--- a/rescue/make_rescue_img
+++ b/rescue/make_rescue_img
@@ -46,6 +46,19 @@ sub installown($$) {
_ "cp $own $tmp$dir";
}
+sub install_perl_script {
+ my ($script, $dir) = @_;
+ my @gi_modules;
+ foreach (`../tools/get-needed-drakx-modules ../perl-install /usr/lib/libDrakX $script`) {
+ chomp;
+ my ($local, $dest) = split "\t";
+ installown($local, dirname($dest || $local));
+ push @gi_modules, "$tmp$dest" if $dest;
+ }
+ installown($script, $dir);
+ system('../tools/simplify-drakx-modules', @gi_modules, "$tmp$dir/$script");
+}
+
_ "$sudo rm -rf $tmp" if -e $tmp;
_ "mkdir $tmp";
_ 'find . -name "*~" | xargs rm -f';
@@ -98,12 +111,12 @@ my $main = chomp_(`cat ../kernel/all.kernels/.main`);
_ "cp ../kernel/all.kernels/$main/modules.{cz,dep} $tmp/modules";
installown("drvinst", "/usr/bin");
-installown("guessmounts", "/usr/bin");
-installown("install_bootloader", "/usr/bin");
+install_perl_script("guessmounts", "/usr/bin");
+install_perl_script("install_bootloader", "/usr/bin");
if (arch() =~ /^i.86|x86_64/) {
- installown("restore_ms_boot", "/usr/bin");
+ install_perl_script("restore_ms_boot", "/usr/bin");
}
-installown("lsparts", "/usr/bin");
+install_perl_script("lsparts", "/usr/bin");
installown("rescue-doc", "/usr/bin");
_ "cd ../mdk-stage1 && make rescue-gui dhcp-client";
installown("../mdk-stage1/rescue-gui", "/usr/bin");
@@ -114,18 +127,7 @@ __ "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');
+ install_perl_script('partimage_whole_disk', '/usr/sbin');
_ "rpm2cpio $ENV{PARTIMAGE_RPM} | (cd $tmp ; cpio -idu ./usr/sbin/partimage)";
my $server = 'partimaged';
@@ -133,7 +135,7 @@ if ($ENV{PARTIMAGE_DIR}) {
substInFile {
$_ = <<EOF if /^\s*rescue-gui/;
if grep -q save_all /proc/cmdline; then
- drvinst ; dhcp-client ; partimage_whole_disk save_all $ENV{PARTIMAGE_DIR} $server
+ drvinst NETWORK ; dhcp-client ; partimage_whole_disk save_all $ENV{PARTIMAGE_DIR} $server
echo "Press enter"
read
fi
@@ -142,7 +144,7 @@ if ($ENV{PARTIMAGE_DIR}) {
if [ -d \$local ]; then
partimage_whole_disk rest_all \$local
else
- drvinst ; dhcp-client ; partimage_whole_disk rest_all $ENV{PARTIMAGE_DIR} $server
+ drvinst NETWORK ; dhcp-client ; partimage_whole_disk rest_all $ENV{PARTIMAGE_DIR} $server
fi
echo "Press enter"
read