From e8d4211c7c9eedec21e2c2623be5e44f60c575ff Mon Sep 17 00:00:00 2001 From: matthewcroughan Date: Thu, 24 Nov 2022 18:33:42 +0000 Subject: [PATCH 1/2] justdoit: set -f on zpool create This fixes the case where justdoit has previously been used on a disk before, where /dev/sda3 may contain an existing ZFS member signature/label for example. This would usually have to be cleared by zpool clearlabel, but passing -f to zpool create also works ``` > + zpool create -o ashift=12 -o altroot=/mnt tank /dev/sda3 > invalid vdev specification > use '-f' to override the following errors: > /dev/sda3 is part of potentially active pool 'tank' ``` --- kexec/justdoit.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kexec/justdoit.nix b/kexec/justdoit.nix index b261a16..f90da97 100644 --- a/kexec/justdoit.nix +++ b/kexec/justdoit.nix @@ -92,7 +92,7 @@ in { ${mkBootTable.${cfg.bootType}} mkswap $SWAP_DEVICE -L NIXOS_SWAP - zpool create -o ashift=12 -o altroot=/mnt ${cfg.poolName} $ROOT_DEVICE + zpool create -f -o ashift=12 -o altroot=/mnt ${cfg.poolName} $ROOT_DEVICE zfs create -o mountpoint=legacy ${cfg.poolName}/root zfs create -o mountpoint=legacy ${cfg.poolName}/home zfs create -o mountpoint=legacy ${cfg.poolName}/nix From aedacd00daa97847d730fffcb255eb837e3bd4e9 Mon Sep 17 00:00:00 2001 From: matthewcroughan Date: Thu, 24 Nov 2022 18:35:25 +0000 Subject: [PATCH 2/2] justdoit: set bootType to vfat if uefi is true Without this, ext4 would always be used, even if uefi is true, which is incorrect --- kexec/justdoit.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kexec/justdoit.nix b/kexec/justdoit.nix index f90da97..e9870b3 100644 --- a/kexec/justdoit.nix +++ b/kexec/justdoit.nix @@ -19,7 +19,7 @@ in { }; bootType = mkOption { type = types.enum [ "ext4" "vfat" "zfs" ]; - default = "ext4"; + default = if cfg.uefi then "vfat" else "ext4"; }; swapSize = mkOption { type = types.int;