kbuild: Do not package /boot and /lib in make tar-pkg
authorMichal Marek <mmarek@suse.cz>
Tue, 25 Sep 2012 14:03:03 +0000 (16:03 +0200)
committerMichal Marek <mmarek@suse.cz>
Thu, 27 Sep 2012 14:26:19 +0000 (16:26 +0200)
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>
arch/x86/Makefile
scripts/Makefile.fwinst
scripts/package/buildtar

index c098ca4671de680f056d4c7aced9f97bf5ad9bfa..b0c5276861ec8cc3b5713b6f83335746f812edde 100644 (file)
@@ -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
 
 ###
index 4d908d16c035c4e6c582e254e531998e7f6156ae..c3f69ae275d1f7710b5f38c02e9daf6b45b947a4 100644 (file)
@@ -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
@@ -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
index 8a7b15598ea96c02890050e901d846a0916c7240..d0d748e72915b2e3217d493c08359739fb6fbf64 100644 (file)
@@ -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}"