From 1a2b8aaa38cee12fff1d62fab29df29e856c29b9 Mon Sep 17 00:00:00 2001 From: Wu Zhangjin Date: Sun, 11 Jul 2021 18:48:39 +0800 Subject: [PATCH 01/12] fix up rootdir-clean target remove "/" suffix from every path, this allows to unify the concat of paths. Signed-off-by: Wu Zhangjin --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 00639ae..152926b 100644 --- a/Makefile +++ b/Makefile @@ -901,13 +901,13 @@ endif # Prebuilt path (not top dir) setting ifneq ($(_BIMAGE),) - PREBUILT_UBOOT_DIR ?= $(dir $(_BIMAGE)) + PREBUILT_UBOOT_DIR ?= $(subst //,,$(dir $(_BIMAGE))/) endif ifneq ($(_KIMAGE),) - PREBUILT_KERNEL_DIR ?= $(dir $(_KIMAGE)) + PREBUILT_KERNEL_DIR ?= $(subst //,,$(dir $(_KIMAGE))/) endif ifneq ($(_ROOTFS),) - PREBUILT_ROOT_DIR ?= $(dir $(_ROOTFS)) + PREBUILT_ROOT_DIR ?= $(subst //,,$(dir $(_ROOTFS))/) endif ifneq ($(_QTOOL),) PREBUILT_QEMU_DIR ?= $(patsubst %/bin/,%,$(dir $(_QTOOL))) -- Gitee From 1b3c2820206e6511ef379e98866a7efe2afe27d8 Mon Sep 17 00:00:00 2001 From: Leo-AERO15WB Date: Mon, 26 Jul 2021 17:05:21 +0800 Subject: [PATCH 02/12] source: add support for kernel fork switching --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 00639ae..c4520e8 100644 --- a/Makefile +++ b/Makefile @@ -189,12 +189,14 @@ _UBOOT_GIT := $(UBOOT_GIT) _UBOOT_SRC ?= u-boot UBOOT_SRC ?= $(_UBOOT_SRC) +# could switch to other kernel fork for example openEuler +KERNEL_FORK = linux #KERNEL_GIT ?= https://github.com/tinyclub/linux-stable.git #KERNEL_GIT ?= https://mirrors.tuna.tsinghua.edu.cn/git/linux-stable.git KERNEL_GIT ?= https://kernel.source.codeaurora.cn/pub/scm/linux/kernel/git/stable/linux.git #KERNEL_GIT ?= git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git _KERNEL_GIT := $(KERNEL_GIT) -_KERNEL_SRC ?= linux-stable +_KERNEL_SRC ?= $(KERNEL_FORK)-stable KERNEL_SRC ?= $(_KERNEL_SRC) # Use faster mirror instead of git://git.buildroot.net/buildroot.git @@ -205,7 +207,6 @@ _ROOT_SRC ?= buildroot ROOT_SRC ?= $(_ROOT_SRC) _LINUX=$(LINUX) -KERNEL_ABS_SRC := $(TOP_SRC)/$(KERNEL_SRC) ROOT_ABS_SRC := $(TOP_SRC)/$(ROOT_SRC) UBOOT_ABS_SRC := $(TOP_SRC)/$(UBOOT_SRC) QEMU_ABS_SRC := $(TOP_SRC)/$(QEMU_SRC) @@ -339,6 +340,9 @@ endif # Customize kernel git repo and local dir $(eval $(call __vs,KERNEL_SRC,LINUX)) $(eval $(call __vs,KERNEL_GIT,LINUX)) +$(eval $(call __vs,KERNEL_SRC,KERNEL_FORK)) +$(eval $(call __vs,KERNEL_GIT,KERNEL_FORK)) +KERNEL_ABS_SRC := $(TOP_SRC)/$(KERNEL_SRC) $(eval $(call __vs,DTS,LINUX)) $(eval $(call __vs,DTB,LINUX)) -- Gitee From 5bea5cc4e7174209d98d5a96936e88a8ba1dd74a Mon Sep 17 00:00:00 2001 From: Leo-AERO15WB Date: Mon, 26 Jul 2021 17:08:27 +0800 Subject: [PATCH 03/12] bsp: add openEuler KERNEL_GIT for x86_64/pc and aarch64/virt --- boards/aarch64/virt/Makefile | 3 +++ boards/x86_64/pc/Makefile | 3 +++ 2 files changed, 6 insertions(+) diff --git a/boards/aarch64/virt/Makefile b/boards/aarch64/virt/Makefile index 7cb9420..d26325d 100644 --- a/boards/aarch64/virt/Makefile +++ b/boards/aarch64/virt/Makefile @@ -19,6 +19,9 @@ CCORI[UBOOT_v2019.10,OS_focal] = internal LINUX ?= v5.1 BUILDROOT?= 2019.11.1 +# git repos for other kernel fork +KERNEL_GIT[KERNEL_FORK_openEuler] := https://gitee.com/openeuler/kernel.git + NETDEV_LIST := virtio NETDEV ?= virtio diff --git a/boards/x86_64/pc/Makefile b/boards/x86_64/pc/Makefile index 2f568bf..c911005 100644 --- a/boards/x86_64/pc/Makefile +++ b/boards/x86_64/pc/Makefile @@ -9,6 +9,9 @@ MEM ?= 128M SMP ?= 4 LINUX ?= v5.1 +# git repos for other kernel fork +KERNEL_GIT[KERNEL_FORK_openEuler] := https://gitee.com/openeuler/kernel.git + GCC = 9 GCC[LINUX_v3.2] = 4.8 GCC[LINUX_v2.6.12.6] = 4.8 -- Gitee From 61af6179d40fb7d6f3038e9b98c0da4fe6919e05 Mon Sep 17 00:00:00 2001 From: Wu Zhangjin Date: Sun, 1 Aug 2021 21:35:31 +0800 Subject: [PATCH 04/12] __v: allow customize variable with any one of the args Signed-off-by: Wu Zhangjin --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 152926b..e1596a6 100644 --- a/Makefile +++ b/Makefile @@ -233,7 +233,7 @@ $($(1)[$(2)_$($(2))$(if $($(3)),$(comma)$(3)_$($(3)))]) endef define __v -$(if $($(3)),$(if $(call ___v,$1,$2,$3),$(call ___v,$1,$2,$3),$(call ___v,$1,$2)),$(call ___v,$1,$2)) +$(if $($(3)),$(if $(call ___v,$1,$2,$3),$(call ___v,$1,$2,$3),$(if $(call ___v,$1,$2),$(call ___v,$1,$2),$(call ___v,$1,$3))),$(call ___v,$1,$2)) endef define _v -- Gitee From de8269872d2e6209f6f7ac361bf74a7ec5623cad Mon Sep 17 00:00:00 2001 From: Leo-AERO15WB Date: Mon, 26 Jul 2021 17:05:21 +0800 Subject: [PATCH 05/12] source: Add support for pkg fork switching Signed-off-by: Leo-AERO15WB Signed-off-by: Wu Zhangjin --- Makefile | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index e1596a6..e64d789 100644 --- a/Makefile +++ b/Makefile @@ -205,10 +205,6 @@ _ROOT_SRC ?= buildroot ROOT_SRC ?= $(_ROOT_SRC) _LINUX=$(LINUX) -KERNEL_ABS_SRC := $(TOP_SRC)/$(KERNEL_SRC) -ROOT_ABS_SRC := $(TOP_SRC)/$(ROOT_SRC) -UBOOT_ABS_SRC := $(TOP_SRC)/$(UBOOT_SRC) -QEMU_ABS_SRC := $(TOP_SRC)/$(QEMU_SRC) BOARD_MAKEFILE := $(BOARD_DIR)/Makefile @@ -337,8 +333,20 @@ ifneq ($(BOARD),) endif # Customize kernel git repo and local dir -$(eval $(call __vs,KERNEL_SRC,LINUX)) -$(eval $(call __vs,KERNEL_GIT,LINUX)) +$(eval $(call __vs,KERNEL_SRC,LINUX,KERNEL_FORK)) +$(eval $(call __vs,KERNEL_GIT,LINUX,KERNEL_FORK)) +$(eval $(call __vs,ROOT_SRC,BUILDROOT,ROOT_FORK)) +$(eval $(call __vs,ROOT_GIT,BUILDROOT,ROOT_FORK)) +$(eval $(call __vs,UBOOT_SRC,UBOOT,UBOOT_FORK)) +$(eval $(call __vs,UBOOT_GIT,UBOOT,UBOOT_FORK)) +$(eval $(call __vs,QEMU_SRC,QEMU,QEMU_FORK)) +$(eval $(call __vs,QEMU_GIT,QEMU,QEMU_FORK)) + +# Allow boards to customize source and repos +KERNEL_ABS_SRC := $(TOP_SRC)/$(KERNEL_SRC) +ROOT_ABS_SRC := $(TOP_SRC)/$(ROOT_SRC) +UBOOT_ABS_SRC := $(TOP_SRC)/$(UBOOT_SRC) +QEMU_ABS_SRC := $(TOP_SRC)/$(QEMU_SRC) $(eval $(call __vs,DTS,LINUX)) $(eval $(call __vs,DTB,LINUX)) -- Gitee From cafc963b66f4b1a6678acdf6c37ac3cf6343474f Mon Sep 17 00:00:00 2001 From: Leo-AERO15WB Date: Mon, 26 Jul 2021 17:08:27 +0800 Subject: [PATCH 06/12] bsp: add openEuler KERNEL_GIT for x86_64/pc and aarch64/virt Signed-off-by: Wu Zhangjin --- boards/aarch64/virt/Makefile | 3 +++ boards/x86_64/pc/Makefile | 3 +++ 2 files changed, 6 insertions(+) diff --git a/boards/aarch64/virt/Makefile b/boards/aarch64/virt/Makefile index 7cb9420..d26325d 100644 --- a/boards/aarch64/virt/Makefile +++ b/boards/aarch64/virt/Makefile @@ -19,6 +19,9 @@ CCORI[UBOOT_v2019.10,OS_focal] = internal LINUX ?= v5.1 BUILDROOT?= 2019.11.1 +# git repos for other kernel fork +KERNEL_GIT[KERNEL_FORK_openEuler] := https://gitee.com/openeuler/kernel.git + NETDEV_LIST := virtio NETDEV ?= virtio diff --git a/boards/x86_64/pc/Makefile b/boards/x86_64/pc/Makefile index 2f568bf..c911005 100644 --- a/boards/x86_64/pc/Makefile +++ b/boards/x86_64/pc/Makefile @@ -9,6 +9,9 @@ MEM ?= 128M SMP ?= 4 LINUX ?= v5.1 +# git repos for other kernel fork +KERNEL_GIT[KERNEL_FORK_openEuler] := https://gitee.com/openeuler/kernel.git + GCC = 9 GCC[LINUX_v3.2] = 4.8 GCC[LINUX_v2.6.12.6] = 4.8 -- Gitee From a0c048154f61fffed26405c777bb6eed9a388f13 Mon Sep 17 00:00:00 2001 From: Wu Zhangjin Date: Sun, 1 Aug 2021 22:50:31 +0800 Subject: [PATCH 07/12] source: fix up version exists checking Signed-off-by: Wu Zhangjin --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e64d789..f55e738 100644 --- a/Makefile +++ b/Makefile @@ -1442,7 +1442,7 @@ $$(call _stamp_$(1),source): $$(call _stamp_$(1),outdir) @echo $$(Q)if [ -e $$($(call _uc,$(1))_SRC_FULL)/.git ]; then \ [ -d $$($(call _uc,$(1))_SRC_FULL) ] && cd $$($(call _uc,$(1))_SRC_FULL); \ - if [ $$(shell [ -d $$($(call _uc,$(1))_SRC_FULL) ] && cd $$($(call _uc,$(1))_SRC_FULL) && git show --pretty=oneline -q $(or $$(__$(call _uc,$(2))),$$(_$(call _uc,$(2)))) >/dev/null 2>&1; echo $$$$?) -ne 0 ]; then \ + if [ $$(shell [ -d $$($(call _uc,$(1))_SRC_FULL) ] && cd $$($(call _uc,$(1))_SRC_FULL) && git show --pretty=oneline -q $$(or $$(__$(call _uc,$(2))),$$(_$(call _uc,$(2)))) >/dev/null 2>&1; echo $$$$?) -ne 0 ]; then \ $$($(call _uc,$(1))_GITADD); \ git fetch --tags $$(or $$($(call _uc,$(1))_GITREPO),origin) && touch $$@; \ fi; \ -- Gitee From 7bfe71ae9db70795d8b453df16919a6076c09aa4 Mon Sep 17 00:00:00 2001 From: Wu Zhangjin Date: Sun, 1 Aug 2021 23:03:16 +0800 Subject: [PATCH 08/12] source: customize default KERNEL_SRC for KERNEL_FORK without this support, requires to add board specific KERNEL_SRC for every KERNEL_FORK, for example: KERNEL_SRC[KERNEL_FORK_xxx] := yyy this set a default standalone KERENL_SRC for a new KERNEL_FORK, this easier the repo switching via using different repository. Signed-off-by: Wu Zhangjin --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index f55e738..5b064f6 100644 --- a/Makefile +++ b/Makefile @@ -180,13 +180,13 @@ PREBUILT_QEMU := $(PREBUILT_DIR)/qemu #QEMU_GIT ?= https://github.com/qemu/qemu.git QEMU_GIT ?= https://gitee.com/mirrors/qemu.git _QEMU_GIT := $(QEMU_GIT) -_QEMU_SRC ?= qemu +_QEMU_SRC ?= $(if $(QEMU_FORK),$(call _lc,$(QEMU_FORK)-qemu),qemu) QEMU_SRC ?= $(_QEMU_SRC) #UBOOT_GIT ?= https://github.com/u-boot/u-boot.git UBOOT_GIT ?= https://gitee.com/mirrors/u-boot.git _UBOOT_GIT := $(UBOOT_GIT) -_UBOOT_SRC ?= u-boot +_UBOOT_SRC ?= $(if $(UBOOT_FORK),$(call _lc,$(UBOOT_FORK)-uboot),u-boot) UBOOT_SRC ?= $(_UBOOT_SRC) #KERNEL_GIT ?= https://github.com/tinyclub/linux-stable.git @@ -194,17 +194,17 @@ UBOOT_SRC ?= $(_UBOOT_SRC) KERNEL_GIT ?= https://kernel.source.codeaurora.cn/pub/scm/linux/kernel/git/stable/linux.git #KERNEL_GIT ?= git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git _KERNEL_GIT := $(KERNEL_GIT) -_KERNEL_SRC ?= linux-stable +_KERNEL_SRC ?= $(if $(KERNEL_FORK),$(call _lc,$(KERNEL_FORK)-kernel),linux-stable) KERNEL_SRC ?= $(_KERNEL_SRC) # Use faster mirror instead of git://git.buildroot.net/buildroot.git #ROOT_GIT ?= https://github.com/buildroot/buildroot ROOT_GIT ?= https://gitee.com/mirrors/buildroot.git _ROOT_GIT := $(ROOT_GIT) -_ROOT_SRC ?= buildroot +_ROOT_SRC ?= $(if $(ROOT_FORK),$(call _lc,$(ROOT_FORK)-buildroot),buildroot) ROOT_SRC ?= $(_ROOT_SRC) -_LINUX=$(LINUX) +_LINUX = $(LINUX) BOARD_MAKEFILE := $(BOARD_DIR)/Makefile -- Gitee From b4d343d06fc02f70535dcc13b004e39919226949 Mon Sep 17 00:00:00 2001 From: Wu Zhangjin Date: Mon, 2 Aug 2021 00:21:29 +0800 Subject: [PATCH 09/12] fork: customize build direcotry and defconfig files Signed-off-by: Wu Zhangjin --- Makefile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 5b064f6..6c72103 100644 --- a/Makefile +++ b/Makefile @@ -667,13 +667,18 @@ _KIMAGE := $(KIMAGE) _ROOTFS := $(ROOTFS) _QTOOL := $(QTOOL) +_QEMU_FORK := $(if $(QEMU_FORK),$(call _lc,$(QEMU_FORK))/,) +_UBOOT_FORK := $(if $(UBOOT_FORK),$(call _lc,$(UBOOT_FORK))/,) +_KERNEL_FORK := $(if $(KERNEL_FORK),$(call _lc,$(KERNEL_FORK))/,) +_ROOT_FORK := $(if $(ROOT_FORK),$(call _lc,$(ROOT_FORK))/,) + # Core build: for building in standalone directories TOP_BUILD := $(TOP_DIR)/build TOP_BUILD_ARCH := $(TOP_BUILD)/$(XARCH) -QEMU_BUILD := $(TOP_BUILD_ARCH)/qemu-$(QEMU)-$(MACH) -UBOOT_BUILD := $(TOP_BUILD_ARCH)/uboot-$(UBOOT)-$(MACH) -KERNEL_BUILD := $(TOP_BUILD_ARCH)/linux-$(LINUX)-$(MACH) -ROOT_BUILD := $(TOP_BUILD_ARCH)/buildroot-$(BUILDROOT)-$(MACH) +QEMU_BUILD := $(TOP_BUILD_ARCH)/$(_QEMU_FORK)qemu-$(QEMU)-$(MACH) +UBOOT_BUILD := $(TOP_BUILD_ARCH)/$(_UBOOT_FORK)uboot-$(UBOOT)-$(MACH) +KERNEL_BUILD := $(TOP_BUILD_ARCH)/$(_KERNEL_FORK)linux-$(LINUX)-$(MACH) +ROOT_BUILD := $(TOP_BUILD_ARCH)/$(_ROOT_FORK)buildroot-$(BUILDROOT)-$(MACH) BSP_BUILD := $(TOP_BUILD_ARCH)/bsp-$(MACH) # Cross Compiler toolchains @@ -1568,7 +1573,7 @@ __stamp_$(1)=$$(_stamp_$(1)) endif endif -$(call _uc,$1)_CONFIG_FILE ?= $(2)_$$($(call _uc,$(2)))_defconfig +$(call _uc,$1)_CONFIG_FILE ?= $$(_$(call _uc,$(1))_FORK)$(2)_$$($(call _uc,$(2)))_defconfig $(3)CFG ?= $$($(call _uc,$1)_CONFIG_FILE) ifeq ($$($(3)CFG),$$($(call _uc,$1)_CONFIG_FILE)) -- Gitee From 8dd644c7983b992c2ad6c2e7d77bbbe1443fc779 Mon Sep 17 00:00:00 2001 From: Wu Zhangjin Date: Mon, 2 Aug 2021 00:41:59 +0800 Subject: [PATCH 10/12] source: use lower case fork variable some filesystems not support upper case by default, use lowercase by default. Signed-off-by: Wu Zhangjin --- boards/aarch64/virt/Makefile | 2 +- boards/x86_64/pc/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/aarch64/virt/Makefile b/boards/aarch64/virt/Makefile index d26325d..bac9d35 100644 --- a/boards/aarch64/virt/Makefile +++ b/boards/aarch64/virt/Makefile @@ -20,7 +20,7 @@ LINUX ?= v5.1 BUILDROOT?= 2019.11.1 # git repos for other kernel fork -KERNEL_GIT[KERNEL_FORK_openEuler] := https://gitee.com/openeuler/kernel.git +KERNEL_GIT[KERNEL_FORK_openeuler] := https://gitee.com/openeuler/kernel.git NETDEV_LIST := virtio diff --git a/boards/x86_64/pc/Makefile b/boards/x86_64/pc/Makefile index c911005..fe11bc4 100644 --- a/boards/x86_64/pc/Makefile +++ b/boards/x86_64/pc/Makefile @@ -10,7 +10,7 @@ SMP ?= 4 LINUX ?= v5.1 # git repos for other kernel fork -KERNEL_GIT[KERNEL_FORK_openEuler] := https://gitee.com/openeuler/kernel.git +KERNEL_GIT[KERNEL_FORK_openeuler] := https://gitee.com/openeuler/kernel.git GCC = 9 GCC[LINUX_v3.2] = 4.8 -- Gitee From 772b90d6482c200aee9858d8629a84c6f7a9cd72 Mon Sep 17 00:00:00 2001 From: Wu Zhangjin Date: Mon, 2 Aug 2021 00:59:37 +0800 Subject: [PATCH 11/12] board: allow customize images for target forks must make sure this order is ok: 1. XXX_FORK setting in local board specific .labconfig 2. _XXX_FORK variables based on XXX_FORK 3. board specific Makefile for KIMAGE, .... Signed-off-by: Wu Zhangjin --- Makefile | 11 ++++++----- boards/aarch64/virt/Makefile | 20 ++++++++++---------- boards/x86_64/pc/Makefile | 6 +++--- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 6c72103..390fe83 100644 --- a/Makefile +++ b/Makefile @@ -325,6 +325,12 @@ ifneq ($(BOARD),) # include $(BOARD_DIR)/.labinit $(eval $(call _bi,labinit)) $(eval $(call _bi,labconfig)) + + _QEMU_FORK := $(if $(QEMU_FORK),$(call _lc,$(QEMU_FORK))/,) + _UBOOT_FORK := $(if $(UBOOT_FORK),$(call _lc,$(UBOOT_FORK))/,) + _KERNEL_FORK := $(if $(KERNEL_FORK),$(call _lc,$(KERNEL_FORK))/,) + _ROOT_FORK := $(if $(ROOT_FORK),$(call _lc,$(ROOT_FORK))/,) + ifeq ($(BOARD_MAKEFILE), $(wildcard $(BOARD_MAKEFILE))) include $(BOARD_MAKEFILE) endif @@ -667,11 +673,6 @@ _KIMAGE := $(KIMAGE) _ROOTFS := $(ROOTFS) _QTOOL := $(QTOOL) -_QEMU_FORK := $(if $(QEMU_FORK),$(call _lc,$(QEMU_FORK))/,) -_UBOOT_FORK := $(if $(UBOOT_FORK),$(call _lc,$(UBOOT_FORK))/,) -_KERNEL_FORK := $(if $(KERNEL_FORK),$(call _lc,$(KERNEL_FORK))/,) -_ROOT_FORK := $(if $(ROOT_FORK),$(call _lc,$(ROOT_FORK))/,) - # Core build: for building in standalone directories TOP_BUILD := $(TOP_DIR)/build TOP_BUILD_ARCH := $(TOP_BUILD)/$(XARCH) diff --git a/boards/aarch64/virt/Makefile b/boards/aarch64/virt/Makefile index bac9d35..eb5d979 100644 --- a/boards/aarch64/virt/Makefile +++ b/boards/aarch64/virt/Makefile @@ -50,7 +50,7 @@ ROOTDEV ?= /dev/vda FSTYPE ?= ext2 ORIIMG ?= arch/$(ARCH)/boot/Image -KIMAGE ?= $(BSP_KERNEL)/$(LINUX)/Image +KIMAGE ?= $(BSP_KERNEL)/$(_KERNEL_FORK)$(LINUX)/Image # Get DRAM start & size via `bdinfo` KRN_ADDR?= 0x45000000 @@ -81,20 +81,20 @@ endif # Run uboot as bios, use -bios instead of -kernel UBOOT_BIOS ?= 1 -BIMAGE ?= $(BSP_UBOOT)/$(UBOOT)/$(LINUX)/u-boot.bin -DTS ?= $(BSP_KERNEL)/$(LINUX)/virt-gicv3.dts +BIMAGE ?= $(BSP_UBOOT)/$(_UBOOT_FORK)$(UBOOT)/$(LINUX)/u-boot.bin +DTS ?= $(BSP_KERNEL)/$(_KERNEL_FORK)$(LINUX)/virt-gicv3.dts # DTB is loaded by QEMU automatically at start of RAM, we load a new one for easier customization # This is dumped out by qemu, see README.md -DTB ?= $(BSP_KERNEL)/$(LINUX)/virt-gicv3.dtb -UKIMAGE ?= $(BSP_KERNEL)/$(LINUX)/Image +DTB ?= $(BSP_KERNEL)/$(_KERNEL_FORK)$(LINUX)/virt-gicv3.dtb +UKIMAGE ?= $(BSP_KERNEL)/$(_KERNEL_FORK)$(LINUX)/Image -ROOTFS ?= $(BSP_ROOT)/$(BUILDROOT)/rootfs.cpio.gz -HROOTFS ?= $(BSP_ROOT)/$(BUILDROOT)/rootfs.$(FSTYPE) -UROOTFS := $(BSP_ROOT)/$(BUILDROOT)/rootfs.cpio.uboot +ROOTFS ?= $(BSP_ROOT)/$(_ROOT_FORK)$(BUILDROOT)/rootfs.cpio.gz +HROOTFS ?= $(BSP_ROOT)/$(_ROOT_FORK)$(BUILDROOT)/rootfs.$(FSTYPE) +UROOTFS := $(BSP_ROOT)/$(_ROOT_FORK)$(BUILDROOT)/rootfs.cpio.uboot XKCLI ?= earlycon # Only for current v5.0.10 support -QTOOL[OS_trusty] ?= $(BSP_QEMU)/$(QEMU)/bin/qemu-system-$(XARCH) -QTOOL[OS_focal] ?= $(BSP_QEMU)/$(QEMU)/bin/qemu-system-$(XARCH) +QTOOL[OS_trusty] ?= $(BSP_QEMU)/$(_QEMU_FORK)$(QEMU)/bin/qemu-system-$(XARCH) +QTOOL[OS_focal] ?= $(BSP_QEMU)/$(_QEMU_FORK)$(QEMU)/bin/qemu-system-$(XARCH) # prebuilt toolchains, please download it if not internal via: make toolchain # Available origin: internal, bootlin, arm, linaro diff --git a/boards/x86_64/pc/Makefile b/boards/x86_64/pc/Makefile index fe11bc4..3a45631 100644 --- a/boards/x86_64/pc/Makefile +++ b/boards/x86_64/pc/Makefile @@ -39,6 +39,6 @@ ROOTDEV_LIST := /dev/hda /dev/ram0 /dev/nfs ROOTDEV_LIST[LINUX_v3.2] := /dev/sda /dev/ram0 /dev/nfs ROOTDEV ?= /dev/ram0 -KIMAGE ?= $(BSP_KERNEL)/$(LINUX)/bzImage -ROOTFS ?= $(BSP_ROOT)/$(BUILDROOT)/rootfs.cpio.gz -ROOTFS[LINUX_v2.6.12.6] ?= $(BSP_ROOT)/$(BUILDROOT)/rootfs32.cpio.gz +KIMAGE ?= $(BSP_KERNEL)/$(_KERNEL_FORK)$(LINUX)/bzImage +ROOTFS ?= $(BSP_ROOT)/$(_ROOT_FORK)$(BUILDROOT)/rootfs.cpio.gz +ROOTFS[LINUX_v2.6.12.6] ?= $(BSP_ROOT)/$(_ROOT_FORK)$(BUILDROOT)/rootfs32.cpio.gz -- Gitee From 27242b97b10ec56aaaa0fd19101bb9521aa508d3 Mon Sep 17 00:00:00 2001 From: Leo-AERO15WB Date: Tue, 3 Aug 2021 12:18:57 +0800 Subject: [PATCH 12/12] fix: _KERNEL_FORK support --- Makefile | 1 - boards/aarch64/virt/Makefile | 22 +++++++++++++--------- boards/aarch64/virt/bsp | 2 +- boards/x86_64/pc/Makefile | 8 +++++--- boards/x86_64/pc/bsp | 2 +- src/linux-stable | 2 +- 6 files changed, 21 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index baa80db..9cac37a 100644 --- a/Makefile +++ b/Makefile @@ -190,7 +190,6 @@ _UBOOT_SRC ?= $(if $(UBOOT_FORK),$(call _lc,$(UBOOT_FORK)-uboot),u-boot) UBOOT_SRC ?= $(_UBOOT_SRC) # could switch to other kernel fork for example openEuler -KERNEL_FORK = linux #KERNEL_GIT ?= https://github.com/tinyclub/linux-stable.git #KERNEL_GIT ?= https://mirrors.tuna.tsinghua.edu.cn/git/linux-stable.git KERNEL_GIT ?= https://kernel.source.codeaurora.cn/pub/scm/linux/kernel/git/stable/linux.git diff --git a/boards/aarch64/virt/Makefile b/boards/aarch64/virt/Makefile index eb5d979..4da3022 100644 --- a/boards/aarch64/virt/Makefile +++ b/boards/aarch64/virt/Makefile @@ -81,20 +81,24 @@ endif # Run uboot as bios, use -bios instead of -kernel UBOOT_BIOS ?= 1 -BIMAGE ?= $(BSP_UBOOT)/$(_UBOOT_FORK)$(UBOOT)/$(LINUX)/u-boot.bin -DTS ?= $(BSP_KERNEL)/$(_KERNEL_FORK)$(LINUX)/virt-gicv3.dts +BSP_ROOT := $(BSP_DIR)/root/$(_ROOT_FORK) +BSP_KERNEL := $(BSP_DIR)/kernel/$(_KERNEL_FORK) +BSP_UBOOT := $(BSP_DIR)/uboot/$(_UBOOT_FORK) +BSP_QEMU := $(BSP_DIR)/qemu/$(_QEMU_FORK) +BIMAGE ?= $(BSP_UBOOT)/$(UBOOT)/$(LINUX)/u-boot.bin +DTS ?= $(BSP_KERNEL)/$(LINUX)/virt-gicv3.dts # DTB is loaded by QEMU automatically at start of RAM, we load a new one for easier customization # This is dumped out by qemu, see README.md -DTB ?= $(BSP_KERNEL)/$(_KERNEL_FORK)$(LINUX)/virt-gicv3.dtb -UKIMAGE ?= $(BSP_KERNEL)/$(_KERNEL_FORK)$(LINUX)/Image +DTB ?= $(BSP_KERNEL)/$(LINUX)/virt-gicv3.dtb +UKIMAGE ?= $(BSP_KERNEL)/$(LINUX)/Image -ROOTFS ?= $(BSP_ROOT)/$(_ROOT_FORK)$(BUILDROOT)/rootfs.cpio.gz -HROOTFS ?= $(BSP_ROOT)/$(_ROOT_FORK)$(BUILDROOT)/rootfs.$(FSTYPE) -UROOTFS := $(BSP_ROOT)/$(_ROOT_FORK)$(BUILDROOT)/rootfs.cpio.uboot +ROOTFS ?= $(BSP_ROOT)/$(BUILDROOT)/rootfs.cpio.gz +HROOTFS ?= $(BSP_ROOT)/$(BUILDROOT)/rootfs.$(FSTYPE) +UROOTFS := $(BSP_ROOT)/$(BUILDROOT)/rootfs.cpio.uboot XKCLI ?= earlycon # Only for current v5.0.10 support -QTOOL[OS_trusty] ?= $(BSP_QEMU)/$(_QEMU_FORK)$(QEMU)/bin/qemu-system-$(XARCH) -QTOOL[OS_focal] ?= $(BSP_QEMU)/$(_QEMU_FORK)$(QEMU)/bin/qemu-system-$(XARCH) +QTOOL[OS_trusty] ?= $(BSP_QEMU)/$(QEMU)/bin/qemu-system-$(XARCH) +QTOOL[OS_focal] ?= $(BSP_QEMU)/$(QEMU)/bin/qemu-system-$(XARCH) # prebuilt toolchains, please download it if not internal via: make toolchain # Available origin: internal, bootlin, arm, linaro diff --git a/boards/aarch64/virt/bsp b/boards/aarch64/virt/bsp index b2d22ae..d6c0ff9 160000 --- a/boards/aarch64/virt/bsp +++ b/boards/aarch64/virt/bsp @@ -1 +1 @@ -Subproject commit b2d22ae4079162cf8200e71a10170b98843a91af +Subproject commit d6c0ff98a5b86c3eece2da2a767305baaf06759d diff --git a/boards/x86_64/pc/Makefile b/boards/x86_64/pc/Makefile index 3a45631..cd1f137 100644 --- a/boards/x86_64/pc/Makefile +++ b/boards/x86_64/pc/Makefile @@ -39,6 +39,8 @@ ROOTDEV_LIST := /dev/hda /dev/ram0 /dev/nfs ROOTDEV_LIST[LINUX_v3.2] := /dev/sda /dev/ram0 /dev/nfs ROOTDEV ?= /dev/ram0 -KIMAGE ?= $(BSP_KERNEL)/$(_KERNEL_FORK)$(LINUX)/bzImage -ROOTFS ?= $(BSP_ROOT)/$(_ROOT_FORK)$(BUILDROOT)/rootfs.cpio.gz -ROOTFS[LINUX_v2.6.12.6] ?= $(BSP_ROOT)/$(_ROOT_FORK)$(BUILDROOT)/rootfs32.cpio.gz +BSP_ROOT := $(BSP_DIR)/root/$(_ROOT_FORK) +BSP_KERNEL := $(BSP_DIR)/kernel/$(_KERNEL_FORK) +KIMAGE ?= $(BSP_KERNEL)/$(LINUX)/bzImage +ROOTFS ?= $(BSP_ROOT)/$(BUILDROOT)/rootfs.cpio.gz +ROOTFS[LINUX_v2.6.12.6] ?= $(BSP_ROOT)/$(BUILDROOT)/rootfs32.cpio.gz diff --git a/boards/x86_64/pc/bsp b/boards/x86_64/pc/bsp index a1c040c..0078bd0 160000 --- a/boards/x86_64/pc/bsp +++ b/boards/x86_64/pc/bsp @@ -1 +1 @@ -Subproject commit a1c040c22c655b469a5a49c5533485d1d28f29bf +Subproject commit 0078bd0a6b85cfa958f66e226bb248b43c842997 diff --git a/src/linux-stable b/src/linux-stable index 92d21ac..e93c9c9 160000 --- a/src/linux-stable +++ b/src/linux-stable @@ -1 +1 @@ -Subproject commit 92d21ac74a9e3c09b0b01c764e530657e4c85c49 +Subproject commit e93c9c99a629c61837d5a7fc2120cd2b6c70dbdd -- Gitee