Skip to content

Commit

Permalink
kbuild: Do not package /boot and /lib in make tar-pkg
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
michal42 committed Sep 27, 2012
1 parent 24cc7fb commit fe04ddf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion arch/x86/Makefile
Expand Up @@ -138,7 +138,7 @@ KBUILD_CFLAGS += $(call cc-option,-mno-avx,)
KBUILD_CFLAGS += $(mflags-y)
KBUILD_AFLAGS += $(mflags-y)

archscripts: scripts_basic
archscripts:
$(Q)$(MAKE) $(build)=arch/x86/tools relocs

###
Expand Down
4 changes: 2 additions & 2 deletions scripts/Makefile.fwinst
Expand Up @@ -27,7 +27,7 @@ endif
installed-mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(mod-fw))

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

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

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

PHONY += __fw_install __fw_modinst FORCE
Expand Down
2 changes: 1 addition & 1 deletion scripts/package/buildtar
Expand Up @@ -109,7 +109,7 @@ esac
if tar --owner=root --group=root --help >/dev/null 2>&1; then
opts="--owner=root --group=root"
fi
tar cf - . $opts | ${compress} > "${tarball}${file_ext}"
tar cf - boot/* lib/* $opts | ${compress} > "${tarball}${file_ext}"
)

echo "Tarball successfully created in ${tarball}${file_ext}"
Expand Down

0 comments on commit fe04ddf

Please sign in to comment.