From 967fd2f2801483d96fdf443823c87f4343c43c3a Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 18 Jun 2010 03:46:24 +0000 Subject: [PATCH] Get rid of the installation directory template variable (=D) This is always '/boot'. We can also stop manipulating this constant in the maintainer scripts. svn path=/dists/sid/linux-2.6/; revision=15885 --- debian/rules.real | 1 - debian/templates/temp.image.plain/postinst | 11 ++--------- debian/templates/temp.image.plain/postrm | 9 ++------- debian/templates/temp.image.plain/preinst | 7 +------ debian/templates/temp.image.plain/prerm | 7 +------ 5 files changed, 6 insertions(+), 29 deletions(-) diff --git a/debian/rules.real b/debian/rules.real index e34aac962..3cfc4580e 100644 --- a/debian/rules.real +++ b/debian/rules.real @@ -395,7 +395,6 @@ install-image_s390_$(FEATURESET)_$(FLAVOUR)_plain_templates: ARG_BOOTLOADER = zi install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain_templates: for i in $(wildcard debian/templates/temp.image.plain/*); do \ sed \ - -e 's,=D,/boot,g' \ -e 's@=A@$(DEB_HOST_ARCH)@g' \ -e 's@=B@$(KERNEL_ARCH)@g' \ -e 's/=IB//g' \ diff --git a/debian/templates/temp.image.plain/postinst b/debian/templates/temp.image.plain/postinst index 6b6128d5a..fcc15fee5 100755 --- a/debian/templates/temp.image.plain/postinst +++ b/debian/templates/temp.image.plain/postinst @@ -18,7 +18,6 @@ my $do_boot_enable = "Yes"; # target machine defined my $do_bootloader = "Yes"; # target machine defined 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 $initrd = "=I"; # initrd kernel my $mkimage = "=M"; # command to generate the initrd image my $use_hard_links = ''; # hardlinks do not work across fs boundaries @@ -52,7 +51,7 @@ my $temp_file_name = "/var/log/$loader" . "_log.$$"; #known variables my $image_dest = "/"; -my $realimageloc = "/$image_dir/"; +my $realimageloc = "/boot/"; my $have_conffile = ""; my $modules_base = '/lib/modules'; @@ -66,12 +65,6 @@ my $DEBUG = 0; # Do some preliminary sanity checks here to ensure we actually have an # valid image dir chdir('/') or die "could not chdir to /:$!\n"; -die "Internal Error: ($image_dir) is not a directory!\n" - unless -d $image_dir; - -# remove multiple leading slashes; make sure there is at least one. -$realimageloc =~ s|^/*|/|o; -$realimageloc =~ s|/+|/|o; die "Internal Error: ($realimageloc) is not a directory!\n" unless -d $realimageloc; @@ -125,7 +118,7 @@ my $pattern = "=" . "I"; $initrd=~ s/^$pattern$//; if ($link_in_boot) { - $image_dest = "/$image_dir/"; # same as realimageloc + $image_dest = $realimageloc; } # Tack on at least one trainling / diff --git a/debian/templates/temp.image.plain/postrm b/debian/templates/temp.image.plain/postrm index a2eb84dcb..2c575b080 100755 --- a/debian/templates/temp.image.plain/postrm +++ b/debian/templates/temp.image.plain/postrm @@ -26,7 +26,6 @@ my $do_boot_enable = "Yes"; # target machine defined my $do_bootloader = "Yes"; # target machine defined 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 @@ -56,13 +55,10 @@ my $temp_file_name = "/var/log/$loader" . "_log.$$"; #known variables my $image_dest = "/"; -my $realimageloc = "/$image_dir/"; +my $realimageloc = "/boot/"; my $CONF_LOC = '/etc/kernel-img.conf'; chdir('/') or die "could not chdir to /:$!\n"; -# remove multiple leading slashes; make sure there is at least one. -$realimageloc =~ s|^/*|/|o; -$realimageloc =~ s|/+|/|o; if (-r "$CONF_LOC" && -f "$CONF_LOC" ) { @@ -102,8 +98,7 @@ if (-r "$CONF_LOC" && -f "$CONF_LOC" ) { } if ($link_in_boot) { - $image_dest = "/$image_dir/"; - $image_dest =~ s|^/*|/|o; + $image_dest = $realimageloc; } $image_dest = "$image_dest/"; diff --git a/debian/templates/temp.image.plain/preinst b/debian/templates/temp.image.plain/preinst index f27ca268b..c0a77e5db 100755 --- a/debian/templates/temp.image.plain/preinst +++ b/debian/templates/temp.image.plain/preinst @@ -14,7 +14,6 @@ my $link_in_boot = "=IB"; # Should be empty, mostly my $no_symlink = "=S"; # Should be empty, mostly my $do_symlink = "Yes"; # target machine defined my $kimage = "=K"; # Should be empty, mostly -my $image_dir = "=D"; # where the image is located my $use_hard_links = ''; # hardlinks do not wirk across fs boundaries my $preinst_hook = ''; #Normally we do not my $minimal_swap = ''; # Do not swap symlinks @@ -29,7 +28,7 @@ my $package_name = "linux-image-$version"; #known variables my $image_dest = "/"; -my $realimageloc = "/$image_dir/"; +my $realimageloc = "/boot/"; my $CONF_LOC = '/etc/kernel-img.conf'; my $modules_base = '/lib/modules'; @@ -39,10 +38,6 @@ die "Pre inst Internal error. Aborting." unless $version; exit 0 if $ARGV[0] =~ /abort-upgrade/; exit 1 unless $ARGV[0] =~ /(install|upgrade)/; -# remove multiple leading slashes; make sure there is at least one. -$realimageloc =~ s|^/*|/|o; -$realimageloc =~ s|/+|/|o; - if (-r "$CONF_LOC" && -f "$CONF_LOC" ) { if (open(CONF, "$CONF_LOC")) { while () { diff --git a/debian/templates/temp.image.plain/prerm b/debian/templates/temp.image.plain/prerm index 24f94af4d..2a053203b 100755 --- a/debian/templates/temp.image.plain/prerm +++ b/debian/templates/temp.image.plain/prerm @@ -15,7 +15,6 @@ my $do_boot_enable = "Yes"; # target machine defined my $do_bootloader = "Yes"; # target machine defined 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 $use_hard_links = ''; # hardlinks do not wirk across fs boundaries my $prerm_hook = ''; #Normally we do not my $minimal_swap = ''; # Do not swap symlinks @@ -43,13 +42,9 @@ my $temp_file_name = "/var/log/$loader" . "_log.$$"; #known variables my $image_dest = "/"; -my $realimageloc = "/$image_dir/"; +my $realimageloc = "/boot/"; my $CONF_LOC = '/etc/kernel-img.conf'; -# remove multiple leading slashes; make sure there is at least one. -$realimageloc =~ s|^/*|/|o; -$realimageloc =~ s|/+|/|o; - # Variables used my $image=''; my $ret=0;