[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 2.6.31 snapshots: all kernels without initrd broken



On Thu, 24 Sep 2009, Martin Michlmayr wrote:
> The package installs now but I still get the following warning:
> Could not find . at /var/lib/dpkg/tmp.ci/preinst line 165, <STDIN> line 9.
> 
> Since I'm not very familiar with the config scripts, I wanted to ask
> if someone else can take a look at this.
> 

allways wondered if that preinst check make sense at all,
as relevant linux images have anyway the right dependencies set
so this check seems to me also as k-p legacy.

could you please test belows patch:

diff --git a/linux-2.6/debian/templates/temp.image.plain/postinst b/linux-2.6/debian/templates/temp.image.plain/postinst
index 40cbf8c..becea6d 100755
--- a/linux-2.6/debian/templates/temp.image.plain/postinst
+++ b/linux-2.6/debian/templates/temp.image.plain/postinst
@@ -37,6 +37,7 @@ my $kimage            = "=K";   # Should be empty, mostly
 my $loader            = "=L"; # lilo, silo, quik, palo, vmelilo, nettrom, arcboot or delo
 my $image_dir         = "=D";        # where the image is located
 my $relative_links    = "";          # target machine defined
+my $initrd            = "=I";        # initrd kernel
 my $mkimage           = "=M";   # command to generate the initrd image
 my $use_hard_links    = ''; # hardlinks do not work across fs boundaries
 my $postinst_hook     = '';          #Normally we do not
@@ -144,6 +145,11 @@ if (-r "$CONF_LOC" && -f "$CONF_LOC"  ) {
 }
 
 
+# For some versions of kernel-package, we had this warning in the
+# postinst, but the rules did not really interpolate the value in.
+# Here is a sanity check.
+my $pattern = "=" . "I";
+$initrd=~ s/^$pattern$//;
 
 if ($link_in_boot) {
   $image_dest = "/$image_dir/"; # same as realimageloc
@@ -866,6 +872,7 @@ sub find_inird_tool {
 }
 
 
+if ($initrd) {
 my @ramdisklist;
 @ramdisklist = find_inird_tool($ramdisk) if $ramdisk;
 die "Failed to find suitable initramfs generation tool in $ramdisk\n"
@@ -895,6 +902,7 @@ if (! defined $ARGV[1] || ! $ARGV[1] || $ARGV[1] =~ m/<unknown>/og) {
                           $realimageloc);
     }
 }
+}
 
 # Only change the symlinks if we are not being upgraded
 if (! defined $ARGV[1] || ! $ARGV[1] || $ARGV[1] =~ m/<unknown>/og) {
diff --git a/linux-2.6/debian/templates/temp.image.plain/preinst b/linux-2.6/debian/templates/temp.image.plain/preinst
index cb8c7d3..3ed584e 100755
--- a/linux-2.6/debian/templates/temp.image.plain/preinst
+++ b/linux-2.6/debian/templates/temp.image.plain/preinst
@@ -115,56 +115,6 @@ if (-r "$CONF_LOC" && -f "$CONF_LOC"  ) {
 
 $ENV{KERNEL_ARCH}=$kernel_arch if $kernel_arch;
 
-# About to upgrade this package from version $2 TO THIS VERSION.
-# "prerm upgrade" has already been called for the old version of
-# this package.
-
-sub find_inird_tool {
-	my $ramdisk = shift;
-	my (@ramdisks, $initramfs_cmd);
-
-	foreach $initramfs_cmd  (split(/[:,\s]+/, $ramdisk)) {
-		if (system("test -x \"\$(command -v $initramfs_cmd)\"") == 0) {
-			push(@ramdisks, $initramfs_cmd);
-		}
-        }
-	return @ramdisks;
-}
-
-chomp (my $hostversion = `uname -r`);
-my @ramdisklist;
-@ramdisklist = find_inird_tool($ramdisk) if $ramdisk;
-if ($#ramdisklist < 0) {
-    my $ret;
-    my $seen;
-    my $text = "${package_name}/preinst/initrd-$version";
-    ($ret,$seen) = fset ("$text", 'seen', 'false');
-    die "Error setting debconf flags in $text: $seen" if $ret;
-
-    ($ret,$seen) = subst("$text", 'hostversion', "$hostversion");
-    die "Error setting debconf substitutions in $text: $seen" if $ret;
-
-    ($ret,$seen) = subst("$text", 'ramdisk', "$ramdisk");
-    die "Error setting debconf substitutions in $text: $seen" if $ret;
-
-    ($ret,$seen) = subst("$text", 'initrddep', "$initrddep");
-    die "Error setting debconf substitutions in $text: $seen" if $ret;
-
-    ($ret,$seen) = input('medium', "$text");
-    if ($ret && $ret != 30 ) {
-      die "Error setting debconf question $text: $seen";
-    }
-
-    ($ret,$seen) = go ();
-    if ($ret && $ret != 30 ) {
-      die "Error asking debconf question $text: $seen";
-    }
-    # I no longer claim this question
-    ($ret,$seen) = unregister("$text");
-    die "Error unregistering debconf question $text: $seen" if $ret;
-    warn "Could not find $ramdisk.";
-}
-
 
 sub check {
   my $version = shift;


Reply to: