summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe/baremetal-image.bbclass
Commit message (Collapse)AuthorAgeFilesLines
* classes/recipes: Switch to use inherit_deferRichard Purdie2024-01-181-1/+1
| | | | | | | | | | | | | | | | | Now that bitbake supports the use of inherit_defer, switch all conditional (variable based) inherits to use this instead. This leads to more a more deterministic user experience since there is no longer an immediate expansion and later changes to the variables in question (e.g. a bbappend) are accounted for. This patch tries to ensure the behaviour before/after remains as unchanged as it reasonably can, e.g. by always inherting populate_sdk_base. native and nativesdk continue to need to be inherited last, hence being used with inherit_defer in a handful of very specific cases. (From OE-Core rev: 451363438d38bd4552d5bcec4a92332f5819a5d4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* baremetal-helloworld: Enable x86 and x86-64 portsAlejandro Hernandez Samaniego2023-01-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - The qemux86 port for helloworld-baremetal builds in the standard way, however, it uses NASM syntax for the startup code, hence we include a dependency to nasm-native, QEMU forces us to use an ELF file rather than a bin file to boot from this architecture using the -kernel parameter. - QEMU refuses to boot using the -kernel parameter for files containing an ELF64 header [1], instead, it requires a multiboot2 compatible image. We could create an image that contains a multiboot2 header by piggybacking into grub2-native, specifically grub-mkrescue, but it requires some extra runtime dependencies (xorriso which is currently part of meta-oe), and assumes a grub installation exists on the host. Due to host contamination and dependency complications, we dont rely on grub2, but rather do this process manually instead, the x86-64 port contains a stage1 bootloader, stage2 bootloader and a 64 bit baremetal app (multiboot2 compatible), booting into real (16 bit), protected (32 bit) and long (64 bit) modes, eventually running the helloworld-baremetal app. This is the reason why we need the code changes to use a separate Makefile, and create an image specifically for qemux86-64. $ runqemu nographic Booting from ROM.. Hello OpenEmbedded on x86! $ runqemu nographic Starting Stage 1 Bootloader Loading Stage 2 Bootloader Stage 2 Loaded. Jumping to Stage2 Bootloader In Stage 2 Done Hello OpenEmbedded on x86-64! [1] https://gitlab.com/qemu-project/qemu/-/blob/v7.2.0/hw/i386/multiboot.c#L199 (From OE-Core rev: 1dffd81b2991f90ab95cb36d8ff7626efd21434f) Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* baremetal-image: Avoid overriding qemu variables from IMAGE_CLASSESAlejandro Hernandez Samaniego2022-12-091-9/+11
| | | | | | | | | | | | | | | | | Since qemuboot is part of IMAGE_CLASSES via qemu.inc it is being inherited before we set the QB_FOO variables. Since our variables have conditional definitions and at that point they've already been defined by qemuboot, we can no longer define them in our class. Move the IMAGE_CLASSES inherit to execute it after we set the QB_FOO variables to fix booting via runqemu. (From OE-Core rev: 8ed78ec262b2502dc3b673b24a868a3eec616a20) Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* baremetal-image.bbclass: Emulate image.bbclass to handle new classes scopeAlejandro Hernandez Samaniego2022-08-311-0/+9
| | | | | | | | | | | | | | | | | | | | The new classes scope implemented on commit 7bd328f9d made testimage.bbclass (and perhaps others) stop working for baremetal-images, the expected way to run testimage is no longer to use INHERIT but to use IMAGE_CLASSES instead, however this functionality was not implemented in the baremetal-image class until now. Emulate image.bbclass allowing the baremetal-image class to use IMAGE_CLASSES to fix this issue. Set defaults for IMAGE_FEATURES to allow bitbake checks to pass properly. (From OE-Core rev: bf083929ecd69a144fedeef5a8725775f632a16c) Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes: Update classes to match new bitbake class scope functionalityRichard Purdie2022-08-121-0/+128
Move classes to classes-global or classes-recipe as appropriate to take advantage of new bitbake functionality to check class scope/usage. (From OE-Core rev: f5c128008365e141082c129417eb72d2751e8045) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>