Chroot: Ensure to remount device before run chroot

This commit is contained in:
Jeremy Gardais 2019-04-05 17:25:38 +02:00
parent 81700aed1b
commit fc69b8633f
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 6 additions and 6 deletions

12
debian/chroot.install vendored
View File

@ -200,6 +200,12 @@ grep "/var/tmp" /target/etc/fstab || echo "/tmp /var/tmp no
sed -i 's;target;;g' /target/etc/fstab
sed -i 's;//;/;g' /target/etc/fstab
## }}}
## Ensure to remount device {{{
mountpoint -q /target/dev/ || mount -t devtmpfs -- none /target/dev
mountpoint -q /target/dev/pts || mount -t devpts -- /dev/pts /target/dev/pts
mountpoint -q /target/proc || mount -t proc -- none /target/proc
mountpoint -q /target/sys || mount -t sysfs -- none /target/sys
## }}}
## Network {{{
### Get all informations from current network configuration in rescue mode
net_device=$(ip r | grep "^default" | head -1 | cut -d" " -f5)
@ -227,12 +233,6 @@ DNS=80.67.169.12
### Ensure to enable systemd-networkd at startup
chroot /target systemctl enable systemd-networkd
## }}}
## Ensure to remount device {{{
mountpoint -q /target/dev/ || mount -t devtmpfs -- none /target/dev
mountpoint -q /target/dev/pts || mount -t devpts -- /dev/pts /target/dev/pts
mountpoint -q /target/proc || mount -t proc -- none /target/proc
mountpoint -q /target/sys || mount -t sysfs -- none /target/sys
## }}}
## Locale {{{
### Enable locale(s)