Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mobile-nixos/mobile-nixos
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2cd23f337039
Choose a base ref
...
head repository: mobile-nixos/mobile-nixos
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a1c0e42c09fa
Choose a head ref

Commits on Apr 4, 2020

  1. Copy the full SHA
    daf2bf2 View commit details
  2. Copy the full SHA
    c3ec672 View commit details
  3. Copy the full SHA
    0969d5f View commit details
  4. Copy the full SHA
    c19eff7 View commit details
  5. Copy the full SHA
    3526c71 View commit details
  6. Copy the full SHA
    62508ba View commit details
  7. pine64-pinephone-braveheart: Fix device specific notes

    The headings have been pushed one lower.
    samueldr committed Apr 4, 2020
    Copy the full SHA
    2e597af View commit details
  8. Copy the full SHA
    4436184 View commit details
  9. Copy the full SHA
    d020fd3 View commit details
  10. Copy the full SHA
    dd262a6 View commit details
  11. doc: Add fluff in getting started

    Most of that fluff is about an upcoming feature, for per-device pages.
    samueldr committed Apr 4, 2020
    Copy the full SHA
    44e6c84 View commit details
  12. Copy the full SHA
    a8601c2 View commit details
  13. Copy the full SHA
    fc5d5f0 View commit details
  14. doc: Build a table for devices

    Still linking to the GitHub pages, but still a step forward.
    samueldr committed Apr 4, 2020
    Copy the full SHA
    df373d7 View commit details
  15. Copy the full SHA
    86065c8 View commit details
  16. Copy the full SHA
    ec34156 View commit details
  17. Copy the full SHA
    5a91f40 View commit details
  18. doc: Rework the devices table

    Put the identifier first, since this is what they're sorted on.
    
    Then, put Manufacturer and Name in their own column.
    samueldr committed Apr 4, 2020
    Copy the full SHA
    ae2be46 View commit details
  19. release-tools: Split useful Mobile NixOS evaluation tools

    This is to be used by the documentation system, without requiring to
    repeat all of the code.
    samueldr committed Apr 4, 2020
    Copy the full SHA
    9179158 View commit details
  20. Copy the full SHA
    75a0d1a View commit details
  21. Copy the full SHA
    b503267 View commit details
  22. Copy the full SHA
    81b0e73 View commit details
  23. doc: Generate the device-specific docs via a script

    Rather than use ugly nix-templated bash.
    samueldr committed Apr 4, 2020
    Copy the full SHA
    96b82fc View commit details
  24. Copy the full SHA
    02ab206 View commit details

Commits on Apr 5, 2020

  1. doc: Add support for system-specific notes

    Using Erb they are templated.
    samueldr committed Apr 5, 2020
    Copy the full SHA
    05d2983 View commit details
  2. Copy the full SHA
    edaa1ee View commit details
  3. Copy the full SHA
    8f09f86 View commit details
  4. android: Add device notes

    samueldr committed Apr 5, 2020
    Copy the full SHA
    4f66599 View commit details
  5. Merge pull request #120 from samueldr-wip/docs/improvements

    doc: Add per-device pages
    samueldr authored Apr 5, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a1c0e42 View commit details
