[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: clang appends an extra string to Grub2 making it not work with MBR s
From: |
Mike Gilbert |
Subject: |
Re: clang appends an extra string to Grub2 making it not work with MBR systems |
Date: |
Tue, 17 Jan 2023 16:14:56 -0500 |
On Tue, Jan 17, 2023 at 12:50 PM Daniel Kiper <dkiper@net-space.pl> wrote:
>
> On Tue, Jan 03, 2023 at 01:15:46AM +0000, Immolo via Grub-devel wrote:
> > Using Gentoo with clang on a MBR system I have come across an extra string
> > the
> > content /lib/ld-linux.so.2 is being added to
> > /usr/lib/grub/i386-pc/diskboot.img
> > and /usr/lib/grub/i386-pc/boot.img taking it over 512 bytes meaning it
> > can't be
> > used on a MBR system.
> > You can use truncate to remove the extra string then it will install and
> > boot
> > correctly but I am highlighting this here in hopes of a better fix.
> > Steps to reproduce in Gentoo:
> > 1. Use a clang stage3 on a MBR system.
> > 2. emerge -va sys-boot/grub
> > 3. grub-install /dev/sda
> > Error:
> > Installing for i386-pc platform.
> > grub-install: error: diskboot.img size must be 512 bytes.
> > Workaround:
> > 1. truncate -s 512 /usr/lib/grub/i386-pc/diskboot.img
> > 2. truncate -s 512 /usr/lib/grub/i386-pc/boot.img
> > 3. grub-install /dev/sda
> > I'm not really sure what files I can attach to help debugging this one but
> > if
> > you can think of any please ask for them.
>
> It looks we will have a fix for this soon [1]...
>
> Daniel
>
> [1] https://lists.gnu.org/archive/html/grub-devel/2023-01/msg00085.html
I applied the fix in Gentoo earlier today.
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c382388940b194bf1a8bb1c4392394a699108165