Skip to content

Commit 075b880

Browse files
jpruiz84astro
authored andcommitted
fix: use target architecture binaries for disk volume creation
Use pkgs instead of pkgs.buildPackages to ensure e2fsprogs and other utilities are built for the target ARM64 architecture rather than the build x86 architecture. This resolves the "Exec format error" when running chattr and mkfs.ext4. Signed-off-by: Juan Pablo Ruiz <[email protected]>
1 parent e238645 commit 075b880

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ rec {
5555
then lib.escapeShellArgs mkfsExtraArgs
5656
else " ";
5757
in (lib.optionalString autoCreate ''
58-
PATH=$PATH:${with pkgs.buildPackages; lib.makeBinPath [ coreutils util-linux e2fsprogs xfsprogs dosfstools btrfs-progs ]}
58+
PATH=$PATH:${with pkgs; lib.makeBinPath [ coreutils util-linux e2fsprogs xfsprogs dosfstools btrfs-progs ]}
5959
6060
if [ ! -e '${image}' ]; then
6161
touch '${image}'

lib/runner.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ let
3030
microvm-run = ''
3131
set -eou pipefail
3232
${preStart}
33-
${createVolumesScript pkgs.buildPackages microvmConfig.volumes}
33+
${createVolumesScript pkgs microvmConfig.volumes}
3434
${lib.optionalString (hypervisorConfig.requiresMacvtapAsFds or false) openMacvtapFds}
3535
3636
exec ${execArg} ${command}

0 commit comments

Comments
 (0)