"J . A . Magallon" <[EMAIL PROTECTED]> writes:
> Hi,
>
> I have installed the latest kernel rpm (2.4.1-4mdk), and it does not install
> any initrd-2.4.1-4mdk. The symlink in /boot remains pointing to the old
> 2.2.18-10 initrd. So kernel does not boot...because I need it on a Pentium200
> that boots from an aha1520 and it is built as a module.
> Can be solved with a manual mkinitrd...
i have just commited this patch on installkernel in the cvs, use it
with the -L option to generate the link and when i make sure that
every case is ok i'll make it as default.
Index: installkernel
===================================================================
RCS file: /home/cvs/cooker/soft/initscripts/mandrake/installkernel,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -u -r1.20 -r1.21
--- installkernel 2001/01/25 17:45:58 1.20
+++ installkernel 2001/02/06 17:10:23 1.21
@@ -6,7 +6,7 @@
# Redistribution of this file is permitted under the terms of the GNU
# Public License (GPL)
#--------------------------------------------------------------------
-# $Id: installkernel,v 1.20 2001/01/25 17:45:58 chmouel Exp $
+# $Id: installkernel,v 1.21 2001/02/06 17:10:23 chmouel Exp $
#--------------------------------------------------------------------
## description:
# Install a kernel to /boot and add an entry for grub or
@@ -24,8 +24,9 @@
use Config;
use strict;
-my ($lilo, $nolaunch, $grub, $autodetect, $default, $nocopy, $quiet, $kversion,
$bootimage, $mapfile);
+my ($link, $lilo, $nolaunch, $grub, $autodetect, $default, $nocopy, $quiet,
+$kversion, $bootimage, $mapfile);
my $loader;
+my $debug = 0;
my $arch = $Config{archname};
my $boot ='/boot';
@@ -37,14 +38,17 @@
parse_option(@ARGV);
die "You have to be root\n" if $> != 0;
+sub debug { print @_, "\n" if $debug;}
+
unless ($nocopy) {
+ debug("copying files of system.map and kernel");
copy_and_backup_it("vmlinuz-$kversion", "$boot");
copy_and_backup_it("System.map-$kversion", "$boot");
# shell suck but it much compact.
die "can't find $bootimage\n" unless -f $bootimage; die "can't find $mapfile\n"
unless -f $mapfile;
`cat $bootimage > $boot/vmlinuz-$kversion && cp -f $mapfile
$boot/System.map-$kversion`;
}
-make_link($kversion);
+make_link($kversion) if $link;
$loader = -x '/usr/sbin/detectloader' ? `/usr/sbin/detectloader` : detect_loader()
if $autodetect;
@@ -89,6 +94,8 @@
$autodetect++;
} elsif (/^--default/ || /^-d/) {
$default++;
+ } elsif (/^--link/ || /^-L/) {
+ $link++;
} elsif (/^--nocopy/ || /^-c/) {
$nocopy++;
} elsif (/^--help/ || /^-h/ || /^-\?/) {
@@ -163,9 +170,20 @@
sub generate_initrd {
my $k = shift;
+ my $ext = '';
+ $ext = "-secure" if $k =~ /secure/;
+ $ext = "-smp" if $k =~ /smp/;
+ my $initrd = "$boot/initrd$ext.img";
+
system("/sbin/mkinitrd --ifneeded /boot/initrd-$k.img $k 2>/dev/null >/dev/null");
- if (-f "/boot/initrd-$k.img") {
- my_symlinkf ("/boot/initrd-$k.img", '/boot/initrd');
+
+ if ( -f "/boot/initrd-$k.img") {
+ if ( -l $initrd ) {
+ if (readlink($initrd) =~ m|^$boot/initrd-$k.img$| ) {
+ return 0;
+ }
+ }
+ my_symlinkf ("/boot/initrd-$k.img", $initrd);
return 1
}
return 0;
--
MandrakeSoft Inc http://www.chmouel.org
--Chmouel