Skip to contentSkip to conversation

Problems with recent Debian GNU/Hurd ISO GRUB menu graphics

DISCUSSION Thomas Schmitt 2 participants 3 messages Jun 20, 2017

lore
Share & tools
lore
#0 lore raw

Hi,

i am discussing with Samuel Thibault two riddling issues of the new Debian GNU/Hurd ISOs, e.g. this one of about 160 MB:

http://ftp.ports.debian.org/debian-ports-cd/hurd-i386/debian-hurd-2017/debian-hurd-2017-i386-NETINST-1.iso

Those ISOs are among the very few which use GRUB for booting via BIOS. So i think the problems are worth to be discussed here.
I assume that Debian maintainers of GRUB are around, too.

My discussion with Samuel begins at:
https://lists.debian.org/debian-hurd/2017/06/msg00019.html

----------------------------------------------------------------------
Issue 1:

There is an MBR with probably x86 code after byte 446 where normally the partition table is located. This yields of course weird results with partition editors and would expose the code for being damaged by editors.

The MBR is a 1:1 copy of what my Debian 8 amd64 has as
/usr/lib/grub/i386-pc/boot.img

It gets appended a grub-mkimage result in line 53 of
https://anonscm.debian.org/cgit/d-i/debian-installer.git/tree/build/util/x86-image

The concatenated result is then submitted to xorrisofs by option -G without any options to write a partition table.

Questions:

- Is the state of i386-pc/boot.img intentional ?
If yes:
- With what use case is it useful to have an MBR with garbled partition table ?
- Are the bytes 446 to 509 indeed intended to be executed as x86 code ? If yes:
- Are there other MBR templates which do not have code in bytes 446 to 509 but would nevertheless be suitable for getting appended a result from grub-mkimage ?
If no:
- What might have went wrong with the production of i386-pc/boot.img ?

----------------------------------------------------------------------
Issue 2:

The GRUB menu of the ISOs when started on Debian 8 amd64 by

qemu-system-i386 -enable-kvm -m 1024 -hda debian-hurd-2017-i386-NETINST-1.iso

appears with wrong color, pushed up by about 30 percent of image size, and rolled over horizontally by about 45 percent. Same effect with qemu option -cdrom rather than -hda.

I can post an image if this cannot be reproduced easily.

The first arrow key press repairs the graphics, but the second arrow key press brings it back into wrong state. So every second menu choice is visible and every other item has to be chosen blindly.
(A nice trick is to navigate to the last item and to press arrow once
in vain. When moving up, the previously bad screens become good and the good ones go bad.)

The problem with qemu + SeaBIOS seems well reproducible.
But only some versions of OVMF seem not to work well with the GRUB software of the Debian 9.0.0 amd64 netinst ISO.
Samuel posted a PNG of a garbled menu which he gets from his local OVMF, which the debian-hurd mailing list seems to have rejected. It's not to see in the archives, i fear.
My local OVMF shows the menu ok.

Questions:
- Is it known that GRUB graphics and SeaBIOS or OVMF do not go well together ?
- Any ideas how to give the GNU/Hurd ISO a flawlessly working menu on SeaBIOS ? (VMs are the main installation target of GNU/Hurd.)

----------------------------------------------------------------------

Have a nice day :)

Thomas

#1 lore raw

вт, 20 июн. 2017 г., 13:02 Thomas Schmitt <[email protected]>:

Quoted 32 lines

Hi,

i am discussing with Samuel Thibault two riddling issues of the new Debian GNU/Hurd ISOs, e.g. this one of about 160 MB:

http://ftp.ports.debian.org/debian-ports-cd/hurd-i386/debian-hurd-2017/debian-hurd-2017-i386-NETINST-1.iso

Those ISOs are among the very few which use GRUB for booting via BIOS. So i think the problems are worth to be discussed here.
I assume that Debian maintainers of GRUB are around, too.

My discussion with Samuel begins at:
https://lists.debian.org/debian-hurd/2017/06/msg00019.html

----------------------------------------------------------------------
Issue 1:

There is an MBR with probably x86 code after byte 446 where normally the partition table is located. This yields of course weird results with partition editors and would expose the code for being damaged by editors.

The MBR is a 1:1 copy of what my Debian 8 amd64 has as
/usr/lib/grub/i386-pc/boot.img

It gets appended a grub-mkimage result in line 53 of

https://anonscm.debian.org/cgit/d-i/debian-installer.git/tree/build/util/x86-image

The concatenated result is then submitted to xorrisofs by option -G without any options to write a partition table.

Quoted 8 lines

Questions:

- Is the state of i386-pc/boot.img intentional ?
If yes:
- With what use case is it useful to have an MBR with garbled partition table ?
- Are the bytes 446 to 509 indeed intended to be executed as x86 code ?

Those are only for floppies with old BIOS. If your image is over 2.88 MiB and thus never useful on floppies, it's safe to overwrite.

Quoted 38 lines

