From: Erico Nunes <nunes.erico@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 6/8] grub2: move usage notes to package readme.txt
Date: Wed, 26 Apr 2017 23:39:51 +0200 [thread overview]
Message-ID: <20170426213953.14904-7-nunes.erico@gmail.com> (raw)
In-Reply-To: <20170426213953.14904-1-nunes.erico@gmail.com>
As discussed in the mailing list, grub2 usage notes were growing too big
for a Config.in documentation, and so it was agreed that a readme.txt in
the package directory is a better place to put them.
This commit simply moves the documentation as-is to preserve the
original contents as they were in Config.in which can be worked on in
further commits.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
This was not in v1.
---
boot/grub2/Config.in | 100 +-------------------------------------------------
boot/grub2/readme.txt | 98 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 100 insertions(+), 98 deletions(-)
create mode 100644 boot/grub2/readme.txt
diff --git a/boot/grub2/Config.in b/boot/grub2/Config.in
index 77f5e7b..8b66952 100644
--- a/boot/grub2/Config.in
+++ b/boot/grub2/Config.in
@@ -12,104 +12,8 @@ config BR2_TARGET_GRUB2
Amongst others, GRUB2 offers EFI support, which GRUB Legacy
doesn't provide.
- 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 /dev/loop0
- 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
- sudo ./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. Cleanup loop device
- sudo partx -d /dev/loop0
- sudo losetup -d /dev/loop0
- 7. Your disk.img is ready!
-
- Using genimage
- --------------
-
- If you use genimage to generate your complete image,
- installing Grub can be tricky. Here is how to achieve Grub's
- installation with genimage:
-
- partition boot {
- in-partition-table = "no"
- image = "path_to_boot.img"
- offset = 0
- size = 512
- }
- partition grub {
- in-partition-table = "no"
- image = "path_to_grub.img"
- offset = 512
- }
-
- The result is not byte to byte identical to what
- grub-bios-setup does but it works anyway.
-
- To test your BIOS image in Qemu
- -------------------------------
-
- qemu-system-{i386,x86-64} -hda disk.img
-
- Notes on using Grub2 for EFI-based platforms
- ============================================
-
- 1. Create a disk image
- dd if=/dev/zero of=disk.img bs=1M count=32
- 2. Partition it with GPT partitions
- cgdisk disk.img
- - Create a first partition, type EF00, for the
- bootloader and kernel image
- - Create a second partition, type 8300, for the root
- filesystem.
- 3. Setup loop device and loop partitions
- sudo losetup -f disk.img
- sudo partx -a /dev/loop0
- 4. Prepare the boot partition
- sudo mkfs.vfat -n boot /dev/loop0p1
- sudo mount /dev/loop0p1 /mnt
- sudo cp -a output/images/efi-part/* /mnt/
- sudo cp output/images/bzImage /mnt/
- sudo umount /mnt
- 5. Prepare the root partition
- sudo mkfs.ext3 -L root /dev/loop0p2
- sudo mount /dev/loop0p2 /mnt
- sudo tar -C /mnt -xf output/images/rootfs.tar
- sudo umount /mnt
- 6 Cleanup loop device
- sudo partx -d /dev/loop0
- sudo losetup -d /dev/loop0
- 7. Your disk.img is ready!
-
- To test your EFI image in Qemu
- ------------------------------
-
- 1. Download the EFI BIOS for Qemu
- Version IA32 or X64 depending on the chosen Grub2
- platform (i386-efi vs. x86-64-efi)
- http://sourceforge.net/projects/edk2/files/OVMF/
- 2. Extract, and rename OVMF.fd to bios.bin and
- CirrusLogic5446.rom to vgabios-cirrus.bin.
- 3. qemu-system-{i386,x86-64} -L ovmf-dir/ -hda disk.img
- 4. Make sure to pass pci=nocrs to the kernel command line,
- to workaround a bug in the EFI BIOS regarding the
- EFI framebuffer.
+ For additional notes on using Grub 2 with Buildroot, please
+ check boot/grub2/readme.txt
http://www.gnu.org/software/grub/
diff --git a/boot/grub2/readme.txt b/boot/grub2/readme.txt
new file mode 100644
index 0000000..278d770
--- /dev/null
+++ b/boot/grub2/readme.txt
@@ -0,0 +1,98 @@
+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 /dev/loop0
+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
+ sudo ./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. Cleanup loop device
+ sudo partx -d /dev/loop0
+ sudo losetup -d /dev/loop0
+7. Your disk.img is ready!
+
+Using genimage
+--------------
+
+If you use genimage to generate your complete image,
+installing Grub can be tricky. Here is how to achieve Grub's
+installation with genimage:
+
+partition boot {
+ in-partition-table = "no"
+ image = "path_to_boot.img"
+ offset = 0
+ size = 512
+}
+partition grub {
+ in-partition-table = "no"
+ image = "path_to_grub.img"
+ offset = 512
+}
+
+The result is not byte to byte identical to what
+grub-bios-setup does but it works anyway.
+
+To test your BIOS image in Qemu
+-------------------------------
+
+qemu-system-{i386,x86-64} -hda disk.img
+
+Notes on using Grub2 for EFI-based platforms
+============================================
+
+1. Create a disk image
+ dd if=/dev/zero of=disk.img bs=1M count=32
+2. Partition it with GPT partitions
+ cgdisk disk.img
+ - Create a first partition, type EF00, for the
+ bootloader and kernel image
+ - Create a second partition, type 8300, for the root
+ filesystem.
+3. Setup loop device and loop partitions
+ sudo losetup -f disk.img
+ sudo partx -a /dev/loop0
+4. Prepare the boot partition
+ sudo mkfs.vfat -n boot /dev/loop0p1
+ sudo mount /dev/loop0p1 /mnt
+ sudo cp -a output/images/efi-part/* /mnt/
+ sudo cp output/images/bzImage /mnt/
+ sudo umount /mnt
+5. Prepare the root partition
+ sudo mkfs.ext3 -L root /dev/loop0p2
+ sudo mount /dev/loop0p2 /mnt
+ sudo tar -C /mnt -xf output/images/rootfs.tar
+ sudo umount /mnt
+6 Cleanup loop device
+ sudo partx -d /dev/loop0
+ sudo losetup -d /dev/loop0
+7. Your disk.img is ready!
+
+To test your EFI image in Qemu
+------------------------------
+
+1. Download the EFI BIOS for Qemu
+ Version IA32 or X64 depending on the chosen Grub2
+ platform (i386-efi vs. x86-64-efi)
+ http://sourceforge.net/projects/edk2/files/OVMF/
+2. Extract, and rename OVMF.fd to bios.bin and
+ CirrusLogic5446.rom to vgabios-cirrus.bin.
+3. qemu-system-{i386,x86-64} -L ovmf-dir/ -hda disk.img
+4. Make sure to pass pci=nocrs to the kernel command line,
+ to workaround a bug in the EFI BIOS regarding the
+ EFI framebuffer.
--
2.9.3
next prev parent reply other threads:[~2017-04-26 21:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-26 21:39 [Buildroot] [PATCH v2 0/8] grub2: bump and add support for arm and aarch64 Erico Nunes
2017-04-26 21:39 ` [Buildroot] [PATCH v2 1/8] grub2: bump up version Erico Nunes
2017-07-16 13:09 ` Thomas Petazzoni
2017-04-26 21:39 ` [Buildroot] [PATCH v2 2/8] grub2-tools: new package Erico Nunes
2017-04-26 21:39 ` [Buildroot] [PATCH v2 3/8] grub2: use grub2-tools as a host package Erico Nunes
2017-07-16 13:39 ` Thomas Petazzoni
2017-08-11 16:39 ` Erico Nunes
2017-04-26 21:39 ` [Buildroot] [PATCH v2 4/8] grub2: enable support for arm and aarch64 targets Erico Nunes
2017-07-16 13:41 ` Thomas Petazzoni
2017-04-26 21:39 ` [Buildroot] [PATCH v2 5/8] grub2: introduce BR2_TARGET_GRUB2_CFG Erico Nunes
2017-04-26 21:39 ` Erico Nunes [this message]
2017-07-16 13:33 ` [Buildroot] [PATCH v2 6/8] grub2: move usage notes to package readme.txt Thomas Petazzoni
2017-04-26 21:39 ` [Buildroot] [PATCH v2 7/8] grub2: add usage notes for Grub 2 ARM and aarch64 Erico Nunes
2017-04-26 21:39 ` [Buildroot] [PATCH v2 8/8] linux: new Image.gz format for aarch64 Erico Nunes
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=20170426213953.14904-7-nunes.erico@gmail.com \
--to=nunes.erico@gmail.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