build: Run as root generally, drop privs on download/bundle
This commit is contained in:
		
							
								
								
									
										16
									
								
								build
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								build
									
									
									
									
									
								
							| @@ -2,13 +2,13 @@ | ||||
| set -e | ||||
| [ -d cache ] || mkdir cache | ||||
| SPAWN="systemd-nspawn -M gentoolooqsbuilder -D gentoo --bind=$(realpath ./out):/out --bind=$(realpath scripts):/scripts --bind=$(realpath cache):/var/cache/distfiles" | ||||
| export UNPRIVUSER="user" | ||||
|  | ||||
|  | ||||
| SETUPSCRIPT="/scripts/3-setup-gentoo.sh" | ||||
| BUILDSCRIPT="/scripts/4-build-looqs.sh" | ||||
| ./scripts/1-create.sh | ||||
| sudo ./scripts/2-create.sh `whoami` | ||||
| sudo ${SPAWN} /${SETUPSCRIPT} | ||||
| sudo ${SPAWN} su - builder -c /${BUILDSCRIPT} | ||||
| ./scripts/5-bundle.sh    | ||||
| su $UNPRIVUSER -c ./scripts/1-create.sh | ||||
| ./scripts/2-create.sh | ||||
| ${SPAWN} /scripts/3-setup-gentoo.sh | ||||
| chown "$UNPRIVUSER" -R out | ||||
| ${SPAWN} su - builder -c /scripts/4-build-looqs.sh | ||||
| chown "$UNPRIVUSER" -R out | ||||
| su $UNPRIVUSER -c "cd $(pwd); ./scripts/5-bundle.sh" | ||||
|  | ||||
|   | ||||
| @@ -6,5 +6,4 @@ mkdir out | ||||
| mkdir out/lib | ||||
| mkdir out/bin | ||||
| chmod -R 755 out | ||||
| chown -R "$1" out | ||||
| tar xfp hardened.tar.xz -C gentoo | ||||
|   | ||||
		مرجع در شماره جدید
	
	Block a user