From f99b2de07e9a09d88cc0c8c69572c64631fe0488 Mon Sep 17 00:00:00 2001 From: Icarus Sparry Date: Sat, 23 Dec 2017 11:27:17 -0800 Subject: [PATCH] Add rootshell target and change shell to be unprivileged Change the "make shell" command to invoke a shell as the "mockbuild" user and starting in ~mockbuild. This is typically what you want when you enter the build environment. Add a new target, "rootshell", which gives the old behavior, a root shell starting at /. Signed-off-by: Icarus Sparry --- Makefile.common | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile.common b/Makefile.common index 1fb8a11..13a1b29 100644 --- a/Makefile.common +++ b/Makefile.common @@ -101,10 +101,14 @@ build-nocheck: configemail $(SPECFILE) upstream $(SRPMFILE) fmvpatches: results/build.log @perl $(TOPLVL)/projects/common/fmvpatches.pl $(PKG_NAME) -#help shell: Puts you in a shell into your build root. -shell: +#help rootshell: Puts you in a root shell at the top of your build root. +rootshell: $(MOCK) --result=results/ --no-cleanup-after --shell --uniqueext=$(PKG_NAME) +#help shell: Puts you in a user shell in the home directory in the build root. +shell: + $(MOCK) --result=results/ --no-cleanup-after --shell --uniqueext=$(PKG_NAME) --unpriv "/bin/sh -c 'cd ; exec \$$SHELL -l -i'" + # Always rebuild the source rpm .PHONY: $(SRPMFILE) $(SRPMFILE): $(SPECFILE) $(__allsources)