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

extlinux-conf: fix cross compilation #51600

Merged
merged 1 commit into from Dec 19, 2018

Conversation

eburimu
Copy link
Contributor

@eburimu eburimu commented Dec 6, 2018

Motivation for this change

Fxs:

 9049 Device                                                                                                                                                                                   Boot  Start     End Sectors  Size Id Type
 9050 /nix/store/5aj337b2ww0ccijwipfygwkffhpl1ll0-nixos-sd-image-19.03.git.7a135ae-armv7l-linux.img-armv7l-unknown-linux-gnueabihf/sd-image/nixos-sd-image-19.03.git.7a135ae-armv7l-linux.img1 *     16384  262143  245760  120M  b W95 FAT32
 9051 /nix/store/5aj337b2ww0ccijwipfygwkffhpl1ll0-nixos-sd-image-19.03.git.7a135ae-armv7l-linux.img-armv7l-unknown-linux-gnueabihf/sd-image/nixos-sd-image-19.03.git.7a135ae-armv7l-linux.img2      262144 7146431 6884288  3.3G 83 Linux
 9052 
 9053 The partition table has been altered.
 9054 Syncing disks.
 9055 6859712+0 records in
 9056 6859712+0 records out
 9057 3512172544 bytes (3.5 GB, 3.3 GiB) copied, 98.8709 s, 35.5 MB/s
 9058 mkfs.fat 4.1 (2017-01-24)
 9059 /nix/store/mcnr9b07b2dc4wp1v3d5h0dncbiapx13-extlinux-conf-builder.sh-armv7l-unknown-linux-gnueabihf: line 38: /nix/store/bf2mqh9w16cszj6p0s7xb1fa19j49hj6-coreutils-8.30-armv7l-unknown-linux-gnueabihf/bin/mkdir: cannot execute binary\
       file: Exec format error
 9060 /nix/store/mcnr9b07b2dc4wp1v3d5h0dncbiapx13-extlinux-conf-builder.sh-armv7l-unknown-linux-gnueabihf: line 39: /nix/store/bf2mqh9w16cszj6p0s7xb1fa19j49hj6-coreutils-8.30-armv7l-unknown-linux-gnueabihf/bin/mkdir: cannot execute binary\
       file: Exec format error
 9061 /nix/store/mcnr9b07b2dc4wp1v3d5h0dncbiapx13-extlinux-conf-builder.sh-armv7l-unknown-linux-gnueabihf: line 107: ./boot/extlinux/extlinux.conf.tmp.296: No such file or directory
 9062 /nix/store/mcnr9b07b2dc4wp1v3d5h0dncbiapx13-extlinux-conf-builder.sh-armv7l-unknown-linux-gnueabihf: line 117: ./boot/extlinux/extlinux.conf.tmp.296: No such file or directory
 9063 /nix/store/mcnr9b07b2dc4wp1v3d5h0dncbiapx13-extlinux-conf-builder.sh-armv7l-unknown-linux-gnueabihf: line 132: /nix/store/bf2mqh9w16cszj6p0s7xb1fa19j49hj6-coreutils-8.30-armv7l-unknown-linux-gnueabihf/bin/mv: cannot execute binary f\
      ile: Exec format error
 9064 Copying bootcode.bin

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@matthewbauer
Copy link
Member

Could you instead override pkgs here:

builder = import ./extlinux-conf-builder.nix { inherit pkgs; };

So that

builder = import ./extlinux-conf-builder.nix { pkgs = pkgs.buildPackages; };

@eburimu
Copy link
Contributor Author

eburimu commented Dec 6, 2018

Could you instead override pkgs here:

nixpkgs/nixos/modules/system/boot/loader/generic-extlinux-compatible/default.nix

Line 11 in f17dd04
builder = import ./extlinux-conf-builder.nix { inherit pkgs; };

So that

builder = import ./extlinux-conf-builder.nix { pkgs = pkgs.buildPackages; };

I tried this and it fails since its called among other places.


 2651 [void@fermat:~/nixpkgs.PR]$ fgrep extlinux-conf-builder * -r
 2652 nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix:  extlinux-conf-builder =
 2653 nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix:    import ../../system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix {
 2654 nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix:        ${extlinux-conf-builder} -t 3 -c ${config.system.build.toplevel} -d ./boot
 2655 nixos/modules/installer/cd-dvd/sd-image-aarch64.nix:  extlinux-conf-builder =
 2656 nixos/modules/installer/cd-dvd/sd-image-aarch64.nix:    import ../../system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix {
 2657 nixos/modules/installer/cd-dvd/sd-image-aarch64.nix:        ${extlinux-conf-builder} -t 3 -c ${config.system.build.toplevel} -d ./boot
 2658 nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix:  extlinux-conf-builder =
 2659 nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix:    import ../../system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix {
 2660 nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix:        ${extlinux-conf-builder} -t 3 -c ${config.system.build.toplevel} -d ./boot
 2661 nixos/modules/system/boot/loader/raspberrypi/uboot-builder.nix:    import ../generic-extlinux-compatible/extlinux-conf-builder.nix {
 2662 nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix:  src = ./extlinux-conf-builder.sh;
 2663 nixos/modules/system/boot/loader/generic-extlinux-compatible/default.nix:  builder = import ./extlinux-conf-builder.nix { pkgs = pkgs.buildPackages; };

Let me know if you want to fix all of them.

@matthewbauer matthewbauer merged commit 92840ab into NixOS:staging Dec 19, 2018
@matthewbauer
Copy link
Member

This is okay for now. Thanks!

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