postinst: Fix failure paths in check for missing firmware (Closes: #560263)

svn path=/dists/trunk/linux-2.6/; revision=14768
This commit is contained in:
Ben Hutchings 2009-12-10 01:48:04 +00:00
parent dcb78dcf90
commit 8bf9a24285
2 changed files with 10 additions and 6 deletions

4
debian/changelog vendored
View File

@ -10,7 +10,9 @@ linux-2.6 (2.6.32-2) UNRELEASED; urgency=low
[ Ben Hutchings ]
* aufs2: Update to snapshot from 2009-12-05
* postinst: Fix failure paths in check for missing firmware
(Closes: #560263)
-- Bastian Blank <waldi@debian.org> Sun, 06 Dec 2009 20:42:14 +0100
linux-2.6 (2.6.32-1) unstable; urgency=low

View File

@ -625,8 +625,7 @@ sub image_magic {
######################################################################
######################################################################
# We may not have any modules installed
if ( -d "$modules_base/$version" ) {
sub do_modules {
print STDERR "Running depmod.\n";
my $ret = system("depmod -a -F $realimageloc/System.map-$version $version");
my $exit_value = $? >> 8;
@ -698,11 +697,10 @@ if ( -d "$modules_base/$version" ) {
my $new_patchlevel = $version;
$new_patchlevel =~ s/^2\.6\.(\d+).*/$1/;
FIRMWARE_CHECK:
if ($new_patchlevel > $running_patchlevel) {
my $missing = '';
my %module_paths;
open(DEP, "<$modules_base/$version/modules.dep") or last FIRMWARE_CHECK;
open(DEP, "<$modules_base/$version/modules.dep") or return;
while (<DEP>) {
if (m|(.*/([^/]*)\.ko):|) {
my ($path, $module) = ($1, $2);
@ -711,7 +709,7 @@ if ( -d "$modules_base/$version" ) {
}
}
close(DEP);
open(MODULES, '</proc/modules') or last FIRMWARE_CHECK;
open(MODULES, '</proc/modules') or return;
while (<MODULES>) {
s/ .*//s;
my $module = $_;
@ -769,6 +767,10 @@ if ( -d "$modules_base/$version" ) {
}
}
# We may not have any modules installed
if (-d "$modules_base/$version") {
&do_modules();
}
sub find_initramfs_tool {