diff --git a/debian/chroot.install b/debian/chroot.install index 6e87c6f..fdad55d 100755 --- a/debian/chroot.install +++ b/debian/chroot.install @@ -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}"* +## }}} + +# }}}