summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--images/NEWS2
-rwxr-xr-ximages/make_boot_img5
2 files changed, 5 insertions, 2 deletions
diff --git a/images/NEWS b/images/NEWS
index a9d70110b..15aaa39f0 100644
--- a/images/NEWS
+++ b/images/NEWS
@@ -1,3 +1,5 @@
+- dynamically determine the size of all.img
+
Version 1.19 - 27 August 2007, by Olivier "blino" Blin
- add raid456 module
diff --git a/images/make_boot_img b/images/make_boot_img
index 2ab543098..6916642bc 100755
--- a/images/make_boot_img
+++ b/images/make_boot_img
@@ -232,8 +232,6 @@ sub remove_ending_zero {
sub boot_img_i386 {
my ($type, $I, $img, $kernel) = @_;
- _ "dd if=/dev/zero of=$img bs=1k count=" . ($type eq 'all' ? 10500 : $type eq 'ka' ? 2950 : 1440);
-
_ "rm -rf $tmp_mnt"; mkdir $tmp_mnt;
_ "cat $kernel > $tmp_mnt/vmlinuz";
@@ -253,6 +251,9 @@ sub boot_img_i386 {
_ "cp -f $rdz $tmp_mnt/$short_type.rdz";
unlink $rdz;
+ my $size = max(chomp_(`du -s -k $tmp_mnt`) + 50, 1440);
+ _ "dd if=/dev/zero of=$img bs=1k count=$size";
+
_ "mkdosfs-with-dir $tmp_mnt $img";
_ "syslinux $img";
_ "rm -rf $tmp_mnt";