Hello,
I’m trying to build an image for a raspberry 2. To do so, I’ve written the following flake.nix
(taken from a wiki)
{
description = "Build image";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
outputs = { self, nixpkgs }: rec {
nixosConfigurations.rpi2 = nixpkgs.lib.nixosSystem {
modules = [
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-raspberrypi.nix"
{
nixpkgs.config.allowUnsupportedSystem = true;
nixpkgs.hostPlatform.system = "armv7l-linux";
nixpkgs.buildPlatform.system = "x86_64-linux"; #If you build on x86 other wise changes this.
# ... extra configs as above
system.stateVersion = "25.05";
}
];
};
images.rpi2 = nixosConfigurations.rpi2.config.system.build.sdImage;
};
}
then nix build .#images.rpi2
. However, this fails with
error: builder for '/nix/store/nwwa1z7h7hsypywxb9ybv2qjdryfi2rb-efivar-armv7l-unknown-linux-gnueabihf-39.drv' failed with exit code 2;
last 25 log lines:
> | long unsigned int
> | %llx
> 364 | iter->esl->signature_list_size,
> 365 | (intmax_t)(iter->len - iter->offset), iter->offset);
> | ~~~~~~~~~~~~
> | |
> | off_t {aka long long int}
> esl-iter.c:396:29: error: cast to pointer from integer of different size [8;;https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Warning-Options.html#index-Wint-to-pointer-cast-Werror=int-to-pointer-cast8;;]
> 396 | iter->esl = (efi_signature_list_t *)((intptr_t)iter->buf
> | ^
> esl-iter.c:414:74: error: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'off_t' {aka 'long long int'} [8;;https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Warning-Options.html#index-Wformat-Werror=format=8;;]
> 414 | warnx("correcting ESL size from %d to %jd at 0x%lx",
> | ~~^
> | |
> | long unsigned int
> | %llx
> 415 | iter->esl->signature_list_size,
> 416 | (intmax_t)(iter->len - iter->offset), iter->offset);
> | ~~~~~~~~~~~~
> | |
> | off_t {aka long long int}
> cc1: all warnings being treated as errors
> make[1]: *** [/build/source/src/include/rules.mk:53: esl-iter.o] Error 1
> make[1]: Leaving directory '/build/source/src'
> make: *** [Makefile:17: all] Error 2
For full logs, run 'nix log /nix/store/nwwa1z7h7hsypywxb9ybv2qjdryfi2rb-efivar-armv7l-unknown-linux-gnueabihf-39.drv'.
The full log is
armv7l-unknown-linux-gnueabihf-gcc -Og -g3 -Wall -Wextra -Werror -std=gnu11 -funsigned-char -fvisibility=hidden -specs=/build/source/src/include/gcc.specs -fno-merge-constants -fPIC -DLIBEFIVAR_VERSION=39 ->
armv7l-unknown-linux-gnueabihf-gcc -Og -g3 -Wall -Wextra -Werror -std=gnu11 -funsigned-char -fvisibility=hidden -specs=/build/source/src/include/gcc.specs -fno-merge-constants -fPIC -DLIBEFIVAR_VERSION=39 ->
armv7l-unknown-linux-gnueabihf-gcc -Og -g3 -Wall -Wextra -Werror -std=gnu11 -funsigned-char -fvisibility=hidden -specs=/build/source/src/include/gcc.specs -fno-merge-constants -fPIC -DLIBEFIVAR_VERSION=39 ->
armv7l-unknown-linux-gnueabihf-gcc -Og -g3 -Wall -Wextra -Werror -std=gnu11 -funsigned-char -fvisibility=hidden -specs=/build/source/src/include/gcc.specs -fno-merge-constants -fPIC -DLIBEFIVAR_VERSION=39 ->
armv7l-unknown-linux-gnueabihf-gcc -Og -g3 -Wall -Wextra -Werror -std=gnu11 -funsigned-char -fvisibility=hidden -specs=/build/source/src/include/gcc.specs -fno-merge-constants -fPIC -DLIBEFIVAR_VERSION=39 ->
armv7l-unknown-linux-gnueabihf-gcc -Og -g3 -Wall -Wextra -Werror -std=gnu11 -funsigned-char -fvisibility=hidden -specs=/build/source/src/include/gcc.specs -fno-merge-constants -fPIC -DLIBEFIVAR_VERSION=39 ->
armv7l-unknown-linux-gnueabihf-gcc -Og -g3 -Wall -Wextra -Werror -std=gnu11 -funsigned-char -fvisibility=hidden -specs=/build/source/src/include/gcc.specs -fno-merge-constants -fPIC -DLIBEFIVAR_VERSION=39 ->
armv7l-unknown-linux-gnueabihf-gcc -Og -g3 -Wall -Wextra -Werror -std=gnu11 -funsigned-char -fvisibility=hidden -specs=/build/source/src/include/gcc.specs -fno-merge-constants -fPIC -DLIBEFIVAR_VERSION=39 ->
armv7l-unknown-linux-gnueabihf-gcc -Og -g3 -Wall -Wextra -Werror -std=gnu11 -funsigned-char -fvisibility=hidden -specs=/build/source/src/include/gcc.specs -fno-merge-constants -fPIC -DLIBEFIVAR_VERSION=39 ->
armv7l-unknown-linux-gnueabihf-gcc -Og -g3 -Wall -Wextra -Werror -std=gnu11 -funsigned-char -fvisibility=hidden -specs=/build/source/src/include/gcc.specs -fno-merge-constants -fPIC -DLIBEFIVAR_VERSION=39 ->
armv7l-unknown-linux-gnueabihf-gcc -Og -g3 -Wall -Wextra -Werror -std=gnu11 -funsigned-char -fvisibility=hidden -specs=/build/source/src/include/gcc.specs -fno-merge-constants -fPIC -DLIBEFIVAR_VERSION=39 ->
armv7l-unknown-linux-gnueabihf-gcc -Og -g3 -Wall -Wextra -Werror -std=gnu11 -funsigned-char -fvisibility=hidden -specs=/build/source/src/include/gcc.specs -fno-merge-constants -fPIC -DLIBEFIVAR_VERSION=39 ->
armv7l-unknown-linux-gnueabihf-gcc -Og -g3 -Wall -Wextra -Werror -std=gnu11 -funsigned-char -fvisibility=hidden -specs=/build/source/src/include/gcc.specs -fno-merge-constants -L. -Wl,--build-id -Wl,--no-a>
ln -vfs libefiboot.so libefiboot.so.1
'libefiboot.so.1' -> 'libefiboot.so'
armv7l-unknown-linux-gnueabihf-gcc -Og -g3 -Wall -Wextra -Werror -std=gnu11 -funsigned-char -fvisibility=hidden -specs=/build/source/src/include/gcc.specs -fno-merge-constants -fPIC -DLIBEFIVAR_VERSION=39 ->
armv7l-unknown-linux-gnueabihf-gcc -Og -g3 -Wall -Wextra -Werror -std=gnu11 -funsigned-char -fvisibility=hidden -specs=/build/source/src/include/gcc.specs -fno-merge-constants -fPIC -DLIBEFIVAR_VERSION=39 ->
armv7l-unknown-linux-gnueabihf-gcc -Og -g3 -Wall -Wextra -Werror -std=gnu11 -funsigned-char -fvisibility=hidden -specs=/build/source/src/include/gcc.specs -fno-merge-constants -fPIC -DLIBEFIVAR_VERSION=39 ->
esl-iter.c: In function 'esl_list_iter_next_with_size_correction':
esl-iter.c:338:80: error: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'off_t' {aka 'long long int'} [-Werror=format=]
338 | warnx("correcting ESL size from %d to %jd at %lx",
| ~~^
| |
| long unsigned int
| %llx
339 | iter->esl->signature_list_size,
340 | (intmax_t)(iter->len - iter->offset), iter->offset);
| ~~~~~~~~~~~~
| |
| off_t {aka long long int}
esl-iter.c:363:82: error: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'off_t' {aka 'long long int'} [-Werror=format=]
363 | warnx("correcting ESL size from %d to %jd at 0x%lx",
| ~~^
| |
| long unsigned int
| %llx
364 | iter->esl->signature_list_size,
365 | (intmax_t)(iter->len - iter->offset), iter->offset);
| ~~~~~~~~~~~~
| |
| off_t {aka long long int}
esl-iter.c:396:29: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
396 | iter->esl = (efi_signature_list_t *)((intptr_t)iter->buf
| ^
esl-iter.c:414:74: error: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'off_t' {aka 'long long int'} [-Werror=format=]
414 | warnx("correcting ESL size from %d to %jd at 0x%lx",
| ~~^
| |
| long unsigned int
| %llx
415 | iter->esl->signature_list_size,
416 | (intmax_t)(iter->len - iter->offset), iter->offset);
| ~~~~~~~~~~~~
| |
| off_t {aka long long int}
cc1: all warnings being treated as errors
make[1]: *** [/build/source/src/include/rules.mk:53: esl-iter.o] Error 1
make[1]: Leaving directory '/build/source/src'
make: *** [Makefile:17: all] Error 2
Does anyone have an idea on how to make it work?