summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--images/Makefile4
-rwxr-xr-ximages/make_boot_img65
-rwxr-xr-ximages/update_kernel38
3 files changed, 4 insertions, 103 deletions
diff --git a/images/Makefile b/images/Makefile
index 07168eb99..c25e965bd 100644
--- a/images/Makefile
+++ b/images/Makefile
@@ -8,7 +8,7 @@ IMAGES_DEST = $(ROOTDEST)/install/images
all: images
-images: all.kernels
+images: all.kernels/.list
DISTRIB_DESCR=$(DISTRIB_DESCR) DISTRIB_VERSION=$(DISTRIB_VERSION) ./make_boot_img
rm -rf images/alternatives
if [ `ls images/*.img-* 2>/dev/null | wc -l` -gt 0 ]; then \
@@ -16,7 +16,7 @@ images: all.kernels
fi
cd images ; md5sum *.{img,iso}* > MD5SUM
-all.kernels: update_kernel ../kernel/list_modules.pm
+all.kernels/.list: update_kernel
./update_kernel $(KERNELS)
dist: tar
diff --git a/images/make_boot_img b/images/make_boot_img
index 21cb435a0..b096097aa 100755
--- a/images/make_boot_img
+++ b/images/make_boot_img
@@ -166,71 +166,6 @@ sub initrd {
}
-sub initrdold {
- my ($type, $I, $img) = @_;
- my $stage1_root = $ENV{USE_LOCAL_STAGE1} ? "../mdk-stage1" : "/usr/$lib/drakx-installer-binaries";
- my ($ext) = $img =~ /rdz-(.*)/ or die "bad initrd name ($img)";
-
- _ "rm -rf $tmp_initrd";
- mkdir_p("$tmp_initrd$_") foreach qw(/etc /firmware /lib /modules /sbin /tmp /var);
- symlink "../modules", "$tmp_initrd/lib/modules";
- symlink "../firmware", "$tmp_initrd/lib/firmware";
-
- symlink "/proc/mounts", "$tmp_initrd/etc/mtab";
- symlink "../tmp", "$tmp_initrd/var/run";
- _ "install -D /usr/share/terminfo/l/linux $tmp_initrd/usr/share/terminfo/l/linux";
- foreach ('pcitable', 'usbtable') {
- _ "install -D /usr/share/ldetect-lst/$_.gz $tmp_initrd/usr/share/ldetect-lst/$_.gz";
- }
- _ "install -D /usr/share/pci.ids $tmp_initrd/usr/share/pci.ids";
- foreach ("dkms-modules.alias", "fallback-modules.alias", "/lib/module-init-tools/ldetect-lst-modules.alias") {
- my $file = m!^/! ? $_ : "/usr/share/ldetect-lst/$_";
- _ "install -D $file $tmp_initrd$file";
- }
- foreach my $firm (glob_("all.kernels$I/$ext/firmware/*")) {
- my $dest=$firm;
- $dest =~ s|all.kernels$I/$ext/||;
- _ "cp -a $firm $tmp_initrd/$dest";
- }
-
- _ "install $stage1_root/init $tmp_initrd/";
- _ "install $stage1_root/stage1 $tmp_initrd/sbin/";
- foreach ('pppd', 'pppoe') {
- _ "install /usr/sbin/${_}-diet $tmp_initrd/sbin/$_";
- }
-
- if ($arch !~ /ppc|ia64/) {
- mkdir_p("$tmp_initrd/etc/pcmcia");
- _ "cp -a /etc/pcmcia/config.opts $tmp_initrd/etc/pcmcia";
- }
- {
- my $modz = "all.kernels$I/$ext";
- mkdir_p("$tmp_initrd/modules/$ext");
- __ "tar xC $tmp_initrd/modules/$ext -f $modz/${type}_modules.tar";
- _ "cp -f $modz/modules.$_ $tmp_initrd/modules/$ext" foreach qw(order builtin);
- substInFile { s,.*/,, } "$tmp_initrd/modules/$ext/modules.order";
- _ "depmod -b $tmp_initrd $ext";
- # depmod keeps only available modules in modules.alias, but we want them all
- _ "cp -f $modz/modules.alias $modz/modules.description $tmp_initrd/modules/$ext";
- }
- mkdir_p("$tmp_initrd/$_") foreach qw(dev proc sys var/tmp tmp/stage2);
- # ka deploy need some files in all.rdz
- if ($ENV{DEBUGSTAGE1} || $ENV{BUILD_KA}) {
- symlink("/sbin", "$tmp_initrd/bin");
- cp_af("/bin/busybox.static", "$tmp_initrd/sbin/busybox");
- my @funct = map { /functions:/ .. /^$/ ? do { s/\s//g; split /,/ } : () } `busybox.static`;
- shift @funct;
- symlink('busybox', $tmp_initrd . "/sbin/$_") foreach @funct;
- }
- if ($ENV{BUILD_KA}) {
- mkdir_p("$tmp_initrd/ka");
- cp_af("/usr/bin/ka-d-client", "$tmp_initrd/ka/ka-d-client");
- }
-
- _ "(cd $tmp_initrd; find . | cpio -o -c --quiet) | xz --check=crc32 --lzma2=dict=512KiB > $img";
- _ "rm -rf $tmp_initrd";
-}
-
sub entries_append {
my ($type) = @_;
diff --git a/images/update_kernel b/images/update_kernel
index 934f5195e..a16513eac 100755
--- a/images/update_kernel
+++ b/images/update_kernel
@@ -15,18 +15,14 @@ use list_modules;
my $rpm = 'rpm --nosignature';
-@ARGV or die "usage: ./update_kernel [--move] (<kernel rpm> ... | <installed kernel name> ...)\n";
+@ARGV or die "usage: ./update_kernel <installed kernel name> ...\n";
eval { rm_rf('all.kernels') }; #- remove old things
mkdir 'all.kernels';
my @kernels = map {
my $kern_ver = rpm2version($_);
- if (/\.rpm$/) {
- extract_kernel($_, $kern_ver);
- } else {
extract_installed_rpm('', $kern_ver);
- }
$kern_ver;
} @ARGV;
@@ -41,40 +37,10 @@ sub rpm2version {
`$rpm $opt $kernel_rpm` =~ m!/boot/vmlinuz-(.*)! && $1 or die "can't find vmlinuz in $kernel_rpm (is it installed?)\n";
}
-sub extract_kernel {
- my ($kernel_rpm, $kern_ver) = @_;
-
- my $dir = "all.kernels/$kern_ver";
-
- warn "Extracting kernel $kern_ver\n";
-
- eval { rm_rf($dir) };
- mkdir_p("$dir/modules");
- sys("rpm2cpio $kernel_rpm | (cd $dir ; cpio -id)");
-
- extract_installed_rpm($dir, $kern_ver);
-
- eval { rm_rf("$dir$_") } foreach qw(/boot /lib /usr);
-}
-
sub extract_installed_rpm {
my ($installed_dir, $kern_ver) = @_;
my $local_dir = "all.kernels/$kern_ver";
- mkdir_p("$local_dir/modules");
+ mkdir_p("$local_dir");
sys('cp', "$installed_dir/boot/vmlinuz-$kern_ver", "$local_dir/vmlinuz");
- sys("cp $installed_dir/lib/modules/$kern_ver/modules.* $local_dir");
-
- open(my $F, "find $installed_dir/lib/modules/$kern_ver -name '*.ko.?z' |");
- my $file; while ($file = <$F>) {
- chomp($file);
- system('cp', $file, "$local_dir/modules/" . basename($file)) == 0
- or warn "conflict for $file\n";
- }
-
- sys('perl', '../kernel/modules.pl', 'remove_unneeded_modules', $kern_ver);
- sys('perl', '../kernel/modules.pl', 'get_firmwares', $kern_ver);
- sys('perl', '../kernel/modules.pl', 'make_modules_per_image', $kern_ver);
-
- rm_rf("$local_dir/modules");
}