diff mbox

[v2,2/2] scripts/package: use fakeroot if available

Message ID 20091015133913.GC6718@progeny.tock (mailing list archive)
State New, archived
Headers show

Commit Message

Jonathan Nieder Oct. 15, 2009, 1:39 p.m. UTC
None
diff mbox

Patch

diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index 6997f38..2aa7e8c 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -1,6 +1,15 @@ 
 # Makefile for the different targets used to generate full packages of a kernel
 # It uses the generic clean infrastructure of kbuild
 
+# How to acquire (fake) root privileges
+ifndef KBUILD_PKG_ROOTCMD
+ifneq ($(shell id -u),0)
+ifeq ($(shell which fakeroot >/dev/null 2>&1 && echo found),found)
+KBUILD_PKG_ROOTCMD := fakeroot -u
+endif
+endif
+endif
+
 # RPM target
 # ---------------------------------------------------------------------------
 # The rpm target generates two rpm files: