summaryrefslogtreecommitdiffstats
path: root/make_boot_img
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2001-10-29 23:50:19 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2001-10-29 23:50:19 +0000
commit02acfce86e535386aa158bb66690afe0a061b9f0 (patch)
treec865e8a17f185b8a0a2b0506de564bed99f4743e /make_boot_img
parentf33ee05d82c6ac4e98d4b43e290c3f6fa306e22f (diff)
downloaddrakx-backup-do-not-use-02acfce86e535386aa158bb66690afe0a061b9f0.tar
drakx-backup-do-not-use-02acfce86e535386aa158bb66690afe0a061b9f0.tar.gz
drakx-backup-do-not-use-02acfce86e535386aa158bb66690afe0a061b9f0.tar.bz2
drakx-backup-do-not-use-02acfce86e535386aa158bb66690afe0a061b9f0.tar.xz
drakx-backup-do-not-use-02acfce86e535386aa158bb66690afe0a061b9f0.zip
better patching of /etc/pcmcia/config (through a prog not a patch)
Diffstat (limited to 'make_boot_img')
-rwxr-xr-xmake_boot_img29
1 files changed, 28 insertions, 1 deletions
diff --git a/make_boot_img b/make_boot_img
index e304f964b..1deb23139 100755
--- a/make_boot_img
+++ b/make_boot_img
@@ -69,6 +69,32 @@ if ($arch =~ /i.86/ && $img =~ /all/) {
sub install_stripped { _ "strip $_[0]"; _ "$sudo install $_[0] $_[1]" }
+sub patch_pcmcia_config {
+ my ($pcmcia_root) = @_;
+ my @ignore_modules_in_deps = qw(pcmcia_core ds);
+
+ my @conf_contents = cat_("$pcmcia_root/pcmcia/config");
+ die "$pcmcia_root/pcmcia/config seems short\n" if listlength(@conf_contents) < 10;
+
+ #- remove all modules with directories since we don't support that during install
+ /\s+class.*module.*/ and s|"[^"]+/([^"]+)"|"$1"|g foreach @conf_contents;
+
+ #- adjust deps
+ foreach (cat_("all.modules/$main/modules.dep")) {
+ /^(\S+): (.*)/ and $deps{$1} = [ split ' ', $2 ] or die "could not understand `$_' in all.modules/$main/modules.dep\n";
+ }
+ foreach my $confline (@conf_contents) {
+ $confline =~ /class.*\s+module\s+(.*)/ or next;
+ my @modules = map { /^\s*"([^"]+)"\s*$/ ? $1 : $_ } split ',', $1;
+ my @modules_with_deps = map { @{$deps{$_}}, $_ } @modules;
+ my $new_modz = join ', ', map { "\"$_\"" } uniq(difference2(\@modules_with_deps, \@ignore_modules_in_deps));
+ $confline =~ s/(class.*\s+module\s+).*/$1$new_modz/;
+ }
+
+ output("/tmp/make_boot_image_pcmcia_config", @conf_contents);
+ _ "$sudo mv /tmp/make_boot_image_pcmcia_config $pcmcia_root/pcmcia/config";
+}
+
sub initrd {
my ($mnt, $img) = @_;
my ($ltype, $I) = $type =~ /(.*?)(64)/; $ltype ||= $type;
@@ -95,7 +121,7 @@ sub initrd {
my $ftype = $type =~ /^(all)$/ ? "pcmcia" : $type;
if ($ftype eq "pcmcia" && $arch !~ /ppc/ && $arch !~ /ia64/) {
_ "$sudo cp -a /etc/pcmcia $mnt/etc";
- _ "$sudo patch --no-backup-if-mismatch -p0 -d $mnt/etc < tools/pcmcia_config.patch";
+ patch_pcmcia_config("$mnt/etc");
}
my ($ext) = $img =~ /rdz-(.*)/ or die "bad initrd name ($img)";
$modz = "all.modules$I/$ext";
@@ -112,6 +138,7 @@ sub initrd {
# _ "rm -f $tmp";
}
+
sub boot_img_i386 {
my ($mnt, $img, $kernel) = @_;