Skip to content

Commit fe04ddf

Browse files
committed
kbuild: Do not package /boot and /lib in make tar-pkg
There were reports of users destroying their Fedora installs by a kernel tarball that replaces the /lib -> /usr/lib symlink. Let's remove the toplevel directories from the tarball to prevent this from happening. Reported-by: Andi Kleen <andi@firstfloor.org> Suggested-by: Ben Hutchings <ben@decadent.org.uk> Cc: <stable@kernel.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
1 parent 24cc7fb commit fe04ddf

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎arch/x86/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ KBUILD_CFLAGS += $(call cc-option,-mno-avx,)
138138
KBUILD_CFLAGS += $(mflags-y)
139139
KBUILD_AFLAGS += $(mflags-y)
140140

141-
archscripts: scripts_basic
141+
archscripts:
142142
$(Q)$(MAKE) $(build)=arch/x86/tools relocs
143143

144144
###

‎scripts/Makefile.fwinst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ endif
2727
installed-mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(mod-fw))
2828

2929
installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all))
30-
installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/./
30+
installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/.
3131

3232
# Workaround for make < 3.81, where .SECONDEXPANSION doesn't work.
3333
PHONY += $(INSTALL_FW_PATH)/$$(%) install-all-dirs
@@ -42,7 +42,7 @@ quiet_cmd_install = INSTALL $(subst $(srctree)/,,$@)
4242
$(installed-fw-dirs):
4343
$(call cmd,mkdir)
4444

45-
$(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $(INSTALL_FW_PATH)/$$(dir %)
45+
$(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $$(dir $(INSTALL_FW_PATH)/%)
4646
$(call cmd,install)
4747

4848
PHONY += __fw_install __fw_modinst FORCE

‎scripts/package/buildtar‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ esac
109109
if tar --owner=root --group=root --help >/dev/null 2>&1; then
110110
opts="--owner=root --group=root"
111111
fi
112-
tar cf - . $opts | ${compress} > "${tarball}${file_ext}"
112+
tar cf - boot/* lib/* $opts | ${compress} > "${tarball}${file_ext}"
113113
)
114114

115115
echo "Tarball successfully created in ${tarball}${file_ext}"

0 commit comments

Comments
 (0)