summaryrefslogtreecommitdiffstats
path: root/make_boot_img
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-01-09 16:16:52 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-01-09 16:16:52 +0000
commitefef1a85bcc615b2fe812522edea541394a05de1 (patch)
tree0e309c3de5ae35c2b463c7ebdbdb3b2356cd942d /make_boot_img
parent4f2ea6ebbfc6e4c476b6c3770feef2ca16db66af (diff)
downloaddrakx-efef1a85bcc615b2fe812522edea541394a05de1.tar
drakx-efef1a85bcc615b2fe812522edea541394a05de1.tar.gz
drakx-efef1a85bcc615b2fe812522edea541394a05de1.tar.bz2
drakx-efef1a85bcc615b2fe812522edea541394a05de1.tar.xz
drakx-efef1a85bcc615b2fe812522edea541394a05de1.zip
when not enough room on a .img, generate a file explaining the modules, their
size, their usage in pcitable
Diffstat (limited to 'make_boot_img')
-rwxr-xr-xmake_boot_img16
1 files changed, 14 insertions, 2 deletions
diff --git a/make_boot_img b/make_boot_img
index 4df3d2c45..7edbc7e0f 100755
--- a/make_boot_img
+++ b/make_boot_img
@@ -129,7 +129,7 @@ sub initrd {
_ "sudo mv /tmp/pcmcia_config_tmp $mnt/etc/pcmcia/config";
}
my ($ext) = $img =~ /rdz-(.*)/ or die "bad initrd name ($img)";
- $modz = "kernel/all.modules$I/$ext";
+ my $modz = "kernel/all.modules$I/$ext";
if ($type !~ /blank/) {
_ "$sudo cp -f $modz/${ltype}_modules.mar $mnt/modules/modules$I.mar" ;
_ "$sudo cp -f $modz/modules.dep $mnt/modules/";
@@ -200,7 +200,19 @@ sub boot_img_i386 {
unlink "$mnt/$short_type.rdz";
my $avail = (split ' ', `df $mnt`)[-3];
my $s = int((-s $rdz) / 1024);
- die sprintf("not enough room for $rdz: need %dKB (available %dKB < needed %dKB)\n", $s - $avail, $avail, $s);
+
+ my ($ext) = $img =~ /\.img-(.*)/ or die "bad initrd name ($img)";
+ my $dir = "kernel/all.modules/$ext";
+ my $pcitable = cat_('/usr/share/ldetect-lst/pcitable');
+ my @l = sort { $a <=> $b } map {
+ my ($name) = /(\w+)\.k?o$/ or die "bad file in .mar";
+ my $gz_size = chomp_(`gzip -c $dir/$_ | wc -c`);
+ sprintf "%7d %6d %s\n", $gz_size, listlength($pcitable =~ /"$name"/g), $name;
+ } split(' ', `mdk-stage1/mar/mar -l $dir/${type}_modules.mar`);
+ output('.not-enough-room', "gz size - pcitable - name\n", @l);
+
+ warn sprintf("not enough room for $rdz: need %dKB (available %dKB < needed %dKB)\n", $s - $avail, $avail, $s);
+ die qq(check file ".not-enough-room" to see modules size and pcitable usage\n);
}
my $timeout = 72;