NixOS Root on ZFS: Do not bind mount /boot/efi
Previously we used a bind mount from /boot/efis/*-part1 to /boot/efi to facilitate bootloader configuration. Recent reports indicate that this bind mount prevents the system from booting. This pull request removes the bind mount. Closes #383. Signed-off-by: Maurice Zhou <ja@apvc.uk>
This commit is contained in:
committed by
George Melikov
parent
0aaa23397e
commit
1211e98faf
@@ -128,6 +128,3 @@ System Installation
|
|||||||
mkdir -p /mnt/boot/efis/${i##*/}-part1
|
mkdir -p /mnt/boot/efis/${i##*/}-part1
|
||||||
mount -t vfat ${i}-part1 /mnt/boot/efis/${i##*/}-part1
|
mount -t vfat ${i}-part1 /mnt/boot/efis/${i##*/}-part1
|
||||||
done
|
done
|
||||||
|
|
||||||
mkdir -p /mnt/boot/efi
|
|
||||||
mount -t vfat $(echo $DISK | cut -f1 -d\ )-part1 /mnt/boot/efi
|
|
||||||
|
|||||||
@@ -28,8 +28,10 @@ System Configuration
|
|||||||
|
|
||||||
sed -i '/boot.loader/d' /mnt/etc/nixos/configuration.nix
|
sed -i '/boot.loader/d' /mnt/etc/nixos/configuration.nix
|
||||||
sed -i '/services.xserver/d' /mnt/etc/nixos/configuration.nix
|
sed -i '/services.xserver/d' /mnt/etc/nixos/configuration.nix
|
||||||
|
tee -a /mnt/etc/nixos/zfs.nix <<EOF
|
||||||
|
boot.loader.efi.efiSysMountPoint = "/boot/efis/$(echo $DISK | cut -f1 -d\ | sed 's|/dev/disk/by-id/||')-part1";
|
||||||
|
EOF
|
||||||
tee -a /mnt/etc/nixos/zfs.nix <<-'EOF'
|
tee -a /mnt/etc/nixos/zfs.nix <<-'EOF'
|
||||||
boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
|
||||||
boot.loader.efi.canTouchEfiVariables = false;
|
boot.loader.efi.canTouchEfiVariables = false;
|
||||||
boot.loader.generationsDir.copyKernels = true;
|
boot.loader.generationsDir.copyKernels = true;
|
||||||
boot.loader.grub.efiInstallAsRemovable = true;
|
boot.loader.grub.efiInstallAsRemovable = true;
|
||||||
@@ -38,16 +40,9 @@ System Configuration
|
|||||||
boot.loader.grub.copyKernels = true;
|
boot.loader.grub.copyKernels = true;
|
||||||
boot.loader.grub.efiSupport = true;
|
boot.loader.grub.efiSupport = true;
|
||||||
boot.loader.grub.zfsSupport = true;
|
boot.loader.grub.zfsSupport = true;
|
||||||
boot.loader.grub.extraPrepareConfig = ''
|
|
||||||
mkdir -p /boot/efis
|
|
||||||
for i in /boot/efis/*; do mount $i ; done
|
|
||||||
|
|
||||||
mkdir -p /boot/efi
|
|
||||||
mount /boot/efi
|
|
||||||
'';
|
|
||||||
boot.loader.grub.extraInstallCommands = ''
|
boot.loader.grub.extraInstallCommands = ''
|
||||||
ESP_MIRROR=$(mktemp -d)
|
ESP_MIRROR=$(mktemp -d)
|
||||||
cp -r /boot/efi/EFI $ESP_MIRROR
|
cp -r ${config.boot.loader.efi.efiSysMountPoint}/EFI $ESP_MIRROR
|
||||||
for i in /boot/efis/*; do
|
for i in /boot/efis/*; do
|
||||||
cp -r $ESP_MIRROR/EFI $i
|
cp -r $ESP_MIRROR/EFI $i
|
||||||
done
|
done
|
||||||
@@ -69,6 +64,11 @@ System Configuration
|
|||||||
sed -i 's|fsType = "zfs";|fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ];|g' \
|
sed -i 's|fsType = "zfs";|fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ];|g' \
|
||||||
/mnt/etc/nixos/hardware-configuration.nix
|
/mnt/etc/nixos/hardware-configuration.nix
|
||||||
|
|
||||||
|
#. Mount EFI partitions on demand::
|
||||||
|
|
||||||
|
sed -i 's|fsType = "vfat";|fsType = "vfat"; options = [ "x-systemd.idle-timeout=1min" "x-systemd.automount" "noauto" "nofail" ];|g' \
|
||||||
|
/mnt/etc/nixos/hardware-configuration.nix
|
||||||
|
|
||||||
#. Set root password::
|
#. Set root password::
|
||||||
|
|
||||||
rootPwd=$(mkpasswd -m SHA-512 -s)
|
rootPwd=$(mkpasswd -m SHA-512 -s)
|
||||||
|
|||||||
Reference in New Issue
Block a user