Skip to content

Commit 4debf48

Browse files
leahneukirchenthe-maldridge
authored andcommitted
use mount --rbind to propagate mounts into the chroot
Else things like efivarfs will not be passed down into the chroot, which makes installing grub fail. Closes #231.
1 parent 488d58f commit 4debf48

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

dracut/autoinstaller/install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ VAI_install_base_system() {
7474
VAI_prepare_chroot() {
7575
# Mount dev, bind, proc, etc into chroot
7676
mount -t proc proc "${target}/proc"
77-
mount -t sysfs sys "${target}/sys"
78-
mount -o rbind /dev "${target}/dev"
77+
mount --rbind /sys "${target}/sys"
78+
mount --rbind /dev "${target}/dev"
7979
}
8080

8181
VAI_configure_sudo() {

installer.sh.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ mount_filesystems() {
11001100
for f in sys proc dev; do
11011101
[ ! -d $TARGETDIR/$f ] && mkdir $TARGETDIR/$f
11021102
echo "Mounting $TARGETDIR/$f..." >$LOG
1103-
mount --bind /$f $TARGETDIR/$f >$LOG 2>&1
1103+
mount --rbind /$f $TARGETDIR/$f >$LOG 2>&1
11041104
done
11051105
}
11061106

lib.sh.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ mount_pseudofs() {
8282
# pseudofs isn't already mounted. If it already is then
8383
# this is virtually impossible to troubleshoot because it
8484
# looks like the subsequent umount just isn't working.
85-
mount -r --bind /$f "$ROOTFS/$f"
85+
mount -r --rbind /$f "$ROOTFS/$f"
8686
fi
8787
done
8888
if ! mountpoint -q "$ROOTFS/tmp" ; then

mklive.sh.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ print_step() {
4747
mount_pseudofs() {
4848
for f in sys dev proc; do
4949
mkdir -p "$ROOTFS"/$f
50-
mount --bind /$f "$ROOTFS"/$f
50+
mount --rbind /$f "$ROOTFS"/$f
5151
done
5252
}
5353
umount_pseudofs() {

0 commit comments

Comments
 (0)