blob: 897889847ea2290ad2580a9eab8e54482244aff7 (
plain) (
tree)
|
|
#!/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
|