[PATCH v3 2/3] scripts/package: add KBUILD_PKG_ROOTCMD variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Let the deb-pkg target acquire (fake) root privileges before
running commands that need them.  Without such privileges,
deb-pkg errors out because chown fails.

The new KBUILD_PKG_ROOTCMD variable, if defined, is used as a
command to run other commands with possibly fake elevated
privileges.  Since this is not needed for the tar-pkg and rpm-pkg
targets, it is only used by deb-pkg.  If it is not defined, the
behavior is as before, and the user will have to rerun make as
root.

In other words, as a shortcut, instead of running 'make oldconfig &&
make && fakeroot -u make deb-pkg', one can use the single command
'make oldconfig deb-pkg KBUILD_PKG_ROOTCMD="fakeroot -u"'.

Suggested-by: Ryan Anderson <ryan@xxxxxxxxxxxxxx>
Signed-off-by: Jonathan Nieder <jrnieder@xxxxxxxxx>
---
This patch does not use the variable in the rpm-pkg or tar-pkg targets
any more, since they already cope fine as non-root.

 scripts/package/Makefile |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index f67cc88..5c0b43a 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -79,7 +79,8 @@ clean-files += $(objtree)/binkernel.spec
 # ---------------------------------------------------------------------------
 deb-pkg: FORCE
 	$(MAKE) KBUILD_SRC=
-	$(CONFIG_SHELL) $(srctree)/scripts/package/builddeb
+	$(KBUILD_PKG_ROOTCMD) $(CONFIG_SHELL) \
+		$(srctree)/scripts/package/builddeb
 
 clean-dirs += $(objtree)/debian/
 
-- 
1.6.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux