[kernel] r14293 - dists/trunk/linux-2.6/debian/templates/temp.image.plain

Maximilian Attems maks at alioth.debian.org
Thu Sep 24 20:37:41 UTC 2009


Author: maks
Date: Thu Sep 24 20:37:39 2009
New Revision: 14293

Log:
allow non initrd images for now

nuke the preinst check if their is an initramfs,
check makes no sense as anyway around thanks to dep by linux-image

Modified:
   dists/trunk/linux-2.6/debian/templates/temp.image.plain/postinst
   dists/trunk/linux-2.6/debian/templates/temp.image.plain/postrm
   dists/trunk/linux-2.6/debian/templates/temp.image.plain/preinst
   dists/trunk/linux-2.6/debian/templates/temp.image.plain/templates

Modified: dists/trunk/linux-2.6/debian/templates/temp.image.plain/postinst
==============================================================================
--- dists/trunk/linux-2.6/debian/templates/temp.image.plain/postinst	Thu Sep 24 18:57:24 2009	(r14292)
+++ dists/trunk/linux-2.6/debian/templates/temp.image.plain/postinst	Thu Sep 24 20:37:39 2009	(r14293)
@@ -37,6 +37,7 @@
 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 @@
 }
 
 
+# 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 @@
 }
 
 
+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 @@
                           $realimageloc);
     }
 }
+}
 
 # Only change the symlinks if we are not being upgraded
 if (! defined $ARGV[1] || ! $ARGV[1] || $ARGV[1] =~ m/<unknown>/og) {

Modified: dists/trunk/linux-2.6/debian/templates/temp.image.plain/postrm
==============================================================================
--- dists/trunk/linux-2.6/debian/templates/temp.image.plain/postrm	Thu Sep 24 18:57:24 2009	(r14292)
+++ dists/trunk/linux-2.6/debian/templates/temp.image.plain/postrm	Thu Sep 24 20:37:39 2009	(r14293)
@@ -45,6 +45,7 @@
 my $kimage            = "=K";	# Should be empty, mostly
 my $loader            = "=L";     # lilo, silo, quik, palo, vmelilo, or nettrom
 my $image_dir         = "=D";     # where the image is located
+my $initrd            = "=I";     # initrd kernel
 my $use_hard_links    = '';       # hardlinks do not work across fs boundaries
 my $postrm_hook       = '';       #Normally we do not
 my $minimal_swap      = '';       # Do not swap symlinks
@@ -326,8 +327,8 @@
   # check and remove damaged and dangling symlinks
   image_magic($kimage,          $image_dest);
   image_magic($kimage . ".old", $image_dest);
-  image_magic("initrd.img",     $image_dest);
-  image_magic("initrd.img.old", $image_dest);
+  image_magic("initrd.img",     $image_dest) if $initrd;
+  image_magic("initrd.img.old", $image_dest) if $initrd;
 }
 
 

Modified: dists/trunk/linux-2.6/debian/templates/temp.image.plain/preinst
==============================================================================
--- dists/trunk/linux-2.6/debian/templates/temp.image.plain/preinst	Thu Sep 24 18:57:24 2009	(r14292)
+++ dists/trunk/linux-2.6/debian/templates/temp.image.plain/preinst	Thu Sep 24 20:37:39 2009	(r14293)
@@ -115,56 +115,6 @@
 
 $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;
- at 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;

Modified: dists/trunk/linux-2.6/debian/templates/temp.image.plain/templates
==============================================================================
--- dists/trunk/linux-2.6/debian/templates/temp.image.plain/templates	Thu Sep 24 18:57:24 2009	(r14292)
+++ dists/trunk/linux-2.6/debian/templates/temp.image.plain/templates	Thu Sep 24 20:37:39 2009	(r14293)
@@ -1,17 +1,3 @@
-Template: =ST-image-=V/preinst/initrd-=V
-Type: text
-Description: Initial RAMdisk image generation impossible
- You are attempting to install an initrd kernel image (version
- =V) on a machine currently running kernel version
- ${hostversion}.
- .
- No suitable tool for generating initrd images was found in
- ${ramdisk} and therefore no initrd image can be generated.
- This will break the installation, unless such tools are also being installed
- right now. Suitable tools:
- .
- ${initrddep}
-
 Template: =ST-image-=V/postinst/depmod-error-initrd-=V
 Type: boolean
 Default: false



More information about the Kernel-svn-changes mailing list