Skip to content

Commit

Permalink
scripts/package: add KBUILD_PKG_ROOTCMD variable
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jonathan Nieder <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
  • Loading branch information
jrn authored and michal42 committed Dec 12, 2009
1 parent 91d1618 commit 05ba448
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/package/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand Down

0 comments on commit 05ba448

Please sign in to comment.