Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Mason <mason+buildroot@postdiluvian.org>
To: buildroot@busybox.net
Subject: [Buildroot] grub on target
Date: Fri, 24 Apr 2015 13:41:49 -0400	[thread overview]
Message-ID: <20150424174149.GA627@postdiluvian.org> (raw)
In-Reply-To: <20150422195220.GA19841@postdiluvian.org>

To answer my own question, it looks like I was having some sort of
UEFI-related problem, and it was fixed by a newer version of Grub2.

When booting from Grub2 under some circumstances (seemingly involving
the phase of the moon and how frustrated I was) I'd get a message
saying "Couldn't terminate EFI service", then some sort of hang.  Some
digging around turned up a Grub2 patch to address this issue that
buildroot-2015-02 doesn't have - Grub2 simply retries the service stop
if it fails the first time, emitting a message about retrying the
service stop instead of a message about being unable to stop.

I have no idea what service(s) are involved, but I've now got reliable
booting.

It's worth nothing that the Grub2 info page does address
phase-of-the-moon issues, but only involving the graphics.

Mark Mason <mason+buildroot@postdiluvian.org> wrote:

> I've installed the Grub2 tools on the target as part of the pre-fs
> script, but I've never figured out how to actually make it install a
> working bootloader.  If you're using it with UEFI then I'd be
> interested in knowing what you did you make it work.
> 
> I'm trying to make the simplest possible x86_64 UEFI config work -
> just boot a single image off a FAT32 boot partition.  No extra logic,
> no loading modules, no fiddling with video modes, no anything except
> booting.  Mostly I get either hangs on entry to the kernel or the
> kernel parameters appear to not be passed through correctly, resulting
> in no rootfs.
> 
> Something else I'd like to be able to do is make a disk image that I
> can run through a disk duplicator to make bootable disks, but I'm not
> sure if that's possible without rewriting the grub.cfg after the first
> boot since the UUIDs appear to different for different disks.
> 
> I've tried the instructions that are in the Grub2 menuconfig help,
> which mostly works on some machines while on others it either hangs
> after a "Couldn't terminate EFI services" message or else is unable to
> find the root device.  I haven't been able to identify any differences
> between the working and non-working machines, and I've tested against
> probably 20 different ones.  The machines are a DN2820FYKF Intel NUC,
> the lowest end NUC, and the BIOS doesn't inspire confidence, so there
> might be bugs there.
> 
> I'd appreciate some advice if anyone has any idea what might be going
> wrong.
> 
> Thanks!
> 
> Mike Musterd <MMusterd@kns.com> wrote:
> 
> > Hello list,
> > 
> > I am developing a small OS that functions as a sort of bootloader for windows.
> > Its primary function is to check whether windows is available and if so, reboot
> > to windows once (then, after that, boot into the bootloader again).
> > 
> > If not it will repartition disk, install itself on new partition, and format
> > drives and clone windows (from a network source) all from within this
> > bootloader.
> > 
> > I am using grub for that, with some custom fixes to the grub-reboot script to
> > make it behave as required.
> > 
> > However to my dismay I found that the grub package does not actually build grub
> > for the target.
> > 
> > grub.mk claims as much:
> > 
> > # We're cheating here as we're installing the grub binary not in the
> > # target directory (where it is useless), but in the host
> > # directory. This grub binary can be used to install grub into the MBR
> > # of a disk or disk image.
> > 
> > In my use case I need grub in the target directory, and it?s not useless at all.
> > So I modified the grub.mk to actually make grub for the target, and it all
> > works.
> > 
> > Now my question is: is my usecase generic enough to warrant a patch submission,
> > or is the ?useless? part always true except in my case?
> > 
> > Kind regards,
> > 
> > 
> > Mike
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

  reply	other threads:[~2015-04-24 17:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-21  6:30 [Buildroot] grub on target Mike Musterd
2015-04-21 20:07 ` Arnout Vandecappelle
2015-04-22 19:52 ` Mark Mason
2015-04-24 17:41   ` Mark Mason [this message]
2015-04-28 18:52     ` Arnout Vandecappelle
2015-05-01 17:54       ` Mark Mason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150424174149.GA627@postdiluvian.org \
    --to=mason+buildroot@postdiluvian.org \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox