don't use arch-chroot
This commit is contained in:
		
							parent
							
								
									729e2cc9de
								
							
						
					
					
						commit
						ef4fe46700
					
				
					 1 changed files with 30 additions and 6 deletions
				
			
		
							
								
								
									
										36
									
								
								unbox.sh
									
										
									
									
									
								
							
							
						
						
									
										36
									
								
								unbox.sh
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -56,11 +56,7 @@ function unbox_outer_stage(){
 | 
			
		|||
	fi
 | 
			
		||||
 | 
			
		||||
	if type -t chroot > /dev/null; then
 | 
			
		||||
		if type -t arch-chroot > /dev/null; then
 | 
			
		||||
			CHROOT=arch-chroot
 | 
			
		||||
		else
 | 
			
		||||
			CHROOT=chroot
 | 
			
		||||
		fi
 | 
			
		||||
		CHROOT=chroot
 | 
			
		||||
	else
 | 
			
		||||
		echo ERROR: no chroot found 1>&2
 | 
			
		||||
		exit 1
 | 
			
		||||
| 
						 | 
				
			
			@ -70,7 +66,35 @@ function unbox_outer_stage(){
 | 
			
		|||
	mount -o bind . target/root/unbox
 | 
			
		||||
	mkdir -p target/root/unbox_data
 | 
			
		||||
	mount -o bind /data target/root/unbox_data
 | 
			
		||||
	$CHROOT target /root/unbox/unbox.sh unbox_inner_stage
 | 
			
		||||
	(
 | 
			
		||||
		mount -obind /sys target/sys
 | 
			
		||||
		mount -obind /proc target/proc
 | 
			
		||||
		mount -obind /dev target/dev
 | 
			
		||||
		mount -obind /dev/pts target/dev/pts
 | 
			
		||||
		
 | 
			
		||||
		if [[ -L target/etc/resolv.conf ]]; then
 | 
			
		||||
		
 | 
			
		||||
			resolv_conf=$(readlink "target/etc/resolv.conf")
 | 
			
		||||
			if [[ $resolv_conf = /* ]]; then
 | 
			
		||||
			  resolv_conf=target$resolv_conf
 | 
			
		||||
			else
 | 
			
		||||
			  resolv_conf=target/etc/$resolv_conf
 | 
			
		||||
			fi
 | 
			
		||||
 | 
			
		||||
			# ensure file exists to bind mount over
 | 
			
		||||
			if [[ ! -f $resolv_conf ]]; then
 | 
			
		||||
			  install -Dm644 /dev/null "$resolv_conf" || return 1
 | 
			
		||||
			fi
 | 
			
		||||
		fi
 | 
			
		||||
		
 | 
			
		||||
		if [[ -e target/etc/resolv.conf ]]; then
 | 
			
		||||
			cp -L /etc/resolv.conf $resolv_conf
 | 
			
		||||
		fi
 | 
			
		||||
		
 | 
			
		||||
		$CHROOT target /root/unbox/unbox.sh unbox_inner_stage
 | 
			
		||||
		umount /dev/pts
 | 
			
		||||
		umount /dev /sys /proc
 | 
			
		||||
	)
 | 
			
		||||
	umount target/root/unbox target/root/unbox_data
 | 
			
		||||
	
 | 
			
		||||
	if type -t post_install_stage > /dev/null; then
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue