Commit Graph

13 Commits (19cb4256f3e8a0e1ed9675c6df72a023d82fd30b)

Author SHA1 Message Date
Dustin 09c7277e30 Run depmod before creating rootfs image
`depmod` needs to be run by `mkrootfs.sh` so that the kernel module
dependency information is included in the SquashFS image.  Without this
information, `modprobe` cannot install kernel modules at runtime.
2022-08-23 09:38:37 -05:00
Dustin 6373ca3d08 Use xrandr instead of wmctrl
basementhud/pipeline/head This commit looks good Details
It turns out the Firefox marionette protocol can move/resize the Firefox
window, so `wmctrl` is not needed.  We will need `xrandr`, though, to
help identify screen/monitor geometry, which we will send to the
control service so it knows how to position the Firefox windows.
2022-04-06 18:43:30 -05:00
Dustin cd4144293b Fix group owner of overlay files
Need to set the GID owner of all files copied in from the overlay
directory to *root*/`0`, to match the user/UID.
2022-04-06 18:43:16 -05:00
Dustin 878f733025 Set GUI time zone from geolocation
The wonderful *ipapi.co* service can help identify the time zone of a
device based on the geolocation information for its IP address.  We can
use this to set the `TZ` environment variable in the user session, which
Firefox will respect.  This has the effect of showing the correct time
in e.g. Grafana dashboards, without hard-coding the time zone in the
rootfs image.
2022-04-06 18:40:58 -05:00
Dustin 3e2e54d3cc Install wmctrl
basementhud/pipeline/head This commit looks good Details
`wmctrl` is needed to resize/reposition windows, since *openbox* does
not have any native automation capabilities.
2022-04-06 10:57:25 -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 919b578ebc Disable systemd-userdbd/systemd-homed
These are unnecessary and waste memory.
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 1e96609ebc Install zram-generator
Try to maximize memory efficiency using using an in-memory block device
with on-the-fly compression as swap space.
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 37ef563b5d Switch to Openbox
Matchbox Window Manager, being designed for mobile devices, does not
handle multiple monitors well.  It manages the monitors together as one
giant screen, which will make it extremely difficult to manage separate
Firefox windows on each screen.  Openbox is almost as lightweight as
Matchbox, but it works significantly better for this use case.
2022-04-04 20:59:34 -05:00
Dustin 2437e6e467 Initial commit 2022-04-04 20:59:32 -05:00