aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/package/Makefile
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2009-11-24 10:21:56 -0500
committerMichal Marek <mmarek@suse.cz>2009-12-12 07:08:16 -0500
commitdb1d18657c96cc675596077cb60ef50fbe1947f8 (patch)
tree14f38c412bb0bee19c0f536fdb22c17b1965a48b /scripts/package/Makefile
parent05ba4488a51edde95df3f89987fdcdbca7c3cebb (diff)
scripts/package: deb-pkg: use fakeroot if available
Running "make deb-pkg" requires setting KBUILD_PKG_ROOTCMD or becoming root oneself or it errors out. Unless already running as root or KBUILD_PKG_ROOTCMD is already set, use fakeroot as a good default. With this patch applied, you can run "make oldconfig deb-pkg" as an ordinary user to build a binary package for an updated kernel tree and it should just work. fakeroot is too zealous by default in treating files as owned by root. Its wrapped stat() sets st_uid and st_gid to 0 for all files, which causes Git to go on a wild goose chase if CONFIG_LOCALVERSION_AUTO is set, checking if any file's content has changed along with its stat information. Avoid this by telling fakeroot to use the actual owner and group for preexisting files, by passing it the -u option. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts/package/Makefile')
-rw-r--r--scripts/package/Makefile21
1 files changed, 19 insertions, 2 deletions
diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index 5c0b43aaf63b..62fcc3a7f4d3 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -77,10 +77,27 @@ clean-files += $(objtree)/binkernel.spec
77 77
78# Deb target 78# Deb target
79# --------------------------------------------------------------------------- 79# ---------------------------------------------------------------------------
80quiet_cmd_builddeb = BUILDDEB
81 cmd_builddeb = set -e; \
82 test `id -u` = 0 || \
83 test -n "$(KBUILD_PKG_ROOTCMD)" || { \
84 which fakeroot >/dev/null 2>&1 && \
85 KBUILD_PKG_ROOTCMD="fakeroot -u"; \
86 } || { \
87 echo; \
88 echo "builddeb must be run as root (or using fakeroot)."; \
89 echo "KBUILD_PKG_ROOTCMD is unset and fakeroot not found."; \
90 echo "Try setting KBUILD_PKG_ROOTCMD to a command to acquire"; \
91 echo "root privileges (e.g., 'fakeroot -u' or 'sudo')."; \
92 false; \
93 } && \
94 \
95 $$KBUILD_PKG_ROOTCMD $(CONFIG_SHELL) \
96 $(srctree)/scripts/package/builddeb
97
80deb-pkg: FORCE 98deb-pkg: FORCE
81 $(MAKE) KBUILD_SRC= 99 $(MAKE) KBUILD_SRC=
82 $(KBUILD_PKG_ROOTCMD) $(CONFIG_SHELL) \ 100 $(call cmd,builddeb)
83 $(srctree)/scripts/package/builddeb
84 101
85clean-dirs += $(objtree)/debian/ 102clean-dirs += $(objtree)/debian/
86 103