grub2: make grub2 tools built in a separate variant
author李国 <uxgood.org@gmail.com>
Sat, 25 Jul 2020 04:48:36 +0000 (04:48 +0000)
committerPaul Spooren <mail@aparcar.org>
Sun, 20 Jun 2021 23:31:09 +0000 (13:31 -1000)
grub2 boot-related code and tools-related code may require different
compilation parameters. We split them into different variants for
compilation, so that we can accurately pass the required parameters and
avoid causing problems.

Signed-off-by: 李国 <uxgood.org@gmail.com>
package/boot/grub2/Makefile

index 709253a935e5f3dc034549ac55e99f92056d3eda..0610d96e903a4de2c1c22246fdb4c5296fb9e393 100644 (file)
@@ -44,7 +44,7 @@ define Package/grub2-editenv
   TITLE:=Grub2 Environment editor
   URL:=http://www.gnu.org/software/grub/
   DEPENDS:=@TARGET_x86
-  VARIANT:=pc
+  VARIANT:=none
 endef
 
 define Package/grub2-editenv/description
@@ -58,7 +58,7 @@ define Package/grub2-bios-setup
   TITLE:=Grub2 BIOS boot setup tool
   URL:=http://www.gnu.org/software/grub/
   DEPENDS:=@TARGET_x86
-  VARIANT:=pc
+  VARIANT:=none
 endef
 
 define Package/grub2-bios-setup/description
@@ -98,6 +98,10 @@ HOST_MAKE_FLAGS += \
 
 TARGET_CFLAGS := $(filter-out -O2 -O3 -fno-plt,$(TARGET_CFLAGS))
 
+ifneq ($(BUILD_VARIANT),none)
+  MAKE_PATH := grub-core
+endif
+
 define Host/Configure
        $(SED) 's,(RANLIB),(TARGET_RANLIB),' $(HOST_BUILD_DIR)/grub-core/Makefile.in
        $(Host/Configure/Default)