From: Jonathan Nieder <jrnieder@gmail.com>
To: Michal Marek <mmarek@suse.cz>
Cc: linux-kbuild@vger.kernel.org, maximilian attems <max@stro.at>,
Sam Ravnborg <sam@ravnborg.org>, Frans Pop <elendil@planet.nl>
Subject: [PATCH v3 2/3] scripts/package: add KBUILD_PKG_ROOTCMD variable
Date: Tue, 24 Nov 2009 09:14:41 -0600 [thread overview]
Message-ID: <20091124151441.GC14731@progeny.tock> (raw)
In-Reply-To: <20091124150904.GA14731@progeny.tock>
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@michonline.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
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
next prev parent reply other threads:[~2009-11-24 15:02 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-14 6:46 [PATCH resend 0/2] fakeroot dwimery for scripts/package/* Jonathan Nieder
2009-10-14 6:54 ` [PATCH resend 1/2] scripts/package: add ROOTCMD variable Jonathan Nieder
2009-10-14 6:55 ` [PATCH resend 2/2] scripts/package: use fakeroot if available Jonathan Nieder
2009-10-14 7:16 ` [PATCH resend 0/2] fakeroot dwimery for scripts/package/* Sam Ravnborg
2009-10-14 9:59 ` Frans Pop
2009-10-14 11:03 ` maximilian attems
2009-10-15 13:31 ` [PATCH v2 " Jonathan Nieder
2009-10-15 13:35 ` [PATCH v2 1/2] scripts/package: add KBUILD_PKG_ROOTCMD variable Jonathan Nieder
2009-11-24 11:27 ` Michal Marek
2009-11-24 12:03 ` Jonathan Nieder
2009-11-24 13:13 ` Michal Marek
2009-11-24 15:09 ` [PATCH v3 0/3] fakeroot dwimery for deb-pkg target Jonathan Nieder
2009-11-24 15:11 ` [PATCH 1/3] scripts/package: tar-pkg: use tar --owner=root Jonathan Nieder
2009-11-24 15:14 ` Jonathan Nieder [this message]
2009-11-24 15:21 ` [PATCH v3 3/3] scripts/package: deb-pkg: use fakeroot if available Jonathan Nieder
2009-11-24 19:07 ` Michal Marek
2009-10-15 13:39 ` [PATCH v2 2/2] scripts/package: " Jonathan Nieder
2009-11-04 21:22 ` [PATCH v2 0/2] fakeroot dwimery for scripts/package/* maximilian attems
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091124151441.GC14731@progeny.tock \
--to=jrnieder@gmail.com \
--cc=elendil@planet.nl \
--cc=linux-kbuild@vger.kernel.org \
--cc=max@stro.at \
--cc=mmarek@suse.cz \
--cc=sam@ravnborg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).