From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] Is grub-bios-setup the way to go to make a bootable CF?
Date: Fri, 27 Jun 2014 20:32:24 +0200 [thread overview]
Message-ID: <20140627203224.1149e36a@free-electrons.com> (raw)
In-Reply-To: <CAEzGmjD9xC59mSjgPAr2GeB15cUwaExp7KfjbRyRMFVHD=92+g@mail.gmail.com>
Dear Lennart Ramberg,
On Fri, 27 Jun 2014 12:32:03 +0200, Lennart Ramberg wrote:
> I am struggling with making a grub 2-bootable Compact Flash for a BIOS
> based PC target.
> The closest I came so far in the target machine is:
> grub rescue >
>
> Then I found 'grub-bios-setup' as a possibly better alternative, but got
> stuck as below.
> Is grub-bios-setup the way to go at all?
Have you checked the detailed instructions available in the help text
of the grub2 package (accessible through xconfig/menuconfig) ? From the
help text:
Notes on using Grub2 for BIOS-based platforms
=============================================
1. Create a disk image
dd if=/dev/zero of=disk.img bs=1M count=32
2. Partition it (either legacy or GPT style partitions work)
cfdisk disk.img
- Create one partition, type Linux, for the root
filesystem. The only constraint is to make sure there
is enough free space *before* the first partition to
store Grub2. Leaving 1 MB of free space is safe.
3. Setup loop device and loop partitions
sudo losetup -f disk.img
sudo partx -a disk.img
4. Prepare the root partition
sudo mkfs.ext3 -L root /dev/loop0p1
sudo mount /dev/loop0p1 /mnt
sudo tar -C /mnt -xf output/images/rootfs.tar
sudo umount /mnt
5. Install Grub2
./output/host/usr/sbin/grub-bios-setup \
-b ./output/host/usr/lib/grub/i386-pc/boot.img \
-c ./output/images/grub.img -d . /dev/loop0
6. Your disk.img is ready!
Of course, this help text is about creating a disk image, but it should
apply (with minor changes) to a real device.
Let me know if that works for you!
Best regards,
Thomas Petazzoni
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
next prev parent reply other threads:[~2014-06-27 18:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-27 10:32 [Buildroot] Is grub-bios-setup the way to go to make a bootable CF? Lennart Ramberg
2014-06-27 18:32 ` Thomas Petazzoni [this message]
2014-06-30 8:23 ` Lennart Ramberg
2014-06-30 9:49 ` Thomas Petazzoni
2014-06-30 19:53 ` Lennart Ramberg
2014-06-30 22:41 ` Thomas Petazzoni
2014-07-01 8:44 ` [Buildroot] [PATCH] grub2: Specify boot partition Jérôme Pouiller
2014-07-01 9:14 ` Thomas Petazzoni
2014-07-01 8:49 ` [Buildroot] Is grub-bios-setup the way to go to make a bootable CF? Jérôme Pouiller
2014-07-01 19:32 ` Lennart Ramberg
2014-07-01 19:56 ` Jérôme Pouiller
2014-07-01 20:16 ` Thomas Petazzoni
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=20140627203224.1149e36a@free-electrons.com \
--to=thomas.petazzoni@free-electrons.com \
--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