[kernel] r16981 - in dists/trunk/linux-2.6/debian: . bin config templates/temp.image.plain
Ben Hutchings
benh at alioth.debian.org
Fri Mar 4 04:14:51 UTC 2011
Author: benh
Date: Fri Mar 4 04:14:38 2011
New Revision: 16981
Log:
Revert "postinst: Remove specific support for running a ramdisk creator" etc.
initramfs-tools still assumes that official kernel packages will call
it specifically and does nothing in the postinst hook if it recognises
that it has been called by an official package. Therefore we cannot
make this change yet.
Modified:
dists/trunk/linux-2.6/debian/bin/gencontrol.py
dists/trunk/linux-2.6/debian/changelog
dists/trunk/linux-2.6/debian/config/defines
dists/trunk/linux-2.6/debian/rules.real
dists/trunk/linux-2.6/debian/templates/temp.image.plain/postinst
dists/trunk/linux-2.6/debian/templates/temp.image.plain/templates
Modified: dists/trunk/linux-2.6/debian/bin/gencontrol.py
==============================================================================
--- dists/trunk/linux-2.6/debian/bin/gencontrol.py Thu Mar 3 15:01:31 2011 (r16980)
+++ dists/trunk/linux-2.6/debian/bin/gencontrol.py Fri Mar 4 04:14:38 2011 (r16981)
@@ -129,6 +129,9 @@
if config_entry_image.get('initramfs', True):
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()
for i in generators:
i = config_entry_relations.get(i, i)
Modified: dists/trunk/linux-2.6/debian/changelog
==============================================================================
--- dists/trunk/linux-2.6/debian/changelog Thu Mar 3 15:01:31 2011 (r16980)
+++ dists/trunk/linux-2.6/debian/changelog Fri Mar 4 04:14:38 2011 (r16981)
@@ -1,10 +1,5 @@
linux-2.6 (2.6.38~rc7-1~experimental.1) experimental; 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
-
[ maximilian attems ]
* New upstream release candidate
* x86: Set DRM_I915_KMS on request by xorg team.
Modified: dists/trunk/linux-2.6/debian/config/defines
==============================================================================
--- dists/trunk/linux-2.6/debian/config/defines Thu Mar 3 15:01:31 2011 (r16980)
+++ dists/trunk/linux-2.6/debian/config/defines Fri Mar 4 04:14:38 2011 (r16981)
@@ -41,13 +41,16 @@
initramfs-generators: initramfs-tools initramfs-fallback
type: plain
+[commands-image-initramfs-generators]
+initramfs-tools: update-initramfs
+
[relations]
# compilers
gcc-4.4: gcc-4.4
# initramfs-generators
initramfs-fallback: linux-initramfs-tool
-initramfs-tools: initramfs-tools (>= 0.94)
+initramfs-tools: initramfs-tools (>= 0.55)
# bootloaders
elilo: elilo (>= 3.12-3.1~)
Modified: dists/trunk/linux-2.6/debian/rules.real
==============================================================================
--- dists/trunk/linux-2.6/debian/rules.real Thu Mar 3 15:01:31 2011 (r16980)
+++ dists/trunk/linux-2.6/debian/rules.real Fri Mar 4 04:14:38 2011 (r16981)
@@ -414,6 +414,7 @@
-e 's@=B@$(KERNEL_ARCH)@g' \
-e 's/=I/$(ARG_INITRD)/g' \
-e 's/=K/$(ARG_KIMAGE)/g' \
+ -e 's@=MK@$(INITRD_CMD)@g' \
-e 's/=V/$(REAL_VERSION)/g' \
$$i > debian/$(PACKAGE_NAME).$$(basename $$i) || exit; \
done
Modified: dists/trunk/linux-2.6/debian/templates/temp.image.plain/postinst
==============================================================================
--- dists/trunk/linux-2.6/debian/templates/temp.image.plain/postinst Thu Mar 3 15:01:31 2011 (r16980)
+++ dists/trunk/linux-2.6/debian/templates/temp.image.plain/postinst Fri Mar 4 04:14:38 2011 (r16981)
@@ -26,7 +26,7 @@
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 $kernel_arch = "=B";
-my $ramdisk = '';
+my $ramdisk = "=MK"; # List of tools to create initial ram fs.
my $package_name = "linux-image-$version";
my $explicit_do_loader = '';
@@ -704,32 +704,60 @@
}
-# Warn if we are ignoring the old ramdisk setting
-if ($ramdisk =~ /\S/) {
- my ($question, $ret, $seen);
- $question = "${package_name}/postinst/ignoring-ramdisk";
- ($ret,$seen) = input('high', "$question");
- die "Error setting debconf question $question: $seen" if $ret && $ret != 30;
- ($ret,$seen) = go();
- die "Error asking debconf question $question: $seen" if $ret && $ret != 30;
+sub find_initramfs_tool {
+ my $ramdisk = shift;
+ my (@tools, $initramfs_cmd);
+
+ foreach $initramfs_cmd (split(/[:,\s]+/, $ramdisk)) {
+ if (system("test -x \"\$(command -v $initramfs_cmd)\"") == 0) {
+ push(@tools, $initramfs_cmd);
+ }
+ }
+ return @tools;
+}
+
+
+if ($initrd) {
+my @ramdisklist;
+ at 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
if (! defined $ARGV[1] || ! $ARGV[1] || $ARGV[1] =~ m/<unknown>/o) {
image_magic($kimage, $image_dest);
- if ($initrd) {
- image_magic("initrd.img", $image_dest);
- }
}
else {
if (! -e "$kimage") {
handle_missing_link($kimage, $image_dest, "$kimage-$version",
$realimageloc);
}
- if ($initrd && ! -e "initrd.img") {
- handle_missing_link("initrd.img", $image_dest, "initrd.img-$version",
- $realimageloc);
- }
}
# set the env var stem
@@ -793,10 +821,6 @@
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;
__END__
Modified: dists/trunk/linux-2.6/debian/templates/temp.image.plain/templates
==============================================================================
--- dists/trunk/linux-2.6/debian/templates/temp.image.plain/templates Thu Mar 3 15:01:31 2011 (r16980)
+++ dists/trunk/linux-2.6/debian/templates/temp.image.plain/templates Fri Mar 4 04:14:38 2011 (r16981)
@@ -1,4 +1,4 @@
-# These templates have mostly been reviewed by the debian-l10n-english
+# These templates have been reviewed by the debian-l10n-english
# team
#
# If modifications/additions/rewording are needed, please ask
@@ -61,19 +61,6 @@
.
If the boot loader needs to be updated whenever a new kernel is
installed, the boot loader package should install a script in
- /etc/kernel/postinst.d.
- .
- If the boot loader package does not yet do this, see
- <http://kernel-handbook.alioth.debian.org/ch-update-hooks.html>.
-
-# 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, and you should remove the line beginning
- 'ramdisk =' from /etc/kernel-img.conf.
- .
- If the ramdisk creator package does not yet do this, see
- <http://kernel-handbook.alioth.debian.org/ch-update-hooks.html>.
+ /etc/kernel/postinst.d. Alternately, you can specify the command
+ to update the boot loader by setting the 'postinst_hook' variable
+ in /etc/kernel-img.conf.
More information about the Kernel-svn-changes
mailing list