From ffb4ebf055de6b4cf5a4b2618717f16396837557 Mon Sep 17 00:00:00 2001 From: Thomas Backlund Date: Tue, 10 May 2016 23:16:42 +0300 Subject: - adjust image creation for new dosfstools 4 using 63 cylinders everywhere - let mkdosfs create the image file, and drop usage of dd --- images/make_boot_img | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'images/make_boot_img') diff --git a/images/make_boot_img b/images/make_boot_img index d4cda303a..3b670c941 100755 --- a/images/make_boot_img +++ b/images/make_boot_img @@ -225,12 +225,11 @@ sub boot_img_i386 { _ "cp -f $rdz $tmp_mnt/$short_type.rdz"; unlink $rdz; - # mtools wants the image to be a power of 32 + # mtools wants the image to be a power of 32, and matching 63 cylinders from new dosfstools my $syslinux_overhead = 32 * 16; - my $size = max(ceil(chomp_(`du -s -k $tmp_mnt`) / 32) * 32 + $syslinux_overhead, 1440); - _ "dd if=/dev/zero of=$img bs=1k count=$size"; + my $size = ceil(max(ceil(chomp_(`du -s -k $tmp_mnt`) / 32) * 32 + $syslinux_overhead, 1440) / 63) * 63; - _ "/sbin/mkdosfs $img"; + _ "/sbin/mkdosfs -C $img $size"; _ "mcopy -i $img $tmp_mnt/* ::"; _ "syslinux $img"; _ "rm -rf $tmp_mnt"; @@ -357,11 +356,10 @@ sub boot_iso { # add theme _ "cp -r /boot/grub2/{fonts,themes} .boot_iso/EFI/BOOT/"; _ "cp -f grub2.theme .boot_iso/EFI/BOOT/themes/maggy/theme.txt"; - # create efiboot.img - my $efisize = ceil(chomp_(`du -s -k .boot_iso/EFI`) / 1024) * 1024; + # create efiboot.img, matching 63 cylinders from new dosfstools + my $efisize = ceil(ceil(chomp_(`du -s -k .boot_iso/EFI`) / 1024) * 1024 / 63) * 63; my $efi_img = ".boot_iso/isolinux/efiboot.img"; - _ "dd if=/dev/zero of=$efi_img bs=1k count=$efisize"; - _ "/sbin/mkdosfs -F12 $efi_img"; + _ "/sbin/mkdosfs -F12 -C $efi_img $efisize"; _ "mcopy -s -i $efi_img .boot_iso/EFI ::"; # create iso _ "$cmd -eltorito-alt-boot -e isolinux/efiboot.img -no-emul-boot -o $iso .boot_iso"; @@ -380,10 +378,8 @@ sub hd_grub { my ($grub_dir) = glob("/lib/grub/*-mageia"); my @grub_files = map { "$grub_dir/$_" } qw(stage1 stage2); - # 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"; + # mtools wants the image to be a power of 32 and matching 63 cylinders from new dosfstools + my $size = ceil(ceil((40_000 + sum(map { -s $_ } @grub_files)) / 32 / 1024) * 32 / 63) * 63; _ "rm -rf $tmp_mnt"; mkdir $tmp_mnt; _ "cp @grub_files $tmp_mnt"; @@ -396,8 +392,8 @@ fallback 1 title Mageia Install root (hd0,0) -kernel /cooker/isolinux/alt0/vmlinuz $default_append $default_acpi $default_vga $default_iswmd automatic=method:disk -initrd /cooker/isolinux/alt0/all.rdz +kernel /cauldron/isolinux/alt0/vmlinuz $default_append $default_acpi $default_vga $default_iswmd automatic=method:disk +initrd /cauldron/isolinux/alt0/all.rdz title Help @@ -416,7 +412,7 @@ pause . pause HELP END EOF - _ "/sbin/mkdosfs $img"; + _ "/sbin/mkdosfs -C $img $size"; _ "mcopy -i $img $tmp_mnt/* ::"; _ "rm -rf $tmp_mnt"; -- cgit v1.2.1