postinst: Remove specific support for running a ramdisk creator
Warn users that specify one in /etc/kernel-img.conf. Require initramfs-tools >= 0.94, which installs a postinst hook. svn path=/dists/trunk/linux-2.6/; revision=16958
This commit is contained in:
parent
04b478b743
commit
a68b161473
|
@ -129,9 +129,6 @@ class Gencontrol(Base):
|
||||||
|
|
||||||
if config_entry_image.get('initramfs', True):
|
if config_entry_image.get('initramfs', True):
|
||||||
generators = config_entry_image['initramfs-generators']
|
generators = config_entry_image['initramfs-generators']
|
||||||
config_entry_commands_initramfs = self.config.merge('commands-image-initramfs-generators', arch, featureset, flavour)
|
|
||||||
commands = [config_entry_commands_initramfs[i] for i in generators if config_entry_commands_initramfs.has_key(i)]
|
|
||||||
makeflags['INITRD_CMD'] = ' '.join(commands)
|
|
||||||
l = PackageRelationGroup()
|
l = PackageRelationGroup()
|
||||||
for i in generators:
|
for i in generators:
|
||||||
i = config_entry_relations.get(i, i)
|
i = config_entry_relations.get(i, i)
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
linux-2.6 (2.6.38~rc6-1~experimental.2) UNRELEASED; urgency=low
|
||||||
|
|
||||||
|
[ Ben Hutchings ]
|
||||||
|
* postinst: Remove specific support for running a ramdisk creator;
|
||||||
|
warn users that specify one in /etc/kernel-img.conf
|
||||||
|
* Require initramfs-tools >= 0.94, which installs a postinst hook
|
||||||
|
|
||||||
|
-- Ben Hutchings <ben@decadent.org.uk> Tue, 01 Mar 2011 05:38:48 +0000
|
||||||
|
|
||||||
linux-2.6 (2.6.38~rc6-1~experimental.1) experimental; urgency=low
|
linux-2.6 (2.6.38~rc6-1~experimental.1) experimental; urgency=low
|
||||||
|
|
||||||
[ Ben Hutchings ]
|
[ Ben Hutchings ]
|
||||||
|
|
|
@ -41,16 +41,13 @@ part-long-xen: This kernel also runs on a Xen hypervisor.
|
||||||
initramfs-generators: initramfs-tools initramfs-fallback
|
initramfs-generators: initramfs-tools initramfs-fallback
|
||||||
type: plain
|
type: plain
|
||||||
|
|
||||||
[commands-image-initramfs-generators]
|
|
||||||
initramfs-tools: update-initramfs
|
|
||||||
|
|
||||||
[relations]
|
[relations]
|
||||||
# compilers
|
# compilers
|
||||||
gcc-4.4: gcc-4.4
|
gcc-4.4: gcc-4.4
|
||||||
|
|
||||||
# initramfs-generators
|
# initramfs-generators
|
||||||
initramfs-fallback: linux-initramfs-tool
|
initramfs-fallback: linux-initramfs-tool
|
||||||
initramfs-tools: initramfs-tools (>= 0.55)
|
initramfs-tools: initramfs-tools (>= 0.94)
|
||||||
|
|
||||||
# bootloaders
|
# bootloaders
|
||||||
elilo: elilo (>= 3.12-3.1~)
|
elilo: elilo (>= 3.12-3.1~)
|
||||||
|
|
|
@ -414,7 +414,6 @@ install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain_templates:
|
||||||
-e 's@=B@$(KERNEL_ARCH)@g' \
|
-e 's@=B@$(KERNEL_ARCH)@g' \
|
||||||
-e 's/=I/$(ARG_INITRD)/g' \
|
-e 's/=I/$(ARG_INITRD)/g' \
|
||||||
-e 's/=K/$(ARG_KIMAGE)/g' \
|
-e 's/=K/$(ARG_KIMAGE)/g' \
|
||||||
-e 's@=MK@$(INITRD_CMD)@g' \
|
|
||||||
-e 's/=V/$(REAL_VERSION)/g' \
|
-e 's/=V/$(REAL_VERSION)/g' \
|
||||||
$$i > debian/$(PACKAGE_NAME).$$(basename $$i) || exit; \
|
$$i > debian/$(PACKAGE_NAME).$$(basename $$i) || exit; \
|
||||||
done
|
done
|
||||||
|
|
|
@ -26,7 +26,7 @@ my $relink_src_link = 'YES'; # There is no harm in checking the link
|
||||||
my $relink_build_link = 'YES'; # There is no harm in checking the link
|
my $relink_build_link = 'YES'; # There is no harm in checking the link
|
||||||
my $force_build_link = ''; # There is no harm in checking the link
|
my $force_build_link = ''; # There is no harm in checking the link
|
||||||
my $kernel_arch = "=B";
|
my $kernel_arch = "=B";
|
||||||
my $ramdisk = "=MK"; # List of tools to create initial ram fs.
|
my $ramdisk = '';
|
||||||
my $package_name = "linux-image-$version";
|
my $package_name = "linux-image-$version";
|
||||||
my $explicit_do_loader = '';
|
my $explicit_do_loader = '';
|
||||||
|
|
||||||
|
@ -704,60 +704,32 @@ if (-d "$modules_base/$version") {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sub find_initramfs_tool {
|
# Warn if we are ignoring the old ramdisk setting
|
||||||
my $ramdisk = shift;
|
if ($ramdisk =~ /\S/) {
|
||||||
my (@tools, $initramfs_cmd);
|
my ($question, $ret, $seen);
|
||||||
|
$question = "${package_name}/postinst/ignoring-ramdisk";
|
||||||
foreach $initramfs_cmd (split(/[:,\s]+/, $ramdisk)) {
|
($ret,$seen) = input('high', "$question");
|
||||||
if (system("test -x \"\$(command -v $initramfs_cmd)\"") == 0) {
|
die "Error setting debconf question $question: $seen" if $ret && $ret != 30;
|
||||||
push(@tools, $initramfs_cmd);
|
($ret,$seen) = go();
|
||||||
}
|
die "Error asking debconf question $question: $seen" if $ret && $ret != 30;
|
||||||
}
|
|
||||||
return @tools;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if ($initrd) {
|
|
||||||
my @ramdisklist;
|
|
||||||
@ramdisklist = find_initramfs_tool($ramdisk) if $ramdisk;
|
|
||||||
die "Failed to find suitable initramfs generation tool in $ramdisk\n"
|
|
||||||
if $#ramdisklist < 0;
|
|
||||||
my $success = 0;
|
|
||||||
for my $ramdisk_cmd (@ramdisklist) {
|
|
||||||
print STDERR "Running $ramdisk_cmd.\n";
|
|
||||||
print STDERR "Other valid candidates: @ramdisklist\n" if $#ramdisklist > 0;
|
|
||||||
|
|
||||||
my $initrd_path = $realimageloc . "initrd.img-$version";
|
|
||||||
my $ret = system("$ramdisk_cmd " .
|
|
||||||
($mkimage ? "-m '$mkimage' " : "") .
|
|
||||||
"-c -t -k $version >&2");
|
|
||||||
if ($ret) {
|
|
||||||
warn "$ramdisk_cmd failed to create initrd image.\n";
|
|
||||||
} else {
|
|
||||||
$success = 1;
|
|
||||||
last;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
die "Failed to create initrd image.\n" unless $success;
|
|
||||||
if (! defined $ARGV[1] || ! $ARGV[1] || $ARGV[1] =~ m/<unknown>/o) {
|
|
||||||
image_magic("initrd.img", $image_dest);
|
|
||||||
} else {
|
|
||||||
if (! -e "initrd.img") {
|
|
||||||
handle_missing_link("initrd.img", $image_dest, "initrd.img-$version",
|
|
||||||
$realimageloc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Only change the symlinks if we are not being upgraded
|
# Only change the symlinks if we are not being upgraded
|
||||||
if (! defined $ARGV[1] || ! $ARGV[1] || $ARGV[1] =~ m/<unknown>/o) {
|
if (! defined $ARGV[1] || ! $ARGV[1] || $ARGV[1] =~ m/<unknown>/o) {
|
||||||
image_magic($kimage, $image_dest);
|
image_magic($kimage, $image_dest);
|
||||||
|
if ($initrd) {
|
||||||
|
image_magic("initrd.img", $image_dest);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (! -e "$kimage") {
|
if (! -e "$kimage") {
|
||||||
handle_missing_link($kimage, $image_dest, "$kimage-$version",
|
handle_missing_link($kimage, $image_dest, "$kimage-$version",
|
||||||
$realimageloc);
|
$realimageloc);
|
||||||
}
|
}
|
||||||
|
if ($initrd && ! -e "initrd.img") {
|
||||||
|
handle_missing_link("initrd.img", $image_dest, "initrd.img-$version",
|
||||||
|
$realimageloc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# set the env var stem
|
# set the env var stem
|
||||||
|
@ -821,6 +793,10 @@ if ($explicit_do_loader) {
|
||||||
die "Error asking debconf question $question: $seen" if $ret && $ret != 30;
|
die "Error asking debconf question $question: $seen" if $ret && $ret != 30;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($initrd && ! -e "initrd.img-$version") {
|
||||||
|
die "Failed to create initrd image.\n";
|
||||||
|
}
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
||||||
__END__
|
__END__
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# These templates have been reviewed by the debian-l10n-english
|
# These templates have mostly been reviewed by the debian-l10n-english
|
||||||
# team
|
# team
|
||||||
#
|
#
|
||||||
# If modifications/additions/rewording are needed, please ask
|
# If modifications/additions/rewording are needed, please ask
|
||||||
|
@ -64,3 +64,13 @@ _Description: Boot loader configuration must be updated
|
||||||
/etc/kernel/postinst.d. Alternately, you can specify the command
|
/etc/kernel/postinst.d. Alternately, you can specify the command
|
||||||
to update the boot loader by setting the 'postinst_hook' variable
|
to update the boot loader by setting the 'postinst_hook' variable
|
||||||
in /etc/kernel-img.conf.
|
in /etc/kernel-img.conf.
|
||||||
|
|
||||||
|
# This has not yet been reviewed
|
||||||
|
Template: linux-image-=V/postinst/ignoring-ramdisk
|
||||||
|
Type: error
|
||||||
|
_Description: Ramdisk configuration must be updated
|
||||||
|
Kernel packages will no longer run a specific ramdisk creator. The
|
||||||
|
ramdisk creator package should install a script in
|
||||||
|
/etc/kernel/postinst.d. Alternately, you can specify the command to
|
||||||
|
create a ramdisk by setting the 'postinst_hook' variable in
|
||||||
|
/etc/kernel-img.conf.
|
||||||
|
|
Loading…
Reference in New Issue