poky/scripts/lib
Vincent Davis Jr 7f522461d2 bootimg_pcbios: add funcs to configure booting with grub
Functions added, but not executed during
wic image creation include:

_get_staging_libdir
	* Finds target lib directory if for some
	  reason STAGING_LIBDIR isn't set.

_do_configure_grub
	* Will search for a grub configuration passed via
	  bootloader --configfile. If not found build a
	  default one which searches for partition that
	  contains the given the kernel name via grub
	  search module.

_do_prepare_grub
	1. Sets default values for GRUB_MKIMAGE_FORMAT_PC
	   and GRUB_PREFIX_PATH if none specified. Both
	   variables are required by grub-mkimage.
	   * GRUB_MKIMAGE_FORMAT_PC is used to define
	     target platform.
	   * GRUB_PREFIX_PATH is used to define which
	     directory grub config and modules are going
	     to reside in.
	2. Generates grub config to embed into core.img.
	   This config is used to search for partition
	   containing grub config.
	3. Creates a custom core.img or grub stage 1.5
	   with an embedded grub config.
	4. Copies all the target built grub modules into
	   GRUB_PREFIX_PATH directory.
	5. Creates boot partition

_do_install_grub
	1. dd target platform specific boot.img to the first
	   0-440 bytes of the resulting wic image. dd grub
	   stage 1 to wic image. If this wics plugin is used
	   with GPT as partition table format and grub selected
	   as bootloader it's more than likely for grub hybrid
	   booting because bootimg_efi plugin should and more
	   than likely will be used in that case. So, boot.img
	   may be dd regardless if partition table format is
	   GPT or MBR.
	2. dd custom core.img (grub stage 1.5) with embedded
	   configuration to the resulting wic image starting
	   at byte 512 up to sizeof(core.img).
	3. Both boot.img and core.img are required for legacy
	   bios boot. See grub Wiki for more details on
	   boot.img and core.img.

	   https://en.wikipedia.org/wiki/GNU_GRUB

Commit also imports python modules required by the
above implemented functions.

(From OE-Core rev: 27c56962f47303cf49a4cf641e85239e4d7779b5)

Signed-off-by: Vincent Davis Jr <vince@underview.tech>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-08-14 10:31:11 +01:00
..
build_perf buildperf: Tweak tooltip positioning for usability 2025-03-28 22:14:14 +00:00
checklayer yocto-check-layer: expect success for test_patches_upstream_status 2025-04-10 11:05:34 +01:00
devtool devtool: fix upgrade for recipes with git submodules 2025-08-14 10:31:10 +01:00
recipetool recipetool/create_go: proxy module fetching to go-mod-update-modules 2025-07-01 08:49:37 +01:00
resulttool resulttool/store: Fix permissions of logarchive 2024-11-26 13:40:30 +00:00
wic bootimg_pcbios: add funcs to configure booting with grub 2025-08-14 10:31:11 +01:00
argparse_oe.py
buildstats.py scripts/lib/buildstats: handle top-level build_stats not being complete 2023-03-25 09:39:28 +00:00
scriptpath.py
scriptutils.py scripts/scriptutils: silence warning about S not existing in emptysrc 2025-06-05 11:02:22 +01:00