Create disk/partitions on target system

This commit is contained in:
Jeremy Gardais 2019-04-03 10:41:51 +02:00
parent 024feded3e
commit ea717c0a75
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 20 additions and 0 deletions

20
debian/chroot.install vendored
View File

@ -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}"*
## }}}
# }}}