Maxim Kammerer
2012-Mar-21 16:22 UTC
[syslinux] altmbr.bin always boots the first partition
Hi, altmbr.bin and its variants apparently always boot the first partition (in Syslinux 4.05, but this issue seems older than that). The following example uses parted 3.0: ---------- rm -f flat mkdir mnt truncate -s 20M flat parted -s flat mklabel msdos mkpart primary fat32 1MiB 10485759B mkpart primary ext2 11MiB 100% unit KiB print losetup -o 1048576 -s 9437184 /dev/loop7 flat mkdosfs /dev/loop7 syslinux -i /dev/loop7 mount -t vfat /dev/loop7 mnt echo LINUX PARTITION-1 > mnt/syslinux.cfg umount -d mnt losetup -o 11534336 -s 9437184 /dev/loop7 flat mkfs.ext2 -q /dev/loop7 mount -t ext2 /dev/loop7 mnt extlinux -i mnt echo LINUX PARTITION-2 > mnt/extlinux.conf umount -d mnt printf '\002' | cat /usr/share/syslinux/altmbr_c.bin - | dd bs=440 count=1 iflag=fullblock conv=notrunc of=flat qemu-kvm -nodefaults -sdl -m 4M -vga cirrus -drive file=flat,if=virtio,readonly ---------- Note also that iflag=fullblock above is necessary, yet the wiki misses it. -- Maxim Kammerer Libert? Linux (discussion / support: http://dee.su/liberte-contribute)
H. Peter Anvin
2012-Mar-21 22:16 UTC
[syslinux] altmbr.bin always boots the first partition
On 03/21/2012 09:22 AM, Maxim Kammerer wrote:> Hi, > > altmbr.bin and its variants apparently always boot the first partition > (in Syslinux 4.05, but this issue seems older than that). The > following example uses parted 3.0: >Could you send a small Qemu disk image which shows the problem? -hpa -- H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf.