summaryrefslogtreecommitdiff
path: root/root_image.nix
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2026-08-31 00:49:23 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2026-08-31 00:53:50 -0500
commitfd0e84863fd7bb32524334b84c69f760a53b4691 (patch)
tree85b8ef5e8f652ba0f975bac314f478598ed0a0bc /root_image.nix
parentb88d595f10d32fa54199d8873f8cfc3ae8263ed4 (diff)
ktest: look at the plymouth boot splash from a headless runHEADmaster
Splash rendering was previously a question you could only answer by rebooting a laptop and watching. Four pieces, together enough to test it: KTEST_GUI=1 drops qemu's -nographic (-display gtk -vga std), for when a person does need to look; ktest screendump takes the display as an image over the monitor socket, which works headless because qemu renders whether or not anyone is watching. kconfig.sh gains a framebuffer, because with no DRM and no fbdev plymouth falls back to the text plugin - whose message erase is one hardcoded line, so a multi-line status block scrolls instead of redrawing. It decides what plymouth renders with, not just what the pixels look like. root_image.nix names what root_image and debootstrap actually invoke instead of relying on the host, and buildFHSUserEnv is gone from nixpkgs. mount.ktest reads /dev/vcsa1 - the VT layer's own character buffer - so "what does the person booting see" has an answer in the test log. HELD BACK, not ready to push: the file-scope kernel command line it adds ("splash plymouth.debug=stream") applies to every test in mount.ktest, and the console tests there care about the console. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
Diffstat (limited to 'root_image.nix')
-rw-r--r--root_image.nix32
1 files changed, 28 insertions, 4 deletions
diff --git a/root_image.nix b/root_image.nix
index 994eea0c..7587967d 100644
--- a/root_image.nix
+++ b/root_image.nix
@@ -1,14 +1,38 @@
# FHS shell for running ./root_image on NixOS
# execute:
-# $ nix-shell root_image.nix
-# $ ./root_image <params>
+# $ sudo nix-shell root_image.nix
+# $ ./root_image create
# $ exit
-
+#
+# sudo outside rather than inside: root_image refuses to run as anyone else,
+# and sudo from within the FHS env leaves it again.
+#
+# targetPkgs is what ./root_image and the vendored debootstrap call by name,
+# taken from what they actually invoke rather than from whatever a Debian host
+# happens to have lying around:
+#
+# root_image - fallocate, mount, umount (util-linux), chroot (coreutils),
+# mkfs.ext4 (e2fsprogs), curl, rsync
+# debootstrap - wget, ar (binutils), tar, xz, gpgv (gnupg), dpkg-deb (dpkg),
+# perl
{ pkgs ? import <nixpkgs> {} }:
-(pkgs.buildFHSUserEnv {
+(pkgs.buildFHSEnv {
name = "root_image-env";
targetPkgs = pkgs: with pkgs; [
coreutils
+ util-linux
+ e2fsprogs
+ curl
+ wget
+ rsync
+ binutils
+ gnutar
+ xz
+ gzip
+ gnupg
+ dpkg
+ perl
+ debianutils
];
runScript = "bash";
}).env