Create disk/partitions on target system
This commit is contained in:
		
							parent
							
								
									024feded3e
								
							
						
					
					
						commit
						ea717c0a75
					
				|  | @ -114,3 +114,23 @@ mountpoint -q /target/sys        || mount -o bind -- /sys /target/sys | |||
| debootstrap --arch amd64 --include="${dbs_pkg_include}" --exclude="${dbs_pkg_exclude}" stretch /target http://ftp.fr.debian.org/debian | ||||
| 
 | ||||
| # }}} | ||||
| # Configure system {{{ | ||||
| ## Create the disk/partitions (eg. /dev/sda, /dev/sda1,…) on the target system {{{ | ||||
| ### Create the disk | ||||
| [ -b /target"${hdd}" ] || mknod --mode=660 /target"${hdd}" b 8 0 | ||||
| 
 | ||||
| ### Count the number of partitions on the rescue system | ||||
| nb_part=$(ls -l -- "${hdd}"? | wc -l) | ||||
| part=1 | ||||
| ### Start at 1 and less/equal $nb_part | ||||
| while [ "${part}" -le "${nb_part}" ]; do | ||||
| 	#### Create the partitions on the target system | ||||
| 	[ -b /target"${hdd}${part}" ] || mknod --mode=660 /target"${hdd}${part}" b 8 "${part}" | ||||
| 	(( part++ )) | ||||
| done | ||||
| 
 | ||||
| ### Fix group of disk/partitions | ||||
| chgrp disk -- /target"${hdd}"* | ||||
| ## }}} | ||||
| 
 | ||||
| # }}} | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue