postinst cleanup the !initrd code pathes
never used and useless. svn path=/dists/trunk/linux-2.6/; revision=14021
This commit is contained in:
parent
a61bed4555
commit
2ab25d6d69
|
@ -39,7 +39,6 @@ my $loader = "=L"; # lilo, silo, quik, palo, vmelilo, nettrom, arcboo
|
||||||
my $image_dir = "=D"; # where the image is located
|
my $image_dir = "=D"; # where the image is located
|
||||||
my $clobber_modules = ''; # target machine defined
|
my $clobber_modules = ''; # target machine defined
|
||||||
my $relative_links = ""; # target machine defined
|
my $relative_links = ""; # target machine defined
|
||||||
my $initrd = "=I"; # initrd kernel
|
|
||||||
my $mkimage = "=M"; # command to generate the initrd image
|
my $mkimage = "=M"; # command to generate the initrd image
|
||||||
my $use_hard_links = ''; # hardlinks do not work across fs boundaries
|
my $use_hard_links = ''; # hardlinks do not work across fs boundaries
|
||||||
my $postinst_hook = ''; #Normally we do not
|
my $postinst_hook = ''; #Normally we do not
|
||||||
|
@ -163,12 +162,6 @@ 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) {
|
if ($link_in_boot) {
|
||||||
$image_dest = "/$image_dir/"; # same as realimageloc
|
$image_dest = "/$image_dir/"; # same as realimageloc
|
||||||
}
|
}
|
||||||
|
@ -957,15 +950,12 @@ sub find_inird_tool {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# The initrd symlink should probably be in the same dir that the
|
my @ramdisklist;
|
||||||
# symlinks are in
|
@ramdisklist = find_inird_tool($ramdisk) if $ramdisk;
|
||||||
if ($initrd) {
|
die "Failed to find suitable initramfs generation tool in $ramdisk\n"
|
||||||
my @ramdisklist;
|
|
||||||
@ramdisklist = find_inird_tool($ramdisk) if $ramdisk;
|
|
||||||
die "Failed to find suitable initramfs generation tool in $ramdisk\n"
|
|
||||||
if $#ramdisklist < 0;
|
if $#ramdisklist < 0;
|
||||||
my $success = 0;
|
my $success = 0;
|
||||||
for $ramdisk_cmd (@ramdisklist) {
|
for $ramdisk_cmd (@ramdisklist) {
|
||||||
print STDERR "Running $ramdisk_cmd.\n";
|
print STDERR "Running $ramdisk_cmd.\n";
|
||||||
print STDERR "Other valid candidates: @ramdisklist\n" if $#ramdisklist > 0;
|
print STDERR "Other valid candidates: @ramdisklist\n" if $#ramdisklist > 0;
|
||||||
|
|
||||||
|
@ -979,38 +969,15 @@ if ($initrd) {
|
||||||
$success = 1;
|
$success = 1;
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
die "Failed to create initrd image.\n" unless $success;
|
die "Failed to create initrd image.\n" unless $success;
|
||||||
if (! defined $ARGV[1] || ! $ARGV[1] || $ARGV[1] =~ m/<unknown>/og) {
|
if (! defined $ARGV[1] || ! $ARGV[1] || $ARGV[1] =~ m/<unknown>/og) {
|
||||||
image_magic("initrd.img", $image_dest);
|
image_magic("initrd.img", $image_dest);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (! -e "initrd.img") {
|
if (! -e "initrd.img") {
|
||||||
handle_missing_link("initrd.img", $image_dest, "initrd.img-$version",
|
handle_missing_link("initrd.img", $image_dest, "initrd.img-$version",
|
||||||
$realimageloc);
|
$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
|
# Only change the symlinks if we are not being upgraded
|
||||||
|
|
Loading…
Reference in New Issue