Dynamically manage mounts in chroot
This commit is contained in:
		@@ -195,11 +195,15 @@ build-gentoo() {
 | 
			
		||||
	popd
 | 
			
		||||
	log "Pivoting to container for more setup"
 | 
			
		||||
	cp "$0" "$_optdest/gentoostrap.sh"
 | 
			
		||||
	if ! grep -qs "$_optdest/proc " /proc/mounts; then
 | 
			
		||||
		mount --types proc /proc "$_optdest/proc"
 | 
			
		||||
	mount --rbind /sys "$_optdest/sys"
 | 
			
		||||
	mount --make-rslave "$_optdest/sys"
 | 
			
		||||
	mount --rbind /dev "$_optdest/dev"
 | 
			
		||||
	mount --make-rslave "$_optdest/dev"
 | 
			
		||||
	fi
 | 
			
		||||
	for dir in sys dev; do
 | 
			
		||||
		if ! grep -qs "$_optdest/$mount " /proc/mounts; then
 | 
			
		||||
			mount --rbind /$mount "$_optdest/$mount"
 | 
			
		||||
			mount --make-rslave "$_optdest/$mount"
 | 
			
		||||
		fi
 | 
			
		||||
	done
 | 
			
		||||
	chroot "$_optdest" /gentoostrap.sh -c
 | 
			
		||||
	chroot "$_optdest" /gentoostrap.sh -d
 | 
			
		||||
	log "Configuration complete! You should be good to reboot now."
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user