4 changes: 2 additions & 2 deletions devices/asus-dumo/default.nix
Original file line number Diff line number Diff line change
@@ -4,8 +4,8 @@
mobile.device.name = "asus-dumo";
mobile.device.info = rec {
format_version = "0";
name = "ASUS Chromebook Tablet CT100PA";
manufacturer = "ASUS";
name = "Chromebook Tablet CT100PA";
manufacturer = "Asus";
arch = "aarch64";
keyboard = false;
external_storage = true;
2 changes: 1 addition & 1 deletion devices/google-walleye/README.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
= Google Pixel 2
include::_support/common.inc[]

== Device-specific note
== Device-specific notes

=== Serial access

2 changes: 1 addition & 1 deletion devices/google-walleye/default.nix
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
{
mobile.device.name = "google-walleye";
mobile.device.info = rec {
name = "Google Pixel 2";
name = "Pixel 2";
# TODO : make kernel part of options.
kernel = pkgs.callPackage ./kernel { kernelPatches = pkgs.defaultKernelPatches; };

2 changes: 1 addition & 1 deletion devices/motorola-addison/default.nix
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
mobile.device.name = "motorola-addison";
mobile.device.info = rec {
format_version = "0";
name = "Motorola Moto Z Play";
name = "Moto Z Play";
manufacturer = "Motorola";
date = "";
modules_initfs = "";
3 changes: 1 addition & 2 deletions devices/oneplus-oneplus3/README.adoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
= Oneplus Oneplus 3
include::_support/common.inc[]
:sitemap_index: true

== Device-specific note
== Device-specific notes

Using `fastboot` to burn system.img to the userdata partition will fail.

2 changes: 1 addition & 1 deletion devices/oneplus-oneplus3/default.nix
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
mobile.device.name = "oneplus-oneplus3";
mobile.device.info = rec {
format_version = "0";
name = "OnePlus OnePlus 3";
name = "OnePlus 3";
manufacturer = "OnePlus";
date = "";
dtb = "";
12 changes: 7 additions & 5 deletions devices/pine64-pinephone-braveheart/README.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
= PinePhone “BraveHeart”
include::_support/common.inc[]

== Building a full disk image
== Device-specific notes

=== Building a full disk image

This platform uses the `u-boot` system-type. This means that a full disk image
can be produced, and this full disk image flashed _outright_ to the block
@@ -16,7 +18,7 @@ booting it.
$ dd if=result of=/dev/mmcblkX bs=8M oflag=sync,direct status=progress
```

== Building the boot partition
=== Building the boot partition

Building the full disk image may require a native AArch64 system.

@@ -28,7 +30,7 @@ NixOS boot partition.
$ dd if=result/mobile-nixos-boot.img of=/dev/mmcblkXp1 bs=8M oflag=sync,direct status=progress
```

== Building U-Boot
=== Building U-Boot

Flashing the boot partition will not affect the installed U-Boot bootloader.

@@ -39,9 +41,9 @@ U-Boot can be built and then flashed the usual way for Allwinner platforms.
$ dd if=result/u-boot-sunxi-with-spl.bin of=/dev/mmcblkX bs=1024 seek=8
```

== Usage notes
=== Usage notes

=== LED
==== LED

In the default setup, the LED has been configured to show status information.
Its colour or pattern can be used to infer the status.
2 changes: 1 addition & 1 deletion devices/xiaomi-lavender/README.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
= Xiaomi Redmi Note 7
include::_support/common.inc[]

== Device-specific note
== Device-specific notes

=== `fastboot oem getlog`

2 changes: 1 addition & 1 deletion devices/xiaomi-lavender/default.nix
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
# TODO : make kernel part of options.
kernel = pkgs.callPackage ./kernel { kernelPatches = pkgs.defaultKernelPatches; };
format_version = "0";
name = "Xiaomi Redmi Note 7";
name = "Redmi Note 7";
manufacturer = "Xiaomi";
codename = "xiaomi-lavender";
modules_initfs = "";
3 changes: 2 additions & 1 deletion devices/xiaomi-tissot/default.nix
Original file line number Diff line number Diff line change
@@ -4,7 +4,8 @@ let
in {
mobile.device.name = "xiaomi-tissot";
mobile.device.info = {
name = "Xiaomi A1";
name = "A1";
manufacturer = "Xiaomi";
screen_width = 1080;
screen_height = 1920;
kernel_cmdline = "androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 androidboot.bootdevice=7824900.sdhci earlycon=msm_hsl_uart,0x78af000 androidboot.selinux=permissive buildvariant=eng";
78 changes: 28 additions & 50 deletions doc/_support/devices/default.nix
Original file line number Diff line number Diff line change
@@ -1,56 +1,34 @@
{ stdenv, nix }:
{ pkgs
, stdenv
, glibcLocales
, runCommandNoCC
, symlinkJoin
, ruby
}:

let
deviceURL = "https://github.com/NixOS/mobile-nixos/tree/master/devices/";
# Release tools used to evaluate the devices metadata.
mobileReleaseTools = (import ../../../lib/release-tools.nix);
inherit (mobileReleaseTools) all-devices;
inherit (mobileReleaseTools.withPkgs pkgs) evalFor;

devicesDir = ../../../devices;
devicesInfo = symlinkJoin {
name = "devices-metadata";
paths = (map (device: (evalFor device).build.device-metadata) all-devices);
};
systemTypesDir = ../../../modules/system-types;
in

# This is only a minimalist gets-us-a-website list of devices.
# TODO : One page per device, with better and more automated information gathering.
stdenv.mkDerivation {
name = "mobile-nixos-docs-devices";
src = ./.;

buildInputs = [ nix ];

buildPhase = ''
export NIX_STATE_DIR=$PWD/nix-state
mkdir -p $out/devices
(cd $out
cat <<EOF > devices/index.adoc
= Devices List
include::_support/common.inc[]
:generated: true
List of devices in the master branch:
EOF
)
(cd ${devicesDir}
for d in $(ls | sort); do
if [ -d "$d" ]; then
echo " - $d"
name=$(
nix-instantiate --eval --arg config null --arg lib null --arg pkgs null $d -A mobile.device.info.name \
| sed -e 's/^"//' -e 's/"$//'
)
echo " * link:${deviceURL}$d[$name]" >> $out/devices/index.adoc
fi
done
)
(cd $out
cat <<EOF >> devices/index.adoc
A more comprehensive device documentation is coming.
Remember to look at the link:https://github.com/NixOS/mobile-nixos/pulls?q=is%3Aopen+is%3Apr+label%3A%22type%3A+port%22[port label]
on the Mobile NixOS pull requests tracker, for upcoming devices.
EOF
)
'';
dontInstall = true;
runCommandNoCC "mobile-nixos-docs-devices" {
nativeBuildInputs = [
ruby
glibcLocales
];
inherit devicesDir devicesInfo systemTypesDir;
}
''
mkdir -p $out/devices
export LC_CTYPE=en_US.UTF-8
ruby ${./generate-devices-listing.rb}
''
130 changes: 130 additions & 0 deletions doc/_support/devices/generate-devices-listing.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
require "erb"
require "json"

def githubURL(device)
"https://github.com/NixOS/mobile-nixos/tree/master/devices/#{device}"
end

def hydraURL(device)
# Yes, x86_64-linux is by design.
# We're using the pre-built images, cross-compiled.
# If we used the native arch, we'd be in trouble with armv7l.
"https://hydra.nixos.org/job/mobile-nixos/unstable/device.#{device}.x86_64-linux"
end

NOTES_HEADER = "== Device-specific notes"

COLUMNS = [
{ key: "identifier", name: "Identifier" },
{ key: "manufacturer", name: "Manufacturer" },
{ key: "name", name: "Name" },
{ key: "hardware.soc", name: "SoC" },
]

$out = ENV["out"]
$devicesInfo = Dir.glob(File.join(ENV["devicesInfo"], "*")).sort.map do |filename|
data = JSON.parse(File.read(filename))
[data["identifier"], data]
end.to_h
$devicesDir = ENV["devicesDir"]
$systemTypesDir = ENV["systemTypesDir"]

# First, generate the devices listing.
puts ":: Generating devices/index.adoc"
File.open(File.join($out, "devices/index.adoc"), "w") do |file|
file.puts <<~EOF
= Devices List
include::_support/common.inc[]
:sitemap_index: true
:generated: true
The following table lists all devices Mobile NixOS available out of the
box on the master branch.
The inclusion in this list does not guarantee the device can boot Mobile
NixOS, but only that it did at one point in the past. Though, efforts are
made to ensure all of these still work.
[.with-links%autowidth]
|===
#{COLUMNS.map {|col| "| #{col[:name]}" }.join("")}
EOF

$devicesInfo.keys.sort.each do |identifier|
data = $devicesInfo[identifier]
COLUMNS.each do |col|
value = data.dig(*(col[:key].split(".")))
if col[:key] == "identifier"
file.puts("|<<#{identifier}.adoc#,`#{value}`>>")
else
file.puts("|<<#{identifier}.adoc#,#{value}>>")
end
end
end

file.puts <<~EOF
|===
Remember to look at the link:https://github.com/NixOS/mobile-nixos/pulls?q=is%3Aopen+is%3Apr+label%3A%22type%3A+port%22[port label]
on the Mobile NixOS pull requests tracker, for upcoming devices.
EOF
end

# Then generate per-device pages
$devicesInfo.values.each do |info|
identifier = info["identifier"]
puts ":: Generating devices/#{identifier}.adoc"
File.open(File.join($out, "devices/#{identifier}.adoc"), "w") do |file|
# TODO: include picture if available.

# Generate the side-bar
file.puts <<~EOF
= #{info["fullName"]}
include::_support/common.inc[]
:generated: true
[.device-sidebar]
.#{info["fullName"]}
****
Manufacturer:: #{info["manufacturer"]}
Name:: #{info["name"]}
Identifier:: #{info["identifier"]}
System Type:: #{info["system"]["type"]}
SoC:: #{info["hardware"]["soc"]}
Architecture:: #{info["system"]["system"]}
Source:: link:#{githubURL(identifier)}[Mobile NixOS repository]
Builds:: link:#{hydraURL(identifier)}[Hydra (`default` build)]
****
EOF

# Generate the page contents

systemTypeFile = File.join($systemTypesDir, info["system"]["type"], "device-notes.adoc.erb")
if File.exists?(systemTypeFile)
template = ERB.new(File.read(systemTypeFile))
file.puts(template.result(binding))
else
file.puts("\n_(No system-specific notes available)_\n\n")
end

deviceNotesFile = File.join($devicesDir, identifier, "README.adoc")
if File.exists?(deviceNotesFile)
notes = File.read(deviceNotesFile).split("\n\n", 2).last.strip
first_line = notes.lines.first.strip
unless first_line == NOTES_HEADER
$stderr.puts(
"Unexpected device-specific notes header for %s.",
"\tGot: #{first_line.inspect}",
"\tExpected: #{NOTES_HEADER.inspect}",
)
exit 1
end
file.puts(notes)
else
file.puts("\n_(No device-specific notes available)_\n\n")
end
end
end
9 changes: 9 additions & 0 deletions doc/_support/styles/asciidoc-fixes.less
Original file line number Diff line number Diff line change
@@ -3,3 +3,12 @@
li > p:first-child:last-child {
margin: 0;
}

p.tableblock:last-child {
margin-bottom: 0;
}

pre > code {
padding-left: 0;
padding-right: 0;
}
4 changes: 4 additions & 0 deletions doc/_support/styles/asciidoc.less
Original file line number Diff line number Diff line change
@@ -29,3 +29,7 @@
.imageblock {
margin-bottom: 1em;
}

table.stretch {
width: 100%;
}
Loading