1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-20 22:41:48 +03:00
Commit Graph

1146 Commits

Author SHA1 Message Date
Samuel Dionne-Riel
507805e9f2 Adds back depthcharge 2019-09-21 22:41:57 -04:00
Samuel Dionne-Riel
b8c4bcda18 Adds back kernel-initrd (for qemu) 2019-09-21 22:41:33 -04:00
Samuel Dionne-Riel
327fda2329 Review build to better use system.build and be more composable 2019-09-21 22:40:24 -04:00
Samuel Dionne-Riel
a9368b3623 splash: review "loading"...
While it's not as useful as the other splashes, this may help showing
issues with early post-framebuffer init. E.g. network or adbd in
stage-1.

The hollow logo is simple to describe, compared to a black and white
one, compared to a full colour one.
2019-09-21 18:07:42 -04:00
Samuel Dionne-Riel
54a52b8351 splash: different splash for sthe stages
This is to allow platforms where the virtual console is not available to
graphically show the state of the system; is it stuck in stage-1, early
stage-2 or is it about to get into systemd's init?

This is still a big hack, though but relatively clean.
2019-09-21 17:46:09 -04:00
Samuel Dionne-Riel
66a7f812c9 depthcharge: Integrates rootfs into image build 2019-09-21 17:32:16 -04:00
Samuel Dionne-Riel
c4d16fd341 rootfs: Build using the image-builder 2019-09-21 17:32:16 -04:00
Samuel Dionne-Riel
70a967a904 modules: Integrate with NixOS...
Otherwise, passing configuration to the NixOS modules system would
become harder, for "outside-in" builds, and would make it harder to
integrate into a nixos-rebuild type build.
2019-09-21 17:32:16 -04:00
Samuel Dionne-Riel
77110eaa92 default.nix: WIP minor refactor 2019-09-21 17:32:16 -04:00
Samuel Dionne-Riel
546dce59a8 overlay: picks up unused changes 2019-09-21 17:32:16 -04:00
Samuel Dionne-Riel
4be6154021 stage-1: Hardcoded udev usage for device detection
This should be extracted into a self-contained module.
2019-09-21 17:32:16 -04:00
Samuel Dionne-Riel
7f236593f3 stage-2: Fixes system path detection
Though this is still naïve and hardcoded to the last one.
2019-09-21 17:32:16 -04:00
Samuel Dionne-Riel
6d0b820318 overlay: Adds imageBuilder 2019-09-21 17:32:16 -04:00
Samuel Dionne-Riel
14ed832220 depthcharge: Build a disk image using our kpart
It's missing a system partition. Fear not, it's coming!
2019-09-21 17:32:16 -04:00
Samuel Dionne-Riel
343407099e Removes old system image stuff
The new upcoming stage-2 things are more clean
2019-09-21 17:32:16 -04:00
Samuel Dionne-Riel
acd6d41ec9 system-target: rephrase trace about cross 2019-09-21 17:32:13 -04:00
Samuel Dionne-Riel
f846f343f3 modules: misc minor refactor 2019-09-21 13:58:59 -04:00
Samuel Dionne-Riel
a04255b4eb image-builder: FIXME disables ext4 fsck...
I *think* there is a new check that wasn't previously (in 19.03) part of
e2fsck. This is now causing the check to fail.

FIXME : figure out a way to disable the check, or make the image comply.
2019-09-21 13:58:03 -04:00
Samuel Dionne-Riel
9264c6afc7 image-builder: WIP adds makeGPT
TODO : review makeMBR
TODO : share common code into makeFromSfdisk
TODO : add tests
2019-09-21 13:57:12 -04:00
Samuel Dionne-Riel
4e0b281d99 misc. removes unneeded comments 2019-09-21 13:56:51 -04:00
Samuel Dionne-Riel
72b4f97956 bin/boot-qemu: WIP fixes for stage-2 changes 2019-09-21 13:56:26 -04:00
Samuel Dionne-Riel
c1acf97334 system-target: reviews implementation
Since the initial implementation I learned enough to know where it was
slighly wrong. I think this fixes most of the slight wrongness.
2019-09-19 15:31:26 -04:00
Samuel Dionne-Riel
3c1408c82d Merge branch 'master' into feature/stage-2 2019-09-18 16:14:30 -04:00
Samuel Dionne-Riel
ead49f6897 Merge branch 'device/asus-dumo' 2019-09-18 15:49:49 -04:00
Samuel Dionne-Riel
7adda4a8d5 asus-dumo: Uses the mainline kernel with a hack 2019-09-18 15:40:01 -04:00
Samuel Dionne-Riel
b7f945aa69 asus-dumo: Adds ASUS Chromebook Tablet CT100PA 2019-09-18 15:40:01 -04:00
Samuel Dionne-Riel
474f3caa0a overlay: vboot_reference cross-compilation fix 2019-09-18 15:40:01 -04:00
Samuel Dionne-Riel
0992b0f91d depthcharge: Inits system type with bootable partition
The partition holds the usual mobile-nixos initrd + the kernel.
2019-09-18 15:39:30 -04:00
Samuel Dionne-Riel
740da6f71d hardware: inits rockchip with OP1
While it is an RK3399 derivative, we'll identify all devices as their
manufacturer does. Meaning that this is an OP1.

