Resize root partition on first boot and include wget #19

Merged
sb10q merged 1 commits from fsagbuya/nix-servo:postboot into master 2024-08-17 17:37:24 +08:00
Collaborator

Description

  • Resize root partition to the remaining of SD card as being done in the nixos/rpi example.
  • Also include wget package

Patch is based from:
https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/sd-card/sd-image.nix#L258-L282

which uses the flag -f /nix-path-registration to do some nix maintenance task and ensures everything is done only in initial boot by removing nix-path-registration at the end.

The nix-path-registration is being generated when creating an ext4 root file system
https://github.com/NixOS/nixpkgs/blob/master/nixos/lib/make-ext4-fs.nix#L56
This allows to import Nix DB in first boot so that nix commands work and know what's installed.

Closes #16

Test Log:

-bash-5.2# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p2  6.9G  223M  6.4G   4% /
devtmpfs        472M     0  472M   0% /dev
tmpfs           490M  4.0K  490M   1% /run
tmpfs           490M     0  490M   0% /dev/shm

### Description - Resize root partition to the remaining of SD card as being done in the `nixos/rpi` example. - Also include `wget` package Patch is based from: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/sd-card/sd-image.nix#L258-L282 which uses the flag `-f /nix-path-registration` to do some nix maintenance task and ensures everything is done only in initial boot by removing `nix-path-registration` at the end. The `nix-path-registration` is being generated when creating an ext4 root file system https://github.com/NixOS/nixpkgs/blob/master/nixos/lib/make-ext4-fs.nix#L56 This allows to import Nix DB in first boot so that nix commands work and know what's installed. Closes #16 Test Log: ``` -bash-5.2# df -h Filesystem Size Used Avail Use% Mounted on /dev/mmcblk0p2 6.9G 223M 6.4G 4% / devtmpfs 472M 0 472M 0% /dev tmpfs 490M 4.0K 490M 1% /run tmpfs 490M 0 490M 0% /dev/shm ```
fsagbuya added 1 commit 2024-01-16 13:40:21 +08:00
Owner

Why do we need strace?

Why do we need strace?
sb10q reviewed 2024-01-16 14:14:38 +08:00
pr-28.patch Outdated
@ -60,0 +74,4 @@
+ example = "rm -f /var/log/messages";
+ type = types.lines;
+ description = lib.mdDoc ''
+ Shell commands to be executed just before runnit is started.
Owner

runit

runit
sb10q reviewed 2024-01-16 14:15:40 +08:00
Author
Collaborator

Why do we need strace?

This is something not-os provided by default. Will remove strace.

> Why do we need strace? This is something not-os provided by default. Will remove strace.
fsagbuya force-pushed postboot from d4055b3c18 to 8f664049d6 2024-01-16 14:33:53 +08:00 Compare
sb10q merged commit 8f664049d6 into master 2024-01-16 14:44:57 +08:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/nix-servo#19
No description provided.