diff options
Diffstat (limited to 'source/installer')
-rw-r--r-- | source/installer/ChangeLog.txt | 7 | ||||
-rwxr-xr-x | source/installer/sources/initrd/sbin/mkbindmounts | 10 | ||||
-rwxr-xr-x | source/installer/sources/initrd/usr/lib/setup/setup | 13 |
3 files changed, 28 insertions, 2 deletions
diff --git a/source/installer/ChangeLog.txt b/source/installer/ChangeLog.txt index b14c77e4..cc14f141 100644 --- a/source/installer/ChangeLog.txt +++ b/source/installer/ChangeLog.txt @@ -1,3 +1,10 @@ +Tue Jan 22 22:42:47 UTC 2019 + Before running the CONFIGURE section, create bind mounts to /dev, /proc, and + /sys. This is useful for chrooting and setting up boot loaders. + Also add "mkbindmounts" command to do this manually for anything that's + mounted on /mnt. This avoids having to type these commands when using the + installer for system rescue purposes. ++--------------------------+ Sun Jan 6 19:54:10 UTC 2019 Account for .x64 suffix on /boot/config-* files with x86_64 when installing the config files and /boot/config symlink. Thanks to Edward Grattan. diff --git a/source/installer/sources/initrd/sbin/mkbindmounts b/source/installer/sources/initrd/sbin/mkbindmounts new file mode 100755 index 00000000..40a9d731 --- /dev/null +++ b/source/installer/sources/initrd/sbin/mkbindmounts @@ -0,0 +1,10 @@ +#!/bin/bash +# Create bind mounts from / to /mnt for /dev/, /proc, and /sys. +# This may be useful for chrooting to a system partition mounted +# on /mnt (for example to run mkinitrd_command_generator.sh or to +# reinstall boot loaders). + +mkdir -p /mnt/{dev,proc,sys} +mount -o bind /dev /mnt/dev +mount -o bind /proc /mnt/proc +mount -o bind /sys /mnt/sys diff --git a/source/installer/sources/initrd/usr/lib/setup/setup b/source/installer/sources/initrd/usr/lib/setup/setup index 7932feca..54334477 100755 --- a/source/installer/sources/initrd/usr/lib/setup/setup +++ b/source/installer/sources/initrd/usr/lib/setup/setup @@ -74,8 +74,13 @@ T_PX="/mnt" echo "$T_PX" > $TMP/SeTT_PX ROOT_DEVICE="`mount | grep "on / " | cut -f 1 -d ' '`" echo "$ROOT_DEVICE" > $TMP/SeTrootdev -if mount | grep /var/log/mount 1> /dev/null 2> /dev/null ; then # clear source - umount /var/log/mount # location +if mount | grep /var/log/mount 1> /dev/null 2> /dev/null ; then # clear source location: + # In case of bind mounts, try to unmount them first: + umount /var/log/mount/dev 2> /dev/null + umount /var/log/mount/proc 2> /dev/null + umount /var/log/mount/sys 2> /dev/null + # Unmount target partition: + umount /var/log/mount fi # Anything mounted on /var/log/mount now is a fatal error: if mount | grep /var/log/mount 1> /dev/null 2> /dev/null ; then @@ -326,6 +331,10 @@ to choose packages individually." 4 60 fi if [ "$MAINSELECT" = "CONFIGURE" ]; then + # Make bind mounts for /dev, /proc, and /sys: + mount -o bind /dev $T_PX/dev 2> /dev/null + mount -o bind /proc $T_PX/proc 2> /dev/null + mount -o bind /sys $T_PX/sys 2> /dev/null SeTconfig REPLACE_FSTAB=Y if [ -r $TMP/SeTnative ]; then |