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

Cross-compile configuration for reMarkable 2 tablet #105432

Merged
merged 1 commit into from Dec 1, 2020

Conversation

tadfisher
Copy link
Contributor

@tadfisher tadfisher commented Nov 30, 2020

Motivation for this change

Following in the footsteps of @siraben's work in #102503, add toolchain support for the reMarkable 2 tablet:

  • lib.systems.examples.remarkable2
  • lib.systems.platforms.zero-sugar

Where the platform differs from zero-gravitas is the target machine-specific options, which support the i.MX 7Dual in the reMarkable 2. In particular, imx7d gains the extra features of the armv7ve arch and an upgrade to the VFPv4 FPU. Otherwise, this is a copy-paste of the reMarkable 1 configuration.

This has been tested by installing Nix on the tablet and using nix-copy-closure to install cross-compiled packages. Packages tested so far:

  • hello
  • nix
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@siraben
Copy link
Member

siraben commented Nov 30, 2020

@tadfisher Nice! I don't have an rM 2 to test but looks good to me.

This has been tested by installing Nix on the tablet and using nix-copy-closure to install cross-compiled packages.

What was your procedure for installing Nix on the tablet? Are you able to cross-compile Nix itself?

Edit: I was able to cross-compile and install Nix on the tablet but some of its dependencies (e.g. bash) were compiled for the wrong arch, so I am unsure if this is an issue with the cross build or Nix itself.

@tadfisher
Copy link
Contributor Author

What was your procedure for installing Nix on the tablet? Are you able to cross-compile Nix itself? — @siraben

I followed your instructions in https://discourse.nixos.org/t/done-remarkable1-cross-compile-toolchain-for-nix/9961/18 and installed the prebuilt Nix from https://github.com/DavHau/nix-on-armv7l.

I'm building Nix now, we'll see what happens.

@tadfisher
Copy link
Contributor Author

Cross-compiled Nix appears to work:

reMarkable: ~/ /nix/store/xmk3w74wsq285sjjlzxwbwfyzbxa9vd4-nix-2.3.9-armv7l-unknown-linux-gnueabihf/bin/nix eval 'nixpkgs.hostPlatform.system'
"armv7l-linux"

@siraben
Copy link
Member

siraben commented Dec 1, 2020

@tadfisher Are you able to install it nix-env -i and use it? Try lauching nix-shell on the device and so on.

@siraben
Copy link
Member

siraben commented Dec 1, 2020

@Ericson2314 This is non-blocking, feel free to merge.

@tadfisher
Copy link
Contributor Author

tadfisher commented Dec 1, 2020

Are you able to install it nix-env -i and use it? Try lauching nix-shell on the device and so on. — @siraben

Yes, I ran nix-env -u /nix/store/<hash>-nix-2.3.9-armv7l-unknown-linux-gnueabihf and it replaced the prebuilt nix installation in my user profile. It continues to work fine.

@Ericson2314
Copy link
Member

Thanks!

@Ericson2314 Ericson2314 merged commit b1d16d8 into NixOS:master Dec 1, 2020
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/done-remarkable1-cross-compile-toolchain-for-nix/9961/19

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

4 participants