grub2: Support setting rootflags in config
Aimee OS/aimee-os/pipeline/head This commit looks good
Details
Aimee OS/aimee-os/pipeline/head This commit looks good
Details
The `AIMEEOS_DEFAULT_ROOTFLAGS` kconfig option can be used to set the default value for the `rootflags` GRUB2 environment variable. The value of this variable will be passed along as command-line arguments to whatever kernel is chosen at boot. Since post-image scripts do not have access to kconfig option values, we need to build the GRUB2 environment file in the `GRUB2_INSTALL_IMAGES_CMDS` script fragment instead.
parent
ddbcf00ce5
commit
47ddc1e834
|
@ -30,3 +30,8 @@ config AIMEEOS_RPI
|
|||
select BR2_TARGET_GRUB2_ARM_EFI
|
||||
help
|
||||
Support running Aimee OS on Rasperry Pi devices
|
||||
|
||||
config AIMEEOS_DEFAULT_ROOTFLAGS
|
||||
string "Default kernel command line argumens"
|
||||
help
|
||||
Additional command line arguments to pass to the kernel by default.
|
||||
|
|
|
@ -3,16 +3,12 @@
|
|||
set -e
|
||||
|
||||
BOARD_DIR=$(dirname "$0")
|
||||
GRUBENV="${BINARIES_DIR}"/efi-part/EFI/BOOT/grubenv
|
||||
|
||||
genimage_tmp=$(mktemp -d)
|
||||
trap 'rm -rf "${genimage_tmp}"' EXIT
|
||||
|
||||
mkdir -p "${genimage_tmp}"/rootfs "${genimage_tmp}"/tmp
|
||||
|
||||
grub-editenv "${GRUBENV}" set default=0
|
||||
grub-editenv "${GRUBENV}" set timeout=3
|
||||
|
||||
cd "${BINARIES_DIR}"
|
||||
genimage \
|
||||
--rootpath "${genimage_tmp}/rootfs" \
|
||||
|
|
|
@ -8,6 +8,6 @@ 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/${kernel_filename}" root=PARTUUID=\$3 ro
|
||||
linux "/boot/${kernel_filename}" root=PARTUUID=\$3 ro \$rootflags
|
||||
}
|
||||
EOF
|
||||
|
|
|
@ -3,6 +3,10 @@ define AIMEEOS_GRUB2_INSTALL_IMAGES_CMDS
|
|||
$(foreach tuple, $(GRUB2_TUPLES-y), \
|
||||
$(INSTALL) -D -m 0644 $(BR2_EXTERNAL_AIMEEOS_PATH)/boot/grub2/grub.cfg $(GRUB2_CFG_$(tuple))
|
||||
)
|
||||
$(HOST_DIR)/bin/grub-editenv $(BINARIES_DIR)/efi-part/EFI/BOOT/grubenv set \
|
||||
default=0 \
|
||||
timeout=3 \
|
||||
rootflags=$(AIMEEOS_DEFAULT_ROOTFLAGS)
|
||||
endef
|
||||
GRUB2_INSTALL_IMAGES_CMDS += $(AIMEEOS_GRUB2_INSTALL_IMAGES_CMDS)
|
||||
|
||||
|
|
Loading…
Reference in New Issue