Though this seems useless at first glance, this allows us to put
conditionals on OP1 specific features or misfeatures, if any.
2019-09-18 15:37:31 -04:00
Samuel Dionne-Riel
6a49a823c9 bin/kernel-normalize-config: Adds script to normalize config 2019-09-18 15:37:31 -04:00
Samuel Dionne-Riel
ca99d75be0 kernel-builder: Use the platform's kernel target 2019-09-18 15:29:15 -04:00
Samuel Dionne-Riel
f40c8c1f08 modules: use types.str over types.string...
types.string having been formally deprecated, and having a likely
unwanted behaviour.
2019-09-18 15:28:51 -04:00
Samuel Dionne-Riel
ec5411a109 Merge branch 'master' into feature/stage-2 2019-09-05 22:56:02 -04:00
Samuel Dionne-Riel
eb0772e8cb
Merge pull request #20 from lheckemann/default.nix-convenience
default.nix: convenience improvements
2019-09-05 22:55:41 -04:00
Samuel Dionne-Riel
039f2c24a0 overlay: updates make_ext4fs with the missing meta 2019-09-05 22:30:31 -04:00
Samuel Dionne-Riel
565d938228 image-builder: Adds a test involving a real bootable image
This creates a disk image that acts *just about* like how the NixOS
sd_image acts. Though it is much less useful as there is no system, not
even an initrd.
2019-09-05 00:39:42 -04:00
Samuel Dionne-Riel
039a166937 image-builder: Adds support for adding gaps.
This is a "tangible" item you add to a `partitions` list. The partition
scheme will know what to do with a gap item.
2019-09-05 00:39:42 -04:00
Samuel Dionne-Riel
ed10664fc9 image-builder: makeFAT32: Let mkfs.fat set the FAT type
It turns out the warnings it spits out when forcing FAT32 with too few
clusters is not for nothing. At the very least the Raspberry Pi 3B does
not like the forced FAT 32. Though, it was validated that a large enough
FAT32 partition is fine with the Raspberry Pi 3B.
2019-09-04 23:07:19 -04:00
Samuel Dionne-Riel
6f52ba48d9 image-builder: Adds in-depth tests for ext4 images 2019-09-04 20:21:14 -04:00
Samuel Dionne-Riel
49d61da7f6 image-build: Fixes test broken by previosu commit
The size of the filesystem has changed because the way it is computed
has changed.
2019-09-04 20:18:21 -04:00
Samuel Dionne-Riel
f777cbdadb image-builder: makeExt4: implements minimal resizing
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.
2019-09-04 20:11:12 -04:00
Samuel Dionne-Riel
f9a719d00f image-builder: makeFAT32: Adjusts sizes
The factor was derived from first making a few test images, finding
there was a common thread, and then looking at what parts of FAT32 were
generated, and how they were generated. That was fun. (Yes, really.)
2019-09-04 00:49:13 -04:00
Samuel Dionne-Riel
b4600a4d23 image-builder: makeFilesystem: prepares API for adjusting sizes 2019-09-04 00:48:58 -04:00
Samuel Dionne-Riel
0f790274da image-builder: makeMBR: work with tiny partitions 2019-09-04 00:47:10 -04:00
Samuel Dionne-Riel
a5cdf69a6a image-builder: Adds alignment tests 2019-09-04 00:47:10 -04:00
Samuel Dionne-Riel
e44bd5ca1a image-builder: makeMBR: Align partitions 2019-09-03 16:52:56 -04:00
Samuel Dionne-Riel
223f6edb1b image-builder: clean-up in makeMBR 2019-09-02 17:48:03 -04:00
Samuel Dionne-Riel
bb095d2f14 image-builder: makeExt4: implements blockSize
The value chosen is the current default from make_ext4fs.

This makes the current tests still valid.
2019-09-02 17:48:03 -04:00
Samuel Dionne-Riel
e008cb416c image-builder: makeFAT32: use block size
In addition, present the sector size as an option.

The sector size is required to set a block size in bytes, so giving the
option to the end-user is probably for the best.

The values here were chosen to keep the builder compatible with the
existing tests.

In addition, the values are quite optimized for smaller filesystem
images, e.g. building a FIRMWARE partition for the Raspberry Pi.
2019-09-02 17:48:03 -04:00
Samuel Dionne-Riel
c0001af576 image-builder: makeFilesystem: reviews minimum size with blockSize
First of all, `du -s` will always combine the sizes into the multiple of
its given --block-size, so 4×1 byte files will show up as 1 block size
(assuming a block size > 4). The expected size would have been at least
one block size per file, so for 512, 512×4 thus 2048.

With this change, we sum the sizes ourselves.

This adds a new requirement to the filesystems, that they pass the block
size to the generic builder, though this is good, as it will increases
reproducibility. In addition, filesystems can present the option to
users, allowing the user to set their block sizes as expected.
2019-09-02 16:29:07 -04:00