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

Maximilian Attems maks at alioth.debian.org
Mon Jul 27 12:14:06 UTC 2009


Author: maks
Date: Mon Jul 27 12:14:01 2009
New Revision: 14021

Log:
postinst cleanup the !initrd code pathes

never used and useless.

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

Modified: dists/trunk/linux-2.6/debian/templates/temp.image.plain/postinst
==============================================================================
--- dists/trunk/linux-2.6/debian/templates/temp.image.plain/postinst	Mon Jul 27 12:13:50 2009	(r14020)
+++ dists/trunk/linux-2.6/debian/templates/temp.image.plain/postinst	Mon Jul 27 12:14:01 2009	(r14021)
@@ -39,7 +39,6 @@
 my $image_dir         = "=D";        # where the image is located
 my $clobber_modules   = '';          # target machine defined
 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
@@ -163,12 +162,6 @@
 
 
 
-# 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
 }
@@ -957,15 +950,12 @@
 }
 
 
-# The initrd symlink should probably be in the same dir that the
-# symlinks are in
-if ($initrd) {
-  my @ramdisklist;
-  @ramdisklist = find_inird_tool($ramdisk) if $ramdisk;
-  die "Failed to find suitable initramfs generation tool in $ramdisk\n"
+my @ramdisklist;
+ at ramdisklist = find_inird_tool($ramdisk) if $ramdisk;
+die "Failed to find suitable initramfs generation tool in $ramdisk\n"
       if $#ramdisklist < 0;
-  my $success = 0;
-  for $ramdisk_cmd (@ramdisklist) {
+my $success = 0;
+for $ramdisk_cmd (@ramdisklist) {
     print STDERR "Running $ramdisk_cmd.\n";
     print STDERR "Other valid candidates: @ramdisklist\n" if $#ramdisklist > 0;
 
@@ -979,38 +969,15 @@
 	$success = 1;
 	last;
     }
-  }
-  die "Failed to create initrd image.\n" unless $success;
-  if (! defined $ARGV[1] || ! $ARGV[1] || $ARGV[1] =~ m/<unknown>/og) {
+}
+die "Failed to create initrd image.\n" unless $success;
+if (! defined $ARGV[1] || ! $ARGV[1] || $ARGV[1] =~ m/<unknown>/og) {
     image_magic("initrd.img", $image_dest);
-  }
-  else {
+} else {
     if (! -e "initrd.img") {
       handle_missing_link("initrd.img", $image_dest, "initrd.img-$version",
                           $realimageloc);
     }
-  }
-
-}
-else {                        # Not making an initrd emage
-  if (-l "initrd.img") {
-    # Ooh, last image was an initrd image? in any case, we should move it. 
-    my $target = readlink "initrd.img";
-    my $real_target = '';
-    $real_target = abs_path($target) if defined ($target);
-
-    if (!defined($target) || ! -f "$real_target") {
-      # Eh. dangling link. can safely be removed.
-      unlink("initrd.img");
-    } else {
-      if (-l "initrd.img.old" || ! -e "initrd.img.old" ) {
-        rename("initrd.img", "initrd.img.old");
-      } else {
-        warn "initrd.img.old is not a symlink, not clobbering\n";
-        unlink("initrd.img");
-      }
-    }
-  }
 }
 
 # Only change the symlinks if we are not being upgraded



More information about the Kernel-svn-changes mailing list