gen-grub-cfg: Support different kernel file names
Aimee OS/aimee-os/pipeline/head There was a failure building this commit
Details
Aimee OS/aimee-os/pipeline/head There was a failure building this commit
Details
Different architectures and/or configurations can use a different name for the Linux kernel image file. The `gen-grub-cfg.sh` shell script needs to be able to identify the correct file name in the GRUB configuration fragment it embeds in the root filesystem image.
parent
00eea4da52
commit
f30c4930d8
|
@ -3,10 +3,11 @@
|
|||
|
||||
vers=${BR2_EXTERNAL_AIMEEOS_VERSION}
|
||||
br2_vers=${BR2_VERSION_FULL}
|
||||
kernel_filename=$1
|
||||
|
||||
cat > "${TARGET_DIR}"/boot/grub.cfg <<EOF
|
||||
menuentry "Aimee OS ${vers} (Buildroot ${br2_vers}) on \$dev" --class gnu-linux --id "id-\$partuuid" "\$dev" "\$partuuid" {
|
||||
set root="\$2"
|
||||
linux "/boot/zImage" root=PARTUUID=\$3 ro
|
||||
linux "${kernel_filename}" root=PARTUUID=\$3 ro
|
||||
}
|
||||
EOF
|
||||
|
|
14
external.mk
14
external.mk
|
@ -6,8 +6,20 @@ $(foreach tuple, $(GRUB2_TUPLES-y), \
|
|||
endef
|
||||
GRUB2_INSTALL_IMAGES_CMDS += $(AIMEEOS_GRUB2_INSTALL_IMAGES_CMDS)
|
||||
|
||||
ifneq ($(BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM),)
|
||||
AIMEEOS_KERNEL_FILENAME = $(BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM)
|
||||
ifeq ($(BR2_LINUX_KERNEL_IMAGE),y)
|
||||
AIMEEOS_KERNEL_FILENAME = Image
|
||||
else ifeq ($(BR2_LINUX_KERNEL_IMAGEZ),y)
|
||||
AIMEEOS_KERNEL_FILENAME = zImage
|
||||
else ifeq ($(BR2_LINUX_KERNEL_VMLINUX),y)
|
||||
AIMEEOS_KERNEL_FILENAME = vmlinux
|
||||
else
|
||||
$(error "Must define a Linux kernel target")
|
||||
endif
|
||||
|
||||
# Generate the grub.cfg stub for the kernel embedded in rootfs.squashfs
|
||||
define AIMEEOS_GEN_GRUB_CFG
|
||||
$(BR2_EXTERNAL_AIMEEOS_PATH)/boot/grub2/gen-grub-cfg.sh
|
||||
$(BR2_EXTERNAL_AIMEEOS_PATH)/boot/grub2/gen-grub-cfg.sh $(AIMEEOS_KERNEL_FILENAME)
|
||||
endef
|
||||
LINUX_TARGET_FINALIZE_HOOKS += AIMEEOS_GEN_GRUB_CFG
|
||||
|
|
Loading…
Reference in New Issue