1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-15 19:23:01 +03:00
mobile-nixos/modules/stage-2-splash.nix
Samuel Dionne-Riel 281f546bff stage-2-splash: Init re-purposed module
This resets the VT for platforms with VTs.

If a console is attached to that VT the logo will be covered by text as
it begins showing up on the VT.

The current way to "opt-out" of VT messages during stage-2 is to opt-out
of console messages on the VT.
2020-03-09 19:57:31 -04:00

18 lines
567 B
Nix

{ config, lib, pkgs, ... }:
{
# This is the earliest in stage-2 we can show, for vt-less devices, that
# stage-2 is really happening.
config.boot.postBootCommands = ''
# Reset the VT console.
# The Mobile NixOS stage-1 can be rude.
for d in /sys/class/vtconsole/vtcon*; do
if ${pkgs.busybox}/bin/grep 'frame buffer' "$d/name"; then
echo 1 > "$d/bind"
fi
done
# Though directly rudely show the stage-2 splash.
${pkgs.ply-image}/bin/ply-image --clear=0x000000 ${../artwork/splash.stage-2.png} > /dev/null 2>&1
'';
}