2019-01-23 05:39:04 +01:00
|
|
|
#!/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}
|
2023-07-09 20:35:37 +02:00
|
|
|
mount -o rbind /dev /mnt/dev
|
|
|
|
mount -o rbind /proc /mnt/proc
|
|
|
|
mount -o rbind /sys /mnt/sys
|
2024-03-11 19:29:55 +01:00
|
|
|
# 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
|