If yes:
- Are there other MBR templates which do not have code in bytes 446 to 509 but would nevertheless be suitable for getting appended a result from grub-mkimage ?
If no:
- What might have went wrong with the production of i386-pc/boot.img ?

----------------------------------------------------------------------
Issue 2:

The GRUB menu of the ISOs when started on Debian 8 amd64 by

qemu-system-i386 -enable-kvm -m 1024 -hda
debian-hurd-2017-i386-NETINST-1.iso

appears with wrong color, pushed up by about 30 percent of image size, and rolled over horizontally by about 45 percent. Same effect with qemu option -cdrom rather than -hda.

I can post an image if this cannot be reproduced easily.

The first arrow key press repairs the graphics, but the second arrow key press brings it back into wrong state. So every second menu choice is visible and every other item has to be chosen blindly.
(A nice trick is to navigate to the last item and to press arrow once
in vain. When moving up, the previously bad screens become good and the good ones go bad.)

The problem with qemu + SeaBIOS seems well reproducible.
But only some versions of OVMF seem not to work well with the GRUB software of the Debian 9.0.0 amd64 netinst ISO.
Samuel posted a PNG of a garbled menu which he gets from his local OVMF, which the debian-hurd mailing list seems to have rejected. It's not to see in the archives, i fear.
My local OVMF shows the menu ok.

Quoted 4 lines

Questions:
- Is it known that GRUB graphics and SeaBIOS or OVMF do not go well together ?

Never had such problems but it sounds like a problem with doublebuffering. Can you disable double buffering and try again

Quoted 16 lines

- Any ideas how to give the GNU/Hurd ISO a flawlessly working menu on SeaBIOS ? (VMs are the main installation target of GNU/Hurd.)

----------------------------------------------------------------------

Have a nice day :)

Thomas

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#2 lore raw

Hi,

Quoted 2 lines · Vladimir 'phcoder' Serbinenko

Those are only for floppies with old BIOS. If your image is over 2.88 MiB and thus never useful on floppies, it's safe to overwrite.

This explains why it looks like somewhat plausible executable code and why i386-pc/boot.img of Debian 8 is in the state it is in.

I meanwhile was courageous enough on my own to try with zeroized partition table and with a repacked ISO using --protective-msdos-label. Both booted with qemu -hda with purposefully erased El Torito boot record, just to be sure.

Quoted 5 lines · i wrote:
Quoted 2 lines

- Is it known that GRUB graphics and SeaBIOS or OVMF do not go well together ?

Never had such problems but it sounds like a problem with doublebuffering. Can you disable double buffering and try again

Only if you instruct me how to do this. {:)

For example i could repack the ISO with a modified boot/grub/grub.cfg. Currently it has this content:
---------------------------------------------------------------------
set cd=$root
set default=3
set timeout=-1

insmod multiboot
insmod cpuid
insmod echo
insmod gzio
insmod minicmd
insmod normal
insmod chain

if loadfont /boot/grub/font.pf2 ; then

        set gfxmode=640x480
        insmod vbe
        insmod gfxterm
        terminal_output gfxterm

fi

insmod png
if background_image /boot/grub/splash.png ; then
set color_normal=white/black
set color_highlight=black/white
else
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
fi

insmod play
play 960 440 1 0 4 440 1

menuentry "Debian GNU/Hurd installer boot menu" {
true
}

menuentry "" {
true
}

function boot_one {
        echo "Loading ..."
        set root=$cd
        multiboot /boot/kernel/gnumach.gz $options
        module --nounzip /boot/${gtk}initrd.gz initrd '$(ramdisk-create)'
        module /boot/kernel/ext2fs.static ext2fs \
                        --multiboot-command-line='${kernel-command-line}' \
                        --host-priv-port='${host-port}' \
                        --device-master-port='${device-port}' \
                        --exec-server-task='${exec-task}' -T typed gunzip:device:rd0 \
                        '$(task-create)' '$(task-resume)'
        module /boot/kernel/exec.static exec '$(exec-task=task-create)'
}

menuentry "Text install" {
set options="TERM=mach-gnu-color"
boot_one
}

menuentry "Pseudo-graphical install" {
set options="GTK_NOVESA=1 VGA_OPTIONS=--font-width=9" boot_one
}

menuentry "Pseudo-graphical install with CJK support" {
set options="GTK_NOVESA=1 VGA_OPTIONS=--font-width=8" boot_one
}

menuentry "Graphical install" {
        set options=""
        if test -e /boot/gtk ; then
                set gtk="gtk/"
        else
                set gtk=""
        fi
        boot_one
}

menuentry "Automated install" {
set options="auto=true priority=critical TERM=mach-gnu-color" boot_one
}

menuentry "Expert install" {
set options="priority=low TERM=mach-gnu-color" boot_one
}

menuentry "Rescue mode" {
set options="rescue/enable=true"
boot_one
}

menuentry "" {
true
}

menuentry "Boot from first hard disk" {
set root=hd0
chainloader +1
}
---------------------------------------------------------------------

Have a nice day :)

Thomas