linux/linux.mk: use namespace for internal variables
These three symbols: KERNEL_ARCH_PATH KERNEL_DTBS KERNEL_DTS_NAME are defined and used only inside this file, so use the LINUX_ namespace for them instead of KERNEL_. Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
parent
0b0d93fe70
commit
a338f59e16
@ -125,15 +125,15 @@ endif
|
|||||||
# going to be installed in the target filesystem.
|
# going to be installed in the target filesystem.
|
||||||
LINUX_VERSION_PROBED = `$(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) --no-print-directory -s kernelrelease 2>/dev/null`
|
LINUX_VERSION_PROBED = `$(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) --no-print-directory -s kernelrelease 2>/dev/null`
|
||||||
|
|
||||||
KERNEL_DTS_NAME += $(call qstrip,$(BR2_LINUX_KERNEL_INTREE_DTS_NAME))
|
LINUX_DTS_NAME += $(call qstrip,$(BR2_LINUX_KERNEL_INTREE_DTS_NAME))
|
||||||
|
|
||||||
# We keep only the .dts files, so that the user can specify both .dts
|
# We keep only the .dts files, so that the user can specify both .dts
|
||||||
# and .dtsi files in BR2_LINUX_KERNEL_CUSTOM_DTS_PATH. Both will be
|
# and .dtsi files in BR2_LINUX_KERNEL_CUSTOM_DTS_PATH. Both will be
|
||||||
# copied to arch/<arch>/boot/dts, but only the .dts files will
|
# copied to arch/<arch>/boot/dts, but only the .dts files will
|
||||||
# actually be generated as .dtb.
|
# actually be generated as .dtb.
|
||||||
KERNEL_DTS_NAME += $(basename $(filter %.dts,$(notdir $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)))))
|
LINUX_DTS_NAME += $(basename $(filter %.dts,$(notdir $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)))))
|
||||||
|
|
||||||
KERNEL_DTBS = $(addsuffix .dtb,$(KERNEL_DTS_NAME))
|
LINUX_DTBS = $(addsuffix .dtb,$(LINUX_DTS_NAME))
|
||||||
|
|
||||||
ifeq ($(BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM),y)
|
ifeq ($(BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM),y)
|
||||||
LINUX_IMAGE_NAME = $(call qstrip,$(BR2_LINUX_KERNEL_IMAGE_NAME))
|
LINUX_IMAGE_NAME = $(call qstrip,$(BR2_LINUX_KERNEL_IMAGE_NAME))
|
||||||
@ -155,9 +155,9 @@ LINUX_IMAGE_NAME = zImage.epapr
|
|||||||
else ifeq ($(BR2_LINUX_KERNEL_APPENDED_ZIMAGE),y)
|
else ifeq ($(BR2_LINUX_KERNEL_APPENDED_ZIMAGE),y)
|
||||||
LINUX_IMAGE_NAME = zImage
|
LINUX_IMAGE_NAME = zImage
|
||||||
else ifeq ($(BR2_LINUX_KERNEL_CUIMAGE),y)
|
else ifeq ($(BR2_LINUX_KERNEL_CUIMAGE),y)
|
||||||
LINUX_IMAGE_NAME = cuImage.$(KERNEL_DTS_NAME)
|
LINUX_IMAGE_NAME = cuImage.$(LINUX_DTS_NAME)
|
||||||
else ifeq ($(BR2_LINUX_KERNEL_SIMPLEIMAGE),y)
|
else ifeq ($(BR2_LINUX_KERNEL_SIMPLEIMAGE),y)
|
||||||
LINUX_IMAGE_NAME = simpleImage.$(KERNEL_DTS_NAME)
|
LINUX_IMAGE_NAME = simpleImage.$(LINUX_DTS_NAME)
|
||||||
else ifeq ($(BR2_LINUX_KERNEL_IMAGE),y)
|
else ifeq ($(BR2_LINUX_KERNEL_IMAGE),y)
|
||||||
LINUX_IMAGE_NAME = Image
|
LINUX_IMAGE_NAME = Image
|
||||||
else ifeq ($(BR2_LINUX_KERNEL_LINUX_BIN),y)
|
else ifeq ($(BR2_LINUX_KERNEL_LINUX_BIN),y)
|
||||||
@ -187,11 +187,11 @@ endif
|
|||||||
# for bzImage, arch/i386 and arch/x86_64 do not exist when copying the
|
# for bzImage, arch/i386 and arch/x86_64 do not exist when copying the
|
||||||
# defconfig file.
|
# defconfig file.
|
||||||
ifeq ($(KERNEL_ARCH),i386)
|
ifeq ($(KERNEL_ARCH),i386)
|
||||||
KERNEL_ARCH_PATH = $(LINUX_DIR)/arch/x86
|
LINUX_ARCH_PATH = $(LINUX_DIR)/arch/x86
|
||||||
else ifeq ($(KERNEL_ARCH),x86_64)
|
else ifeq ($(KERNEL_ARCH),x86_64)
|
||||||
KERNEL_ARCH_PATH = $(LINUX_DIR)/arch/x86
|
LINUX_ARCH_PATH = $(LINUX_DIR)/arch/x86
|
||||||
else
|
else
|
||||||
KERNEL_ARCH_PATH = $(LINUX_DIR)/arch/$(KERNEL_ARCH)
|
LINUX_ARCH_PATH = $(LINUX_DIR)/arch/$(KERNEL_ARCH)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(BR2_LINUX_KERNEL_VMLINUX),y)
|
ifeq ($(BR2_LINUX_KERNEL_VMLINUX),y)
|
||||||
@ -201,7 +201,7 @@ LINUX_IMAGE_PATH = $(LINUX_DIR)/$(LINUX_IMAGE_NAME)
|
|||||||
else ifeq ($(BR2_LINUX_KERNEL_VMLINUZ_BIN),y)
|
else ifeq ($(BR2_LINUX_KERNEL_VMLINUZ_BIN),y)
|
||||||
LINUX_IMAGE_PATH = $(LINUX_DIR)/$(LINUX_IMAGE_NAME)
|
LINUX_IMAGE_PATH = $(LINUX_DIR)/$(LINUX_IMAGE_NAME)
|
||||||
else
|
else
|
||||||
LINUX_IMAGE_PATH = $(KERNEL_ARCH_PATH)/boot/$(LINUX_IMAGE_NAME)
|
LINUX_IMAGE_PATH = $(LINUX_ARCH_PATH)/boot/$(LINUX_IMAGE_NAME)
|
||||||
endif # BR2_LINUX_KERNEL_VMLINUX
|
endif # BR2_LINUX_KERNEL_VMLINUX
|
||||||
|
|
||||||
define LINUX_APPLY_LOCAL_PATCHES
|
define LINUX_APPLY_LOCAL_PATCHES
|
||||||
@ -323,14 +323,14 @@ endef
|
|||||||
ifeq ($(BR2_LINUX_KERNEL_DTS_SUPPORT),y)
|
ifeq ($(BR2_LINUX_KERNEL_DTS_SUPPORT),y)
|
||||||
ifeq ($(BR2_LINUX_KERNEL_DTB_IS_SELF_BUILT),)
|
ifeq ($(BR2_LINUX_KERNEL_DTB_IS_SELF_BUILT),)
|
||||||
define LINUX_BUILD_DTB
|
define LINUX_BUILD_DTB
|
||||||
$(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(KERNEL_DTBS)
|
$(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_DTBS)
|
||||||
endef
|
endef
|
||||||
ifeq ($(BR2_LINUX_KERNEL_APPENDED_DTB),)
|
ifeq ($(BR2_LINUX_KERNEL_APPENDED_DTB),)
|
||||||
define LINUX_INSTALL_DTB
|
define LINUX_INSTALL_DTB
|
||||||
# dtbs moved from arch/<ARCH>/boot to arch/<ARCH>/boot/dts since 3.8-rc1
|
# dtbs moved from arch/<ARCH>/boot to arch/<ARCH>/boot/dts since 3.8-rc1
|
||||||
cp $(addprefix \
|
cp $(addprefix \
|
||||||
$(KERNEL_ARCH_PATH)/boot/$(if $(wildcard \
|
$(LINUX_ARCH_PATH)/boot/$(if $(wildcard \
|
||||||
$(addprefix $(KERNEL_ARCH_PATH)/boot/dts/,$(KERNEL_DTBS))),dts/),$(KERNEL_DTBS)) \
|
$(addprefix $(LINUX_ARCH_PATH)/boot/dts/,$(LINUX_DTBS))),dts/),$(LINUX_DTBS)) \
|
||||||
$(1)
|
$(1)
|
||||||
endef
|
endef
|
||||||
endif # BR2_LINUX_KERNEL_APPENDED_DTB
|
endif # BR2_LINUX_KERNEL_APPENDED_DTB
|
||||||
@ -340,8 +340,8 @@ endif # BR2_LINUX_KERNEL_DTS_SUPPORT
|
|||||||
ifeq ($(BR2_LINUX_KERNEL_APPENDED_DTB),y)
|
ifeq ($(BR2_LINUX_KERNEL_APPENDED_DTB),y)
|
||||||
# dtbs moved from arch/$ARCH/boot to arch/$ARCH/boot/dts since 3.8-rc1
|
# dtbs moved from arch/$ARCH/boot to arch/$ARCH/boot/dts since 3.8-rc1
|
||||||
define LINUX_APPEND_DTB
|
define LINUX_APPEND_DTB
|
||||||
(cd $(KERNEL_ARCH_PATH)/boot; \
|
(cd $(LINUX_ARCH_PATH)/boot; \
|
||||||
for dtb in $(KERNEL_DTS_NAME); do \
|
for dtb in $(LINUX_DTS_NAME); do \
|
||||||
if test -e $${dtb}.dtb ; then \
|
if test -e $${dtb}.dtb ; then \
|
||||||
dtbpath=$${dtb}.dtb ; \
|
dtbpath=$${dtb}.dtb ; \
|
||||||
else \
|
else \
|
||||||
@ -359,10 +359,10 @@ ifeq ($(BR2_LINUX_KERNEL_APPENDED_UIMAGE),y)
|
|||||||
LINUX_APPEND_DTB += ; \
|
LINUX_APPEND_DTB += ; \
|
||||||
MKIMAGE_ARGS=`$(MKIMAGE) -l $(LINUX_IMAGE_PATH) |\
|
MKIMAGE_ARGS=`$(MKIMAGE) -l $(LINUX_IMAGE_PATH) |\
|
||||||
sed -n -e 's/Image Name:[ ]*\(.*\)/-n \1/p' -e 's/Load Address:/-a/p' -e 's/Entry Point:/-e/p'`; \
|
sed -n -e 's/Image Name:[ ]*\(.*\)/-n \1/p' -e 's/Load Address:/-a/p' -e 's/Entry Point:/-e/p'`; \
|
||||||
for dtb in $(KERNEL_DTS_NAME); do \
|
for dtb in $(LINUX_DTS_NAME); do \
|
||||||
$(MKIMAGE) -A $(MKIMAGE_ARCH) -O linux \
|
$(MKIMAGE) -A $(MKIMAGE_ARCH) -O linux \
|
||||||
-T kernel -C none $${MKIMAGE_ARGS} \
|
-T kernel -C none $${MKIMAGE_ARGS} \
|
||||||
-d $(KERNEL_ARCH_PATH)/boot/zImage.$${dtb} $(LINUX_IMAGE_PATH).$${dtb}; \
|
-d $(LINUX_ARCH_PATH)/boot/zImage.$${dtb} $(LINUX_IMAGE_PATH).$${dtb}; \
|
||||||
done
|
done
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@ -371,7 +371,7 @@ endif
|
|||||||
# configuration has changed.
|
# configuration has changed.
|
||||||
define LINUX_BUILD_CMDS
|
define LINUX_BUILD_CMDS
|
||||||
@for dts in $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)); do \
|
@for dts in $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)); do \
|
||||||
cp -f $${dts} $(KERNEL_ARCH_PATH)/boot/dts/ ; \
|
cp -f $${dts} $(LINUX_ARCH_PATH)/boot/dts/ ; \
|
||||||
done
|
done
|
||||||
$(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_TARGET_NAME)
|
$(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_TARGET_NAME)
|
||||||
@if grep -q "CONFIG_MODULES=y" $(@D)/.config; then \
|
@if grep -q "CONFIG_MODULES=y" $(@D)/.config; then \
|
||||||
@ -386,7 +386,7 @@ ifeq ($(BR2_LINUX_KERNEL_APPENDED_DTB),y)
|
|||||||
# appended DTBs.
|
# appended DTBs.
|
||||||
define LINUX_INSTALL_IMAGE
|
define LINUX_INSTALL_IMAGE
|
||||||
mkdir -p $(1)
|
mkdir -p $(1)
|
||||||
cp $(KERNEL_ARCH_PATH)/boot/$(LINUX_IMAGE_NAME).* $(1)
|
cp $(LINUX_ARCH_PATH)/boot/$(LINUX_IMAGE_NAME).* $(1)
|
||||||
endef
|
endef
|
||||||
else
|
else
|
||||||
# Otherwise, just install the unique image generated by the kernel
|
# Otherwise, just install the unique image generated by the kernel
|
||||||
@ -482,7 +482,7 @@ $(error No kernel configuration file specified, check your BR2_LINUX_KERNEL_CUST
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(BR2_LINUX_KERNEL_DTS_SUPPORT):$(strip $(KERNEL_DTS_NAME)),y:)
|
ifeq ($(BR2_LINUX_KERNEL_DTS_SUPPORT):$(strip $(LINUX_DTS_NAME)),y:)
|
||||||
$(error No kernel device tree source specified, check your \
|
$(error No kernel device tree source specified, check your \
|
||||||
BR2_LINUX_KERNEL_INTREE_DTS_NAME / BR2_LINUX_KERNEL_CUSTOM_DTS_PATH settings)
|
BR2_LINUX_KERNEL_INTREE_DTS_NAME / BR2_LINUX_KERNEL_CUSTOM_DTS_PATH settings)
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user