Skip to content

uneeded builds when using binfmt for a crossSystem #988

@meck

Description

@meck

I'm cross compiling a system for armv7 and trying to use disko to write an sd-card.

In the Im doing a writeShellScript that references ubootAmx335xEVM (an armv7 only build).
and adding to environment.systemPackages.

I'm using binfmt while building the sdcard

disko.imageBuilder = {
  enableBinfmt = true;
  pkgs = pkgs.buildPackages;
  kernelPackages = pkgs.buildPackages.linuxPackages_latest;
};

When running the build (on an x86 host) the following line in make-disk-image.nix seems
to try to build ubootAmx335xEVM using x86 gcc which fails.

ln -sfn ${systemToInstallNative.config.system.build.etc}/etc/udev/rules.d /etc/udev/rules.d

The issue can be workaround by doing:

environment.systemPackages = lib.mkIf (pkgs.stdenv.hostPlatform == "armv7l-linux") [
  update-bootloader
];

However it seems a lot of unnecary packages ar build in this situation when refrencing systemToInstallNative.config.system.build.etc just to get the udev rules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions