Dynamically manage mounts in chroot
This commit is contained in:
parent
aad2417c11
commit
cb8c7537c0
@ -195,11 +195,15 @@ build-gentoo() {
|
|||||||
popd
|
popd
|
||||||
log "Pivoting to container for more setup"
|
log "Pivoting to container for more setup"
|
||||||
cp "$0" "$_optdest/gentoostrap.sh"
|
cp "$0" "$_optdest/gentoostrap.sh"
|
||||||
mount --types proc /proc "$_optdest/proc"
|
if ! grep -qs "$_optdest/proc " /proc/mounts; then
|
||||||
mount --rbind /sys "$_optdest/sys"
|
mount --types proc /proc "$_optdest/proc"
|
||||||
mount --make-rslave "$_optdest/sys"
|
fi
|
||||||
mount --rbind /dev "$_optdest/dev"
|
for dir in sys dev; do
|
||||||
mount --make-rslave "$_optdest/dev"
|
if ! grep -qs "$_optdest/$mount " /proc/mounts; then
|
||||||
|
mount --rbind /$mount "$_optdest/$mount"
|
||||||
|
mount --make-rslave "$_optdest/$mount"
|
||||||
|
fi
|
||||||
|
done
|
||||||
chroot "$_optdest" /gentoostrap.sh -c
|
chroot "$_optdest" /gentoostrap.sh -c
|
||||||
chroot "$_optdest" /gentoostrap.sh -d
|
chroot "$_optdest" /gentoostrap.sh -d
|
||||||
log "Configuration complete! You should be good to reboot now."
|
log "Configuration complete! You should be good to reboot now."
|
||||||
|
Loading…
Reference in New Issue
Block a user