diff mbox

[resend,1/2] scripts/package: add ROOTCMD variable

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

Commit Message

Jonathan Nieder Oct. 14, 2009, 6:54 a.m. UTC
None
diff mbox

Patch

diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index f67cc88..14b65a8 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -53,7 +53,8 @@  rpm-pkg rpm: $(objtree)/kernel.spec FORCE
 	set -e; \
 	mv -f $(objtree)/.tmp_version $(objtree)/.version
 
-	$(RPM) $(RPMOPTS) --target $(UTS_MACHINE) -ta ../$(KERNELPATH).tar.gz
+	$(ROOTCMD) $(RPM) $(RPMOPTS) --target $(UTS_MACHINE) \
+		-ta ../$(KERNELPATH).tar.gz
 	rm ../$(KERNELPATH).tar.gz
 
 clean-files := $(objtree)/kernel.spec
@@ -70,8 +71,8 @@  binrpm-pkg: $(objtree)/binkernel.spec FORCE
 	set -e; \
 	mv -f $(objtree)/.tmp_version $(objtree)/.version
 
-	$(RPM) $(RPMOPTS) --define "_builddir $(objtree)" --target \
-		$(UTS_MACHINE) -bb $<
+	$(ROOTCMD) $(RPM) $(RPMOPTS) --define "_builddir $(objtree)" \
+		--target $(UTS_MACHINE) -bb $<
 
 clean-files += $(objtree)/binkernel.spec
 
@@ -79,7 +80,7 @@  clean-files += $(objtree)/binkernel.spec
 # ---------------------------------------------------------------------------
 deb-pkg: FORCE
 	$(MAKE) KBUILD_SRC=
-	$(CONFIG_SHELL) $(srctree)/scripts/package/builddeb
+	$(ROOTCMD) $(CONFIG_SHELL) $(srctree)/scripts/package/builddeb
 
 clean-dirs += $(objtree)/debian/
 
@@ -88,7 +89,7 @@  clean-dirs += $(objtree)/debian/
 # ---------------------------------------------------------------------------
 tar%pkg: FORCE
 	$(MAKE) KBUILD_SRC=
-	$(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@
+	$(ROOTCMD) $(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@
 
 clean-dirs += $(objtree)/tar-install/
 
@@ -96,10 +97,10 @@  clean-dirs += $(objtree)/tar-install/
 # Help text displayed when executing 'make help'
 # ---------------------------------------------------------------------------
 help: FORCE
+	@echo ' Set ROOTCMD={sudo|fakeroot -u|super|...} and make as non-root:'
 	@echo '  rpm-pkg         - Build both source and binary RPM kernel packages'
 	@echo '  binrpm-pkg      - Build only the binary kernel package'
 	@echo '  deb-pkg         - Build the kernel as an deb package'
 	@echo '  tar-pkg         - Build the kernel as an uncompressed tarball'
 	@echo '  targz-pkg       - Build the kernel as a gzip compressed tarball'
 	@echo '  tarbz2-pkg      - Build the kernel as a bzip2 compressed tarball'
-