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

Add installer script to android device output #87

Merged
merged 2 commits into from Mar 2, 2020

Conversation

samueldr
Copy link
Member

@samueldr samueldr commented Mar 2, 2020

It will install to both A/B slots, and to the boot, and recovery partitions.

To be used like so:

 $ nix-build --argstr device google-walleye -A build.android-device
 $ result/flash-critical.sh

This is not documented as being "the way" to install on devices yet since this is almost unusable as it is right now.

The android-device output assumes a rootfs can be built. The current defaults cannot build a usable rootfs when cross-compiling.

This can be worked around like so:

local.nix

{ lib, pkgs, ... }:

{
  system.build.rootfs = (pkgs.runCommandNoCC "dummy-rootfs" {
    passthru = {
      filename = "dummy.img";
    };
  } ''
    mkdir -p $out/
    touch $out/dummy.img
  '');
}

Though, this points to a wart: this does not use lib.mkForce or anything similar. Using lib.mkForce seemingly does not work for system.build. I'm not even sure why this works.

TODO

  • Make a usable rootfs when cross-compiling

Either through forcing a dummy image by default, or preferred, making a small "placeholder" nixos system that boots to an LVGL app in stage-2. (That LVGL app could be a hardware test app...)

This script will flash the "critical" bits to the device.

Though note that this will flash both A/B slots unconditionally.

Similarly, this will flash both the boot and recovery partitions.
@samueldr
Copy link
Member Author

samueldr commented Mar 2, 2020

Small note: with this change, we copy the outputs, rather than symlink, which makes this take more space on the filesystem.

@samueldr samueldr merged commit abd360b into NixOS:master Mar 2, 2020
@samueldr samueldr deleted the feature/installer-script branch March 2, 2020 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant