summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-10-29 16:13:47 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-10-29 16:13:47 +0000
commite2ffebc8fd3f10c175846d6b5a7f40e202277d7d (patch)
tree0eb5ff217d1f6767a4d0340ed7ba5d6670215b12 /kernel
parent368a0547548096f496c71a6690124366cc05424c (diff)
downloaddrakx-backup-do-not-use-e2ffebc8fd3f10c175846d6b5a7f40e202277d7d.tar
drakx-backup-do-not-use-e2ffebc8fd3f10c175846d6b5a7f40e202277d7d.tar.gz
drakx-backup-do-not-use-e2ffebc8fd3f10c175846d6b5a7f40e202277d7d.tar.bz2
drakx-backup-do-not-use-e2ffebc8fd3f10c175846d6b5a7f40e202277d7d.tar.xz
drakx-backup-do-not-use-e2ffebc8fd3f10c175846d6b5a7f40e202277d7d.zip
handle depfile per kernel, not just 2.4* modules.dep
Diffstat (limited to 'kernel')
-rw-r--r--kernel/dependencies.pl12
-rw-r--r--kernel/modules.pl5
-rwxr-xr-xkernel/update_kernel8
3 files changed, 18 insertions, 7 deletions
diff --git a/kernel/dependencies.pl b/kernel/dependencies.pl
new file mode 100644
index 000000000..10663b56b
--- /dev/null
+++ b/kernel/dependencies.pl
@@ -0,0 +1,12 @@
+use strict;
+
+use MDK::Common;
+use list_modules;
+
+my $depfile = shift @ARGV;
+load_dependencies($depfile);
+print STDERR "Loaded dependencies from $depfile\n";
+
+my @modules = uniq(map { dependencies_closure($_) } @ARGV);
+print join " ", map { "$_.o" } @modules;
+print "\n";
diff --git a/kernel/modules.pl b/kernel/modules.pl
index 97231731d..d3ec763c8 100644
--- a/kernel/modules.pl
+++ b/kernel/modules.pl
@@ -116,8 +116,6 @@ my %images = (
all => 'fs/cdrom disk/cdrom|raw bus/usb disk/usb|scsi fs/loopback|local bus/pcmcia disk/pcmcia|hardware_raid fs/network network/main|pcmcia|usb|raw|gigabit bus/firewire disk/firewire',
);
-load_dependencies(glob("all.modules/2.4*/modules.dep"));
-
my $verbose = "@ARGV" =~ /-v/;
images() if "@ARGV" =~ /images/;
check() if "@ARGV" =~ /check/;
@@ -135,8 +133,7 @@ sub images {
if ($image !~ /all/) {
@modules = difference2(\@modules, \@modules_only_for_all_img);
}
- @modules = uniq(map { dependencies_closure($_) } @modules);
- printf qq(%s_modules="%s"\n), $image, join(" ", map { "$_.o" } @modules);
+ printf qq(%s_modules_raw="%s"\n), $image, join ' ', @modules;
}
}
diff --git a/kernel/update_kernel b/kernel/update_kernel
index 26f2734fb..1131e5d0d 100755
--- a/kernel/update_kernel
+++ b/kernel/update_kernel
@@ -27,7 +27,7 @@ function create_modules() {
kernel_path=$1
kern=$2
echo "Updating modules in '`pwd`' for kernel '$kern'"
- cp -f `find $kernel_path/lib/modules/ -name "*.o"` .
+ find $kernel_path/lib/modules/ -name "*.o" -exec cp -f {} . \;
/sbin/depmod -F $kernel_path/boot/System.map* -e *.o | perl -pe 's/\\\n//' \
| perl -ne 's/\.o//g; s/[ \t]+/ /g; print if /: /' > modules.dep
perl -pi -e 's/((plip|ppa|imm): parport)/$1 parport_pc/' modules.dep
@@ -45,8 +45,9 @@ function create_modules_mar() {
echo "done"
mv modules.cz ../modules.cz-$kern
for i in network network_gigabit_usb network_gigabit network_usb cdrom hd hdcdrom_usb pcmcia all; do
- modules_var="${i}_modules"
- eval "create_marfile ${i}_modules.mar \$$modules_var"
+ modules_with_deps=`perl $GIBASEDIR/kernel/dependencies.pl $GIBASEDIR/kernel/all.modules/$kern/modules.pl ${i}_modules`
+ if [ -n "$MOVE" ]; then modules_with_deps="$modules_with_deps loop.o gzloop.o isofs.o zlib_inflate.o"; fi
+ eval "create_marfile ${i}_modules.mar \$$modules_with_deps"
done
echo
}
@@ -60,6 +61,7 @@ else
if [ -n "$1" ]; then
file=$1
rpm=$2
+ MOVE=1
else
file=$RPMS/kernel-BOOT-*.rpm
rpm=$(rpm -qp --qf '%{name}' $file | perl -pe 's/kernel-BOOT-((\.?[0-9]+){3})\.(.*)/$1-${3}BOOT/')