summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-11-22 14:15:24 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-11-22 14:15:24 +0000
commitc879294087d1f55b5992ff194bae9d0ded78c31a (patch)
treee54ee940894d61a91f93ee69fc66b3e0d08e58ed
parent0a60319a0b805bf9c7dfe191ab2bd64fb0fa60e6 (diff)
downloaddrakx-backup-do-not-use-c879294087d1f55b5992ff194bae9d0ded78c31a.tar
drakx-backup-do-not-use-c879294087d1f55b5992ff194bae9d0ded78c31a.tar.gz
drakx-backup-do-not-use-c879294087d1f55b5992ff194bae9d0ded78c31a.tar.bz2
drakx-backup-do-not-use-c879294087d1f55b5992ff194bae9d0ded78c31a.tar.xz
drakx-backup-do-not-use-c879294087d1f55b5992ff194bae9d0ded78c31a.zip
- no more kernel/all.modules, things are in kernel/all.kernels
- cleanup what we keep in kernel/all.kernels: only vmlinuz, modules.dep, *.mar, all_modules.tar, modules.cz - replace all_modules.list + modules with all_modules.tar - kernel/all.modules/modules.cz-VERSION are now in kernel/all.kernels/VERSION/modules.cz - allow having a normal in isolinux, but don't use it for floppy images (for this, add kernel/all.kernels/.main-BOOT) - add many modules kernel/list_modules.pm in unused categories since we don't take all modules from kernel, only those listed (needed to have a not too big modules.cz for normal kernel) - complete rewrite of update_kernel (now written in perl)
-rw-r--r--Makefile2
-rw-r--r--docs/HACKING15
-rw-r--r--kernel/.cvsignore1
-rw-r--r--kernel/Makefile6
-rw-r--r--kernel/dependencies.pl13
-rw-r--r--kernel/list_modules.pm17
-rw-r--r--kernel/modules.pl119
-rwxr-xr-xkernel/update_kernel267
-rwxr-xr-xmake_boot_img28
-rwxr-xr-xmdk-stage1/pci-resource/update-pci-ids.pl2
-rw-r--r--perl-install/Makefile7
-rwxr-xr-xrescue/make_rescue_img5
12 files changed, 241 insertions, 241 deletions
diff --git a/Makefile b/Makefile
index 85eee1baf..f2144fb86 100644
--- a/Makefile
+++ b/Makefile
@@ -48,7 +48,7 @@ install_only:
make -C rescue install
clean:
- rm -rf images all.modules all.modules64
+ rm -rf images
for i in $(DIRS); do make -C $$i clean; done
find . -name "*~" -o -name ".#*" | xargs rm -f
diff --git a/docs/HACKING b/docs/HACKING
index 1b0fd444e..5530168df 100644
--- a/docs/HACKING
+++ b/docs/HACKING
@@ -53,17 +53,10 @@ extract the package(s) and build stuff from it.
FYI, for each kernel, directories will be populated as follows:
gi/kernel/all.kernels/2.6.0
- containing all files from the said kernel RPM package
-
-gi/kernel/all.modules/2.6.0
- containing all modules, and special files containing
- modules for stage1 (*.mar)
-
-gi/kernel/all.modules/
- containing a special file containing modules for stage1
- (*.cz*)
-
-Note: the modules must not be in compressed form (*.gz *.bz2 etc)
+ special files containing
+ - vmlinuz, modules.dep
+ - modules for stage1 (*.mar, *.tar)
+ - modules for stage2 (modules.cz)
(3) required rpm packages
diff --git a/kernel/.cvsignore b/kernel/.cvsignore
index 827e0ba13..66624465e 100644
--- a/kernel/.cvsignore
+++ b/kernel/.cvsignore
@@ -1,3 +1,2 @@
modules.description
-all.modules
all.kernels
diff --git a/kernel/Makefile b/kernel/Makefile
index 9e4dd9bb5..585d85d7b 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -1,13 +1,13 @@
-all: all.modules
+all: all.kernels
-all.modules: ../mdk-stage1/mar/mar update_kernel list_modules.pm
+all.kernels: ../mdk-stage1/mar/mar update_kernel list_modules.pm
./update_kernel
../mdk-stage1/mar/mar:
make -C `dirname $@` mar
clean:
- rm -rf *~ modules.description all.modules all.modules64
+ rm -rf *~ modules.description all.kernels
check:
perl modules.pl check > /dev/null
diff --git a/kernel/dependencies.pl b/kernel/dependencies.pl
deleted file mode 100644
index e3be14212..000000000
--- a/kernel/dependencies.pl
+++ /dev/null
@@ -1,13 +0,0 @@
-use strict;
-
-use MDK::Common;
-use list_modules;
-
-my $version = shift @ARGV;
-my $depfile = shift @ARGV;
-load_dependencies($depfile);
-print STDERR "Loaded dependencies from $depfile\n";
-
-my @modules = uniq(map { dependencies_closure($_) } @ARGV);
-print join " ", map { $_ . ($version == 24 ? '.o' : '.ko') } @modules;
-print "\n";
diff --git a/kernel/list_modules.pm b/kernel/list_modules.pm
index 99edf778d..798f87ff0 100644
--- a/kernel/list_modules.pm
+++ b/kernel/list_modules.pm
@@ -39,7 +39,7 @@ our %l = (
],
raw => [
- qw(ppp_generic ppp_async),
+ qw(ppp_generic ppp_async ppp_deflate bsd_comp),
],
pcmcia => [
qw(3c574_cs 3c589_cs axnet_cs fmvj18x_cs),
@@ -132,7 +132,7 @@ our %l = (
if_(arch() =~ /^ppc/, qw(hfs)),
qw(reiserfs),
],
- various => [ qw(smbfs romfs ext3 xfs) ],
+ various => [ qw(smbfs romfs ext3 xfs jfs ufs) ],
},
@@ -170,10 +170,12 @@ our %l = (
# just here for classification, unused categories (nor auto-detect, nor load_thiskind)
{
raid => [
- qw(linear raid0 raid1 raid5 lvm-mod multipath),
+ qw(linear raid0 raid1 raid5 lvm-mod multipath dm-mod),
],
mouse => [
qw(busmouse msbusmouse logibusmouse serial qpmouse atixlmouse),
+ if_(arch() =~ /ppc/, 'macserial'),
+ qw(hid mousedev usbhid usbmouse),
],
char => [
if_(arch() =~ /ia64/, qw(efivars)),
@@ -185,6 +187,11 @@ our %l = (
qw(parport_pc parport_serial),
qw(btaudio),
+ arch() =~ /i.86/ ? 'aes-i586' : 'aes',
+ if_(arch() =~ /sparc/, 'openprom'),
+
+ qw(wacom evdev), qw(usblp printer),
+
#- these need checking
qw(tmspci rrunner meye),
],
@@ -226,6 +233,10 @@ sub category2modules {
} split(' ', $_[0]);
}
+sub all_modules() {
+ map { @$_ } map { values %$_ } values %l;
+}
+
sub module2category {
my ($module) = @_;
foreach my $t1 (keys %l) {
diff --git a/kernel/modules.pl b/kernel/modules.pl
index 587674e8f..b8207087a 100644
--- a/kernel/modules.pl
+++ b/kernel/modules.pl
@@ -105,28 +105,117 @@ my %images = (
all => 'fs/cdrom disk/cdrom|raw bus/usb|usb_keyboard disk/usb|scsi fs/loopback|local bus/pcmcia disk/pcmcia|hardware_raid fs/network network/main|pcmcia|usb|raw|gigabit bus/firewire disk/firewire',
);
-my $verbose = "@ARGV" =~ /-v/;
-images() if "@ARGV" =~ /images/;
-check() if "@ARGV" =~ /check/;
-pci_modules4stage1($1) if "@ARGV" =~ /pci_modules4stage1:(.*)/;
-
-sub images() {
- while (my ($image, $l) = each %images) {
- my @modules = if_($image !~ /drivers/, @modules_always_on_stage1);
- push @modules, map { category2modules($_) } split(' ', $l);
+my $verbose = $ARGV[0] eq '-v' && shift;
+my ($f, @para) = @ARGV;
+$::{$f}->(@para);
+
+sub image2modules {
+ my ($image) = @_;
+ my $l = $images{$image};
+
+ my @modules = if_($image !~ /drivers/, @modules_always_on_stage1);
+ push @modules, map { category2modules($_) } split(' ', $l);
- @modules = difference2(\@modules, \@modules_removed_from_stage1);
+ @modules = difference2(\@modules, \@modules_removed_from_stage1);
+
+ if ($image !~ /all/) {
+ @modules = difference2(\@modules, \@modules_only_for_all_img);
+ }
+
+ @modules;
+}
+
+sub remove_unneeded_modules {
+ my ($kern_ver) = @_;
+
+ #- need creating a first time the modules.dep for all modules
+ #- it will be redone in make_modules_dep when unneeded modules are removed
+ make_modules_dep($kern_ver);
+ load_dependencies("all.kernels/$kern_ver/modules.dep");
+
+ my $ext = module_extension($kern_ver);
+
+ my @all = list_modules::all_modules();
+ my @all_with_deps = map { dependencies_closure($_) } @all;
+ my %wanted_modules = map {; "$_.$ext" => 1 } @all_with_deps;
+ foreach (all("all.kernels/$kern_ver/modules")) {
+ $wanted_modules{$_} or unlink "all.kernels/$kern_ver/modules/$_";
+ }
+}
+
+sub make_modules_per_image {
+ my ($kern_ver) = @_;
+
+ make_modules_dep($kern_ver);
+ load_dependencies("all.kernels/$kern_ver/modules.dep");
- if ($image !~ /all/) {
- @modules = difference2(\@modules, \@modules_only_for_all_img);
+ my $ext = module_extension($kern_ver);
+
+ foreach my $image (keys %images) {
+ my @modules_with_deps = uniq(map { dependencies_closure($_) } image2modules($image));
+ my @l = map { "$_.$ext" } @modules_with_deps;
+
+ my $dir = "all.kernels/$kern_ver/modules";
+ @l = grep { -e "$dir/$_" } @l;
+
+ if ($image =~ /all/) {
+ system("cd $dir ; tar cf ../${image}_modules.tar @l") == 0 or die "tar failed\n";
+ } else {
+ my $gi_base_dir = chomp_(`pwd`) . '/..';
+ system("cd $dir ; $gi_base_dir/mdk-stage1/mar/mar -c ../${image}_modules.mar @l") == 0 or die "mar failed\n";
+ }
+ }
+}
+
+sub make_modules_dep {
+ my ($kern_ver) = @_;
+
+ my @l =
+ kernel_is_26($kern_ver) ?
+ cat_("all.kernels/$kern_ver/lib/modules/$kern_ver/modules.dep") :
+ `/sbin/depmod-24 -F all.kernels/$kern_ver/boot/System.map-$kern_ver -e *.o | perl -pe 's/\\\n//'`;
+
+ @l = map {
+ if (/(\S+):\s+(.*)/) {
+ my ($module, @deps) = map { m!.*/(.*)\.k?o(\.gz)$! && $1 } $1, split(' ', $2);
+ if (member($module, 'plip', 'ppa', 'imm')) {
+ @deps = map { $_ eq 'parport' ? 'parport_pc' : $_ } @deps;
+ } elsif ($module eq 'vfat') {
+ push @deps, 'nls_cp437', 'nls_iso8859-1';
+ }
+ if_(@deps, join(' ', "$module:", @deps));
+ } else {
+ ();
}
- printf qq(%s_modules_raw="%s"\n), $image, join ' ', @modules;
+ } @l;
+
+ output("all.kernels/$kern_ver/modules.dep", map { "$_\n" } @l);
+}
+
+sub make_modules_description {
+ my ($kern_ver) = @_;
+ my $ext = module_extension($kern_ver);
+ my $dir = "all.kernels/$kern_ver/modules";
+
+ my @l;
+ if (kernel_is_26(`uname -r`)) { #- modinfo behaves differently depending on the build kernel used
+ my $name;
+ @l = map {
+ $name = $1 if m!^filename:\s*(.*)\.$ext!;
+ if_($name && /^description:\s*(.*)/, "$name\t$1");
+ } `cd $dir ; /sbin/modinfo *.$ext`;
+ } else {
+ @l = map {
+ if_(/(.*?)\.$ext "(.*)"/, "$1\t$2\n");
+ } `cd $dir ; /sbin/modinfo-24 -f '%{filename} %{description}\n' *.$ext`;
}
- printf qq(images="%s"\n), join(' ', keys %images);
+ output("modules.description", @l);
}
sub pci_modules4stage1 {
- print "$_\n" foreach uniq(map { dependencies_closure($_) } difference2([ category2modules($_[0]) ], \@modules_removed_from_stage1));
+ my ($category) = @_;
+ my @modules = difference2([ category2modules($category) ], \@modules_removed_from_stage1);
+ print "$_\n" foreach uniq(map { dependencies_closure($_) } @modules);
}
sub check() {
diff --git a/kernel/update_kernel b/kernel/update_kernel
index 4e0924efa..13a9b3203 100755
--- a/kernel/update_kernel
+++ b/kernel/update_kernel
@@ -1,187 +1,110 @@
-#!/bin/bash
+#!/usr/bin/perl
-ALL_KERNELS="all.kernels"
-RPMS=/export/media/main
+use MDK::Common;
+use list_modules;
-ARCH=`uname -m | sed -e 's/i.86/i386/' -e 's/sparc.*/sparc/'`
+my $RPMS = '/export/media/main';
+my $rpm = 'rpm --nosignature';
-# move stuff to this new "kernel" directory
-if [ ! -d all.kernels ]; then
- if [ -d ../all.kernels ]; then
- mv ../all.kernels .
- rm -rf ../all.modules
- else
- # make sure "all.kernels" directory exists
- mkdir all.kernels
- fi
-fi
+my $MOVE = $ARGV[0] eq '--move' && shift;
-function create_marfile() {
- marfile=$1
- shift
- $GIBASEDIR/mdk-stage1/mar/mar -c $marfile $*
-}
+@ARGV <= 1 or die "usage: ./update_kernel [--move] [<kernel rpm>]\n";
-function build_kernel_is_26() {
- uname -r | grep -q '^2\.6'
-}
-function kern_version() {
- if echo $1 | grep -q ^2.4; then
- version=24
- objects="*.o"
- else
- version=25
- objects="*.ko"
- fi
-}
-
-function create_modules() {
- kernel_path=$1
- kern=$2
- echo "Updating modules in '`pwd`' for kernel '$kern'"
- kern_version $kern
- find $kernel_path/lib/modules/ -name "$objects" -exec cp -f {} . \;
- if [ $version -eq 24 ]; then
- /sbin/depmod-24 -F $kernel_path/boot/System.map* -e *.o | perl -pe 's/\\\n//' \
- | perl -ne 's/\.o//g; s/[ \t]+/ /g; print if /: /' > modules.dep
- else
- cp $kernel_path/lib/modules/*/modules.dep .
- perl -ni -e 's|/\S+/([^/]+)\.k?o(\.gz)|$1|g; print if /: /' modules.dep
- fi
- perl -pi -e 's/((plip|ppa|imm): parport)/$1 parport_pc/' modules.dep
- perl -pi -e 's/(vfat: fat)/$1 nls_cp437 nls_iso8859-1/' modules.dep
-
- if build_kernel_is_26; then
- /sbin/modinfo $objects | perl -lne 'print "$name\t$1" if $name && /^description:\s*(.*)/; $name = $1 if m!^filename:\s*(.*)\.k?o!' > modules.description
- else
- /sbin/modinfo-$version -f '%{filename} %{description}\n' $objects | perl -lne 'print "$1\t$2" if /(.*?)\.k?o "(.*)"/' > modules.description
- fi
-}
+mkdir 'all.kernels'; # make sure "all.kernels" directory exists
+eval { rm_rf('all.modules') }; #- not used anymore
+
+my $main = chomp_(cat_('all.kernels/.main'));
+my $main_BOOT = chomp_(cat_('all.kernels/.main-BOOT'));
-function create_modules_mar() {
- kern_version $kern
-
- if [ $version -eq 24 ]; then
- echo -n "stripping $kern: "
- $GIBASEDIR/kernel/strip_modules *.o 2>/dev/null
- echo "done"
- else
- echo "don't strip on 2.6 since it breaks modules"
- fi
-
- if [ -z "$MOVE" ]; then
- echo -n "packdrake $kern: "
- ls $objects | packdrake -b9s "modules.cz" 400000
- echo "done"
- mv modules.cz ../modules.cz-$kern
- fi
- for i in $images; do
- eval "modules=\$${i}_modules_raw"
- modules_with_deps=`perl -I $GIBASEDIR/kernel $GIBASEDIR/kernel/dependencies.pl $version modules.dep $modules`
- if [ $i = "all" ]; then
- echo $modules_with_deps > "${i}_modules.list"
- else
- eval "create_marfile ${i}_modules.mar $modules_with_deps"
- fi
- done
- echo
+if (@ARGV) {
+ install_kernel($ARGV[0]);
+} else {
+ update_kernel_from_repository($RPMS, '2.6', 0);
+ update_kernel_from_repository($RPMS, '2.6', 1);
+ update_kernel_from_repository($RPMS, '2.4', 1);
}
-function install_kernel() {
- rpm=$1
-
- ver=$(rpm --nosignature -qpl $rpm | sed -n 's!/boot/vmlinuz-!!p')
- [ -n "$ver" ] || return
-
- if [ -n "$2" ]; then
- [ -d $ALL_KERNELS/$ver ] && return
- main_ver=$2
- echo Removing previous kernel $ALL_KERNELS/$main_ver*
- rm -rf $ALL_KERNELS/$main_ver*
- fi
-
- rm -rf $ALL_KERNELS/$ver
- echo "Installing kernel $ver"
- mkdir -p $ALL_KERNELS/$ver
- rpm2cpio $rpm | (cd $ALL_KERNELS/$ver ; cpio -id)
-
- find $ALL_KERNELS/$ver -type f -name "*.o.gz" -o -name "*.ko.gz" | xargs gunzip
-
- # remove those files during update_kernel, they will get back when make_boot_img is called
- for dir in /tftpboot /var/lib/tftpboot; do
- rm -f $dir/{vmlinuz,network.rdz,all.rdz}
- done
+
+sub system_verbose { print join(' ', @_), "\n"; system(@_) }
+sub sys { &system_verbose; $? and die }
+
+sub rpm2version {
+ my ($kernel_rpm) = @_;
+ `$rpm -qpl $kernel_rpm` =~ m!/boot/vmlinuz-(.*)! && $1 or die "can't find vmlinuz in $kernel_rpm\n";
}
-[ -e $ALL_KERNELS/.main ] && main=$(cat $ALL_KERNELS/.main)
-
-if [ "$1" = "--move" ]; then
- MOVE=1
- shift
-fi
-
-if [ "$ARCH" == "ia64" ] || [ "$ARCH" == "ppc" ]; then
- name=kernel
-else
- name=kernel-BOOT
-fi
-
-if [ -n "$1" ]; then
- #- allow specifying a kernel file on commandline (./update_kernel /RPMS/kernel-2.4.22.10mdk-1-1mdk.i586.rpm)
- install_kernel $1
-else
-# install_kernel $RPMS/kernel-BOOT-2.4*.rpm 2.4
- install_kernel $RPMS/kernel-BOOT-2.6*.rpm 2.6
-fi
-
-[ -n "$main" -a -e $ALL_KERNELS/$main ] || {
- cd $ALL_KERNELS
- main=$(echo 2.6* | sed 's/.* //')
- [ -e "$main" ] || main=$(echo 2.4* | sed 's/.* //')
- [ -e "$main" ] || { echo "no kernel installed in $ALL_KERNELS"; exit 1; }
- echo "Choosing $main"
- echo $main > .main
- cd ..
+sub update_kernel_from_repository {
+ my ($RPMS, $main_ver, $is_BOOT) = @_;
+ my $rpm_wildcard = 'kernel-' . ($is_BOOT ? 'BOOT-' : '') . $main_ver . '*.rpm';
+ my ($kernel_rpm) = my @kernels = glob("$RPMS/$rpm_wildcard");
+ @kernels <= 1 or die "more than one kernel match $rpm_wildcard";
+ @kernels >= 1 or die "no kernel match $rpm_wildcard";
+
+ install_kernel($kernel_rpm, 1);
}
+sub install_kernel {
+ my ($kernel_rpm, $o_update) = @_;
+
+ my $kern_ver = rpm2version($kernel_rpm);
+ my $dir = "all.kernels/$kern_ver";
+
+ -d $dir and return if $o_update;
+
+ my $is_BOOT = $kern_ver =~ /BOOT/;
+ my ($main_ver) = $kern_ver =~ /^(2\.\d)/;
+ if (my @previous = grep { ($is_BOOT xor !/BOOT/) && /^\Q$main_ver/ } all('all.kernels')) {
+ warn "Removing previous kernels ", join(' ', @previous), "\n";
+ rm_rf("all.kernels/$_") foreach @previous;
+ }
+
+ if (!$main || !-d "all.kernels/$main") {
+ $main = $kern_ver;
+ output('all.kernels/.main', "$main\n");
+ }
+ if ($is_BOOT && (!$main_BOOT || !-d "all.kernels/$main_BOOT")) {
+ $main_BOOT = $kern_ver;
+ output('all.kernels/.main-BOOT', "$main_BOOT\n");
+ }
-if [ "$ARCH" == "i386" ]; then
- for i in $ALL_KERNELS/*/boot/vmlinuz*; do
- #disable any existing resolution!!!
- /usr/sbin/rdev -v $i 65535 #788 #785
- done
-fi
-
-
-GIBASEDIR=`pwd`/..
-
-rm -rf all.modules ; mkdir all.modules
-for i in $ALL_KERNELS/*; do
- kern=`basename $i`
- (
- mkdir all.modules/$kern
- cd all.modules/$kern
-
- create_modules ../../$i $kern
- ) || exit 1
-done
-cp -f all.modules/$main/modules.description .
-
-l=`MOVE=$MOVE perl modules.pl images` || exit 1
-eval $l
-
-for i in $ALL_KERNELS/*; do
- kern=`basename $i`
- (
- cd all.modules/$kern
-
- if [ "$kern" = "$main" ]; then
- create_modules_mar ../../$i $kern
- else
- echo "$kern ($main)"
- create_modules_mar ../../$i $kern 2>/dev/null
- fi
- ) || exit 1
-done
+ warn "Installing kernel $kern_ver\n";
+
+ eval { rm_rf($dir) };
+ mkdir_p("$dir/modules");
+ sys("rpm2cpio $kernel_rpm | (cd $dir ; cpio -id)");
+
+ rename "$dir/boot/vmlinuz-$kern_ver", "$dir/vmlinuz" or die "can't find vmlinuz\n";
+
+ sys("find $dir -name '*.gz' | xargs gunzip");
+
+ my $ext = module_extension($kern_ver);
+
+ open(my $F, "find $dir -name '*.$ext' |");
+ my $file; while ($file = <$F>) {
+ chomp($file);
+ rename $file, "$dir/modules/" . basename($file) or warn "conflict for $file\n";
+ }
+
+ if (kernel_is_26($kern_ver)) {
+ warn "no stripping on 2.6 since it breaks modules\n";
+ } else {
+ print STDERR "stripping $kern_ver: ";
+ sys("./strip_modules $dir/modules/*.$ext");
+ print STDERR "done\n";
+ }
+
+ sys('perl', 'modules.pl', 'remove_unneeded_modules', $kern_ver) if $kern_ver !~ /BOOT/;
+
+ sys('perl', 'modules.pl', 'make_modules_per_image', $kern_ver);
+ sys('perl', 'modules.pl', 'make_modules_description', $kern_ver) if $kern_ver eq $main;
+
+ if (!$MOVE) {
+ print STDERR "packdrake $kern_ver: ";
+ sys("cd $dir/modules ; ls *.$ext | packdrake -b9s ../modules.cz 400000");
+ print STDERR "done\n";
+ }
+
+ eval { rm_rf("$dir$_") } foreach qw(/boot /lib /usr /modules);
+}
diff --git a/make_boot_img b/make_boot_img
index d5c1db2af..a6dd190d0 100755
--- a/make_boot_img
+++ b/make_boot_img
@@ -8,7 +8,6 @@ my ($arch) = $Config{archname} =~ /(.*?)-/;
# move stuff to new "kernel" directory
-d 'kernel' or die "directory kernel is missing\n";
rename 'all.kernels', 'kernel/all.kernels';
-rename 'all.modules', 'kernel/all.modules';
my $default_append = "ramdisk_size=128000";
# full acpi support for x86_64, enough acpi support for x86 ht, no acpi for others
@@ -37,8 +36,9 @@ _ "$sudo mkdir -p $tmp_mnt $tmp_mnt_initrd";
mkdir "images";
my $main = chomp_(cat_('kernel/all.kernels/.main'));
+my $main_BOOT = chomp_(cat_('kernel/all.kernels/.main-BOOT'));
my @kernels = grep { /^2/ } all('kernel/all.kernels');
-
+my @kernels_BOOT = grep { /BOOT/ } @kernels;
my @all_images = (
if_($arch =~ /i.86|x86_64/, 'cdrom.img', 'cdrom-changedisk.img', 'pcmcia.img', 'isolinux', 'boot.iso', 'hd_grub.img', 'network.img', 'network_drivers.img'),
@@ -76,14 +76,14 @@ foreach my $img (@images) {
} elsif ($img =~ /bootcdrom.iso/) {
boot_iso($img, 1);
} elsif ($img =~ /drivers/) {
- drivers($type, $I, "$img-$_") foreach @kernels;
- rename("$img-$main", $img);
+ drivers($type, $I, "$img-$_") foreach @kernels_BOOT;
+ rename("$img-$main_BOOT", $img);
} elsif ($extension eq 'rdz') {
initrd($tmp_mnt_initrd, $type, $I, "$img-$_") foreach @kernels;
} elsif ($extension eq 'img') {
print STDERR "calling boot_img_$arch for $img\n";
- $::{"boot_img_$arch"}->($tmp_mnt, $type, $I, "$img-$_", glob("kernel/all.kernels/$_/boot/vmlinu*")) foreach @kernels;
- rename("$img-$main", $img);
+ $::{"boot_img_$arch"}->($tmp_mnt, $type, $I, "$img-$_", "kernel/all.kernels/$_/vmlinuz") foreach @kernels_BOOT;
+ rename("$img-$main_BOOT", $img);
} else {
die "unknown image $img";
}
@@ -163,13 +163,13 @@ sub initrd {
if (member($type, qw(pcmcia all network)) && $arch !~ /ppc|ia64|x86_64/) {
_ "$sudo cp -a /etc/pcmcia $mnt/etc";
_ "cp $mnt/etc/pcmcia/config /tmp/pcmcia_config_tmp";
- _ "tools/patch_pcmcia_config.pl /tmp/pcmcia_config_tmp kernel/all.modules/$main/modules.dep";
+ _ "tools/patch_pcmcia_config.pl /tmp/pcmcia_config_tmp kernel/all.kernels/$main/modules.dep";
_ "sudo mv /tmp/pcmcia_config_tmp $mnt/etc/pcmcia/config";
}
my ($ext) = $img =~ /rdz-(.*)/ or die "bad initrd name ($img)";
- my $modz = "kernel/all.modules$I/$ext";
+ my $modz = "kernel/all.kernels$I/$ext";
if ($type eq 'all') {
- __ "cd $modz ; $sudo cp -f `cat ${type}_modules.list` $mnt/modules";
+ __ "$sudo tar xC $mnt/modules -f $modz/${type}_modules.tar";
} else {
_ "$sudo cp -f $modz/${type}_modules.mar $mnt/modules/modules$I.mar";
}
@@ -254,7 +254,7 @@ F3 boot.msg
my $s = int((-s $rdz) / 1024);
my ($ext) = $img =~ /\.img-(.*)/ or die "bad initrd name ($img)";
- my $dir = "kernel/all.modules/$ext";
+ my $dir = "kernel/all.kernels/$ext";
my $pcitable = cat_('/usr/share/ldetect-lst/pcitable');
my @l = sort { $a <=> $b } map {
my ($name) = /(\S+)\.k?o$/ or die "bad file in .mar";
@@ -679,8 +679,7 @@ sub isolinux {
each_index {
mkdir "isolinux/alt$::i", 0777;
- my ($kernel) = glob("kernel/all.kernels/$_/boot/vmlinu*");
- _ "cp $kernel isolinux/alt$::i/vmlinuz";
+ _ "cp kernel/all.kernels/$_/vmlinuz isolinux/alt$::i";
initrd($tmp_mnt_initrd, 'all', '', "images/all.rdz-$_");
_ "mv images/all.rdz-$_ isolinux/alt$::i/all.rdz";
} @kernels;
@@ -720,8 +719,7 @@ F3 boot.msg
sub isolinux_move {
my ($main) = @_;
- my ($kernel) = glob("kernel/all.kernels/$main/boot/vmlinu*");
- _ "cp $kernel move/isolinux/vmlinuz";
+ _ "cp kernel/all.kernels/$main/vmlinuz move/isolinux";
initrd($tmp_mnt_initrd, 'all', '', "move/isolinux/all.rdz-$main", '-with-busybox');
rename "move/isolinux/all.rdz-$main", "move/isolinux/all.rdz";
@@ -814,7 +812,7 @@ sub drivers {
_ "$sudo mount -t ext2 $img $tmp_mnt -o loop";
my ($ext) = $img =~ /img-(.*)/ or die "bad image name ($img)";
- _ "$sudo cp -f kernel/all.modules$I/$ext/${type}_modules.mar $tmp_mnt/modules$I.mar";
+ _ "$sudo cp -f kernel/all.kernels$I/$ext/${type}_modules.mar $tmp_mnt/modules$I.mar";
_ "sync";
_ "df $tmp_mnt";
diff --git a/mdk-stage1/pci-resource/update-pci-ids.pl b/mdk-stage1/pci-resource/update-pci-ids.pl
index 27ec62845..b11af8a78 100755
--- a/mdk-stage1/pci-resource/update-pci-ids.pl
+++ b/mdk-stage1/pci-resource/update-pci-ids.pl
@@ -33,7 +33,7 @@ my %t = (
);
foreach my $type (keys %t) {
- my @modules = chomp_(`perl ../../kernel/modules.pl pci_modules4stage1:"$t{$type}"`);
+ my @modules = chomp_(`perl ../../kernel/modules.pl pci_modules4stage1 "$t{$type}"`);
my (@entries, @entries_full);
diff --git a/perl-install/Makefile b/perl-install/Makefile
index 3937dde90..d5a9b8402 100644
--- a/perl-install/Makefile
+++ b/perl-install/Makefile
@@ -197,8 +197,9 @@ endif
clean-rpmsrate $(MEDIA_INFO_DEST)/rpmsrate $(MAIN_RPMS_DIR)
- cp -f ../kernel/{modules.description,all.modules/modules.cz*} $(DEST)/lib/
- ls $(DEST)/lib | sed -n 's/modules.cz-//p' > $(STAGE2_DEST)/mdkinst.kernels
+ cp -f ../kernel/modules.description $(DEST)/lib/
+ for i in `ls ../kernel/all.kernels`; do cp -f ../kernel/all.kernels/$$i/modules.cz $(DEST)/lib/modules.cz-$$i; done
+ ls ../kernel/all.kernels | grep '^2' > $(STAGE2_DEST)/mdkinst.kernels
$(MAKE) -C share/po install SUDO= NAME=libDrakX LOCALEDIR=$(DEST)/usr/share/locale_special
@@ -207,7 +208,7 @@ endif
ifeq (y,$(USE_PCMCIA))
cp -a /etc/pcmcia $(DEST)/etc
- ../tools/patch_pcmcia_config.pl $(DEST)/etc/pcmcia/config ../kernel/all.modules/`cat ../kernel/all.kernels/.main`/modules.dep
+ ../tools/patch_pcmcia_config.pl $(DEST)/etc/pcmcia/config ../kernel/all.kernels/`cat ../kernel/all.kernels/.main`/modules.dep
endif
cp -f $(STAGE1)/init-stage2 $(DEST)/usr/bin/init
diff --git a/rescue/make_rescue_img b/rescue/make_rescue_img
index 7dafd1923..dd4a9dc9b 100755
--- a/rescue/make_rescue_img
+++ b/rescue/make_rescue_img
@@ -89,12 +89,11 @@ foreach (cat_("aliases")) {
symlink $dest, "$tmp$f";
}
--e "../kernel/all.modules" or die "use ./update_kernel in gi/kernel first\n";
+-e "../kernel/all.kernels" or die "use ./update_kernel in gi/kernel first\n";
chomp($main = `cat ../kernel/all.kernels/.main`);
-_ "cp ../kernel/all.modules/modules.cz-$main $tmp/modules/modules.cz";
-_ "cp ../kernel/all.modules/$main/modules.dep $tmp/modules";
+_ "cp ../kernel/all.kernels/$main/modules.{cz,dep} $tmp/modules";
installown("drvinst", "/usr/bin");
installown("guessmounts", "/usr/bin");