Re: Bringing the 2.6.13 (and beyond) kernel to sid, solving ramdisk generations issues and stuff.
On Sat, Oct 15, 2005 at 12:19:04PM +0200, Sven Luther wrote:
> Hello,
>
> Now that we have a solution for the ramdisk generation tool mess, we can go
> ahead, and outline a plan for bringing 2.6.13 to sid, and then go ahead and do
> the same with 2.6.14 shortly after that, while 2.6.12 is safely in etch.
Ok, thanks to Mattia Dongili i have created a tentative new kernel-package
which i uploaded here :
http://people.debian.org/~luther/ramdisk
together with the fixed initrd-tools and initramfs-tools (Jonas, can you send
me the fixed yaird, so i can put it there also ?).
I am not 100% sure of the kernel-package fix, so i added the kernel-package
diff there also (and attached it here), and i would like inspection of it as
much as possible, as well as testing with real kernels in all possible
situations.
To test, you need to install the new kernel-package, and rebuild linux-2.6,
and then install the yaird | initrd-tools | initramfs-tools, and then install
the resulting kernel image and see if it is ok, and play a bit with the
ramdisk= entries in /etc/kernel-img.conf.
It would be nice also to see how this would react with older kernels.
Also, the current patch is not checking the case of not-supporting the
--supported-(host|target)-version stuff, so this either needs to be added as a
check or better yet, have kernel-package add an explicit conflict to
kernel-package generated kernel images.
So, i would appreciate comments on this, and if someone with more perl
experience could look this over, and maybe partially take over for the next
2/3 days, as i will not have much time for debian until wednesday myself.
Friendly,
Sven Luther
diff -Nur kernel-package-9.008/kernel/image.postinst kernel-package-9.008.1/kernel/image.postinst
--- kernel-package-9.008/kernel/image.postinst 2005-09-22 20:57:56.000000000 +0200
+++ kernel-package-9.008.1/kernel/image.postinst 2005-10-16 09:28:42.000000000 +0200
@@ -54,6 +54,9 @@
my $arch = "=A"; # should be same as dpkg --print-installation-architecture
my $kernel_arch = "=B";
my $ramdisk = '/usr/sbin/mkinitrd'; # Tool to create initial ram fs.
+chomp (my $unamedashr = `uname -r`);
+$ramdisk = '/usr/sbin/mkinitrd.yaird' if (system ("dpkg --compare-versions $unamedashr ge 2.6.13 1>/dev/null 2>&1") == 0);
+
my $package_name = "=ST-image-$version";
@@ -972,6 +975,16 @@
# The initrd symlink should probably be in the same dir that the
# symlinks are in
if ($initrd) {
+ my @ramdisklist =
+ grep {
+ -x and
+ system ("$_ --supported-host-version=$unamedashr 1>/dev/null 2>&1") == 0
+ }
+ (split (/ /, $ramdisk));
+
+ defined ($ramdisk = shift @ramdisklist)
+ or die ("Failed to find suitable ramdisk generation tool for kernel version $version in $ramdisk\n");
+
my $initrd_path = $realimageloc . "initrd.img-$version";
my $ret = system("$ramdisk " .
($mkimage ? "-m '$mkimage' " : "") .
diff -Nur kernel-package-9.008/kernel/image.postrm kernel-package-9.008.1/kernel/image.postrm
--- kernel-package-9.008/kernel/image.postrm 2005-09-22 20:52:29.000000000 +0200
+++ kernel-package-9.008.1/kernel/image.postrm 2005-10-16 09:28:52.000000000 +0200
@@ -52,6 +52,8 @@
my $arch = "=A"; # should be same as dpkg --print-installation-architecture
my $kernel_arch = "=B";
my $ramdisk = '/usr/sbin/mkinitrd'; # Tool to create initial ram fs.
+chomp (my $unamedashr = `uname -r`);
+$ramdisk = '/usr/sbin/mkinitrd.yaird' if (system ("dpkg --compare-versions $unamedashr ge 2.6.13 1>/dev/null 2>&1") == 0);
my $Loader = "NoLOADER"; #
$Loader = "LILO" if $loader =~ /^lilo/io;
diff -Nur kernel-package-9.008/kernel/image.preinst kernel-package-9.008.1/kernel/image.preinst
--- kernel-package-9.008/kernel/image.preinst 2005-09-22 21:01:04.000000000 +0200
+++ kernel-package-9.008.1/kernel/image.preinst 2005-10-16 09:29:00.000000000 +0200
@@ -52,6 +52,9 @@
my $arch = "=A"; # should be same as dpkg --print-installation-architecture
my $kernel_arch = "=B";
my $ramdisk = '/usr/sbin/mkinitrd'; # Tool to create initial ram fs.
+chomp (my $unamedashr = `uname -r`);
+$ramdisk = '/usr/sbin/mkinitrd.yaird' if (system ("dpkg --compare-versions $unamedashr ge 2.6.13 1>/dev/null 2>&1") == 0);
+
my $Loader = "NoLOADER"; #
@@ -182,13 +185,25 @@
$initrd=~ s/^$pattern$//;
if ($initrd) {
+ my @ramdisklist =
+ grep {
+ -x and
+ system ("$_ --supported-host-version=$unamedashr 1>/dev/null 2>&1") == 0
+ }
+ (split (/ /, $ramdisk));
+
+ my $msgramdisk = $ramdisk;
+ $ramdisk = shift @ramdisklist;
+
if (! -e $ramdisk) {
print STDERR <<EOERROR;
You are attempting to install an initrd kernel image (version
-$version) but you do not seem to have a $ramdisk
-command. This will break the installation, unless initrd-tools are
-also being installed right now.
+$version) while running a kernel of version $unamedashr, but
+you have no suitable ramdisk generation tool installed among
+$msgramdisk. This will break the installation, unless a
+suitable ramdisk generation tool is also being installed right
+now.
EOERROR
;
diff -Nur kernel-package-9.008/kernel/image.prerm kernel-package-9.008.1/kernel/image.prerm
--- kernel-package-9.008/kernel/image.prerm 2005-06-13 07:41:31.000000000 +0200
+++ kernel-package-9.008.1/kernel/image.prerm 2005-10-16 09:29:10.000000000 +0200
@@ -48,6 +48,8 @@
my $arch = "=A"; # should be same as dpkg --print-installation-architecture
my $kernel_arch = "=B";
my $ramdisk = '/usr/sbin/mkinitrd'; # Tool to create initial ram fs.
+chomp (my $unamedashr = `uname -r`);
+$ramdisk = '/usr/sbin/mkinitrd.yaird' if (system ("dpkg --compare-versions $unamedashr ge 2.6.13 1>/dev/null 2>&1") == 0);
my $Loader = "NoLOADER"; #
$Loader = "LILO" if $loader =~ /^lilo/io;
Reply to: