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

[PATCH 3/4] linux-image: Remove undocumented $KERNEL_ARCH variable from hook environment



Maintainer scripts generated by kernel-package pass an environment
variable $KERNEL_ARCH to hook scripts.  This is undocumented but seems
to be the architecture string that the kernel will report
(e.g. through 'uname -m').

However, for the past few years our maintainer scripts have set it to
the source architecture name instead.  Since no-one reported this bug,
I don't think anyone depends on it.  codesearch didn't find any users
either.  So remove it.

--- a/debian/templates/image.plain.postinst.in
+++ b/debian/templates/image.plain.postinst.in
@@ -22,7 +22,6 @@ my $use_hard_links    = ''; # hardlinks
 my $postinst_hook     = '';          #Normally we do not
 my $minimal_swap      = '';          # Do not swap symlinks
 my $ignore_depmod_err = '';          # normally we do not
-my $kernel_arch       = "=B";
 my $ramdisk           = '';
 my $package_name      = "linux-image-$version";
 
@@ -99,8 +98,6 @@ if ($do_symlink && $no_symlink) {
 # most of our work is done in $image_dest (nominally /)
 chdir("$image_dest") or die "could not chdir to $image_dest:$!\n";
 
-$ENV{KERNEL_ARCH}=$kernel_arch if $kernel_arch;
-
 
 die "Internal Error: Could not find image (" . $realimageloc
   . "$kimage-$version)\n" unless -e $realimageloc
--- a/debian/templates/image.plain.postrm.in
+++ b/debian/templates/image.plain.postrm.in
@@ -24,7 +24,6 @@ my $link_in_boot      = "";
 my $kimage            = "=K";
 my $initrd            = "=I";     # initrd kernel
 my $postrm_hook       = '';       #Normally we do not
-my $kernel_arch       = "=B";
 my $ramdisk           = "=MK";  # List of tools to create initial ram fs.
 my $package_name    = "linux-image-$version";
 
@@ -66,8 +65,6 @@ if (-d "$image_dest") {
   chdir("$image_dest") or die "could not chdir to $image_dest:$!\n";
 }
 
-$ENV{KERNEL_ARCH}=$kernel_arch if $kernel_arch;
-
 
 ######################################################################
 ######################################################################
--- a/debian/templates/image.plain.preinst.in
+++ b/debian/templates/image.plain.preinst.in
@@ -13,7 +13,6 @@ $|=1;
 my $version         = "=V";
 my $kimage          = "=K";
 my $preinst_hook    = '';       #Normally we do not
-my $kernel_arch       = "=B";
 my $package_name    = "linux-image-$version";
 
 #known variables
@@ -40,8 +39,6 @@ if (-r "$CONF_LOC" && -f "$CONF_LOC"  )
   }
 }
 
-$ENV{KERNEL_ARCH}=$kernel_arch if $kernel_arch;
-
 
 # set the env var stem
 $ENV{'STEM'} = "linux";
--- a/debian/templates/image.plain.prerm.in
+++ b/debian/templates/image.plain.prerm.in
@@ -11,7 +11,6 @@ $|=1;
 my $version         = "=V";
 my $kimage          = "=K";
 my $prerm_hook      = '';       #Normally we do not
-my $kernel_arch       = "=B";
 my $package_name    = "linux-image-$version";
 
 #known variables
@@ -43,8 +42,6 @@ if (-r "$CONF_LOC" && -f "$CONF_LOC"  )
 }
 
 
-$ENV{KERNEL_ARCH}=$kernel_arch if $kernel_arch;
-
 #check to see if we are trying to remove a running kernel
 # if so we abort right now.
 chop($running=`uname -r`);
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ linux (3.11~rc4-1~exp2) UNRELEASED; urge
   * trace: Enable UPROBES, UPROBE_EVENT (Closes: #691167)
   * Clean up maintainer scripts and templating system
     - Move all templates under debian/templates
+    - linux-image: Remove undocumented $KERNEL_ARCH variable from hook
+      environment
 
  -- Ben Hutchings <ben@decadent.org.uk>  Sun, 11 Aug 2013 19:34:47 +0200
 

-- 
Ben Hutchings
Man invented language to satisfy his deep need to complain. - Lily Tomlin

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: