summaryrefslogtreecommitdiffstats
path: root/images/make_boot_img
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-08-31 08:30:52 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-08-31 08:30:52 +0000
commit5f94b12578bb9a5ca44e01d19c72b15aa458abf4 (patch)
treeb74adcb67b906515510172dea2ee1c78014eb6d7 /images/make_boot_img
parent390a60dea5eddbcc76624436b311677dec704b3e (diff)
downloaddrakx-5f94b12578bb9a5ca44e01d19c72b15aa458abf4.tar
drakx-5f94b12578bb9a5ca44e01d19c72b15aa458abf4.tar.gz
drakx-5f94b12578bb9a5ca44e01d19c72b15aa458abf4.tar.bz2
drakx-5f94b12578bb9a5ca44e01d19c72b15aa458abf4.tar.xz
drakx-5f94b12578bb9a5ca44e01d19c72b15aa458abf4.zip
- dynamically determine the size of all.img
Diffstat (limited to 'images/make_boot_img')
-rwxr-xr-ximages/make_boot_img5
1 files changed, 3 insertions, 2 deletions
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";