summaryrefslogtreecommitdiffstats
path: root/images
diff options
context:
space:
mode:
authorOlivier Blin <blino@mageia.org>2011-05-19 22:37:11 +0000
committerOlivier Blin <blino@mageia.org>2011-05-19 22:37:11 +0000
commit75d01697bd4b5a8e1162d4415ea69c035899cd34 (patch)
tree15d0fc693423faab6b0affe5507c139f12dafa84 /images
parent28bc4b8310ebf809df99fb17bc813e2085b2ffba (diff)
downloaddrakx-backup-do-not-use-75d01697bd4b5a8e1162d4415ea69c035899cd34.tar
drakx-backup-do-not-use-75d01697bd4b5a8e1162d4415ea69c035899cd34.tar.gz
drakx-backup-do-not-use-75d01697bd4b5a8e1162d4415ea69c035899cd34.tar.bz2
drakx-backup-do-not-use-75d01697bd4b5a8e1162d4415ea69c035899cd34.tar.xz
drakx-backup-do-not-use-75d01697bd4b5a8e1162d4415ea69c035899cd34.zip
merge mkdosfs patch from packages SVN
(to replace mkdosfs-with-dir which requires obsolete perl-suid)
Diffstat (limited to 'images')
-rw-r--r--images/NEWS2
-rwxr-xr-ximages/make_boot_img17
2 files changed, 14 insertions, 5 deletions
diff --git a/images/NEWS b/images/NEWS
index 1970e2025..abf60aab0 100644
--- a/images/NEWS
+++ b/images/NEWS
@@ -1,5 +1,7 @@
Version 1.54 - 20 May 2011 by Olivier Blin
- add ums-* (USB mass storage) modules in disk/usb category
+- merge mkdosfs patch from packages SVN
+ (to replace mkdosfs-with-dir which requires obsolete perl-suid)
Version 1.53 - 5 May 2011 by Anne Nicolas
- make boot.iso isohybrid
diff --git a/images/make_boot_img b/images/make_boot_img
index 2cb2ba586..5b6fbc5f2 100755
--- a/images/make_boot_img
+++ b/images/make_boot_img
@@ -3,6 +3,8 @@
use Config;
use FileHandle;
use MDK::Common;
+use POSIX;
+
Config->import;
my ($arch) = $Config{archname} =~ /(.*?)-/;
@@ -281,10 +283,12 @@ 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);
+ # mtools wants the image to be a power of 32
+ my $size = max((ceil(chomp_(`du -s -k $tmp_mnt`) / 32) * 32) + 128, 1440);
_ "dd if=/dev/zero of=$img bs=1k count=$size";
- _ "mkdosfs-with-dir $tmp_mnt $img";
+ _ "/sbin/mkdosfs $img";
+ _ "mcopy -i $img $tmp_mnt/* ::";
_ "syslinux $img";
_ "rm -rf $tmp_mnt";
}
@@ -776,9 +780,11 @@ sub hd_grub {
my ($grub_dir) = glob("/lib/grub/*-*");
my @grub_files = map { "$grub_dir/$_" } qw(stage1 stage2);
- my $size = 40_000 + sum(map { -s $_ } @grub_files);
- _ "dd if=/dev/zero of=$img bs=1 count=$size";
+ # mtools wants the image to be a power of 32
+ my $size = ceil((40_000 + sum(map { -s $_ } @grub_files)) / 32 / 1024) * 32;
+
+ _ "dd if=/dev/zero of=$img bs=1k count=$size";
_ "rm -rf $tmp_mnt"; mkdir $tmp_mnt;
_ "cp @grub_files $tmp_mnt";
@@ -811,7 +817,8 @@ pause .
pause HELP END
EOF
- _ "mkdosfs-with-dir $tmp_mnt $img";
+ _ "/sbin/mkdosfs $img";
+ _ "mcopy -i $img $tmp_mnt/* ::";
_ "rm -rf $tmp_mnt";
output($mapfile, "(fd0) $img\n");