Release Vulpes OS Preview 26 with Gecko 161.0 and Tundra 0.2.0

This commit is contained in:
OverSu 2026-12-01 22:22:00 +01:00
commit e241a42d2f
9 changed files with 1305 additions and 331 deletions

View file

@ -0,0 +1,14 @@
{
"version": "161.0",
"runtime": "engines/161.0/firefox",
"archive": "https://archive.mozilla.org/pub/firefox/releases/161.0/linux-aarch64/en-US/firefox-161.0.tar.xz",
"sha512": "a4689c3cdd88e240db36c6cca06a1c3411568a4a0c1c6ce9944d939e8c7ad78cb42eaea049bffecfc4b49fa6f55467f64529775c471a6736d0fad30fa733da63",
"checksumSource": "https://archive.mozilla.org/pub/firefox/releases/161.0/SHA512SUMS",
"channel": "release",
"sourceArchive": "https://archive.mozilla.org/pub/firefox/releases/161.0/source/firefox-161.0.source.tar.xz",
"localChanges": [
"distribution/policies.json: pin engine; no automatic update"
],
"gaiaPorted": false,
"architecture": "aarch64"
}

View file

@ -0,0 +1,106 @@
#!/bin/sh
# SPDX-License-Identifier: MPL-2.0
# Called by rescue PID 1 only after the read-only storage check succeeds.
set -eu
BUILD_EPOCH=1795212545
APPLY_NATIVE_CONFIG=1
SYSTEM_IMAGE=/volume/tundra/images/c3017c3decc0824ed4a64124b5f7c47a7ceac5d116419bfd4fecdc4bdffd70b0.ext4
SYSTEM_IMAGE_SHA=c3017c3decc0824ed4a64124b5f7c47a7ceac5d116419bfd4fecdc4bdffd70b0
SYSTEM_IMAGE_BYTES=2684354560
STATE_IMAGE=/volume/tundra/data/54b47c1b-1a3a-47b9-bace-11badc025f82.ext4
STATE_UUID=54b47c1b-1a3a-47b9-bace-11badc025f82
STATE_BYTES=2147483648
# A kernel fallback date must not precede the build; RTC is not modified.
if [ "$(date +%s)" -lt "${BUILD_EPOCH:-0}" ]; then date -s "@$BUILD_EPOCH"; fi
trap 'echo TUNDRA_NATIVE_SETUP_FAILED; while :; do /bin/busybox sleep 5; done' EXIT
: "${SYSTEM_IMAGE:?A bundled system image is required}"
LOWER=/run/tundra-system
if [ -n "${SYSTEM_IMAGE:-}" ]; then
test -f "$SYSTEM_IMAGE" && test ! -L "$SYSTEM_IMAGE"
test "$(stat -c %s "$SYSTEM_IMAGE")" = "$SYSTEM_IMAGE_BYTES"
mkdir -p /run/tundra-system
mount -t ext4 -o loop,ro,noload "$SYSTEM_IMAGE" /run/tundra-system
LOWER=/run/tundra-system
fi
test -f "$LOWER/etc/systemd/system/tundra.target"
UPPER=/run/native-upper
WORK=/run/native-work
if [ -n "${STATE_IMAGE:-}" ]; then
test -f "$STATE_IMAGE" && test ! -L "$STATE_IMAGE"
test "$(stat -c %s "$STATE_IMAGE")" = "$STATE_BYTES"
blkid "$STATE_IMAGE" | grep -F "UUID=\"$STATE_UUID\"" >/dev/null
repaired=0
e2fsck -p "$STATE_IMAGE" || repaired=$?
test "$repaired" -le 1
mkdir -p /run/tundra-state
mount -t ext4 -o loop,rw,nosuid,nodev "$STATE_IMAGE" /run/tundra-state
# A data layer belongs to one immutable system image. Refuse accidental reuse.
test "$(cat /run/tundra-state/system.sha256)" = "$SYSTEM_IMAGE_SHA"
UPPER=/run/tundra-state/upper
WORK=/run/tundra-state/work
fi
mkdir -p "$UPPER" "$WORK" /newroot
chmod 755 "$UPPER"
mount -t overlay overlay -o "lowerdir=$LOWER,upperdir=$UPPER,workdir=$WORK" /newroot
if [ -z "${SYSTEM_IMAGE:-}" ] || [ "${APPLY_NATIVE_CONFIG:-0}" = 1 ]; then
# Only the selected upper layer is edited; the system image stays read-only.
if [ -n "${STATE_IMAGE:-}" ]; then
mkdir -p /run/tundra-identity
for identity in machine-id passwd group shadow gshadow; do
if [ -s "/newroot/etc/$identity" ]; then
cp -p "/newroot/etc/$identity" "/run/tundra-identity/$identity"
fi
done
fi
rm -f /newroot/etc/tundra/hardware-enabled /newroot/etc/systemd/system/tundra.target.wants/ofono.service /newroot/etc/systemd/system/tundra.target.wants/tundra-audio.service /newroot/etc/tundra/network-enabled /newroot/etc/systemd/system/tundra.target.wants/NetworkManager.service /newroot/etc/systemd/system/tundra.target.wants/tundra-wifi.service
tar -xJf /native-config.tar -C /newroot
if [ -d /run/tundra-identity ]; then
for identity in /run/tundra-identity/*; do
[ -f "$identity" ] && cp -p "$identity" /newroot/etc/
done
chmod 644 /newroot/etc/machine-id
fi
fi
if [ -f /shared-ui.tar ]; then tar -xJf /shared-ui.tar -C /newroot; fi
ENGINE=/volume/tundra/engines/p26-161
test -x "$ENGINE/firefox/firefox"
grep -qx 'Milestone=161.0' "$ENGINE/firefox/platform.ini"
mkdir -p /newroot/opt/vulpes/engines/161.0/firefox
mount --bind "$ENGINE/firefox" /newroot/opt/vulpes/engines/161.0/firefox
mount --bind "$ENGINE/engine-lock.json" /newroot/opt/vulpes/engine-lock.json
# A previous successful session must never count as proof of this boot.
for log in test.json home.png session.pid gecko.log server.log compositor.log network-gecko.json wifi-ui.json; do
rm -f "/newroot/opt/vulpes/logs/$log"
done
mkdir -p /newroot/reference /newroot/run /newroot/root/.ssh
if [ -z "${SYSTEM_IMAGE:-}" ]; then
: > /newroot/reference/android-rootfs.img
mount --bind /volume/var/lib/lxc/android/android-rootfs.img /newroot/reference/android-rootfs.img
else
test -s /newroot/reference/android-rootfs.img
fi
mkdir -p /newroot/reference
test -s /volume/tundra/hardware/vendor.img
: > /newroot/reference/vendor.img
mount --bind /volume/tundra/hardware/vendor.img /newroot/reference/vendor.img
mount -o remount,bind,ro /newroot/reference/vendor.img
test -s /volume/tundra/hardware/modem.img
: > /newroot/reference/modem.img
mount --bind /volume/tundra/hardware/modem.img /newroot/reference/modem.img
mount -o remount,bind,ro /newroot/reference/modem.img
mkdir -p /newroot/etc/tundra
printf '%s\n' '{"images":{"vendor.img":{"source":"vendor_a.img","sha256":"d584429873c88db741b81144b55977bbd8126b3e877445901bee6a0bda7fe4d0","bytes":805306368},"modem.img":{"source":"modem_a.img","sha256":"fd0624b37ac1d80c064a9763c7e2d2d6f94c3fd5e4617965b735ad411a473d0a","bytes":115343360}}}' > /newroot/etc/tundra/hardware-images.json
mkdir -p /newroot/usr/libexec /newroot/etc/systemd/system/tundra.target.wants
mkdir -p /newroot/usr/share/doc/qbootctl
cp /qbootctl-copyright /newroot/usr/share/doc/qbootctl/copyright
cp /sbin/tundra-qbootctl /newroot/usr/libexec/tundra-qbootctl
cp /standalone-boot-success.py /newroot/usr/libexec/tundra-mark-boot-success.py
cp /standalone-boot-success.service /newroot/etc/systemd/system/tundra-boot-success.service
ln -sf ../tundra-boot-success.service /newroot/etc/systemd/system/tundra.target.wants/tundra-boot-success.service
# Installed lower layers stay reachable for the overlay/loop driver until reboot.
mkdir -p /newroot/reference/tundra-volume
mount --move /volume /newroot/reference/tundra-volume
# Public boot: no USB maintenance account or shared SSH key.
for fs in dev proc sys run; do mount --move "/$fs" "/newroot/$fs"; done
# A static watchdog survives switch_root without needing the old /bin or /proc.
exec switch_root /newroot /sbin/init --unit=tundra.target

View file

@ -0,0 +1,57 @@
#!/usr/bin/env python3
"""Extract the upgrade payload from the clean installation image (Linux)."""
import argparse
import gzip
import hashlib
import json
from pathlib import Path
import subprocess
import tarfile
import tempfile
def pack(tree, destination):
# A canonical uncompressed tar has the same digest with any gzip implementation.
with destination.open("wb") as file, gzip.GzipFile(filename="", fileobj=file, mode="wb", compresslevel=2, mtime=0) as compressed, tarfile.open(fileobj=compressed, mode="w|", format=tarfile.GNU_FORMAT) as archive:
for path in sorted(tree.rglob("*")):
name = path.relative_to(tree).as_posix()
header = archive.gettarinfo(str(path), arcname=name)
if not (header.isdir() or header.isfile()):
raise ValueError(f"Unexpected entry {name}")
header.uid = header.gid = header.mtime = 0
header.uname = header.gname = ""
if header.isfile():
with path.open("rb") as source:
archive.addfile(header, source)
else:
archive.addfile(header)
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--work-dir", type=Path, default=Path.cwd(), help="Filesystem with 10 GiB available")
args = parser.parse_args()
base = Path(__file__).resolve().parent
with tempfile.TemporaryDirectory(dir=args.work_dir.resolve()) as temp:
work = Path(temp)
raw = work / "volume.ext4"
sparse = base / "userdata.img"
manifest = json.loads((base / "package.json").read_text())
with sparse.open("rb") as src:
if hashlib.file_digest(src, "sha256").hexdigest() != manifest["partitions"]["userdata"]["sha256"]:
raise ValueError("Invalid userdata.img digest")
subprocess.run(["simg2img", sparse, raw], check=True)
subprocess.run(["debugfs", "-R", 'rdump /tundra/engines/p26-161 .', raw], cwd=work, check=True)
tree = work / "p26-161"
if not (tree / "firefox/platform.ini").is_file():
raise ValueError("Missing runtime in installation image")
packed = work / "engine.tar.gz"
pack(tree, packed)
with gzip.open(packed, "rb") as data:
digest = hashlib.file_digest(data, "sha256").hexdigest()
if digest != (base / "engine-tar.sha256").read_text().strip():
raise ValueError("Reconstructed engine checksum differs")
import shutil
shutil.copyfile(packed, base / "engine.tar.gz")
print("engine.tar.gz ready for the recovery")
if __name__ == "__main__":
main()

View file

@ -0,0 +1,31 @@
#!/bin/sh
set -eu
test "$(id -u)" = 0
dev=/dev/block/by-name/userdata
test -b "$dev" || dev=/dev/mmcblk0p72
uuid=4e2a0eec-cd82-4a0a-ac57-70e79b3faebb
blkid "$dev" | grep -F "UUID=\"$uuid\"" >/dev/null
cd /tmp
actual=$(gzip -dc engine.tar.gz | sha256sum)
test "${actual%% *}" = "ebe0c80498f2a520f83e52e04cecda82c948f427b725605a7cac6b1135313a68"
vol=$(mktemp -d /tmp/vulpes-volume.XXXXXX)
mount -t ext4 -o rw "$dev" "$vol"
trap 'umount "$vol" && rmdir "$vol"' EXIT
test "$(cat "$vol/tundra-volume-id")" = "$uuid"
test -f "$vol/tundra/images/c3017c3decc0824ed4a64124b5f7c47a7ceac5d116419bfd4fecdc4bdffd70b0.ext4"
mkdir -p "$vol/tundra/engines"
dest="$vol/tundra/engines/p26-161"
test ! -e "$dest" || { echo "Engine directory already exists; inspect before proceeding." >&2; exit 1; }
stage=$(mktemp -d "$vol/tundra/engines/.p26-161.XXXXXX")
trap 'rm -rf "$stage"; umount "$vol" && rmdir "$vol"' EXIT
tar -xzpf engine.tar.gz -C "$stage"
chown -R 32011:32011 "$stage/firefox/vulpes" "$stage/firefox/defaults/pref" "$stage/firefox/vulpes.cfg"
chmod 755 "$stage"
test -x "$stage/firefox/firefox"
grep -qx 'Milestone=161.0' "$stage/firefox/platform.ini"
mv "$stage" "$dest"
sync
umount "$vol"
trap - EXIT
rmdir "$vol"
echo 'Vulpes engine ready'

View file

@ -107,21 +107,24 @@ def control(p):
def set_session_idle(idle):
"""Tell logind that Gaia has switched the display between active and idle."""
try:
result = subprocess.run(['/usr/bin/loginctl', 'list-sessions', '--no-legend', '--no-pager'],
capture_output=True, text=True, timeout=3, check=True)
sessions = []
for line in result.stdout.splitlines():
fields = line.split()
if len(fields) >= 2 and fields[1] == '32011' and fields[0].isalnum():
sessions.append(fields[0])
bus = ['/usr/bin/busctl', '--system']
service = 'org.freedesktop.login1'
result = subprocess.run([*bus, '--json=short', 'call', service, '/org/freedesktop/login1',
service + '.Manager', 'ListSessions'],
capture_output=True, text=True, timeout=3, check=True)
rows, = json.loads(result.stdout)['data']
sessions = [path for _, uid, _, _, path in rows if uid == 32011]
if not sessions:
raise RuntimeError('No Tundra logind sessions found')
value = 'true' if idle else 'false'
for session in sessions:
subprocess.run(['/usr/bin/busctl', '--system', 'call', 'org.freedesktop.login1',
'/org/freedesktop/login1/session/'+session,
'org.freedesktop.login1.Session', 'SetIdleHint', 'b', value],
capture_output=True, text=True, timeout=3, check=True)
failures = []
for path in sessions:
reply = subprocess.run([*bus, 'call', service, path, service + '.Session',
'SetIdleHint', 'b', value], capture_output=True, text=True, timeout=3)
if reply.returncode:
failures.append(path + ' ' + reply.stderr.strip())
if failures:
raise RuntimeError(', '.join(failures))
return True
except (OSError, RuntimeError, subprocess.SubprocessError) as error:
print('TUNDRA_LOGIND_IDLE_FAILED '+str(error), file=sys.stderr, flush=True)
@ -149,7 +152,9 @@ def serve():
fd = os.open('/dev/input/'+device.name, os.O_RDONLY | os.O_NONBLOCK)
selector.register(fd, selectors.EVENT_READ)
while True:
timeout = max(0, min(1, vibration.deadline - time.monotonic())) if vibration.deadline is not None else 1
timers = [t for t in (vibration.deadline, wake_recovery.deadline) if t is not None]
timeout = max(0, min(timers) - time.monotonic()) if timers else None
previous_sequence = state['sequence']
for key, _ in selector.select(timeout):
if key.fileobj is server:
conn, _ = server.accept()
@ -178,7 +183,8 @@ def serve():
if vibration.deadline is not None:
vibration.advance(time.monotonic())
wake_recovery.advance(time.monotonic())
publish()
if previous_sequence != state['sequence']:
publish()
def client():
raw = sys.stdin.read(1024)

View file

@ -154,6 +154,20 @@ class Camera:
actual = int(self.read_parameters().get('zoom',index))
if not 0 <= actual < len(self.zoom_ratios): raise RuntimeError('CAMERA_INVALID_ZOOM_REPLY')
return {'zoom':self.zoom_ratios[actual]}
if action == 'focusMode':
mode = command.get('mode')
# AutoFocusMode from libhybris camera_compatibility_layer_capabilities.h.
modes = {'continuous-video': 1, 'auto': 2, 'macro': 3,
'continuous-picture': 4, 'infinity': 5}
if mode not in modes or mode not in self.metadata()['focusModes']:
raise ValueError('CAMERA_FOCUS_UNAVAILABLE')
function(self.lib,'android_camera_stop_autofocus',[P])(self.camera)
if mode.startswith('continuous-'):
function(self.lib,'android_camera_reset_focus_region',[P])(self.camera)
function(self.lib,'android_camera_set_auto_focus_mode',[P,I])(self.camera,modes[mode])
if self.read_parameters().get('focus-mode') != mode:
raise RuntimeError('CAMERA_FOCUS_READBACK_FAILED')
return {'mode': mode}
if action == 'focus':
if 'auto' not in self.metadata()['focusModes']:
raise ValueError('CAMERA_FOCUS_UNAVAILABLE')

View file

@ -21,13 +21,19 @@ class Buttons(unittest.TestCase):
with self.assertRaises(ValueError):b.control(p)
def test_display_state_updates_all_logind_sessions(self):
sessions='1 32011 droidian - 1017 manager - no -\nc2 32011 droidian - 1082 background - no -\nc3 32011 droidian seat0 1119 user tty7 no -\n'
with patch.object(b.subprocess,'run') as run:
run.side_effect=[type('Result',(),{'stdout':sessions})(),None,None,None]
self.assertTrue(b.set_session_idle(True))
calls=[call.args[0] for call in run.call_args_list[1:]]
self.assertEqual(len(calls),3)
self.assertTrue(all(call[-2:]==['b','true'] for call in calls))
import subprocess
rows = [['1',32011,'droidian','','/org/freedesktop/login1/session/_31'],
['c2',32011,'droidian','seat0','/org/freedesktop/login1/session/c2'],
['2',1000,'tester','','/org/freedesktop/login1/session/_32']]
listing = subprocess.CompletedProcess([],0,b.json.dumps({'data':[rows]}))
for first_status in (0,1):
with patch.object(b.subprocess,'run') as run:
run.side_effect=[listing,subprocess.CompletedProcess([],first_status,'','error'),
subprocess.CompletedProcess([],0,'','')]
self.assertEqual(b.set_session_idle(True),first_status==0)
calls=[call.args[0] for call in run.call_args_list[1:]]
self.assertEqual([cmd[4] for cmd in calls],[rows[0][-1],rows[1][-1]])
self.assertTrue(all(cmd[-2:]==['b','true'] for cmd in calls))
def test_vibration_pattern_progresses_without_blocking_and_can_be_cancelled(self):
with tempfile.TemporaryDirectory() as d,patch.object(b,'VIBRATOR',Path(d)),patch.object(b.time,'monotonic',return_value=10):

View file

@ -21,7 +21,8 @@ def sample():
for path in sorted(Path('/sys/class/power_supply').iterdir()):
supplies[path.name] = values(path, (
'type', 'status', 'online', 'capacity', 'current_now',
'voltage_now', 'power_now', 'charge_now', 'energy_now', 'temp'))
'voltage_now', 'power_now', 'charge_now', 'charge_counter', 'charge_full',
'charge_full_design', 'energy_now', 'temp'))
thermal = {}
for path in sorted(Path('/sys/class/thermal').glob('thermal_zone*')):
item = values(path, ('type', 'temp'))
@ -33,6 +34,8 @@ def sample():
if item:
idle[str(path.relative_to('/sys/devices/system/cpu'))] = item
return {'timeUnix': time.time(), 'timeMonotonic': time.monotonic(),
'timeBoottime': time.clock_gettime(time.CLOCK_BOOTTIME),
'brightness': values(Path('/sys/class/backlight/panel0-backlight'), ('brightness',)),
'powerSupplies': supplies, 'thermalZones': thermal, 'cpuIdle': idle}

View file

@ -65,12 +65,16 @@ def selected_files():
ROOT.parent/'assets/webapps/clock.gaiamobile.org/js/panels/timer/main.js',
ROOT.parent/'assets/webapps/search.gaiamobile.org/manifest.webapp',
ROOT.parent/'assets/webapps/homescreen.gaiamobile.org/gaia_build_defer_index.js',
ROOT.parent/'assets/webapps/settings.gaiamobile.org/index.html',
ROOT.parent/'assets/webapps/settings.gaiamobile.org/resources/open_source_license.html',
ROOT.parent/'assets/webapps/settings.gaiamobile.org/resources/obtaining_source_code.html',
ROOT.parent/'assets/webapps/settings.gaiamobile.org/js/panels/app_permissions_list/panel.js',
ROOT.parent/'assets/webapps/settings.gaiamobile.org/js/panels/screen_lock_passcode/panel.js',
ROOT.parent/'assets/webapps/verticalhome.gaiamobile.org/gaia_build_defer_index.js',
ROOT.parent/'assets/webapps/verticalhome.gaiamobile.org/js/init.json',
ROOT.parent/'gaia/apps/verticalhome/js/sources/application.js',
ROOT.parent/'assets/webapps/wallpaper.gaiamobile.org/style/wallpaper.css',
ROOT.parent/'assets/webapps/wallpaper.gaiamobile.org/resources/list.json',
ROOT.parent/'assets/webapps/ringtones.gaiamobile.org/gaia_build_defer_pick.js',
ROOT.parent/'assets/webapps/ringtones.gaiamobile.org/gaia_build_defer_manage.js',
ROOT.parent/'assets/webapps/ringtones.gaiamobile.org/js/tone_player.js',