Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "nixos/raspberrypi-builder: fix cross using buildPackages" #97462

Merged
merged 1 commit into from Sep 9, 2020

Conversation

kampka
Copy link
Contributor

@kampka kampka commented Sep 8, 2020

Motivation for this change

The reverted commit enforces buildPackages in the builder but neglects the fact that the builder is intended to run on the target system. Because of that, the builder will fail when remotely building a configuration eg. with nixops or nix-copy-closure.

@sorki
Copy link
Member

sorki commented Sep 8, 2020

I see, thanks. I'm not sure what's the right way to fix it for both though. Maybe @matthewbauer can help.

Btw you should target master and cherry-pick to release-20.09 branch after it's merged.

Edit: similar fix for uBoot builder - 03ae0c0

@kampka kampka changed the base branch from release-20.09 to master September 8, 2020 18:13
The commit enforces buildPackages in the builder but neglects
the fact that the builder is intended to run on the target system.
Because of that, the builder will fail when remotely building a
configuration eg. with nixops or nix-copy-closure.

This reverts commit a6ac6d0.
@kampka
Copy link
Contributor Author

kampka commented Sep 8, 2020

I see, thanks. I'm not sure what's the right way to fix it for both though. Maybe @matthewbauer can help.

It's probably something like what @flokli did in 54129e7
Sadly, I don't have the time atm. to look too deep into this one.

Btw you should target master and cherry-pick to release-20.09 branch after it's merged.

Right, thanks.

@matthewbauer
Copy link
Member

Sorry about this! This looks okay - it does mean you can't cross-compile a sd-image and use boot.loader.raspberryPi.enable, but this is the case for most of the boot.loader.* anyway. To cross-compile an sd-image, we'll have to do something like this:

{ pkgs, lib, config, modulesPath, ... }:

let
  raspberrypi-conf-builder =
    import (modulesPath + "/system/boot/loader/raspberrypi/raspberrypi-builder.nix") {
      pkgs = pkgs.buildPackages;
      raspberrypifw = pkgs.raspberrypifw;
      configTxt = pkgs.writeText "config.txt" (''
        kernel=kernel.img
        initramfs initrd followkernel
      '' + config.boot.loader.raspberryPi.firmwareConfig);
    };
in {
  imports = [ (modulesPath + "/installer/cd-dvd/sd-image.nix") ];

  sdImage.populateFirmwareCommands = "${raspberrypi-conf-builder} -c ${config.system.build.toplevel} -d firmware";
}

@matthewbauer matthewbauer merged commit 58823ac into NixOS:master Sep 9, 2020
@sorki
Copy link
Member

sorki commented Sep 9, 2020

Thanks! I wonder if we should also revert 03ae0c0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants