mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-29 17:25:38 +00:00
9cc5f3bf63
The compiled dtb files aren't executable, so install them with 0644 as their
permission mode, instead of defaulting to 0755 for the permission mode and
installing them with the executable bits set.
Some Linux distributions, including Debian, [1][2][3] already include fixes
in their kernel package build recipes to change the dtb file permissions to
0644 in their kernel packages. These changes, when additionally propagated
into the long-term kernel versions, will allow such distributions to remove
their downstream fixes.
[1] https://salsa.debian.org/kernel-team/linux/-/merge_requests/642
[2] https://salsa.debian.org/kernel-team/linux/-/merge_requests/749
[3] https://salsa.debian.org/kernel-team/linux/-/blob/debian/6.8.12-1/debian/rules.real#L193
Cc: Diederik de Haas <didi.debian@cknow.org>
Cc: <stable@vger.kernel.org>
Fixes: aefd80307a
("kbuild: refactor Makefile.dtbinst more")
Signed-off-by: Dragan Simic <dsimic@manjaro.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
44 lines
1.0 KiB
Makefile
44 lines
1.0 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
# ==========================================================================
|
|
# Installing dtb files
|
|
#
|
|
# Installs all dtb files listed in $(dtb-y) either in the
|
|
# INSTALL_DTBS_PATH directory or the default location:
|
|
#
|
|
# $INSTALL_PATH/dtbs/$KERNELRELEASE
|
|
# ==========================================================================
|
|
|
|
PHONY := __dtbs_install
|
|
__dtbs_install:
|
|
|
|
include include/config/auto.conf
|
|
include $(srctree)/scripts/Kbuild.include
|
|
|
|
dst := $(INSTALL_DTBS_PATH)
|
|
|
|
quiet_cmd_dtb_install = INSTALL $@
|
|
cmd_dtb_install = install -D -m 0644 $< $@
|
|
|
|
$(dst)/%: $(obj)/%
|
|
$(call cmd,dtb_install)
|
|
|
|
dtbs := $(patsubst $(obj)/%,%,$(call read-file, $(obj)/dtbs-list))
|
|
|
|
ifdef CONFIG_ARCH_WANT_FLAT_DTB_INSTALL
|
|
|
|
define gen_install_rules
|
|
$(dst)/%: $(obj)/$(1)%
|
|
$$(call cmd,dtb_install)
|
|
endef
|
|
|
|
$(foreach d, $(sort $(dir $(dtbs))), $(eval $(call gen_install_rules,$(d))))
|
|
|
|
dtbs := $(notdir $(dtbs))
|
|
|
|
endif # CONFIG_ARCH_WANT_FLAT_DTB_INSTALL
|
|
|
|
__dtbs_install: $(addprefix $(dst)/, $(dtbs))
|
|
@:
|
|
|
|
.PHONY: $(PHONY)
|