summaryrefslogtreecommitdiffstats
path: root/images
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
parent390a60dea5eddbcc76624436b311677dec704b3e (diff)
downloaddrakx-backup-do-not-use-5f94b12578bb9a5ca44e01d19c72b15aa458abf4.tar
drakx-backup-do-not-use-5f94b12578bb9a5ca44e01d19c72b15aa458abf4.tar.gz
drakx-backup-do-not-use-5f94b12578bb9a5ca44e01d19c72b15aa458abf4.tar.bz2
drakx-backup-do-not-use-5f94b12578bb9a5ca44e01d19c72b15aa458abf4.tar.xz
drakx-backup-do-not-use-5f94b12578bb9a5ca44e01d19c72b15aa458abf4.zip
- dynamically determine the size of all.img
Diffstat (limited to 'images')
-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";