Commit Graph

11 Commits (master)

Author SHA1 Message Date
Dustin 379eca833c fx-marionette: Exit after idle
dustin/basementhud/pipeline/head This commit looks good Details
By default, `systemd-socket-proxyd` keeps running after the remote
disconnects.  This prevents the HUD control from reconnecting if e.g.
Firefox crashes.
2022-12-13 11:55:31 -06:00
Dustin 0caf50f656 xinit: Start Xorg on tty1
Because `tty1` is active when `xinit@user.service` starts on `tty7`,
Xorg cannot bind the modesetting driver to the DRM device:

> (II) systemd-logind: got fd for /dev/dri/card2 226:2 fd 13 paused 1
> (EE) Error systemd-logind returned paused fd for drm node

To fix this, we need to start Xorg on the active console.

Another potential fix would be to run `chvt 7` before running `startx`,
but running the GUI on tty1 seems to be what the major display managers,
e.g. GDM, are doing now.
2022-12-13 11:44:16 -06:00
Dustin 5083b91871 Install mqttdpms
dustin/basementhud/pipeline/head This commit looks good Details
The `mqttdpms` tool will allow the screens to be turned off and on using
Home Assistant.  We'll install it into the rootfs image by copying the
artifact from its Jenkins build into the overlay tree before building
the image.
2022-08-02 23:04:22 -05:00
Dustin 4aadca95a2 Do not wait for NTP sync to start Xorg
Now that the system clock is set from the RTC, the time will be close
enough to correct by the time Xorg starts that there won't be any
certificate issues.  We can shave several seconds off the startup time
now.
2022-04-06 17:47:36 -05:00
Dustin 406c0b869e Allow access to the emergency shell
basementhud/pipeline/head This commit looks good Details
By default, the emergency shell prompts for the root password.  If the
root account is locked, the emergency shell is unusable.  This makes it
impossible to troubleshoot issues before the network is available.
Fortunately, systemd can be configured to skip the root password prompt
and allow access to the emergency shell with an environment variable.
2022-04-06 10:13:52 -05:00
Dustin d6139d4884 Switch from NetworkManager to dhclient
basementhud/pipeline/head This commit looks good Details
NetworkManager is a memory hog.  We don't need it to do anything except
renew the DHCP lease when it's time, so let's switch to a more
lightweight alternative.  Unfortunately, Fedora does not include any
systemd units for `dhclient`, so we have to provide our own.
2022-04-05 17:58:19 -05:00
Dustin e055500476 Drop Playwright, run Firefox Marionette
Running Voonex (Python), Playwight (Node.js), and Firefox simultaneously
takes way too much memory.  Using the NBD swap prevents hard lockups and
crashes in OOM situations, but it makes the machine *incredibly* slow.
To avoid needing to push anything into the network swap, I want to try
and reduce the memory footprint as much as possible.  To that end, we
will go back to running just Firefox.  To control it, we will use the
Marionette protocol.

Firefox only allows control via Marionette over the loopback interface.
This is hard-coded in the Marionette server, and cannot be changed at
runtime.  To allow a remote machine (running Voonex) to control it, we
need to expose the socket to the network.  Fortunately, *systemd*
includes a tool for exactly this purpose: `systemd-socket-proxyd`.
2022-04-05 17:58:19 -05:00
Dustin 2a0737ab78 Enable local persistent storage
Machine-specific data, such as SSH keys, should not be included in the
immutable root filesystem image, as this would prevent multiple machines
running from the same image.  These few files can be stored locally, on
the SD card on eMMC flash.

The first time a machine boots up using this image, its local storage is
initialized.  This involves creating a new filesystem on the block
device and generating SSH host keys.  Once the storage is initialized,
it is remounted read-only.  All subsequent mounts are read-only as well.
2022-04-05 14:54:30 -05:00
Dustin 14d0cdcec1 Configure swap space on NBD volume
Using zram to compress pages did not provide enough memory to run
Firefox, Node, and Python for an extended period of time.  Here's hoping
swap-on-NBD will be fast and reliable enough to work.

Note that systemd's default behavior with respect to swap areas is to
enable them all rather early in the boot process, before the network is
fully configured.  As such, we have to use the *noauto* flag to disable
the default dependencies and add our own in a later target.
2022-04-04 20:59:34 -05:00
Dustin a3c2afc3fa Install Playwright to control Firefox
[Playwright] is a cross-browser automation framework, intended for
automating browser-based GUI application tests.  It also works as a
general remote-control tool for automating basically anything having to
do with a browser.

Playwright requires a special Firefox binary that it manages itself.  To
avoid downloading and installing Playwright and Firefox, and thus
storing them in memory, we need them to be already available in the
rootfs image.  Since I want the control software to be updated easily,
without rebooting the machine, I decided to separate it into its own
project, [Voonex].  A short shell script to install/update and run it is
launched by the systemd user instance.

[Playwright]: https://playwright.dev/
[Voonex]: https://git.pyrocufflink.blue/dustin/voonex
2022-04-04 20:59:34 -05:00
Dustin 2437e6e467 Initial commit 2022-04-04 20:59:32 -05:00