f777cbdadb
The algorithms inside `make_ext4fs` can be followed, but it ends up being a bit complex. I did not figure out all variables, but the amount of them made me reluctant to implement it as a complte formula. Instead, I looked at the actual usable space using `df` and mapped it in a spreadsheet. With the knowledge from actively looking at the source code, and other data, it is known that the lookup table will work, while not be ideal. The fudge factor starting at 256MiB is about stable, but there is a slight downward deviation at 512MiB, which is why 512MiB was used. The downward deviation was not observed in other values. Here's the table as computed. ``` MIB Fudge 5 0.84609375 8 0.5419921875 16 0.288818359375 32 0.1622314453125 64 0.09893798828125 128 0.067291259765625 256 0.0518646240234375 512 0.05208587646484375 1024 0.048187255859375 2048 0.04060554504394531 4096 0.03718090057373047 ``` The difference from .52% to .37% is negligible for 0.5 vs. 4 GiB is annoying me. The lookup table could be changed to include all known values instead, I guess. |
||
---|---|---|
artwork | ||
bin | ||
devices | ||
doc | ||
lib | ||
modules | ||
nixos | ||
overlay | ||
systems | ||
.gitignore | ||
default.nix | ||
LICENSE | ||
README.md | ||
shell.nix | ||
system-image.nix |
Mobile NixOS
An overlay for building stuff.
This is a work-in-progress.
WIP notes
nix-build --argstr device asus-z00t -A all
# Maybe `nix copy ./result --to ssh://another-host`
adb wait-for-device && adb reboot bootloader
fastboot boot result # or full path
# getting adb and fastboot working is left as an exercise to the reader.
Alternatively, helpers under bin
can be used. They mostly pave over
the nix CLI to provide one-liners and one-parameter helpers.
# Builds -A all for device_name $1
bin/build asus-z00t
Booting qemu
bin/build qemu-x86_64
bin/boot-qemu
This currently does not build using 18.03 and may never (18.09 may release before!)
local.nix
This file can be used to override (possibly with lib.mkForce
) options on a global
scale for your local builds.
If the file does not exist, it will not fail.
A sample local.nix
:
{ lib, ... }:
{
mobile.boot.stage-1.splash.enable = false;
}
This will disable splash screens.
This will be most useful to configure local sensitive stuff like password (hashes) or ssh keys.
Goals
The goal is to get a nix-built operating system, preferably NixOS running on mobile devices, e.g. Android phones.
This is intended as building blocks, allowing the end-users to configure their systems as desired.
The amount of targeted devices does not dilute or devalue the work. It's the other way around, it increases the odds that people will start using the project and contribute back.
Prior work
This project initially borrowed and relied on the hard work from the PostmarketOS project. They are forever thanked in their valiant efforts.