1
0
mirror of https://github.com/tboerger/nixos-config synced 2024-11-23 03:32:08 +01:00

chore: hopefully fixing non-efi boot

This commit is contained in:
Thomas Boerger 2022-10-25 16:49:36 +02:00
parent 88d1fa9b21
commit 2cdc9f7864
No known key found for this signature in database
GPG Key ID: 09745AFF9D63C79B
3 changed files with 14 additions and 13 deletions

@ -15,7 +15,7 @@
grub = { grub = {
enable = true; enable = true;
version = 2; version = 2;
device = "nodev"; device = "/dev/disk/by-path/pci-0000:00:14.1-ata-1";
efiSupport = false; efiSupport = false;
}; };
}; };

@ -23,12 +23,15 @@ while true; do
done done
echo "----> Drop existing partitions" echo "----> Drop existing partitions"
sgdisk --zap-all /dev/sda wipefs -a /dev/sda
sgdisk -og /dev/sda sfdisk --delete /dev/sda
echo "-----> Wait for cleanup" echo "-----> Wait for cleanup"
sleep 3 sleep 3
echo "-----> Mark GPT disk"
echo yes | parted /dev/sda -- mklabel gpt
echo "-----> Create boot partition" echo "-----> Create boot partition"
sgdisk -n 0:0:+1G -t 0:ef00 -c 0:boot /dev/sda sgdisk -n 0:0:+1G -t 0:ef00 -c 0:boot /dev/sda
@ -79,9 +82,6 @@ mount -t ext4 /dev/system/home /mnt/home
echo "-----> Create boot filesystem" echo "-----> Create boot filesystem"
mkfs.vfat -n boot /dev/disk/by-partlabel/boot mkfs.vfat -n boot /dev/disk/by-partlabel/boot
echo "-----> Wait for boot"
sleep 3
echo "-----> Mount boot filesystem" echo "-----> Mount boot filesystem"
mkdir /mnt/boot mkdir /mnt/boot
mount /dev/disk/by-label/boot /mnt/boot mount /dev/disk/by-label/boot /mnt/boot

@ -23,14 +23,18 @@ while true; do
done done
echo "----> Drop existing partitions" echo "----> Drop existing partitions"
sgdisk --zap-all /dev/sda wipefs -a /dev/sda
sgdisk -og /dev/sda sfdisk --delete /dev/sda
sgdisk --zap-all /dev/sdb wipefs -a /dev/sdb
sgdisk -og /dev/sdb sfdisk --delete /dev/sdb
echo "-----> Wait for cleanup" echo "-----> Wait for cleanup"
sleep 3 sleep 3
echo "-----> Mark GPT disk"
echo yes | parted /dev/sda -- mklabel gpt
echo yes | parted /dev/sdb -- mklabel gpt
echo "-----> Create boot partition" echo "-----> Create boot partition"
sgdisk -n 0:0:+1G -t 0:ef00 -c 0:boot /dev/sda sgdisk -n 0:0:+1G -t 0:ef00 -c 0:boot /dev/sda
@ -78,9 +82,6 @@ mount -t ext4 /dev/system/home /mnt/home
echo "-----> Create boot filesystem" echo "-----> Create boot filesystem"
mkfs.vfat -n boot /dev/disk/by-partlabel/boot mkfs.vfat -n boot /dev/disk/by-partlabel/boot
echo "-----> Wait for boot"
sleep 3
echo "-----> Mount boot filesystem" echo "-----> Mount boot filesystem"
mkdir /mnt/boot mkdir /mnt/boot
mount /dev/disk/by-label/boot /mnt/boot mount /dev/disk/by-label/boot /mnt/boot