This commit changes to use partition-type-uuid = U instead of
c12a7328-f81f-11d2-ba4b-00a0c93ec93b where relevant for the EFI System
Partition.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Actually genimage fails to create final image with:
```
ERROR: hdimage(disk.img): partition [MBR] (offset 0x1b8, size 0x48) overlaps previous partition boot (offset 0x0, size 0x200)
ERROR: hdimage(disk.img): bootloaders, etc. that overlap with the partition table must declare the overlapping area as a hole.
```
This is because genimage 15 is less permissive than before, so let's add
holes = {"(440; 512)"} to leave room to MBR.
The generated image is identical to the image generated by the previous
version of genimage.
Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/1865935249
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Tested-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Genimage 15 deprecated the gpt option and now prints a warning when it is
used:
INFO: hdimage(sdcard.img): The option 'gpt' is deprecated. Use 'partition-table-type' instead
So change the genimage configuration files to use that instead.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Commit 82d1e8c628 (boot/grub2: use none platform when building for
host) changed host-grub2 to only install the tools, not the actual
bootloader or its modules, as they are of no use on the host.
It so happened that, when not instructed to built for a specific
platform, the grub2 buildsystem would default to build the legacy bios
platform (at least when the build happens on an x86 or x86_64 host).
However, because the host is more often than not an x86 or x86_64, when
the target was also an x68 or x86_64, the modules built for the host
could be re-used for the target, and this is what was done for our
pc_x86_64_bios_defconfig.
But now that we explicitly tell the grub2 buildsystem to not build any
platform when we build host-grub2, we no longer have access to the grub2
modules from the host directory, and the build fails when assembling the
final image.
We fix that in two ways:
First, we ensure that individual modules from the target grub2 get installed
in target/; we can only do that if the target grub2 tools are also
installed, so we enable that in the configuration.
Second, we fix the post-build script to look in target/ rather than in
host/.
All that, just for the 512-byte boot.img bootstrap, which pulls in all
the other modules (4.3MiB), the tools (8.8MiB)... But we are not going
to cherry-pick individual modules; this is error prone and
unmaintainable...
Reported-by: Adam Duskett <aduskett@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Köry Maincent <kory.maincent@bootlin.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Beatify this genimage .cfg file to have consistency with all genimage .cfg
files in Buildroot.
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Beatify this genimage .cfg file to have consistency with all genimage .cfg
files in Buildroot.
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
The startup.nsh file is useless to boot EFI payloads. We just need to
follow the naming detection specified in the UEFI spec.
The EFI payload need to be placed in the boot/efi folder in the EFI partition
and follow the architecture naming as described below:
32bit : bootia32.efi
x64 : bootx64.efi
aarch32 : bootarm.efi
aarch64 : bootaa64.efi
This naming is already right in the packages involved (systemd, grub2,
gummiboot), therefore we just need to drop the generation of the
startup.nsh file.
The usage of the startup.nsh in genimage is also dropped to avoid errors in
the image generation.
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Tested-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
For grub-efi we can align the rootfs to start at exactly 16MB from the
beginning of the disk. This can be done by reducing the vfat partition to
be 32 KB smaller than its 16MB size, just like the offset of the vfat
partition.
Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
[Peter: drop redundant offset/size settings, add comment]
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Commit 3468ef16fa
("configs/pc_x86_64_efi: use genimage GPT partition table support")
had a small typo on the path to grub boot.img file: i387-pc instead of
i386-pc, which causes a build failure.
Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/378314412
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Alexandre PAYEN <alexandre.payen@smile.fr>
Cc: Carlos Santos <casantos@datacom.com.br>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
As already done in post-build.sh, to prevent hiding errors.
Signed-off-by: Carlos Santos <unixmania@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Thanks to the introduction of GPT partition table support in genimage,
this commit improves the pc_x86_64_efi_defconfig to remove the use of
the custom script creating the image.
Tested in QEMU, not on a physical device.
So:
- revert commit fee29b05bb7db25e37c8a5175ce00dc712554edf[1]
- add GPT support
- tweak shell script to add the correct UUID in genimage config.
[1]: https://git.buildroot.net/buildroot/commit/?id=fee29b05bb7db25e37c8a5175ce00dc712554edf
[2]: https://git.buildroot.net/buildroot/commit/?id=79b8540d624ac4846ba341b1b9691eccacf0bc05
Signed-off-by: Alexandre PAYEN <alexandre.payen@smile.fr>
Cc: Carlos Santos <casantos@datacom.com.br>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
[Thomas:
- drop commented code in post-build.sh
- take into account comments made by Carlos Santos in
http://patchwork.ozlabs.org/patch/1143502/]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Following commit fee29b05bb
("configs/pc_x86_64_efi: use a GPT partition table"),
board/pc/grub-efi.cfg is no longer used anywhere: the
post-image-efi-gpt.sh script generates the grub configuration.
Also, since post-image-efi-gpt.sh generates a grub configuration file
that uses the root filesystem partition UUID as the root= kernel
argument, the instructions in the readme.txt file to tweak root= from
/dev/sda2 to /dev/vda2 is no longer relevant. This was noted in the
commit log of fee29b05bb:
The root filesystem location is passed to the kernel by a partition
UUID, so it is possible to boot on QEMU, directly from the disk image,
or dump the image to a physical device.
Fixes: #11841
Cc: Pete Morici <pmorici@dev295.com>
Cc: Carlos A. M. dos Santos <unixmania@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Since all EFI-based systems support GPT, this commit changes
pc_x86_64_efi to use a GPT partition table. It shows an example of how
to craft a disk image with GPT partitioning instead of MBR. This is
achieved by means of a post-image script which uses
mkdosfs+mcopy+sfdisk, since genimage is unable to deal with GPT. Long
term, it would be ideal if genimage had GPT support, but until then,
this script shows how to achieve creating a GPT-based disk image.
The script was kept as simple as possible to make it easy to understand
and adapt for other purposes.
The root filesystem location is passed to the kernel by a partition
UUID, so it is possible to boot on QEMU, directly from the disk image,
or dump the image to a physical device.
Signed-off-by: Carlos Santos <casantos@datacom.com.br>
Acked-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Before this commit, the grub configuration file was copied to the
TARGET_DIR in a post-image hook, after the filesystem has been
generated. It was kinda working because the board/pc's grub
configuration and the default one are the same and the later was
copied during the build process of the grub2 package.
This commit ensures the custom board/pc grub configuration is copied at
the right time.
Signed-off-by: Grégoire Delattre <gregoire.delattre@gmail.com>
Reviewed-by: Matt Weber <matthew.weber@rockwellcollin.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
The default ORC unwinder requires libelf to be built. While we could
build libelf using BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF, we probably
don't really need the ORC unwinder in the PC defconfigs, so let's use
the frame pointer unwinder instead.
Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/123771107
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Add some documentation about running the pc defconfigs in qemu.
In particular, document the use of the -bios parameter to use the OVMF
firmware to test the UEFI image.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This simplifies the pc configs and respective post image scripts to use
the shared genimage script and separate grub config files.
Separate grub files are cleaner to maintain and easier to copy and
modify, for example to support booting the pc defconfigs in qemu.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Since things are no longer installed in $(HOST_DIR)/usr, the callers
should also not refer to it.
This is a mechanical change with
git grep -l 'HOST_DIR}\?/usr/' board | xargs sed -i 's%\(HOST_DIR}\?\)/usr/%\1/%g'
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reusing the qemu x86-64 linux config isn't very obvious, so these defconfigs
aren't taken into consideration when the qemu defconfigs are updated,
breaking the build.
Instead use a custom linux config for the pc defconfigs. With this, we also
can get rid of the fragment file containing the delta fra the qemu config.
Created by linux-update-defconfig (after turning of the fragment file).
Also drop the linux kernel version number from the file name as it just
causes extra noise whenever the kernel is bumped.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
The pc_x86_64_efi reference defconfig is targeted towards an EFI
environment but the kernel which comes with it does not enable EFI
support by default.
Booting this defconfig without kernel EFI support on a qemu virtual
machine with EFI firmware resulted in no output to tty1 or ttyS0.
Enabling EFI support in the kernel fixed this and seems saner for an EFI
reference Buildroot defconfig.
Adding CONFIG_EFI to board/pc/linux-extras.config also affects
pc_x86_64_bios_defconfig which doesn't require it, however it was
observed that the extra overhead is small and so this is preferred
rather than having a separate config file.
This was tested with qemu 2.6.0 running with kvm enabled and firmware
EFI v2.60 by EDK II. Also built and verified bios defconfig on the same
setup but with BIOS firmware instead.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
Acked-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
The instructions listed sdcard.img as output image name but
board/pc/genimage-*.cfg generate it named as disk.img instead.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Add two new sample defconfigs oriented towards real PC targets.
It adds two variants for BIOS and EFI boot strategy.
On the build side we enable eudev to autoload relevant kernel
modules/support when necessary.
It adds a bunch of drivers and extra filesystem support which is by no
means extensive/complete, mostly geared towards the hardware i've got at
hand to test with.
This is accomplished by adding on top of the Qemu x86_64 kernel sample
config.
Build connman since by using eudev network interfaces get renamed on
boot thus complicating any form of automatic and friendly bringup.
It also makes Wi-Fi configuration/support easier.
In principle these base defconfigs should work just fine for other
storage media != pendrive like sata or ssd disk, however driver support
isn't there quite yet, and pendrive is mostly supported by usb storage
plus the usual usb host controller drivers.
Tested on old Lenovo laptop (BIOS) and Asus Zenbook (EFI).
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>