x86: add support to set GRUB menu entry title
authorKjel Delaey <kjel_delaey@hotmail.com>
Tue, 5 Jun 2018 13:47:05 +0000 (15:47 +0200)
committerJo-Philipp Wich <jo@mein.io>
Tue, 18 Dec 2018 16:47:41 +0000 (17:47 +0100)
$ make menuconfig

        Target Images -> Title for the menu entry in GRUB

Signed-off-by: Kjel Delaey <kjel_delaey@hotmail.com>
(backported from 8492ad0cc183550137ea5afadcbebbfb4fd68fed)

config/Config-images.in
target/linux/x86/image/Makefile
target/linux/x86/image/grub-iso.cfg
target/linux/x86/image/grub.cfg

index c7cc7fe3be2ca51b041560de5596f1d3f9287581..6242e36d34b9293854176cc4097f82d2155a464c 100644 (file)
@@ -231,6 +231,14 @@ menu "Target Images"
                help
                  If you don't know, 5 seconds is a reasonable default.
 
+       config GRUB_TITLE
+               string "Title for the menu entry in GRUB"
+               depends on GRUB_IMAGES
+               default "OpenWrt"
+               help
+                 This is the title of the GRUB menu entry.
+                 If unspecified, it defaults to OpenWrt.
+
        config VDI_IMAGES
                bool "Build VirtualBox image files (VDI)"
                depends on TARGET_x86 || TARGET_x86_64
index fcdfcb8afb9b17b9cd0f3a55f7243d6d13ba0363..dbf8a8594b44865ef3ff509d8262d9d2103b4a56 100644 (file)
@@ -46,6 +46,7 @@ ROOTPART:=$(call qstrip,$(CONFIG_TARGET_ROOTFS_PARTNAME))
 ROOTPART:=$(if $(ROOTPART),$(ROOTPART),PARTUUID=$(SIGNATURE)-02)
 
 GRUB_TIMEOUT:=$(call qstrip,$(CONFIG_GRUB_TIMEOUT))
+GRUB_TITLE:=$(call qstrip,$(CONFIG_GRUB_TITLE))
 
 ifneq ($(CONFIG_TARGET_x86_xen_domu),)
   GRUB_ROOT = xen/xvda,msdos1
@@ -82,6 +83,7 @@ ifneq ($(CONFIG_GRUB_IMAGES),)
                -e 's#@CMDLINE@#$(strip $(call Image/cmdline/$(1)) $(BOOTOPTS) $(GRUB_CONSOLE_CMDLINE))#g' \
                -e 's#@TIMEOUT@#$(GRUB_TIMEOUT)#g' \
                -e 's#@ROOT@#$(GRUB_ROOT)#g' \
+               -e 's#@TITLE@#$(GRUB_TITLE)#g' \
                ./grub.cfg > $(KDIR)/root.grub/boot/grub/grub.cfg
        -$(CP) $(STAGING_DIR_ROOT)/boot/. $(KDIR)/root.grub/boot/
        PADDING="$(CONFIG_TARGET_IMAGES_PAD)" SIGNATURE="$(SIGNATURE)" PATH="$(TARGET_PATH)" $(SCRIPT_DIR)/gen_image_generic.sh \
@@ -120,6 +122,7 @@ define Image/Build/iso
                -e 's#@TERMINAL_CONFIG@#$(strip $(GRUB_TERMINAL_CONFIG))#g' \
                -e 's#@CMDLINE@#root=/dev/sr0 rootfstype=iso9660 rootwait $(strip $(call Image/cmdline/$(1)) $(BOOTOPTS) $(GRUB_CONSOLE_CMDLINE))#g' \
                -e 's#@TIMEOUT@#$(GRUB_TIMEOUT)#g' \
+               -e 's#@TITLE@#$(GRUB_TITLE)#g' \
                ./grub-iso.cfg > $(KDIR)/root.grub/boot/grub/grub.cfg
        -$(CP) $(STAGING_DIR_ROOT)/boot/. $(KDIR)/root.grub/boot/
        mkisofs -R -b boot/grub/eltorito.img -no-emul-boot -boot-info-table \
index 3d47a95a4b8209b61c8e0f38165b38b929fdaf08..9c59bdf6d49e797ccecc310da08172d84aadf954 100644 (file)
@@ -5,6 +5,6 @@ set default="0"
 set timeout="@TIMEOUT@"
 set root='(cd)'
 
-menuentry "OpenWrt" {
+menuentry "@TITLE@" {
        linux /boot/vmlinuz @CMDLINE@ noinitrd
 }
index 9ec6b2d39c89b7f4a2170456b7ac0c91ff2cee09..dedfa0a6367524e51e24f1128a3b7786ed1cba3a 100644 (file)
@@ -5,9 +5,9 @@ set default="0"
 set timeout="@TIMEOUT@"
 set root='(@ROOT@)'
 
-menuentry "OpenWrt" {
+menuentry "@TITLE@" {
        linux /boot/vmlinuz @CMDLINE@ noinitrd
 }
-menuentry "OpenWrt (failsafe)" {
+menuentry "@TITLE@ (failsafe)" {
        linux /boot/vmlinuz failsafe=true @CMDLINE@ noinitrd
 }