Error if loopback failed in createimg.sh
This commit is contained in:
		
							parent
							
								
									abaaf147ab
								
							
						
					
					
						commit
						0c0a0c9f90
					
				
					 1 changed files with 7 additions and 1 deletions
				
			
		|  | @ -30,7 +30,11 @@ w | ||||||
| PARTITION_START2=$((${PARTITION_START} * 512)) | PARTITION_START2=$((${PARTITION_START} * 512)) | ||||||
| echo "PARTITION_START2: ${PARTITION_START2}" | echo "PARTITION_START2: ${PARTITION_START2}" | ||||||
| LOOPBACK=$(losetup -o ${PARTITION_START2} -s -f iglunix.img) | LOOPBACK=$(losetup -o ${PARTITION_START2} -s -f iglunix.img) | ||||||
| echo "LOOPBACK: ${LOOPBACK}" | echo "loopback interface: ${LOOPBACK}" | ||||||
|  | 
 | ||||||
|  | #ERROR IF NO LOOPBACK | ||||||
|  | [ -z "$LOOPBACK" ] && echo "loopback creation failed!" && exit -1 | ||||||
|  | 
 | ||||||
| mke2fs -t ext4 -L "__IGLUNIX_ROOT" ${LOOPBACK} | mke2fs -t ext4 -L "__IGLUNIX_ROOT" ${LOOPBACK} | ||||||
| 
 | 
 | ||||||
| ROOT=/mnt/__IGLUNIX_ROOT | ROOT=/mnt/__IGLUNIX_ROOT | ||||||
|  | @ -51,6 +55,8 @@ cp /etc/hostname ${ROOT}/hostname | ||||||
| 
 | 
 | ||||||
| echo "Using the host keymap" | echo "Using the host keymap" | ||||||
| cp /etc/vconsole.conf ${ROOT}/etc/vconsole.conf  | cp /etc/vconsole.conf ${ROOT}/etc/vconsole.conf  | ||||||
|  | #TODO: this is a systemd file, | ||||||
|  | #      use udev/kbd | ||||||
| 
 | 
 | ||||||
| echo "Unmounting & closing loopback" | echo "Unmounting & closing loopback" | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue