1
0
Fork 0
mirror of git://slackware.nl/current.git synced 2025-01-14 08:01:11 +01:00
slackware-current/source/installer/sources/initrd/sbin/mkbindmounts

15 lines
510 B
Text
Raw Permalink Normal View History

#!/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 rbind /dev /mnt/dev
mount -o rbind /proc /mnt/proc
mount -o rbind /sys /mnt/sys
# Needed for EFI boot menu operations:
if [ -d /sys/firmware/efi/efivars ]; then
mount -o rbind /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivars
fi