Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions scripts/build-signmar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,16 @@ done < "$PIN"

L="$SRC/modules/libmar"
C="$SRC/other-licenses/nsis/Contrib/CityHash/cityhash"
NSS_FLAGS=$(pkg-config --cflags --libs nss nspr)
# Libraries go after the sources: Ubuntu's linker defaults to --as-needed, which drops a library named
# before the objects that use it ("undefined reference to VFY_Update", first sign-publish, 2026-11-26).
NSS_CFLAGS=$(pkg-config --cflags nss nspr)
NSS_LIBS=$(pkg-config --libs nss nspr)
c++ -O2 -c -I"$C" "$C/city.cpp" -o "$SRC/city.o"
# MAR_CHANNEL_ID and MOZ_APP_VERSION feed only the `signmar` banner; -T, -s and -v do not read them.
# shellcheck disable=SC2086 -- pkg-config emits separate flags
cc -O2 -DMAR_NSS -DMAR_CHANNEL_ID='"release-tool"' -DMOZ_APP_VERSION='"pinned-source"' \
-I"$L/src" -I"$L/sign" -I"$L/verify" -I"$C" $NSS_FLAGS \
-I"$L/src" -I"$L/sign" -I"$L/verify" -I"$C" $NSS_CFLAGS \
"$L/tool/mar.c" "$L/src/mar_create.c" "$L/src/mar_extract.c" "$L/src/mar_read.c" \
"$L/sign/mar_sign.c" "$L/sign/nss_secutil.c" "$L/verify/cryptox.c" "$L/verify/mar_verify.c" \
"$SRC/city.o" -lstdc++ -o "$OUT/signmar"
"$SRC/city.o" $NSS_LIBS -lstdc++ -o "$OUT/signmar"
sha256sum "$OUT/signmar"
17 changes: 15 additions & 2 deletions systemd/legion-pb.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
# path to the registration token (still InaccessiblePaths) or to /home (still ProtectHome). This is
# the price of running rootless podman under this unit, and it is why third-party build code (the
# agent server's npm closure in particular) should run inside the container or off this host.
{ config, pkgs, lib, ... }:
{ config, pkgs, lib, options, ... }:
let
# Rootless podman runs newuidmap and newgidmap from PATH. The kernel lets a multi-range id map be
# written only by the namespace owner holding CAP_SETUID (or CAP_SETGID) in the parent namespace,
Expand Down Expand Up @@ -106,7 +106,10 @@ in
# it deletes everything inside it on every start; the tmpfiles rule in section 3 creates it.
workDir = "/var/lib/pb-runner";
extraLabels = [ "powerbrowser-release" ];
extraPackages = with pkgs; [ git gh nix podman uidmapWrappers ];
# util-linux: verify-platform.sh takes the live lock with setsid and flock (first release run past
# packaging, 2026-11-26: "flock on the live lock ... ended without taking it"). With it, all seven
# packaged rows pass under this unit's PATH with no display.
extraPackages = with pkgs; [ git gh nix podman util-linux uidmapWrappers ];
extraEnvironment = {
ACTIONS_RUNNER_HOOK_JOB_STARTED = "/etc/pb-runner/legion-pre-job-hook.sh";
# The module sets HOME to workDir, which it wipes on every start. Rootless podman keeps its image
Expand Down Expand Up @@ -184,6 +187,16 @@ in
enable = true;
registries.search = [ "docker.io" ];
};
# The packaged rows run the portable release tarball on this host, and NixOS has no /usr/lib, so
# the tarball's GTK, X11, audio and media libraries come through nix-ld. Same list as
# nix/pkg/powerbrowser-bin.nix (buildInputs and dlopen libraries). First release run past the lock
# (2026-11-26): "libmozgtk.so: libgtk-3.so.0: cannot open shared object file". With these libraries,
# all seven packaged rows pass outside any FHS sandbox. The module default (base libraries) is kept:
# setting the option replaces it otherwise.
programs.nix-ld.libraries = options.programs.nix-ld.libraries.default ++ (with pkgs; [
gtk3 libx11 libxext libdbusmenu-gtk3 alsa-lib libpulseaudio libxscrnsaver libva libgbm cups udev
libnotify ffmpeg_8 pciutils vulkan-loader libglvnd speechd-minimal pipewire libkrb5
]);
users.users.pb-runner = {
isSystemUser = true;
group = "pb-runner";
Expand Down
Loading