summaryrefslogtreecommitdiffstats
path: root/rescue/make_rescue_img
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-05-19 09:01:42 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-05-19 09:01:42 +0000
commit7969dda435fe3a8b3d1dd89bd3551853003c3649 (patch)
tree80c8a05fa6633bbc2638d82cd840f318358211ce /rescue/make_rescue_img
parent2849ab74496135102867402dd9fe682ba778b89e (diff)
downloaddrakx-7969dda435fe3a8b3d1dd89bd3551853003c3649.tar
drakx-7969dda435fe3a8b3d1dd89bd3551853003c3649.tar.gz
drakx-7969dda435fe3a8b3d1dd89bd3551853003c3649.tar.bz2
drakx-7969dda435fe3a8b3d1dd89bd3551853003c3649.tar.xz
drakx-7969dda435fe3a8b3d1dd89bd3551853003c3649.zip
use install-xml-file-list
Diffstat (limited to 'rescue/make_rescue_img')
-rwxr-xr-xrescue/make_rescue_img76
1 files changed, 13 insertions, 63 deletions
diff --git a/rescue/make_rescue_img b/rescue/make_rescue_img
index bf9e9c1d7..b350218ca 100755
--- a/rescue/make_rescue_img
+++ b/rescue/make_rescue_img
@@ -18,27 +18,6 @@ BEGIN { undef *_ }
sub __ { print @_, "\n"; system(@_) }
sub _ { __ @_; $? and die }
-sub install_raw {
- s|^/|| foreach @_;
- _ "tar c -C / @_ | tar x -C $tmp" if @_;
-}
-sub install_deref {
- s|^/|| foreach @_;
- _ "tar c -C / --dereference @_ | tar x -C $tmp" if @_;
-}
-
-sub install_l {
- my @l = @_;
-
- @l = uniq(map { chomp_($_) } @l);
- push @l,
- `ldd @l 2>/dev/null | grep "=>" | perl -pe 's/.*=> //; s/ .*//; s,^/(lib|lib64)/.*?/,/\\1/,'`;
-
- my ($deref, $raw) = partition { /lib.*\.so/ || readlink("/$_") =~ m|/etc/alternatives| } uniq(map { chomp_($_) } @l);
- install_raw(@$raw);
- install_deref(@$deref);
-}
-
sub installown($$) {
my ($own, $dir) = @_;
return if -e "$tmp$dir/" . basename($own);
@@ -62,16 +41,21 @@ sub install_perl_script {
_ "$sudo rm -rf $tmp" if -e $tmp;
_ "mkdir $tmp";
_ 'find . -name "*~" | xargs rm -f';
-foreach (cat_("dirs")) {
- chomp;
- mkdir_p("$tmp$_");
-}
+mkdir_p($tmp . chomp_($_)) foreach cat_("dirs");
_ "cp -a tree/* $tmp";
_ "find $tmp -name 'CVS*' | xargs rm -rf";
_ "perl devices.pl $tmp/dev";
substInFile { s/DISTRIB_DESCR/$ENV{DISTRIB_DESCR}/ } "$tmp/etc/issue";
-install_raw(keyboard::loadkeys_files());
+{
+ _ "cd ../mdk-stage1 && make rescue-gui dhcp-client";
+ -e "../kernel/all.kernels" or die "use ./update_kernel in gi/kernel first\n";
+
+ $ENV{MAIN_KERNEL} = chomp_(`cat ../kernel/all.kernels/.main`);
+
+ _ "../tools/install-xml-file-list list.xml $tmp";
+}
+
my %keytable_conflicts;
my @less_important_keytables = qw(am_old am_phonetic no-dvorak fr_CH-latin1);
foreach (keyboard::loadkeys_files()) {
@@ -86,49 +70,13 @@ foreach (keyboard::loadkeys_files()) {
}
}
-my $perl_version = join ".", unpack "C3", $^V;
-my @bad;
-my @files = map {
- chomp;
- s/PERL_VERSION/$perl_version/g;
- s|/LIB/|/$lib/|g;
- my @l = glob($_) or push @bad, $_;
- m|\*.*/| && @l != 1 and die "multiple match for $_\n";
- @l;
-} (cat_("list"), cat_(`../tools/specific_arch list`));
-@bad and die "files missing\n" . join("\n", @bad) . "\n";
-install_l(@files);
-
foreach (cat_("aliases")) {
chomp; my ($f, $dest) = split;
symlink $dest, "$tmp$f";
}
--e "../kernel/all.kernels" or die "use ./update_kernel in gi/kernel first\n";
-
-my $main = chomp_(`cat ../kernel/all.kernels/.main`);
-
-_ "cp ../kernel/all.kernels/$main/modules.{cz,dep} $tmp/modules";
-
-installown("drvinst", "/usr/bin");
-install_perl_script("guessmounts", "/usr/bin");
-install_perl_script("install_bootloader", "/usr/bin");
-if (arch() =~ /^i.86|x86_64/) {
- install_perl_script("restore_ms_boot", "/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");
-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_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';
@@ -159,7 +107,9 @@ EOF
} "$tmp/etc/rc.sysinit";
}
+_ "$sudo chown root.root -R $tmp/*";
+
exit 0 if $ARGV[0];
_ "mkisofs -quiet -D -R $tmp | create_compressed_fs - 65536 $rescue 200 2>/dev/null";
-_ "$sudo rm -rf $tmp";
+#_ "$sudo rm -rf $tmp";