28 Commits
Author SHA1 Message Date
Herrie df79df8404 Merge pull request #5 from codepoet80/main
Fix missing libraries, commonize packaging
2026-08-24 06:02:36 +02:00
codepoet80andClaude Fable 5 6fa6fc40ec Document the GPU-wedge root cause (fixed in 0.9.11 engine binaries)
The wedge (#3) was never the GPU: three UIProcess-side bugs, each caught
live on-device — a stale close of the WebKit-adopted renderer-host fd and
an unread FRAME_ACK backlog (atlas-wpe-backend/wpe-atlas-backend.c), plus a
debug hook stealing JSC's SIGUSR1 thread-suspend signal (BrowserPageWPE.cpp).
BUILDING.md points at atlas-wpe-backend/ARCHITECTURE.md for the full account
and keeps the watchdog history for context.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VmkRfybXhMBzbELMrKZWvp
2026-08-23 16:45:48 -04:00
codepoet80andClaude Fable 5 b846b82cab 0.9.10: install on webOS CE 3.1.0, watchdog off, user-triggered engine restart
Packaging (found on webOS CE 3.1.0, all three verified on-device):
- No Depends: in the ipk. ipkg has no notion of OS version, so a hard
  Depends blocks 3.1.0 (TLS stack built in) instead of describing anything;
  the FEED's stanza qualifies environments (Preware drops MaxWebOSVersion-
  incompatible packages at load time). FEED_DEPENDS= overrides.
- Ship postinst/prerm additionally as pmPostInstall.script/pmPreRemove.script
  ar members: com.palm.appinstaller never runs the deferred ipkg postinst
  (it extracts and runs the ar members as root), so WOQI installs ended up
  with no engine half and reported SUCCESS.
- postinst stops the engine + kills the qcamd/qspkd/qmicd helpers before
  sweeping FUSE .fuse_hidden remnants (upgrades kept running old binaries;
  uninstall left an undeletable app dir). prerm same sweep, and it must NOT
  restart LunaSysMgr: appinstaller runs pmPreRemove.script synchronously
  from inside Luna BEFORE ipkg remove, so the restart killed the removal.

Watchdog: wrapper now passes -d 0. The idle-gated deadlock detector aborts
healthy idle engines (13 and 155 ticks/90s observed on an untouched tablet);
recovery is now user-triggered instead: atlas-sensord grew a loopback control
socket (127.0.0.1:8442, /restart-engine) the app's Restart Browser Engine
menu item calls — sensord is root and does not depend on a live BS.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VmkRfybXhMBzbELMrKZWvp
2026-08-23 16:45:48 -04:00
codepoet80andClaude Opus 5 b290f43dc0 Build ipks into atlas-browser-app/ipks/<target>/
$OUT defaults to the app repo's tracked ipks/ directory instead of ~/atlas-ipk,
so a release's artifacts sit next to the source they were built from. Docs and
both wrappers updated to the new paths.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-04 10:43:02 -04:00
codepoet80andClaude Opus 5 947c6649bc Package two targets: feed vs standalone
A package manager and a hand install need opposite behaviour, and one package
cannot be right for both — which is why the feed has been repacking every build.

  feed        postinst/prerm must NOT restart LunaSysMgr (Preware runs under it;
              an inline restart kills the installer mid-chain). Declares
              PostInstallFlags/PostUpdateFlags/PostRemoveFlags=RestartLuna, and
              Depends on the feed's OpenSSL 1.1 package for /usr/lib/ssl11.
  standalone  postinst/prerm restart Luna themselves — no installer to defer to,
              and the plugin stays invisible until it reloads. No Depends,
              because nothing would resolve one.

One postinst/prerm still, with a PKG_TARGET line the builder stamps; the wrappers
build-ipk-feed.sh / build-ipk-standalone.sh pick the target. Outputs land in
$OUT/<target>/ under the canonical opkg filename so neither clobbers the other.
ATLAS_POSTINST_RESTART_LUNA=1 / ATLAS_PRERM_RESTART_LUNA=1 still force a restart.

data.tar.gz is now byte-identical between the two targets, so only control.tar.gz
differs and a feed can index the same payload. That needed the payload to be
reproducible: the two builds differed in 300 mtimes and zero bytes of content, so
tar now stamps --mtime from the app repo's HEAD commit (SOURCE_DATE_EPOCH
overrides) and sorts members. Deliberately a per-commit stamp rather than a fixed
constant: GStreamer invalidates its cached plugin registry by plugin mtime, so it
has to keep moving between releases.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-04 10:13:15 -04:00
codepoet80andClaude Opus 5 bd03a428b5 Stop restarting LunaSysMgr from postinst/prerm; declare it instead
LunaSysMgr has to reload before it can see the NPAPI browser plugin, and both
scripts did it inline with `killall LunaSysMgr`. Batch installers run UNDER
LunaSysMgr, so that kills the installer mid-run: in the WOSA Modernize feed Atlas
is a dependency of atlas-default-browser (which also pulls tls-updates), and the
restart fired the instant Atlas finished, abandoning the rest of the chain.

The reload is the installer's job, once, at the end. Emit
PostInstallFlags/PostUpdateFlags/PostRemoveFlags = RestartLuna in the ipk control's
Source block. Preware reads those from the FEED's Packages index rather than from
the ipk, so a distributor still has to carry them into their stanza -- but the ipk
is now self-describing and needs no postinst/prerm edits downstream, which is the
point: the feed was re-packing every rebuild.

Hand installs keep an escape hatch: ATLAS_POSTINST_RESTART_LUNA=1 /
ATLAS_PRERM_RESTART_LUNA=1 restart immediately; otherwise both scripts log that a
Luna restart or reboot is needed to finish.

Feed-specific metadata (Depends on that feed's OpenSSL package, and the display
half of the Source block) is deliberately NOT emitted here.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-04 10:00:55 -04:00
codepoet80andClaude Opus 5 9fce179af4 postinst: stage the GPU driver reliably instead of failing silently
Fresh installs of 0.9.8 could end up with no libEGL.so.1 / libGLESv2.so.2 in the
engine lib dir: the browser opened and rendered nothing. postinst staged them
with a bare `cp -f /usr/lib/libEGL.so ...` and never checked the result, so on a
device without that source file the copy failed quietly and the install reported
success.

- fall back to the copy bundled in the ipk when the device's file is unreadable
- also stage the UNVERSIONED libEGL.so. The vendor libGLESv2 blob NEEDs it
  (readelf), and its own SONAME is libEGL.so as well, so until now it resolved
  only by luck: either the already-loaded libEGL.so.1 satisfied it under that
  SONAME, or the loader fell through to /usr/lib/libEGL.so, which is not
  guaranteed to exist
- log a clear error when a name is still missing afterwards

build-ipk-atlas.sh gains a matching guard: the payload must carry all three
names or the build dies. They were only present before because the reference
deviceroot happened to be pulled from a device where postinst had already staged
them -- provenance, not intent, which is how an ipk could ship without them.

Also document why the atlas upstart job must keep `respawn limit 0 0`: the GPU
wedge recovery is an abort+respawn, so capping it (as atlas-sensord now is, for
good reasons of its own) would turn the Nth wedge into a dead browser.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-04 09:48:03 -04:00
Herrie b874cf0798 Merge pull request #4 from codepoet80/main
Build reproducibility and Viewport fixes
2026-08-04 06:01:42 +02:00
codepoet80andClaude Opus 5 88e4e14da9 wrapper: drop the deadlock timeout 600000 -> 90000 so a wedge recovers in ~1 min
-d 600000 was set because the 15s default aborted BrowserServer during
memory-pressure GC stalls. The side effect was that the GPU wedge (#3) -- which
this watchdog is the only thing that recovers -- took 14m30s to clear, long
enough that users reboot instead.

BrowserServer now gates the abort on the process being idle as well as stalled
(YapServer.cpp), so a GC stall no longer trips it and a short timeout is safe.

Measured on-device 2026-08-03 against a real wedge: 63s from hang to serving
pages again, page restored automatically.

Do not raise this back, and do not lower it below ~90s on an engine built before
that gate. BUILDING.md documents both, plus the gotcha that the watchdog logs to
syslog rather than bs-atlas.log.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-03 16:35:08 -04:00
codepoet80 fc8c7df4d3 note moved to Issue 2026-07-25 12:27:43 -04:00
codepoet80andClaude Opus 5 b2277c7173 Stop tracking hosttools-env.sh: it hardcodes one machine's paths
hosttools-env.sh is generated by stage-hosttools-atlas.sh, which resolves $HOSTTOOLS (default
~/hosttools) into absolute paths and writes them out. Committing the generated file meant the tree
carried one developer's home directory:

    export PATH="/home/jonwise/hosttools/root/usr/bin:$PATH"
    export LD_LIBRARY_PATH="/home/jonwise/hosttools/root/usr/lib/x86_64-linux-gnu..."
    export RUBYLIB="/home/jonwise/hosttools/root/usr/lib/ruby/3.2.0:..."

Anyone else sourcing it would put a non-existent directory on PATH and get the "ruby not on PATH"
failure from build-webkit-atlas.sh with no indication why.

The generator was already correct; only its output should not have been tracked. Ignore it and let
stage-hosttools-atlas.sh produce it locally. Nothing sources it implicitly - build-webkit-atlas.sh
only checks that ruby/unifdef are on PATH and points at it in the error - so dropping it from the
tree changes no build behaviour.

This was the last absolute path in any tracked build input; a sweep of the whole tree for /home/
now turns up only camera/NOTES.md, which documents an external kernel tree rather than feeding a
build.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015tsY5bvFrBNb5e4pfYreJH
2026-07-25 12:26:29 -04:00
codepoet80andClaude Opus 5 afc8b83514 Expose PaymentRequest on ports without APPLE_PAY; document the GPU readback wedge
PaymentRequest was fully compiled and linked into the engine, then hidden unconditionally at runtime.
WebPage.cpp gates it on an Apple Pay preference:

    #if ENABLE(PAYMENT_REQUEST)
        settings.setPaymentRequestEnabled(store.getBoolValueForKey(
            WebPreferencesKey::applePayEnabledKey()));
    #endif

but ApplePayEnabled is `condition: ENABLE(APPLE_PAY)`, which is OFF for this port. With APPLE_PAY
disabled the preference is compiled out of the WebKitFeature list and out of the set-by-name map, and
defaults to false everywhere - so window.PaymentRequest can never appear and no runtime API can reach
it. Every payment identifier (canMakePayment, PaymentResponse, PaymentRequestUpdateEvent,
paymentmethodchange) is present in the shipped library; only the switch is unreachable.

Patch WebPage.cpp so that when PAYMENT_REQUEST is built without APPLE_PAY the API is simply exposed.
With no payment handler registered, canMakePayment() resolves false and show() rejects, which is the
correct behaviour for a device that has no payment methods - the TouchPad has no Apple Pay, no Google
Pay and no secure element. Verified on device: the feature-detection test now passes.

Also add ISSUE-gpu-readback-wedge.md, a write-up of a pre-existing hang that is NOT fixed here. The
readback path in wpe-atlas-backend.c calls glFinish() with no timeout on the BrowserServer main
thread; when the Adreno 220 stops retiring commands the whole main loop blocks forever and the
browser becomes a no-op while the process still looks healthy. Reproduced on a stock 0.9.6 install as
well as on master, so it predates this work. The document also covers why the backend cannot
currently be rebuilt from source, which is what blocks fixing it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015tsY5bvFrBNb5e4pfYreJH
2026-07-25 12:13:53 -04:00
codepoet80andClaude Opus 5 c5d8aa9088 webkit: cap viewport units too, not just the ICB
The first version of this patch capped RenderView::viewHeight() and
availableLogicalHeight(), which fixes `height: 100%`. But viewport units resolve
through a completely separate path - LocalFrameView::sizeForCSS*ViewportUnits()
via RenderView::sizeForCSS{Default,Small,Large,Dynamic}ViewportUnits() - and
were left resolving against the whole pan buffer. So `height: 100vh` still
produced the original "content starts a screen and a half down" bug, just on a
different set of pages, and the fix would have looked complete while being half
done. All four accessors are now capped the same way, so vh/svh/lvh/dvh and
percentage heights agree.

Also documents a limitation rather than leaving it to be discovered:
ATLAS_ICB_HEIGHT is read once at WebProcess startup and cannot follow rotation.
It is the panel height from luna.conf DisplayHeight (768 on a TouchPad), exact
in landscape; in portrait the visible height is 1024, so pages get a viewport
256px short. That is far better than the ~3072 they had, but not exact, and
fixing it properly means pushing the value over IPC instead of through the
environment. The cap deliberately errs SMALL - capping at 1024 would leave
landscape over-tall, which is the bug this patch exists to fix.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015tsY5bvFrBNb5e4pfYreJH
2026-07-25 09:35:10 -04:00
codepoet80andClaude Opus 5 2ef420908c build: fail on ANY call to address 0
The four QtWebKit hit-test/cache stubs that used to populate the allowlist now
have real WPE implementations or fail safe, so the binary has none left. Empty
allowlist means any future unresolved symbol - a missing source file or library
- fails the build instead of shipping a latent SIGSEGV.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015tsY5bvFrBNb5e4pfYreJH
2026-07-25 09:23:13 -04:00
codepoet80andClaude Opus 5 d794de193c webkit: enable DEVICE_ORIENTATION, and add a feature-parity check
ENABLE_DEVICE_ORIENTATION defaults OFF and this build had it off, so the
engine was missing JSDeviceMotionEvent and JSDeviceOrientationEvent - i.e. the
DeviceOrientation/DeviceMotion APIs that atlas-sensord feeds and that the
0.9.7 "motion & orientation sensors" release exists for. It would have shipped
as a silent regression against the engine it replaces.

Nothing already in place could have caught it. The NEEDED diff cannot: the
feature needs no extra library. Spot-checking a handful of binding classes
cannot either, unless you happen to spot-check that one.

So add a `parity` mode that diffs the FULL set of generated JS<Name> binding
classes against a reference libWPEWebKit. Every enabled IDL interface
contributes one, which makes the set a sensitive and very cheap proxy for the
feature configuration. Missing entries fail; extra entries are reported but
allowed. JavaScriptCore's C-API exports (JSValueToNumber and friends) are
filtered out - they are not interface bindings and only add noise.

Run it after every build:

    ./build-webkit-atlas.sh parity

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015tsY5bvFrBNb5e4pfYreJH
2026-07-25 08:13:48 -04:00
codepoet80andClaude Opus 5 79af640eff webkit: cap the initial containing block to one screen (the "loads halfway" bug)
Pages that centre themselves with a quirks-mode `height: 100%` table - the
reported case is home.jonandnic.com - opened with their content roughly a screen
and a half below the fold.

The engine renders into a pan buffer four screens tall and the adapter pans
within it, because this Adreno cannot read back per scroll frame. That height is
a PAINT extent, but WebKit uses the view height as the initial containing block,
so `height: 100%` resolved against ~3072px instead of the 768px the user can
actually see. Measured on device before the fix, on that page:

    content height = 3072 (virt 3072)

i.e. the document was exactly as tall as the buffer. After:

    content height = 998 (virt 3072)

the page reports its natural height while the buffer stays four screens, so
smooth scrolling is unaffected. As a side effect the adapter's scroll range is
now correct too: the old value was silently discarded, because
onContentHeight() treats "height == m_virtualWindowHeight" as a reflow artifact
and never reported it.

Implemented as a cap on RenderView::viewHeight() and
RenderView::availableLogicalHeight(), driven by ATLAS_ICB_HEIGHT. Deliberately
NOT via setUseFixedLayout()/setFixedLayoutSize(), which is the obvious lever:
on WPE, enabling fixed layout activates this in viewportPropertiesDidChange()

    if (view && view->useFixedLayout() && !m_viewSize.isEmpty()) {
        setFixedLayoutSize(roundedIntSize(attr.layoutSize));
        scaleView(deviceWidth / attr.layoutSize.width());
    }

so every page carrying a viewport meta tag would recompute the layout size and
rescale the view, clobbering ours - a large behaviour change for most of the
modern web. Capping the ICB touches nothing else: view size, visible content
rect, scrolling and the painted region are all unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015tsY5bvFrBNb5e4pfYreJH
2026-07-25 08:04:51 -04:00
codepoet80andClaude Opus 5 41fe97076a BUILDING.md: WPE WebKit is no longer a prebuilt dependency
Section 7's provenance table said the whole WebKit runtime came from
$DEVICEROOT_REF. That is now only true for the parts we still do not build -
the GStreamer stack, the glibc-2.23 runtime, share/, webkit-data, the config
files and the camera/mic daemons. libWPEWebKit, the WebProcess/NetworkProcess
launchers and the injected bundle come from build-webkit-atlas.sh when a
destroot is present.

Also lists the webkit-deps phase in the §3 table and adds the `everything`
shortcut, so the sysroot section covers what §8 actually needs.

Verified end to end on device from a clean ipk install: BrowserServer-atlas and
WPEWebProcess both running, frame_rendered #0/#1 at 1024x3072, zero
shared-object errors, zero cores, installed libWPEWebKit md5 matching the
from-source build.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015tsY5bvFrBNb5e4pfYreJH
2026-07-25 02:58:44 -04:00
codepoet80andClaude Opus 5 6c66ea71a6 ipk: patchelf the from-source WebKit launchers, and guard it
With WebKit built from source the browser started, stayed up, and rendered
nothing. The only symptom was buried in the engine log:

    WPEWebProcess: error while loading shared libraries:
    libWPEWebKit-2.0.so.1: cannot open shared object file

CMake drops the build RPATH at install time unless CMAKE_INSTALL_RPATH is set,
so the freshly built WPEWebProcess/WPENetworkProcess had no RPATH at all and
still pointed at the host-default interpreter /lib/ld-linux.so.3 - which on the
device is the ancient system glibc 2.8, not the bundled 2.23. The shipped
binaries carry the deviceroot loader and rpath; ours now get the same treatment
via patchelf, mirroring deploy-252.sh.

This failure mode deserves the guard it now has: BrowserServer keeps running, so
the app looks healthy, the launcher just dies on every page load. Packaging now
refuses to build an ipk whose launchers lack the bundled loader or an RPATH.

Verified on device with a truncated log: BrowserServer-atlas and WPEWebProcess
both alive, frame_rendered #0/#1 at 1024x3072, zero shared-object errors, zero
cores, and the installed libWPEWebKit md5 matching our from-source build.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015tsY5bvFrBNb5e4pfYreJH
2026-07-25 02:43:19 -04:00
codepoet80andClaude Opus 5 074e7d5432 ipk: ship the from-source WPE WebKit when one has been built
build-ipk-atlas.sh took the whole engine runtime from $DEVICEROOT_REF, so even
after building WebKit the ipk still carried the prebuilt libWPEWebKit. It now
overlays the build-webkit-atlas.sh destroot when present: the library, the
WebProcess/NetworkProcess launchers, the injected bundle and the inspector
resources beside it.

Copies the real file rather than the .so -> .so.1 -> .so.1.9.8 symlink chain,
because cryptofs has no symlinks - the deviceroot keeps one real file per
SONAME, the same rule full-restore-atlas.sh follows.

The final line of output now states plainly whether the engine in the package
was built from source or came from the reference deviceroot, so it is not
possible to hand someone an ipk and be unsure which one it contains.
WEBKIT_DESTROOT= (empty) forces the prebuilt path.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015tsY5bvFrBNb5e4pfYreJH
2026-07-25 00:53:06 -04:00
codepoet80andClaude Opus 5 29a7250b47 webkit: restore libwoff2 and MPEG-TS, which the build was silently dropping
Diffing our libWPEWebKit's NEEDED list against the shipped one showed two
libraries missing from ours: libwoff2dec and libgstmpegts-1.0.

The WOFF2 one is a cross-compilation trap worth spelling out. WebKit probes
whether FreeType itself can decompress WOFF2 and, if it can, turns USE_WOFF2
back off and uses FreeType instead. That probe compiles against the Debian
FreeType headers we stage, which do have WOFF2 support - but the FreeType the
DEVICE ships does not: its NEEDED list is just libpthread and libc, with no
brotli anywhere. So the build cheerfully dropped libwoff2dec and would have
produced an engine that hands WOFF2 fonts to a FreeType that cannot decompress
them. Every WOFF2 web font would fail at runtime, on a build that compiled and
linked perfectly. Forcing FREETYPE_WOFF2_SUPPORT_IS_AVAILABLE=OFF restores
libwoff2, matching the shipped engine.

USE_GSTREAMER_MPEGTS simply defaults off; the shipped engine links
libgstmpegts-1.0 for AAC-in-MPEG-TS and the HLS path.

Everything else already matched: the generated binding classes for WebGL,
WebGL2, ServiceWorker, PaymentRequest, EncryptedMedia, RTCPeerConnection,
MediaStreamTrack, SpeechSynthesis, Gamepad and OffscreenCanvas are all present
in both, WebDriver is absent from both, and the Adreno ANGLE fallback marker is
in ours.

Diff the NEEDED lists after any change to this file - it is the cheapest way to
catch this class of silent feature loss.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015tsY5bvFrBNb5e4pfYreJH
2026-07-25 00:49:11 -04:00
codepoet80andClaude Opus 5 4260bed726 webkit: fix stale comment left behind by the job-count change
The divisor moved to 4 GB but the comment above it still said 3 GB.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015tsY5bvFrBNb5e4pfYreJH
2026-07-25 00:05:47 -04:00
codepoet80andClaude Opus 5 83f34c2768 webkit: budget 4 GB per compile job, not 3
3 GB/job resolved to -j10 on a 31 GB host, i.e. 30 GB of headroom consumed at
peak - no margin for the linker or anything else on the machine. 4 GB/job gives
-j7 there, which leaves room and still keeps all cores busy for most of the
build.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015tsY5bvFrBNb5e4pfYreJH
2026-07-25 00:05:28 -04:00
codepoet80andClaude Opus 5 8b1c661928 webkit: pick a memory-aware default job count
WebCore's unified sources routinely push a single cc1plus past 2 GB, so -j12 on
this 31 GB box gets OOM-killed partway through WebCore. The failure is opaque:
ninja prints only "fatal error: Killed signal terminated program cc1plus", with
no compiler diagnostic, which reads like a toolchain bug rather than memory
pressure. Budget ~3 GB per job, capped at the core count; JOBS= still overrides.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015tsY5bvFrBNb5e4pfYreJH
2026-07-25 00:05:11 -04:00
codepoet80andClaude Opus 5 3196db2434 webkit: supply the missing ssrc() accessor, fix PaymentRequest on gcc 12,
correct the ServiceWorker/EncryptedMedia feature flags

Three things, all found by actually compiling.

1. The WebRTC patch set is incomplete. webrtc-receive-av.patch calls
   s->ssrc() on RealtimeOutgoing{Audio,Video}SourceGStreamer and
   webrtc-sendpath-ssrc.patch reads m_ssrc, but no patch adds either - they
   only ever existed in the tree the patches were cut from, so the series has
   never built standalone. Adds the member and accessor, generating the SSRC in
   initialize(): it has to exist before the first OFFER is built (the endpoint
   stamps a=ssrc onto the codec caps) and that happens long before any
   packetizer is created, so it cannot come from the packetizer.

2. PaymentRequest.cpp assigns `details.shippingOptions = { { } }` to a
   std::optional<Vector<T>>. gcc 12 in C++23 finds that ambiguous - the inner
   braces could initialise the contained Vector or the Vector's first element.
   Naming the type resolves it without changing behaviour.

3. The feature flags were partly wrong, and the method that produced them was
   wrong. Grepping the shipped library for an interface name ("ServiceWorker")
   proves nothing: those strings live in IDL-derived name tables whether or not
   the feature is compiled in. The generated binding class is the real signal -
   JSServiceWorkerContainer, JSPaymentRequest, JSMediaKeys are only linked when
   the feature is on. By that test the shipped engine has ServiceWorker and
   EncryptedMedia ON, not off as previously recorded here. WebDriver really is
   off (no JSWebDriver). The script now documents the check so the next person
   does not repeat the mistake.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015tsY5bvFrBNb5e4pfYreJH
2026-07-24 23:22:24 -04:00
codepoet80andClaude Opus 5 3bce385bfd webkit: fix roundeven on glibc 2.23, and stop two builds sharing one log
roundeven()/roundevenf() are C23 and only landed in glibc 2.25. WebKit ships
fallback implementations but guards them with

    #if (OS(LINUX) && !defined(__GLIBC__)) || OS(HAIKU)

i.e. only for non-glibc Linux (musl) and Haiku - it assumes any glibc has them.
The Atlas engine targets the TouchPad's bundled glibc 2.23, so JavaScriptCore's
MathCommon.cpp fails to compile. Extend the guard with a __GLIBC_PREREQ(2, 25)
check rather than forcing the fallback everywhere, so newer glibc still uses the
libm versions.

Also make the build step defensive about its log. It wrote to a fixed
build.log with truncation, so starting a second build while one was running left
both ninjas writing at independent offsets in the same file: the result was a
log with a 600 KB run of padding where the error should have been, no "FAILED"
or "error:" anywhere, and a stale "ninja: build stopped" from the earlier run -
which reads exactly like a mysterious failure of the build that is in fact still
running fine. Now it refuses to start when a ninja is already running, and
rotates the previous log to build.log.prev instead of clobbering it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015tsY5bvFrBNb5e4pfYreJH
2026-07-24 23:03:43 -04:00
codepoet80andClaude Opus 5 144a278c2a BUILDING.md: document building WPE WebKit from source
Adds section 8 covering the WebKit cross-build: the dependency-staging model
(headers only, pinned to the device's sonames rather than to current versions),
the patch-series ordering requirement, and the four cross-build traps that each
cost a failed configure - stale CFLAGS/LDFLAGS from env-atlas-cross.sh,
CMAKE_SYSROOT hiding libc's headers, rootfs dragging in the device's glibc 2.8
libpthread, and Debian multiarch hiding headers pkg-config never mentions.

Also records that pkg-config --modversion tells you nothing useful (only
--cflags --libs walks transitive Requires), which is why a missing libpcre2-8.pc
presents as "Could NOT find Soup3", and that apt-get download silently drops the
whole batch when one package name is wrong.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015tsY5bvFrBNb5e4pfYreJH
2026-07-24 22:52:38 -04:00
codepoet80andClaude Opus 5 ab34b01de6 Cross-build WPE WebKit 2.52.4: toolchain, dependency staging, build script
Everything needed to build the engine itself from source, rather than taking a
prebuilt libWPEWebKit off a device.

cmake/atlas-arm-toolchain.cmake - portable reconstruction of the unpublished
cmake-toolchain-glibc-gcc125.cmake. Three things in it are non-obvious and each
cost a failed configure to find:

- No CMAKE_SYSROOT. --sysroot would replace the toolchain's own sysroot, so
  libc's headers stop resolving. Dependency headers arrive as explicit -I from
  pkg-config instead.
- $STAGING/rootfs is NOT on the link path, unlike the BrowserServer build.
  rootfs is the device's SYSTEM tree (glibc 2.8); since linklib deliberately
  excludes libc/libpthread, ld falls through to rootfs and picks up the 2.8
  libpthread, which needs GLIBC_PRIVATE symbols our glibc 2.23 does not have.
- /usr/include/<triplet> is added explicitly. Debian multiarch puts gpg-error.h,
  ffi.h, jconfig.h, openssl/ and libxslt/ there, and pkg-config never emits it.

Also: env-atlas-cross.sh's CFLAGS/LDFLAGS must be unset before configuring.
-L$STAGING/lib puts the DEVICE's libc.so on the link line, which shadows the
toolchain's and leaves __libc_csu_init undefined - CMake's "can the compiler
build a trivial program" check fails outright.

stage-sysroot-atlas.sh gains a webkit-deps phase, driven by webkitdeps.list: 65
armhf dev packages pinned by version and sha256, fetched through an unprivileged
apt root spanning bookworm/trixie/jammy. Versions match the DEVICE's sonames,
not what is current - libicu-dev must be 70.x because ICU mangles every symbol
with its major (u_strToUpper_70), GStreamer is 1.20 to match the device's
1.20.7, and jpeg comes from Debian for libjpeg.so.62. Roughly half the list is
transitive pkg-config providers; without their .pc files pkg-config fails and
WebKit's Find modules quietly fall back to header-scraping and report versions
like "..", which is how a missing libpcre2-8.pc surfaces as "Could NOT find
Soup3". The dev debs' libX.so symlinks all dangle (the runtime lives in the
non-dev package), so each is repointed at the real library the device ships.

The feature set in build-webkit-atlas.sh is derived from the shipped
libWPEWebKit-2.0.so.1, not from the old build-webkit-252.sh - that script
disables video, GStreamer, WebRTC and WebGL, which the shipped engine plainly
has. Its 65 NEEDED libraries and symbol table give: DFG JIT on (343 refs, zero
CLoop, which is also why the softfp-jit patch exists), WebGL/WebGL2,
MediaStream, WebRTC, WebAssembly, SpeechSynthesis via flite, Gamepad,
PaymentRequest, cairo not skia; ServiceWorker, WebDriver and EncryptedMedia off.

Adds one new patch: sysprof-platform.c's mkostemp fallback references O_BINARY
and O_CLOEXEC without including <fcntl.h>. That branch is dead on any kernel
with memfd_create (3.17+), so upstream never notices; Atlas builds against
2.6.32 headers for the TouchPad's 2.6.35 kernel, so it is the live path.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015tsY5bvFrBNb5e4pfYreJH
2026-07-24 22:50:35 -04:00
codepoet80andClaude Opus 5 7f439fe503 Make the WebKit patch series apply cleanly, and script it
Three problems stopped the Atlas patch series from applying to a pristine
wpewebkit-2.52.4 tarball:

- Order. mediastream-camera is authored on top of mdpdetile-videosink (same
  block in MediaPlayerPrivateGStreamer.cpp) and webrtc-mono-opus on top of
  webrtc-receive-av (same block in GStreamerMediaEndpoint.cpp). Applied in
  tarball order they fail. apply-webkit-patches.sh encodes the working order.

- wma-wmv-canplaytype.patch was not a valid diff at all. Its hunk header was a
  human note - "@@ ogg block closing brace, before "if (matroskaSupported)" @@" -
  so patch(1) rejected the whole file as garbage. Regenerated as a real unified
  diff against the pristine source; content is unchanged.

- mediastream-camera.patch's MediaPlayerPrivateGStreamer.cpp hunk was generated
  against a tree without mdpdetile-videosink's comment line, so the context did
  not match. Regenerated against the correct base (pristine + mdpdetile). The
  GStreamerVideoCapturer.cpp hunk is untouched.

Verified: all 13 patches now apply cleanly to a freshly extracted tarball, in
series order, and the script is idempotent (--forward, so re-runs skip rather
than reverse). Note webrtc-getstats-fix and webrtc-mono-opus report "already"
on a clean tree because webrtc-receive-av already carries those changes; both
were checked to be present in the resulting source.

Also add stage-hosttools-atlas.sh. WebKit's build needs host ruby (offlineasm,
the bindings generators) and unifdef, which are not installable here without
root; it fetches them with apt-get download and dpkg-deb -x into a private
prefix, and writes the PATH/LD_LIBRARY_PATH/RUBYLIB glue an extracted (never
installed) ruby needs to find its own stdlib.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015tsY5bvFrBNb5e4pfYreJH
2026-07-24 22:32:23 -04:00
32 changed files with 1475 additions and 511 deletions

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
# Generated by stage-hosttools-atlas.sh with absolute paths resolved for THIS machine
# ($HOSTTOOLS, default ~/hosttools). Committing it forces one developer's home directory
# onto everyone else, so it is generated locally and never tracked.
hosttools-env.sh
+187 -16
View File
@@ -93,7 +93,8 @@ The sysroot (`$STAGING`, default `~/atlas-staging`) holds the engine's **librari
matching **dev headers** (to compile against). It is built by one script:
```sh
atlas-wpe-env/stage-sysroot-atlas.sh all # = headers + device + linklib
atlas-wpe-env/stage-sysroot-atlas.sh all # = headers + device + linklib
atlas-wpe-env/stage-sysroot-atlas.sh everything # ... plus webkit-deps (needed only for §8)
```
or one phase at a time:
@@ -103,6 +104,7 @@ or one phase at a time:
| `headers` | `include/` — pinned Debian armhf dev debs (extracted, never installed) + host Khronos/zlib + libwpe + this repo's `reconstructed-headers/` | network |
| `device` | `lib/` (engine runtime, `deviceroot/wpe-252/lib`) and `rootfs/` (`/usr/lib` + `/lib`, ~84 MB, for `-rpath-link`) | a TouchPad running Atlas, over novacom |
| `linklib` | derives `linklib/` + the unversioned dev symlinks from `lib/` | — |
| `webkit-deps` | `webkitdeps/` — 65 pinned armhf dev packages (headers + `.pc`) for building WebKit itself, §8 | network |
Overridable: `STAGING`, `REPOS`, `DEB_CACHE`, `CRYPTO_DR`, `LIBWPE_TAG`.
@@ -261,6 +263,71 @@ binary. A/B on `example.com`: 113 vs 115 frames, 12 vs 13 `WPEWebProcess` spawns
`deploy-252.sh` / `redeploy-webkit.sh` cover the fuller flows (WebKit runtime, test harness).
### The deadlock watchdog and `-d`
> **As of Atlas 0.9.10 the watchdog is OFF (`-d 0`).** The section below describes why it existed and how
> it was tuned; keep it for the day someone builds a detector that works. What went wrong is that
> `YapServer`'s "stalled **and** idle" gate — the very thing that made a short `-d` safe — is *also* an
> exact description of a healthy engine with nothing to do. The heartbeat counter is only proof the main
> loop is BUSY, never proof it is ALIVE, so an idle engine looks identical to a wedged one. Measured on
> webOS CE 3.1.0 with one idle card open and nobody touching the tablet:
>
> BrowserServer-atlas: Deadlock detected; aborting! (13 cpu ticks in the last 90000ms)
> BrowserServer-atlas: Deadlock detected; aborting! (155 cpu ticks in the last 90000ms)
>
> Two aborts in six minutes, each tearing down and reloading the user's cards. Note both are far *below*
> the 2250-tick busy threshold, so the busy-stall deferral never engages — being idle is what condemns it.
>
> **Nothing replaces it.** Atlas does not attempt to detect a hang — every heuristic tried either fired
> at healthy idle engines or missed real wedges. Clearing one is a user action: the **Restart Browser
> Engine** menu item, which asks `atlas-sensord` to restart the `atlas` job over a loopback control
> socket on `127.0.0.1:8442`. That routing is forced — the Enyo app runs as `luna` and cannot exec, and
> anything through BS is dead when BS is wedged; sensord is root and does not depend on BS.
>
> Re-enable `-d` here only with a detector that has the same property: a heartbeat that advances
> unconditionally (proving the loop is ALIVE, not that it is BUSY), so "counter stalled" alone is the
> signal and the CPU gate can be dropped.
**The GPU wedge is fixed (2026-08-23)** — and it was never the GPU. See
`atlas-wpe-backend/ARCHITECTURE.md` ("The GPU wedge — root cause") for the full account. In short, two
bugs in `libWPEBackend-atlas.so`'s UIProcess frame channel:
1. the backend closed, on the first frame, the socketpair end it had *returned to WebKit* — but WebKit
adopts and closes that fd itself within milliseconds, so the backend's later `close()` hit whatever
had reused the number (proven on-device: the main loop was found blocked in `recv()` on an fd whose
peer was a WPEWebProcess's **WebKit IPC socket**);
2. the per-frame FRAME_ACK was never read by the WebProcess, so the blocking ack `send()` eventually
parked the main loop once the socket buffer filled — "right after a good frame".
Both are in `wpe-atlas-backend.c`; rebuild with `build-backend-atlas.sh` and the ipk picks it up.
The history below is kept because the watchdog settings it explains are still in the tree.
The boot wrapper used to run the engine with `-d 90000`. That number was load-bearing for the **GPU wedge**
([#3](https://github.com/Herrie82/atlas-wpe-env/issues/3)) before the fix above: a wedge parks BrowserServer's main thread in
`futex_wait_queue_me` (or `__skb_recv_datagram`) with yap still accepting but nothing being serviced, and the yap deadlock watchdog
(`YapServer.cpp`) was the **only** thing that recovered it — it `abort()`s, upstart respawns, and the app's
cards reload themselves.
It used to be `-d 600000`, raised from the 15 s default because a memory-pressure GC stall would trip the
watchdog and abort a perfectly healthy engine. The cost was that a wedge took **14 min 30 s** to clear,
which every user reads as permanent. `YapServer.cpp` now gates the abort on the process **also being
idle**, which distinguishes the two cases the tick counter alone cannot:
| | main loop ticking | process CPU |
|---|---|---|
| GC / swap-in stall | stalled | pegs a core → abort deferred (bounded by `kMaxBusyStalls`) |
| GPU wedge | stalled | ~idle → abort immediately |
Measured on-device 2026-08-03 against a real wedge: `Deadlock detected; aborting! (528 cpu ticks in the
last 90000ms)` — 528 against a 2250-tick (25% of one core) threshold — wedge to serving pages again in
**63 s**.
Two practical notes: that message goes to **syslog** (`/var/log/messages`), *not* `bs-atlas.log`, so grep
the right file when checking whether the watchdog fired. And do not lower `-d` below ~90 s on an engine
built **before** this gate, or GC stalls will start killing healthy engines again.
To recover a wedge by hand now that the watchdog is off: `stop atlas; start atlas` (the cards reload
themselves, same as they did after an abort).
## 7. Package the installable ipk ✅
`build-ipk-atlas.sh` produces the real, installable `org.webosports.app.atlas_<ver>_all.ipk` (~99 MB
@@ -270,7 +337,8 @@ which cannot run outside Herrie's tree (they source the unpublished `env-glibc-g
```sh
source atlas-wpe-env/env-atlas-cross.sh
atlas-wpe-env/build-ipk-atlas.sh # -> ~/atlas-ipk/org.webosports.app.atlas_<ver>_all.ipk
atlas-wpe-env/build-ipk-standalone.sh # -> atlas-browser-app/ipks/standalone/org.webosports.app.atlas_<ver>_all.ipk
atlas-wpe-env/build-ipk-feed.sh # -> atlas-browser-app/ipks/feed/... (Preware feed build)
DOSTRIP=0 atlas-wpe-env/build-ipk-atlas.sh # keep symbols, for gdb
```
@@ -281,11 +349,12 @@ DOSTRIP=0 atlas-wpe-env/build-ipk-atlas.sh # keep symbols, for gdb
| `BrowserServer-atlas`, `libWPEBackend-atlas.so` | **built from source here** (§5) |
| boot wrapper, NPAPI adapter, upstart jobs, ls2 roles, `atlas-sensord`, `qspkd`, postinst/prerm | committed in this repo |
| Enyo front-end (`appinfo`/`index.html`/`source`/`css`/`images`/`db`) | `atlas-browser-app` checkout |
| WPE WebKit runtime (`libWPEWebKit`, `WPEWebProcess`/`WPENetworkProcess`, injected bundle), GStreamer stack, glibc-2.23 runtime, `share/`, `webkit-data`, `fonts.conf`/`gstomx.conf`, `qcamd`/`qmicd` | **`$DEVICEROOT_REF`** — a deviceroot pulled off a working device |
| WPE WebKit (`libWPEWebKit`, `WPEWebProcess`/`WPENetworkProcess`, injected bundle) | **built from source** (§8), when a `build-webkit-atlas.sh` destroot is present |
| GStreamer stack, glibc-2.23 runtime, `share/`, `webkit-data`, `fonts.conf`/`gstomx.conf`, `qcamd`/`qmicd` | **`$DEVICEROOT_REF`** — a deviceroot pulled off a working device |
So this is not yet a from-scratch engine build: **WPE WebKit itself is still a prebuilt runtime.**
Rebuilding it (`build-webkit-252.sh`, ~40 min, plus the `patches/`) is the remaining milestone; everything
around it now reproduces.
**As of 2026-07-25 WPE WebKit is also built from source** (§8) and `build-ipk-atlas.sh` ships it,
falling back to `$DEVICEROOT_REF` only when no build is present. The final line of its output states
which engine the package actually contains.
**Get `$DEVICEROOT_REF`** — do this *before* removing the browser from a device, it is also your rollback
artifact:
@@ -308,17 +377,18 @@ the bundled `ld-linux.so.3`.
### Installing it
`postinst` must run as **root**, so install through Preware or WebOS Quick Install — *not* `palm-install`.
Since 0.9.10 the package carries its setup script under **both** names the two installers look for, so
either path completes on its own — see *Who runs the install scripts* below.
Headless over novacom, using the same appinstaller service those front-ends use:
```sh
novacom put file:///media/internal/atlas.ipk < ~/atlas-ipk/org.webosports.app.atlas_0.9.7_all.ipk
novacom put file:///media/internal/atlas.ipk < ~/Projects/atlas-browser-app/ipks/standalone/org.webosports.app.atlas_0.9.9_all.ipk
# then, ON THE DEVICE (see the -n warning below):
luna-send -n 20 -f palm://com.palm.appinstaller/installNoVerify \
'{"target":"/media/internal/atlas.ipk","subscribe":true,"uncompressedSize":214232}' > /tmp/reply.log 2>&1 &
LS=$!; i=0
while [ $i -lt 72 ]; do grep -q 'SUCCESS\|FAILED' /tmp/reply.log && break; sleep 5; i=$((i+1)); done
kill -9 $LS 2>/dev/null
sh /path/to/ipk-postinst.sh # installNoVerify does NOT run postinst — run it yourself, as root
```
> **`luna-send -n <n>` blocks until it receives exactly `n` replies.** `installNoVerify` emits only a
@@ -326,10 +396,52 @@ sh /path/to/ipk-postinst.sh # installNoVerify does NOT run postinst — r
> in the background with a bounded poll, as above. (`remove` happens to emit exactly 3, which is why
> `-n 3` returns cleanly there.)
>
> **`installNoVerify` installs the payload and registers the package, but does not execute `postinst`** —
> the rootfs bits (`/etc/event.d/atlas`, the NPAPI adapter, `/var/atlas252`, db8 kinds, ls2 roles) will
> all be missing and the engine will not start. Run `ipk-postinst.sh` manually as root afterwards. It is
> idempotent, so running it again after a Preware/Quick Install is harmless.
> **A standalone-target install restarts LunaSysMgr from its own postinst**, which kills the subscription
> `installNoVerify` is answering on — so the poll above often ends with
> `"com.palm.appinstaller is not running"` rather than `SUCCESS`, on an install that completed fine.
> Check the result on the device (below) instead of trusting the last subscription message.
#### Who runs the install scripts
`ipkg -o <root> install` — the command **both** installers use — does not run `postinst`. It says so:
Configuring org.webosports.app.atlas
(offline root mode: not running org.webosports.app.atlas.postinst)
The two front-ends handle that differently, and the difference is invisible until the browser renders
nothing:
| | what it does | what the package must ship |
|---|---|---|
| **Preware** (`org.webosinternals.ipkgservice`) | runs ipkg, then `IPKG_OFFLINE_ROOT=/media/cryptofs/apps /bin/sh <info>/<pkg>.postinst` itself | `postinst`/`prerm` in `control.tar.gz` |
| **`com.palm.appinstaller`** (WebOS Quick Install, tapped `.ipk`, `installNoVerify`) | runs ipkg and stops; separately `ar x`es the ipk and runs `<tmpdir>/pmPostInstall.script` (and `pmPreRemove.script` on removal) as root — webOS package format v2 | `pmPostInstall.script`/`pmPreRemove.script` as **ar members** |
With no `pmPostInstall.script` member the appinstaller writes a 0-byte placeholder into
`/media/cryptofs/apps/.scripts/<pkg>/` and reports **SUCCESS** for an install whose entire engine half is
missing. `build-ipk-atlas.sh` therefore emits the same two scripts twice, once under each name; only one
of them ever runs for a given install, and they are idempotent anyway.
Check afterwards that the engine half actually landed:
```sh
ls -l /usr/lib/BrowserPlugins/BrowserAdapterAtlas.so /etc/event.d/atlas /var/atlas252
ls -l /media/cryptofs/apps/usr/palm/applications/org.webosports.app.atlas/deviceroot/wpe-252/lib/libEGL.so.1
# ^ should be the DEVICE's Adreno driver (171517 bytes), not the bundled fallback
ps -ef | grep BrowserServer-atlas # running, with -d 0
```
#### Uninstalling: kill the helper daemons first
`/media/cryptofs` is FUSE — unlinking a file a process still has open renames it to `.fuse_hiddenXXXXXXXX`
instead of removing it. The boot wrapper backgrounds `qcamd`/`qspkd`/`qmicd` as children of the engine, and
if the engine dies without reaping them they re-parent to init and keep holding the engine libs open. A
`prerm` that only kills `BrowserServer-atlas` therefore leaves an app directory `rm -rf` cannot remove:
rm: can't remove '.../deviceroot/atlas': Directory not empty
rm: can't remove '.../deviceroot/wpe-252/lib': Directory not empty
leaving an empty `deviceroot` skeleton that the next install unpacks on top of. `ipk-prerm.sh` kills all of
`BrowserServer-atlas qcamd qspkd qmicd atlas-sensord` (TERM then KILL) and sweeps `.fuse_hidden*`.
`postinst` copies the device's real Adreno driver over the versioned GPU sonames, creates the
`/var/atlas252` bridge symlink, installs the adapter/upstart/ls2-role/db8 files into the rootfs, registers
@@ -353,8 +465,67 @@ that is how the `stage-sysroot-atlas.sh` output was verified against the hand-as
Add `-ffile-prefix-map=$STAGING=/staging` (and a `SOURCE_DATE_EPOCH`-derived date) if you ever need
byte-reproducible output.
### Not required for engine work
## 8. Building WPE WebKit itself
Rebuilding **WPE WebKit itself** (`build-webkit-252.sh`, ~40 min) is only needed when changing WebKit
source or its `patches/`. For backend/BrowserServer changes you link against the WebKit libs pulled in
step 3.
Only needed when changing WebKit source or its `patches/` — for backend/BrowserServer work you link
against the WebKit libs pulled in step 3. But this is what makes the build reproducible end-to-end
instead of depending on a prebuilt engine runtime.
```sh
atlas-wpe-env/stage-hosttools-atlas.sh # ruby + unifdef, unprivileged
atlas-wpe-env/stage-sysroot-atlas.sh webkit-deps # 65 pinned armhf dev packages
source atlas-wpe-env/env-atlas-cross.sh
source atlas-wpe-env/hosttools-env.sh
atlas-wpe-env/apply-webkit-patches.sh # extract 2.52.4 + the Atlas series, in order
atlas-wpe-env/build-webkit-atlas.sh configure
atlas-wpe-env/build-webkit-atlas.sh build # ~8500 targets
```
> **`build-webkit-252.sh` is not this.** That script disables VIDEO, GSTREAMER, WEBRTC and WEBGL — the
> shipped engine plainly has all of them. It is an experiment, kept for reference. The feature set in
> `build-webkit-atlas.sh` was reconstructed from the shipped `libWPEWebKit-2.0.so.1`: its 65 `NEEDED`
> libraries and its symbol table (343 DFG references and zero CLoop → **JIT is on**, which is also why
> `wpewebkit-2.52.4-softfp-jit.patch` exists).
**Patch order matters.** `mediastream-camera` is authored on top of `mdpdetile-videosink`, and
`webrtc-mono-opus` on top of `webrtc-receive-av`; applying them alphabetically fails.
`apply-webkit-patches.sh` encodes the working order and is idempotent.
**Dependencies are headers, not builds.** The engine links what the device already ships, so
`webkit-deps` stages only dev headers and `.pc` files — 65 armhf packages pinned by version + sha256 in
[`webkitdeps.list`](webkitdeps.list), fetched through an unprivileged apt root spanning
bookworm/trixie/jammy. Versions track the **device's sonames**, not what is current:
| Package | Pinned to | Because |
|---------|-----------|---------|
| `libicu-dev` | **70.1** (jammy) | ICU mangles every symbol with its major (`u_strToUpper_70`); any other ICU will not link against the device's `libicuuc.so.70` |
| `libgstreamer1.0-dev` + plugins | **1.20.1** (jammy) | device ships GStreamer 1.20.7 |
| `libjpeg62-turbo-dev` | Debian | device ships `libjpeg.so.62`; Ubuntu's is `libjpeg.so.8` |
| `libcairo2-dev` | 1.18 (trixie) | device ships cairo 1.18.0 |
About half the list is *transitive pkg-config providers* (libpcre2, brotli, expat, libdw, libunwind,
orc, nghttp2, ffi, the X11 headers cairo's `.pc` references). They matter more than they look:
> **`pkg-config --modversion` succeeding proves nothing.** Only `--cflags --libs` walks the transitive
> `Requires:`. A missing `libpcre2-8.pc` surfaces as `Could NOT find Soup3: Found unsuitable version ".."`,
> because WebKit's Find modules silently fall back to scraping version headers when pkg-config fails.
> Also, `apt-get download` aborts the **entire batch** on one bad package name — fetch one at a time, or
> you will believe you staged things you did not.
**Four cross-build traps**, each worth a failed configure:
1. **`unset CFLAGS CXXFLAGS LDFLAGS` before cmake.** `env-atlas-cross.sh` aims them at the BrowserServer
build, and `-L$STAGING/lib` puts the *device's* `libc.so` on the link line, shadowing the toolchain's
and leaving `__libc_csu_init` undefined — CMake's trivial-program check fails outright.
2. **No `CMAKE_SYSROOT`.** `--sysroot` replaces the toolchain's own sysroot, so libc's headers stop
resolving. Dependency headers arrive as explicit `-I` from pkg-config instead.
3. **`$STAGING/rootfs` must not be on the link path** — unlike the BrowserServer build. rootfs is the
device's *system* tree (glibc 2.8). Because `linklib` deliberately excludes libc/libpthread, ld falls
through to rootfs and picks up the 2.8 `libpthread.so.0`, whose `GLIBC_PRIVATE` symbols
(`__default_sa_restorer_v2`, `h_errno`, …) do not exist in glibc 2.23.
4. **Add `/usr/include/<triplet>` explicitly.** Debian multiarch keeps `gpg-error.h`, `ffi.h`,
`jconfig.h`, `openssl/` and `libxslt/` there, and pkg-config never emits that directory.
`CMAKE_INSTALL_PREFIX` is the **device** path (`/var/atlas252`, the short symlink `postinst` creates),
with `DESTDIR` staging the tree locally. That bakes correct `PKGLIBEXECDIR`/`PKGLIBDIR` at build time,
so the binary prefix-patching `deploy-252.sh` performs is no longer needed.
-148
View File
@@ -1,148 +0,0 @@
# Atlas WPE on the HP Pre 3 (webOS 2.2.4) — low-memory port
Goal: a **modern browser (WPE WebKit 2.52, real JS + OAuth2)** on the HP Pre 3 — 512 MB RAM,
single-core 1.4 GHz (MSM8x55), Adreno 205, 480×800, webOS 2.2.4 (mantaray). The bottleneck is **RAM**,
not CPU. Everything below exists to (a) never allocate the multi-screen-tall pan buffer, (b) keep a
single WebProcess with a low memory cap, and (c) avoid running a heavyweight tablet UI on top.
Feasibility was confirmed against the extracted rootfs
(`/home/herrie/webos/Pre3/nova-cust-image-mantaray.rootfs`): it has **Enyo 1.0**, the stock
`BrowserAdapter.so` + `BrowserServer` (so the NPAPI/yap plumbing exists), and `media/internal`. The
engine binaries are largely self-contained (bundled glibc/libs), so the TouchPad-built WPE engine is
expected to run on 2.2.4; the true unknowns are the GPU driver (Adreno 205 vs 220) and whether stock
LunaSysMgr 2.2.4 composites the NPAPI card the same way — both only testable on-device.
---
## Two paths
**Path B — engine swap under the stock Mojo browser (RECOMMENDED end state).**
Keep the stock webOS phone browser UI (`com.palm.app.browser`, already 480×800, already the default-
browser slot, lightweight Mojo) and swap ONLY the engine underneath it to WPE. No Enyo app on the
device. This is the right long-term phone experience and what you proposed.
Why it works (verified): the stock Mojo UI only speaks the **NPAPI JS contract** to the adapter plugin;
the yap wire protocol is internal to the adapter+server pair (they ship together), so yap divergence is
irrelevant. The Atlas adapter already implements ~95% of the NPAPI methods/callbacks the stock
framework `webview` widget uses. The only required change is registering the adapter under the stock
mime/socket.
**Path A — Enyo Atlas app, low-memory profile (good FIRST smoke test).**
Ship the existing Atlas Enyo app with a global low-memory profile. Use this first because
Atlas-app + Atlas-adapter + Atlas-server is the **known-good** combination (it works on the TouchPad),
so if it renders on the Pre 3 you've proven *the WPE engine runs on 2.2.4 hardware* — independent of
the Mojo NPAPI-contract unknown. Then move to Path B for the production UI.
Suggested order: **smoke-test with A → switch to B.**
---
## What changed (all on `pre3-lowmem` branches; nothing merged to master/main)
| Repo | Branch | Change |
|------|--------|--------|
| `atlas-browser-app` | `pre3-lowmem` | Global low-memory profile: hardware autodetect (`AtlasEngineOverride.js` sets `window.__atlasLowMem` from screen size/model), every card born `simpleMode`, `lowMemoryMode` pref + Preferences toggle, single-card "open in new card", `css/phone.css` (480×800). |
| `atlas-wpe-backend` | `pre3-lowmem` | `bpwpe_force_low_mem()` — forces viewport-only rendering for **every** page (no `atlas-simple:` marker needed) when low-RAM or forced. **Essential for Path B** (Mojo UI can't send the marker). No-op on the TouchPad. Rebased on top of the now-committed Spotify-UA/cache work on `master`, so the branch has both. |
| `BrowserAdapter` | `pre3-lowmem` | Optional `-DATLAS_STOCK_BROWSER` build → registers stock mime `application/x-palm-browser` + client name `browser`. **Path B enabler.** Default build unchanged. |
| `atlas-wpe-env` | `pre3-lowmem` | `device-profile-pre3` (RAM/core/buffer overrides), wrapper sources `$ATLAS/device-profile` last, `upstart-browser-pre3` (BROWSERSERVER_NAME=browser), this doc. |
### Engine tuning applied on the Pre 3 (`ipk-build/pull/device-profile-pre3`)
- `JSC_forceRAMSize=96MB` (TouchPad 192) · `WEBKIT_NICOSIA_PAINTING_THREADS=1` (single core)
- `BPWPE_FORCE_SIMPLE=1` + `BPWPE_SIMPLE_SCREENS=1` → exact-viewport (mult=1) buffers
- `BPWPE_MEM_LIMIT=160` (TouchPad 480) · `BPWPE_NO_STRIP=0` (strip wins for viewport-sized rendering)
- RGB565 tiles + `MALLOC_ARENA_MAX=2` kept from Phase-1.
---
## Build
> **Already built (2026-07-28) → `~/webos/Pre3/atlas-pre3-build/`** (see its `DEPLOY-README.md`):
> the Path-A app ipk (`org.webosports.app.atlas_0.9.7_all.ipk`) and the Path-B stock adapter
> (`BrowserAdapter-stock-pre3.so`, mime `application/x-palm-browser`, verified). **Reuse the TouchPad
> engine as-is** — Pre 3 and TouchPad share ABI (ARMv7 softfp cortex-a8; adapter is classic armv6), so
> `libWPEWebKit`/`WPEWebProcess`/GStreamer/`BrowserServer-atlas` need **no rebuild**. Path B renders
> viewport-only via the adapter's `atlas-simple:` prepend + `device-profile` env, so even the server is
> reused. The steps below are only if you want to rebuild from scratch.
>
> **Engine note:** the reused engine is **symbol-stripped (67 MB) but NOT feature-stripped** — it still
> carries video / WebRTC / WebAudio + the full GStreamer stack. The Phase-3 feature-strip
> (`-DENABLE_VIDEO=OFF -DENABLE_WEB_RTC=OFF -DENABLE_WEB_AUDIO=OFF -DUSE_AVIF=OFF -DUSE_JPEGXL=OFF`,
> `GPU_PROCESS=OFF`) reclaims RAM/flash but needs the ~40-min WebKit rebuild in a separate build dir;
> it is not in the reuse ipk.
>
> **The prebuilt full Pre 3 ipk is `~/webos/Pre3/atlas-pre3-build/org.webosports.app.atlas_0.9.7_pre3.ipk`**
> (built by `build-ipk-pre3.sh`).
All builds are ARM cross-builds run from `atlas-wpe-env` (see the existing scripts). Check out the
`pre3-lowmem` branch in each repo first.
```sh
for r in atlas-browser-app atlas-wpe-backend BrowserAdapter atlas-wpe-env; do
git -C ~/Documents/GitHub/$r checkout pre3-lowmem
done
```
> **Backend note:** the Spotify-UA + cache-on-tmpfs work is now committed on `atlas-wpe-backend/master`,
> and `pre3-lowmem` is rebased on top of it — so the branch contains **both** that work and the
> force-simple change. Just check it out. (The force-simple commit adds `bpwpe_force_low_mem()` near
> `lunaConfInt` and one call in `openUrl()`; it composes with the WIP's simple-mode prewarm teardown.)
1. **Engine server** (both paths) — includes the backend force-simple change:
`./build-browserserver-atlas.sh` then link (see repo). Produces `BrowserServer-atlas`.
2. **Adapter**:
- Path A: `./deploy-adapter.sh` as usual → `BrowserAdapterAtlas.so` (mime `x-atlas-browser`).
- Path B: build the adapter with **`-DATLAS_STOCK_BROWSER`** added to its CXXFLAGS → a `.so` that
registers `application/x-palm-browser`. Install it as the device's
`/usr/lib/BrowserPlugins/BrowserAdapter.so` (back up the stock one first).
3. **App front-end** (Path A only): `palm-package ~/Documents/GitHub/atlas-browser-app`, or the full
`build-ipk-atlas.sh`. No compile step. (No rename needed for the smoke test — keep the
`org.webosports.app.atlas` id; Path B is what takes over `com.palm.app.browser`.)
> The stripped "Phase-3" engine (drop video/webrtc/webaudio/avif/jpegxl, `GPU_PROCESS=OFF`) is an
> **optimization, not required for the first test** — the current engine is self-contained and should
> run. When you want it, fork `build-webkit-252.sh` to a separate build dir + staging prefix and start
> from the LIVE `_b/CMakeCache.txt` flags (see the env map notes), then apply the drops. It buys the
> most headroom for the marginal heavy-SPA cases.
---
## Deploy + test
### Path A (Enyo smoke test)
1. Install the Atlas ipk (or drop the app front-end into its cryptofs app dir).
2. Deploy the engine deviceroot to the Pre 3; ship `device-profile-pre3` as `$ATLAS/device-profile`
next to the wrapper; install `BrowserAdapterAtlas.so` → `/usr/lib/BrowserPlugins/`; install the
`atlas` upstart job (BROWSERSERVER_NAME=atlas).
3. `killall LunaSysMgr`; launch Atlas.
4. **Expect:** the app opens phone-sized; `[Atlas] lowMemory autodetect=true` in the log; pages render
viewport-only (no tall-buffer pan); an OAuth2 login (e.g. Google) completes. This proves the engine
on 2.2.4.
### Path B (engine swap — production phone browser)
1. Leave the stock `com.palm.app.browser` app **as-is**.
2. Back up `/usr/lib/BrowserPlugins/BrowserAdapter.so`, install the `-DATLAS_STOCK_BROWSER` adapter in
its place.
3. Deploy the engine deviceroot (with `device-profile`), install `upstart-browser-pre3` as
`/etc/event.d/browser-wpe` (BROWSERSERVER_NAME=browser → `/tmp/yapserver.browser`), adjust its `cd`
path to where you put the engine. Make sure the **stock** BrowserServer isn't also grabbing that
socket.
4. `killall LunaSysMgr`; open the stock Web app.
5. **Expect:** the stock UI renders modern pages via WPE. Watch `/media/ram/bs-atlas.log` for the
Connect handshake and `low-memory device/env -> forcing simple`.
**Path-B risks to watch (from the NPAPI compat review):**
- *Renders-but-blank* → the shared-buffer/offscreen paint handshake (`asyncCmdConnect 0x1000`
sharedBufferKey/size ↔ `Painted 0x2000` blit) between the stock widget's offscreen path and the WPE
backend. This is the deepest coupling; validate visually first.
- *Navigation stalls at start* → the widget gates the first `openURL` on `adapterInitialized` +
`serverConnected` firing in order.
- *Preferences clear / text-select errors* → 4 NPAPI methods not yet exposed (`clearCache`,
`clearCookies`, `ignoreMetaRefreshTags`, `setUserSelect`); non-fatal, listed as a follow-up in the
BrowserAdapter commit. Add them to `names[]`/`methods[]` when convenient.
---
## Reality check
OAuth2 flows, normal pages, and light SPAs are very achievable on 512 MB with this profile. A single
**heavy** SPA (WhatsApp/Teams/Gmail full, ~300 MB+ resident) may still OOM regardless — that's a
hardware limit, not a tuning gap. The stripped Phase-3 engine widens the margin but won't erase it.
+4 -2
View File
@@ -1,8 +1,10 @@
# atlas-wpe-env
Build environment, cross-build scripts, toolchain recipe, and deploy/packaging for the **Atlas**
browser engine on the HP TouchPad (webOS 3.0.5) — the WPE WebKit backend, `BrowserServer-atlas`, and
the self-contained IPK.
browser engine on the HP TouchPad (webOS 3.0.5 and webOS CE 3.1.0) — the WPE WebKit backend,
`BrowserServer-atlas`, and the self-contained IPK. One IPK installs on both OS versions; see
[BUILDING.md § Who runs the install scripts](BUILDING.md#who-runs-the-install-scripts) and the
`FEED_DEPENDS` note in `build-ipk-atlas.sh` for why that took three separate packaging fixes.
- **[BUILDING.md](BUILDING.md)** — reproduce the whole engine build from a clean host (toolchain →
sysroot → components → deploy).
+81
View File
@@ -0,0 +1,81 @@
#!/bin/bash
# Extract WPE WebKit 2.52.4 and apply the Atlas patch series, in order.
#
# WK_SRC=~/Projects/webkit-build ./apply-webkit-patches.sh # extract + patch
# ./apply-webkit-patches.sh --verify # patch a throwaway tree, report, delete
#
# ORDER MATTERS. Several patches touch the same files and were authored on top of each other:
# - mediastream-camera depends on mdpdetile-videosink (same block in MediaPlayerPrivateGStreamer.cpp)
# - webrtc-mono-opus depends on webrtc-receive-av (same block in GStreamerMediaEndpoint.cpp)
# Applying them in tarball/alphabetical order fails. The list below is the working order.
#
# Overridable: WK_SRC (build root), TARBALL, REPOS.
set -eu
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
REPOS="${REPOS:-$(dirname "$SCRIPT_DIR")}"
WK_SRC="${WK_SRC:-$REPOS/webkit-build}"
V=2.52.4
TARBALL="${TARBALL:-$HOME/webos/wpe/build/wpewebkit-$V.tar.xz}"
BK="$REPOS/atlas-wpe-backend/patches"
SERIES="
$BK/wpewebkit-$V-softfp-jit.patch
$BK/wpewebkit-$V-memorypressuremonitor-2.6.35.patch
$BK/wpewebkit-$V-audio-autoplay-toggle.patch
$BK/wpewebkit-$V-mdpdetile-videosink.patch
$BK/wpewebkit-$V-webrtc-receive-av.patch
$BK/wpewebkit-$V-wma-wmv-canplaytype.patch
$SCRIPT_DIR/wpe-$V-atlas-flite-speech-fixes.patch
$SCRIPT_DIR/wpe-$V-atlas-fullscreen-fixes.patch
$SCRIPT_DIR/wpe-$V-atlas-webgl-angle-fixes.patch
$SCRIPT_DIR/wpe-$V-atlas-webrtc-getstats-fix.patch
$SCRIPT_DIR/wpe-$V-atlas-webrtc-sendpath-ssrc.patch
$SCRIPT_DIR/wpe-$V-atlas-webrtc-mono-opus.patch
$SCRIPT_DIR/wpe-$V-atlas-mediastream-camera.patch
$SCRIPT_DIR/wpe-$V-atlas-sysprof-oldkernel-fcntl.patch
$SCRIPT_DIR/wpe-$V-atlas-glibc223-roundeven.patch
$SCRIPT_DIR/wpe-$V-atlas-webrtc-ssrc-accessor.patch
$SCRIPT_DIR/wpe-$V-atlas-paymentrequest-gcc12.patch
$SCRIPT_DIR/wpe-$V-atlas-icb-height-cap.patch
$SCRIPT_DIR/wpe-$V-atlas-paymentrequest-expose-without-applepay.patch
"
die(){ echo "apply-webkit-patches: $*" >&2; exit 1; }
[ -f "$TARBALL" ] || die "source tarball not found: $TARBALL (set TARBALL=)"
if [ "${1:-}" = "--verify" ]; then
WK_SRC=$(mktemp -d); trap 'rm -rf "$WK_SRC"' EXIT
echo "== verify mode: patching a throwaway tree in $WK_SRC =="
fi
mkdir -p "$WK_SRC"
TREE="$WK_SRC/wpewebkit-$V"
if [ ! -d "$TREE/Source" ]; then
echo "== extracting $(basename "$TARBALL") =="
tar xJf "$TARBALL" -C "$WK_SRC"
else
echo "== tree already extracted at $TREE (delete it to start clean) =="
fi
echo "== applying the Atlas patch series =="
fail=0
cd "$TREE"
for p in $SERIES; do
n=$(basename "$p")
[ -f "$p" ] || { echo " MISSING $n"; fail=1; continue; }
# --forward makes re-runs idempotent: an already-applied patch is skipped, not reversed.
out=$(patch -p1 --forward < "$p" 2>&1) || true
if echo "$out" | grep -q "FAILED"; then
echo " FAILED $n"; echo "$out" | grep -E "FAILED|Hunk" | sed 's/^/ /'; fail=1
elif echo "$out" | grep -q "previously applied\|Skipping patch"; then
echo " already $n"
else
echo " applied $n"
fi
done
[ "$fail" = 0 ] || die "patch series did not apply cleanly"
find "$TREE" -name '*.rej' -delete 2>/dev/null || true
find "$TREE" -name '*.orig' -delete 2>/dev/null || true
echo "== patch series applied cleanly -> $TREE =="
+5 -8
View File
@@ -111,15 +111,12 @@ echo "== 4. link BrowserServer-atlas (bundled ld-linux + rpath; toolchain provid
-Wl,-rpath-link,"$LL" -Wl,-rpath-link,"$RL/usr/lib" -Wl,-rpath-link,"$RL/lib" -Wl,-rpath-link,"$RL/usr/lib/ssl11" \
-Wl,--unresolved-symbols=ignore-in-object-files
echo "== 5. null-call guard =="
# Every `blx 0` is an unresolved symbol that will SIGSEGV when reached. Only the unfinished QtWebKit
# hit-test/cache paths are allowed to have them; anything else is a missing source file or library and
# MUST fail the build. This exact class of bug shipped once: Settings.cpp calls
# Every `blx 0` is an unresolved symbol that will SIGSEGV when reached, so NONE are tolerated. This exact class of bug shipped once: Settings.cpp calls
# webOS::WebSettings::initSettings(), WebKitSupplemental/misc was never compiled in, and BrowserServer
# SIGSEGV'd inside InitSettings() on startup with an empty log.
ALLOWED_NULLCALL='_ZN13BrowserServer27asyncCmdGetImageInfoAtPointEP8YapProxyiii
_ZN13BrowserServer25asyncCmdInspectUrlAtPointEP8YapProxyiii
_ZN13BrowserServer10clearCacheEv
_ZN11BrowserPage7hitTestEjj'
# Was four QtWebKit hit-test/cache stubs; all now have real WPE implementations or fail safe, so the
# allowlist is EMPTY and any null call at all fails the build.
ALLOWED_NULLCALL=''
BAD=$("${OBJDUMP:-$TARGET-objdump}" -d "$OBJ/BrowserServer-atlas" 2>/dev/null | awk '
/^[0-9a-f]+ </ { fn=$2; gsub(/[<>:]/,"",fn) }
/blx?\t0 </ { print fn }' | sort -u | grep -vxF "$ALLOWED_NULLCALL" || true)
@@ -129,6 +126,6 @@ if [ -n "$BAD" ]; then
echo " !! These WILL SIGSEGV at runtime. A source file or -l library is missing from this script." >&2
exit 1
fi
echo " OK — null calls confined to the known QtWebKit hit-test stubs"
echo " OK — no calls to address 0"
echo "== built: $OBJ/BrowserServer-atlas ($(du -h "$OBJ/BrowserServer-atlas"|cut -f1)) =="
+174 -5
View File
@@ -4,7 +4,8 @@
# ($WPE/env-glibc-gcc125.sh, staging-glibc-252, the wpewebkit _b build dir, camera-path-a).
#
# source env-atlas-cross.sh
# ./build-ipk-atlas.sh # -> $OUT/org.webosports.app.atlas_<ver>_all.ipk
# ./build-ipk-atlas.sh # -> atlas-browser-app/ipks/<target>/org.webosports.app.atlas_<ver>_all.ipk
# ./build-ipk-feed.sh / ./build-ipk-standalone.sh # the two distribution targets (see ATLAS_PKG_TARGET)
# DOSTRIP=0 ./build-ipk-atlas.sh # keep symbols (bigger ipk, for gdb)
#
# WHAT COMES FROM WHERE (see BUILDING.md §7):
@@ -27,8 +28,44 @@ APPSRC="${APPSRC:-$REPOS/atlas-browser-app}"
BLD="${BLD:-$REPOS/browserserver-build}"
BACKEND="${BACKEND:-$REPOS/atlas-wpe-backend/libWPEBackend-atlas.so}"
DEVICEROOT_REF="${DEVICEROOT_REF:-$HOME/atlas-device-backup/ref/org.webosports.app.atlas/deviceroot}"
OUT="${OUT:-$HOME/atlas-ipk}"
# Built ipks land in the app repo's ipks/, which is TRACKED — the released artifacts are committed
# alongside the source they were built from. Per-target subdirectory is appended below.
OUT="${OUT:-$APPSRC/ipks}"
DOSTRIP="${DOSTRIP:-1}"
# Packaging target. The PAYLOAD (data.tar.gz) is identical either way — only control.tar.gz differs, so a
# feed can index the same engine bits without repacking anything.
# standalone (default) : postinst restarts LunaSysMgr itself (WOQI / by-hand installs, where
# there is no installer to defer to). No Depends — nothing else to resolve them.
# feed : postinst must NOT restart Luna (it would kill a batch installer running
# under it); instead declare PostInstallFlags=RestartLuna, and depend on the
# feed's OpenSSL 1.1 package so /usr/lib/ssl11 gets pulled in.
# Use the wrappers build-ipk-feed.sh / build-ipk-standalone.sh, or set ATLAS_PKG_TARGET here.
ATLAS_PKG_TARGET="${ATLAS_PKG_TARGET:-standalone}"
case "$ATLAS_PKG_TARGET" in feed|standalone) ;; *) echo "build-ipk-atlas: ATLAS_PKG_TARGET must be 'feed' or 'standalone' (got '$ATLAS_PKG_TARGET')" >&2; exit 1 ;; esac
# Depends: for a feed build. EMPTY BY DEFAULT, on purpose — the package does no environment checking,
# it just installs; qualifying environments is the FEED's job.
#
# Why not declare the OpenSSL 1.1 dependency here: ipkg enforces Depends against its own status file and
# has no notion of webOS version, so a hard dependency cannot be "3.0.5 only". webOS CE 3.1.0 bakes the
# TLS 1.3 stack (/usr/lib/ssl11) into the OS image and never registers org.webosarchive.tls-updates —
# the Modernize bundle is MaxWebOSVersion 3.0.9 and deliberately not offered there — so declaring it made
# ipkg refuse the install on a device that already had everything Atlas needs:
# ERROR: Cannot satisfy the following dependencies for org.webosports.app.atlas:
# org.webosarchive.tls-updates
# and abort mid-unpack, leaving the app directory half-created (empty deviceroot, no launcher icon).
#
# The FEED's Packages stanza carries `Depends: org.webosarchive.tls-updates` instead, and that qualifies
# itself: Preware's loadPackage() DROPS a package whose MaxWebOSVersion is older than the running OS
# (packages.js — not merely hides it), and getDependencies() only queues names it can find in the loaded
# set. So on 3.0.5 tls-updates loads and is pulled in; on 3.1.0 it is filtered out and the dependency
# resolves to nothing. Verified against Preware 1.9.18 on-device.
#
# Keep the feed stanza's Depends in PLAIN comma syntax — Preware's parser splits on "," only, so an
# alternation ("A | B") reaches it as one unknown package name and queues nothing, on 3.0.5 too.
#
# Set FEED_DEPENDS=... to emit a Depends line anyway (for a feed that resolves OpenSSL under its own
# name, or one whose index cannot carry dependency metadata).
FEED_DEPENDS="${FEED_DEPENDS:-}"
APPNAME=org.webosports.app.atlas
CRYPTO_DR="/media/cryptofs/apps/usr/palm/applications/$APPNAME/deviceroot"
@@ -51,6 +88,7 @@ VER=$(grep -oE '"version"[[:space:]]*:[[:space:]]*"[0-9.]+"' "$APPSRC/appinfo.js
WORKROOT=$(mktemp -d); trap 'rm -rf "$WORKROOT"' EXIT
APP="$WORKROOT/usr/palm/applications/$APPNAME"
D="$APP/deviceroot/wpe-252"; A="$APP/deviceroot/atlas"
OUT="$OUT/$ATLAS_PKG_TARGET" # same canonical filename per target, kept apart so one cannot clobber the other
mkdir -p "$APP" "$OUT"
echo "=== 1. app front-end from source ($APPSRC) ==="
@@ -72,6 +110,43 @@ cp -f "$BACKEND" "$D/lib/libWPEBackend-atlas.so"
echo " BrowserServer-atlas $(stat -c%s "$D/BrowserServer-atlas") bytes"
echo " libWPEBackend-atlas.so $(stat -c%s "$D/lib/libWPEBackend-atlas.so") bytes"
# WPE WebKit itself, if it has been built from source (build-webkit-atlas.sh). Without this the engine
# runtime is whatever $DEVICEROOT_REF carried, i.e. prebuilt. Set WEBKIT_DESTROOT= to skip.
WEBKIT_DESTROOT="${WEBKIT_DESTROOT-$REPOS/webkit-build/destroot/var/atlas252}"
if [ -n "$WEBKIT_DESTROOT" ] && [ -d "$WEBKIT_DESTROOT/lib" ]; then
echo "=== 3b. overlay WPE WebKit built from source ($WEBKIT_DESTROOT) ==="
# Copy the real files, not the .so -> .so.1 -> .so.1.9.8 symlink chain: cryptofs has no symlinks, so
# the deviceroot keeps one real file per SONAME (same rule full-restore-atlas.sh follows).
wk_real=$(readlink -f "$WEBKIT_DESTROOT/lib/libWPEWebKit-2.0.so.1")
[ -f "$wk_real" ] || die "no libWPEWebKit in $WEBKIT_DESTROOT/lib"
cp -f "$wk_real" "$D/lib/libWPEWebKit-2.0.so.1"
cp -f "$WEBKIT_DESTROOT/libexec/wpe-webkit-2.0/WPEWebProcess" "$D/libexec/wpe-webkit-2.0/"
cp -f "$WEBKIT_DESTROOT/libexec/wpe-webkit-2.0/WPENetworkProcess" "$D/libexec/wpe-webkit-2.0/"
cp -f "$WEBKIT_DESTROOT/lib/wpe-webkit-2.0/injected-bundle/libWPEInjectedBundle.so" \
"$D/lib/wpe-webkit-2.0/injected-bundle/"
# Web Inspector resources ship beside the library; keep them in step with it.
[ -d "$WEBKIT_DESTROOT/lib/wpe-webkit-2.0" ] && cp -rf "$WEBKIT_DESTROOT/lib/wpe-webkit-2.0/." "$D/lib/wpe-webkit-2.0/"
# Freshly built launchers point at the HOST-default interpreter (/lib/ld-linux.so.3 — on the device
# that is the ancient system glibc 2.8) and carry no RPATH, because CMake drops the build RPATH at
# install time unless CMAKE_INSTALL_RPATH is set. Left alone they die with
# "libWPEWebKit-2.0.so.1: cannot open shared object file"
# while BrowserServer itself stays up, so the browser looks alive but renders nothing. Point them at
# the bundled loader and engine lib dir, matching what the shipped binaries carry.
command -v patchelf >/dev/null || die "patchelf required to fix the WebKit launchers"
for b in "$D/libexec/wpe-webkit-2.0/WPEWebProcess" "$D/libexec/wpe-webkit-2.0/WPENetworkProcess"; do
patchelf --set-interpreter "$CRYPTO_DR/wpe-252/lib/ld-linux.so.3" \
--force-rpath --set-rpath "$CRYPTO_DR/wpe-252/lib:/usr/lib:/lib" "$b" \
|| die "patchelf failed on $(basename "$b")"
done
echo " libWPEWebKit-2.0.so.1 $(stat -c%s "$D/lib/libWPEWebKit-2.0.so.1") bytes (from source)"
echo " patchelf'd WPEWebProcess/WPENetworkProcess to the bundled loader + engine rpath"
ATLAS_WEBKIT_FROM_SOURCE=1
else
echo "=== 3b. WPE WebKit: using the PREBUILT runtime from \$DEVICEROOT_REF ==="
ATLAS_WEBKIT_FROM_SOURCE=0
fi
echo "=== 4. overlay artifacts committed in this repo ==="
cp -f "$ENV_DIR/ipk-build/pull/wrapper-BrowserServer" "$A/BrowserServer" # upstart execs ./BrowserServer
mkdir -p "$APP/deviceroot/BrowserPlugins" "$APP/deviceroot/event.d" "$APP/deviceroot/ls2-roles"
@@ -89,6 +164,22 @@ chmod 755 "$D/BrowserServer-atlas" "$A/BrowserServer" 2>/dev/null || true
chmod 755 "$A"/qcamd "$A"/qmicd "$A"/qspkd "$A"/atlas-sensord 2>/dev/null || true
echo "=== 5. sanity guards (fail loud rather than ship a broken browser) ==="
# GPU driver: ship all three names the engine asks for. postinst re-copies the DEVICE's own driver over
# these at install time, but the package must be self-sufficient — an ipk that omits them installs a
# browser that renders nothing if /usr/lib has no unversioned libEGL.so (the 0.9.8 field report).
# These come in via the reference deviceroot, which is only correct because it was pulled from a device
# where postinst had already staged them; guard it rather than keep relying on that provenance.
if [ -s "$D/lib/libEGL.so.1" ] && [ ! -s "$D/lib/libEGL.so" ]; then
# The vendor libGLESv2 blob NEEDs the UNVERSIONED name (its own SONAME is libEGL.so too).
cp -f "$D/lib/libEGL.so.1" "$D/lib/libEGL.so"
echo " staged unversioned libEGL.so (vendor libGLESv2 NEEDs it)"
fi
for gl in libEGL.so.1 libGLESv2.so.2 libEGL.so; do
[ -s "$D/lib/$gl" ] || die "GPU driver $gl missing from the payload — a fresh install would render nothing.
Copy the device's Adreno driver into the reference deviceroot:
/usr/lib/libEGL.so -> \$DEVICEROOT_REF/wpe-252/lib/libEGL.so.1 (and libEGL.so)
/usr/lib/libGLESv2.so -> \$DEVICEROOT_REF/wpe-252/lib/libGLESv2.so.2"
done
# The engine links versioned GPU sonames; postinst copies the device's real Adreno driver over these.
for f in "$D/lib/libWPEWebKit-2.0.so.1" "$D/libexec/wpe-webkit-2.0/WPEWebProcess" \
"$D/libexec/wpe-webkit-2.0/WPENetworkProcess" "$D/lib/wpe-webkit-2.0/injected-bundle/libWPEInjectedBundle.so"; do
@@ -109,6 +200,15 @@ done
# Our BrowserServer must already carry the bundled loader + device rpath (the build script links it so).
readelf -p .interp "$D/BrowserServer-atlas" 2>/dev/null | grep -q "wpe-252/lib/ld-linux.so.3" \
|| die "BrowserServer-atlas is not linked against the bundled loader"
# Same for the WebKit launchers. If these point at /lib/ld-linux.so.3 (the device's glibc 2.8) or have
# no RPATH, BrowserServer still starts and the browser renders NOTHING - the only symptom is
# "cannot open shared object file" buried in the engine log.
for b in "$D/libexec/wpe-webkit-2.0/WPEWebProcess" "$D/libexec/wpe-webkit-2.0/WPENetworkProcess"; do
readelf -p .interp "$b" 2>/dev/null | grep -q "wpe-252/lib/ld-linux.so.3" \
|| die "$(basename "$b") does not use the bundled loader"
readelf -d "$b" 2>/dev/null | grep -qE "RPATH|RUNPATH" \
|| die "$(basename "$b") has no RPATH — it will not find libWPEWebKit at runtime"
done
echo " guards passed"
if [ "$DOSTRIP" = 1 ]; then
@@ -122,7 +222,25 @@ fi
echo "=== 7. data.tar.gz ==="
INSTALLED_KB=$(du -sk "$WORKROOT/usr" | awk '{print $1}')
( cd "$WORKROOT" && tar czf "$OUT/data.tar.gz" --owner=0 --group=0 ./usr )
# Reproducible payload: stamp every member with one epoch and emit members in name order, so two builds
# of the same source produce a BYTE-IDENTICAL data.tar.gz. Without this the ~300 files we copy fresh each
# run carry the build clock, so every rebuild churns the ipk's md5 and a feed has to re-stanza a package
# whose contents did not actually change (measured: feed vs standalone build differed in 300 mtimes and
# ZERO bytes of content). It also makes the two packaging targets differ in control.tar.gz only.
#
# The stamp is the app repo's HEAD commit time, deliberately NOT a fixed constant: GStreamer invalidates
# its cached plugin registry by plugin .so mtime, so the stamp has to keep changing from release to
# release or an upgraded engine could be left running against a stale registry. Override with
# SOURCE_DATE_EPOCH; falls back to the build clock outside a git checkout (non-reproducible, as before).
SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(git -C "$APPSRC" log -1 --format=%ct 2>/dev/null || true)}"
if [ -n "$SOURCE_DATE_EPOCH" ]; then
echo " reproducible: stamping payload mtimes @$SOURCE_DATE_EPOCH (app HEAD)"
( cd "$WORKROOT" && tar czf "$OUT/data.tar.gz" --owner=0 --group=0 \
--sort=name --mtime="@$SOURCE_DATE_EPOCH" ./usr )
else
echo " WARN: no git checkout at $APPSRC and no SOURCE_DATE_EPOCH — payload mtimes are the build clock"
( cd "$WORKROOT" && tar czf "$OUT/data.tar.gz" --owner=0 --group=0 ./usr )
fi
echo "=== 8. control.tar.gz ==="
CTRL="$WORKROOT/CONTROL"; mkdir -p "$CTRL"
@@ -138,16 +256,67 @@ Description: Atlas Web — WPE WebKit 2.52 browser for webOS (HP TouchPad).
webOS-Package-Format-Version: 2
webOS-Packager-Version: 3.0.5b38
EOF
if [ "$ATLAS_PKG_TARGET" = feed ]; then
# Depends: normally NOT emitted — see the FEED_DEPENDS block above. The OpenSSL 1.1 requirement is
# declared in the feed's Packages stanza, where MaxWebOSVersion can qualify it per OS version; ipkg
# cannot, and a hard dependency here just blocks the install on webOS CE 3.1.0.
if [ -n "$FEED_DEPENDS" ]; then echo "Depends: $FEED_DEPENDS" >> "$CTRL/control"; fi
# Source: postinst deliberately does NOT restart LunaSysMgr in a feed build (it would kill a batch
# installer running under it), so the reload is declared here for the installer to do once, at the end.
# NOTE: Preware reads these flags from the FEED's Packages index Source block, not from this control —
# a distributor must carry them into their stanza too. Emitting them keeps the ipk self-describing.
# The display half of Source (Feed, Category, Title, FullDescription, Icon, DeviceCompatibility,
# LastUpdated) stays out: that is per-feed catalog metadata, not a property of this package.
cat >> "$CTRL/control" <<EOF
Source: { "PostInstallFlags":"RestartLuna", "PostUpdateFlags":"RestartLuna", "PostRemoveFlags":"RestartLuna" }
EOF
fi
cp "$ENV_DIR/ipk-postinst.sh" "$CTRL/postinst"; chmod 755 "$CTRL/postinst"
cp "$ENV_DIR/ipk-prerm.sh" "$CTRL/prerm"; chmod 755 "$CTRL/prerm"
# Stamp the target into both scripts (they default to standalone when run straight from the repo).
for s in postinst prerm; do
sed -i "s/^PKG_TARGET=.*/PKG_TARGET=$ATLAS_PKG_TARGET/" "$CTRL/$s"
grep -q "^PKG_TARGET=$ATLAS_PKG_TARGET$" "$CTRL/$s" || die "failed to stamp PKG_TARGET into $s"
done
( cd "$CTRL" && tar czf "$OUT/control.tar.gz" --owner=0 --group=0 ./control ./postinst ./prerm )
# The SAME two scripts again, under the names webOS's own installer looks for. There are two install
# paths on this device and they disagree about who runs the control scripts:
#
# Preware (org.webosinternals.ipkgservice) runs
# /usr/bin/ipkg -o /media/cryptofs/apps -force-overwrite install <ipk>
# IPKG_OFFLINE_ROOT=/media/cryptofs/apps /bin/sh <info>/<pkg>.postinst
# -- i.e. it knows ipkg SKIPS postinst in offline-root mode ("Configuring <pkg> / (offline root
# mode: not running <pkg>.postinst)") and runs the deferred script itself. control.tar.gz's
# postinst/prerm are for this path.
#
# com.palm.appinstaller (WebOS Quick Install, a tapped .ipk, installNoVerify) runs the same ipkg
# command and then STOPS. It never runs the deferred postinst. What it does instead is extract the
# ipk with `ar x` into a temp dir and run <tmpdir>/pmPostInstall.script (and pmPreRemove.script on
# removal) as root -- webOS package format v2. With no such member it writes a 0-byte placeholder
# and moves on, reporting SUCCESS.
#
# So a package that only ships postinst/prerm installs through that path with its ENGINE HALF MISSING:
# no BrowserAdapterAtlas.so, no /etc/event.d/atlas, no GPU driver staged, no db8 kinds. Atlas opens and
# renders nothing, which is exactly the "installs but cannot open a web page" report. `ar x` extracts
# every member, so shipping the scripts a second time as plain ar members covers that path too.
# Only ONE of the two ever runs for a given install; postinst/prerm are idempotent regardless.
cp "$CTRL/postinst" "$OUT/pmPostInstall.script"; chmod 755 "$OUT/pmPostInstall.script"
cp "$CTRL/prerm" "$OUT/pmPreRemove.script"; chmod 755 "$OUT/pmPreRemove.script"
echo "=== 9. ar the ipk ==="
IPK="$OUT/${APPNAME}_${VER}_all.ipk"
printf '2.0\n' > "$OUT/debian-binary"
rm -f "$IPK"
( cd "$OUT" && ar rc "$(basename "$IPK")" debian-binary control.tar.gz data.tar.gz )
rm -f "$OUT/debian-binary" "$OUT/control.tar.gz" "$OUT/data.tar.gz"
( cd "$OUT" && ar rc "$(basename "$IPK")" debian-binary control.tar.gz data.tar.gz \
pmPostInstall.script pmPreRemove.script )
rm -f "$OUT/debian-binary" "$OUT/control.tar.gz" "$OUT/data.tar.gz" \
"$OUT/pmPostInstall.script" "$OUT/pmPreRemove.script"
echo "== built: $IPK ($(du -h "$IPK" | cut -f1), installed ~$((INSTALLED_KB/1024)) MB, v$VER) =="
if [ "${ATLAS_WEBKIT_FROM_SOURCE:-0}" = 1 ]; then
echo " engine: WPE WebKit built FROM SOURCE"
else
echo " engine: WPE WebKit is the PREBUILT runtime from \$DEVICEROOT_REF (build it with build-webkit-atlas.sh)"
fi
echo " install via Preware / WebOS Quick Install (postinst must run as root)."
+22
View File
@@ -0,0 +1,22 @@
#!/bin/bash
# Build the Atlas ipk for distribution through a Preware-style FEED (e.g. WOSA Modernize).
#
# Differs from the standalone build ONLY in control.tar.gz — the engine payload is identical, so a feed
# can index these bits without repacking anything:
# - postinst/prerm do NOT restart LunaSysMgr. Preware runs under LunaSysMgr, so restarting it mid-batch
# kills the installer and abandons the rest of the dependency chain. The reload is declared instead as
# PostInstallFlags/PostUpdateFlags/PostRemoveFlags = RestartLuna.
# - NO Depends. The package does no environment checking, it just installs; qualifying environments is
# the FEED's job. Atlas needs OpenSSL 1.1 (/usr/lib/ssl11), but that requirement is only true on
# webOS 3.0.x — CE 3.1.0 bakes the stack into the OS image — and ipkg has no notion of OS version,
# so a hard Depends here blocks the install on 3.1.0 instead of describing anything useful. Declare
# it in the feed's Packages stanza (`Depends: org.webosarchive.tls-updates`, plain comma syntax),
# where MaxWebOSVersion qualifies it: Preware drops a max-incompatible package at load time, so the
# dependency pulls the bundle on 3.0.5 and resolves to nothing on 3.1.0. FEED_DEPENDS= overrides.
#
# NOTE: Preware reads the restart flags from the FEED's Packages index "Source" block, not from the ipk's
# control — copy them into your stanza as well.
#
# ./build-ipk-feed.sh # -> atlas-browser-app/ipks/feed/org.webosports.app.atlas_<ver>_all.ipk
set -eu
exec env ATLAS_PKG_TARGET=feed "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/build-ipk-atlas.sh" "$@"
-82
View File
@@ -1,82 +0,0 @@
#!/bin/bash
# Assemble the FEATURE-STRIPPED Pre 3 ipk: take the reuse Pre 3 ipk's deviceroot (app + device-profile +
# already-patched WebProcess launch paths) and swap in the stripped WebKit artifacts built by
# build-webkit-252-pre3.sh, then drop the now-dead GStreamer/media plugins to reclaim flash.
#
# ABI lockstep: feature-strip changes WebKit struct layouts, so libWPEWebKit + libWPEInjectedBundle +
# WPEWebProcess + WPENetworkProcess are ALL swapped together from _b_pre3 (a mismatched injected bundle =
# WebProcess SIGBUS — see redeploy-webkit.sh). libWPEWebKit is prefix-patched (host staging -> /var/atlas252)
# exactly like redeploy-webkit.sh; the WebProcess stubs get the same patchelf interp/rpath as deploy-252.sh.
#
# Run AFTER build-webkit-252-pre3.sh build completes. Output: *_pre3-stripped.ipk
# NOTE: the patched cross-engine is UNVERIFIED on-device — keep the reuse ipk as the safe fallback.
set -euo pipefail
ENV_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
WPE="${WPE:-$HOME/webos/wpe}"
. "${WPE_ENV:-$WPE/env-glibc-gcc125.sh}"; S="$STAGING"
: "${TARGET:=arm-unknown-linux-gnueabi}"; STRIP_BIN="${STRIP:-$TARGET-strip}"
BP="$WPE/build/wpewebkit-2.52.4/_b_pre3"
DEST="$WPE/pre3-destroot"
BASE_IPK="${BASE_IPK:-/home/herrie/webos/Pre3/atlas-pre3-build/org.webosports.app.atlas_0.9.7_pre3.ipk}"
OUT="${OUT:-/home/herrie/webos/Pre3/atlas-pre3-build}"
APPNAME=org.webosports.app.atlas
CRYPTO_DR="/media/cryptofs/apps/usr/palm/applications/$APPNAME/deviceroot"
DEVPATH="$CRYPTO_DR/wpe-252"; PREFIX_LINK="/var/atlas252"
BUILT_LIB="$BP/lib/libWPEWebKit-2.0.so.1.9.8"
[ -f "$BUILT_LIB" ] || { echo "stripped lib not built yet: $BUILT_LIB (run build-webkit-252-pre3.sh build)"; exit 1; }
[ -f "$BASE_IPK" ] || { echo "base ipk missing: $BASE_IPK (run build-ipk-pre3.sh)"; exit 1; }
W=$(mktemp -d); trap 'rm -rf "$W"' EXIT
echo "=== 1. unpack base (reuse) ipk ==="
( cd "$W" && ar x "$BASE_IPK" && mkdir data ctl && tar xzf data.tar.gz -C data && tar xzf control.tar.gz -C ctl )
DR="$W/data/usr/palm/applications/$APPNAME/deviceroot/wpe-252"
echo "=== 2. swap libWPEWebKit (prefix-patch + strip) ==="
TMP="$W/libwpe.so"; cp -f "$BUILT_LIB" "$TMP"; "$STRIP_BIN" --strip-unneeded "$TMP" || true
ATLAS_HOST_PREFIX="$S" PREFIX_LINK="$PREFIX_LINK" python3 - "$TMP" <<'PY'
import sys, os
host=os.environ['ATLAS_HOST_PREFIX'].encode(); dev=os.environ['PREFIX_LINK'].encode()
pad=b''
while len(dev+pad)<len(host): pad+=b'/.'
devp=(dev+pad)[:len(host)]; assert len(devp)==len(host)
f=sys.argv[1]; d=open(f,'rb').read(); n=d.count(host); open(f,'wb').write(d.replace(host,devp))
print(f" prefix-patched {n} occurrences -> {devp.decode()}")
PY
cp -f "$TMP" "$DR/lib/libWPEWebKit-2.0.so.1"
echo "=== 3. swap injected bundle + WebProcess/NetworkProcess (ABI lockstep) ==="
IB_SRC=$(find "$BP" "$DEST" -name libWPEInjectedBundle.so 2>/dev/null | head -1)
cp -f "$IB_SRC" "$DR/lib/wpe-webkit-2.0/injected-bundle/libWPEInjectedBundle.so"
"$STRIP_BIN" --strip-unneeded "$DR/lib/wpe-webkit-2.0/injected-bundle/libWPEInjectedBundle.so" || true
RP="$DEVPATH/lib:/usr/lib:/lib"
for name in WPEWebProcess WPENetworkProcess; do
SRC=$(find "$BP" "$DEST" -name "$name" -type f 2>/dev/null | head -1)
[ -n "$SRC" ] || { echo " WARN: $name not found in build output"; continue; }
cp -f "$SRC" "$DR/libexec/wpe-webkit-2.0/$name"
"$STRIP_BIN" --strip-unneeded "$DR/libexec/wpe-webkit-2.0/$name" || true
patchelf --set-interpreter "$DEVPATH/lib/ld-linux.so.3" --force-rpath --set-rpath "$RP" "$DR/libexec/wpe-webkit-2.0/$name"
# WebProcess needs libEGL.so.1 as a direct NEEDED so the Adreno subdriver's eglSubDriverWait resolves
# in the global scope (same bring-up fix as the full build; the base ipk's WebProcess is replaced here).
[ "$name" = WPEWebProcess ] && patchelf --add-needed libEGL.so.1 "$DR/libexec/wpe-webkit-2.0/$name"
echo " patched $name"
done
echo "=== 4. drop dead GStreamer/media plugins + libs (video/webrtc gone) ==="
BEFORE=$(du -sm "$DR" | cut -f1)
rm -rf "$DR/lib/gstreamer-1.0" "$DR/libexec/gstreamer-1.0" 2>/dev/null || true
rm -f "$DR"/lib/libgst*.so* "$DR"/lib/libav*.so* "$DR"/lib/libswscale*.so* "$DR"/lib/libswresample*.so* \
"$DR"/lib/libavcodec*.so* "$DR"/lib/libavformat*.so* "$DR"/lib/libavutil*.so* \
"$DR"/lib/libvpx*.so* "$DR"/lib/libopus*.so* "$DR"/lib/libwebrtc*.so* 2>/dev/null || true
AFTER=$(du -sm "$DR" | cut -f1)
echo " deviceroot ${BEFORE}MB -> ${AFTER}MB"
echo "=== 5. repack ==="
VER=$(grep -oE '^Version: .*' "$W/ctl/control" | awk '{print $2}')
sed -i -E "s/graphics bring-up\)\./graphics bring-up; feature-stripped engine)./" "$W/ctl/control"
( cd "$W/data" && tar --format=ustar -czf "$W/data.tar.gz" --owner=0 --group=0 ./* )
( cd "$W/ctl" && tar --format=ustar -czf "$W/control.tar.gz" --owner=0 --group=0 ./* )
echo "2.0" > "$W/debian-binary"
IPK="$OUT/${APPNAME}_${VER}_pre3-stripped.ipk"; rm -f "$IPK"
( cd "$W" && ar rc "$IPK" debian-binary control.tar.gz data.tar.gz )
echo "=== done: $IPK ($(stat -c%s "$IPK") bytes) ==="
-77
View File
@@ -1,77 +0,0 @@
#!/bin/bash
# Build a complete, installable HP Pre 3 Atlas ipk from an existing TouchPad ("tenderloin") ipk's engine
# bundle (same ABI) + the on-device fixes found during Pre 3 bring-up baked in. Produces a drop that
# installs clean via Preware with no manual repair. See PRE3-PORT.md and the pre3-graphics-bringup notes.
#
# Bakes in, over the reused deviceroot:
# - pre3-lowmem app front-end (low-memory profile + phone CSS)
# - libaffinity.so.0 (webOS-3.0.5 system lib, absent on 2.2.4) -> $D/lib
# - rebuilt BrowserServer-atlas (viewport fix: BPWPE_SCREEN_W/H) -> $D/
# - patched libepoxy.so.0 (EGL 1.4 version clamp for Adreno 205) -> $D/lib
# - WPEWebProcess --add-needed libEGL.so.1 (EGL subdriver global symbol scope) -> $D/libexec/...
# - device-profile-pre3 (RAM/core/buffer/screen tuning) + wrapper sources it, minus -platform (Qt4)
# - postinst SELF-HEAL: rename any files whose name got the octal mode appended by 2.2.4 busybox-tar
# Result: $OUT/org.webosports.app.atlas_<ver>_pre3.ipk
set -euo pipefail
ENV_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
REPOS="${REPOS:-$(dirname "$ENV_DIR")}"
TP_IPK="${TP_IPK:-/home/herrie/webos/wpe/ipk-build/org.webosports.app.atlas_0.9.6_all.ipk}"
APPSRC="${APPSRC:-$REPOS/atlas-browser-app}"
PROFILE="${PROFILE:-$ENV_DIR/ipk-build/pull/device-profile-pre3}"
OUT="${OUT:-/home/herrie/webos/Pre3/atlas-pre3-build}"
# engine-fix artifacts (overridable)
BS_ATLAS="${BS_ATLAS:-/home/herrie/webos/wpe/browserserver-wpe/obj/BrowserServer-atlas}"
LIBEPOXY="${LIBEPOXY:-/home/herrie/webos/wpe/build/libepoxy-1.5.10/_b/src/libepoxy.so.0.0.0}"
LIBAFFINITY="${LIBAFFINITY:-/home/herrie/webos/touchpad-kernel/doctor305/nova-cust-image-topaz.rootfs/usr/lib/libaffinity.so.0.0.0}"
APPNAME=org.webosports.app.atlas
for f in "$TP_IPK" "$APPSRC/appinfo.json" "$PROFILE" "$BS_ATLAS" "$LIBEPOXY" "$LIBAFFINITY"; do
[ -e "$f" ] || { echo "missing: $f" >&2; exit 1; }; done
command -v patchelf >/dev/null || { echo "patchelf required" >&2; exit 1; }
VER=$(grep -oE '"version"[[:space:]]*:[[:space:]]*"[0-9.]+"' "$APPSRC/appinfo.json" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1); : "${VER:=0.9.7}"
W=$(mktemp -d); trap 'rm -rf "$W"' EXIT
echo "=== 1. unpack TouchPad ipk (reused engine) ==="
( cd "$W" && ar x "$TP_IPK" && mkdir data ctl && tar xzf data.tar.gz -C data && tar xzf control.tar.gz -C ctl )
APP="$W/data/usr/palm/applications/$APPNAME"; D="$APP/deviceroot/wpe-252"
[ -d "$D" ] || { echo "no engine deviceroot" >&2; exit 1; }
echo "=== 2. pre3-lowmem app front-end ==="
for item in appinfo.json css db depends.js index.html source images icon-1024x1024.png icon-256x256.png icon-48x48.png icon-64x64.png icon.png; do
rm -rf "$APP/${item:?}"; [ -e "$APPSRC/$item" ] && cp -a "$APPSRC/$item" "$APP/"
done
echo "=== 3. bake engine fixes ==="
install -m644 "$LIBAFFINITY" "$D/lib/libaffinity.so.0"
install -m755 "$BS_ATLAS" "$D/BrowserServer-atlas"
install -m644 "$LIBEPOXY" "$D/lib/libepoxy.so.0"
# WPEWebProcess: add libEGL.so.1 as a direct NEEDED so the Adreno subdriver's eglSubDriverWait resolves.
patchelf --add-needed libEGL.so.1 "$D/libexec/wpe-webkit-2.0/WPEWebProcess"
echo " WPEWebProcess NEEDED libEGL: $(readelf -d "$D/libexec/wpe-webkit-2.0/WPEWebProcess" | grep -c 'libEGL.so.1')"
echo "=== 4. device-profile + wrapper (source it, drop Qt5 -platform) ==="
cp -a "$PROFILE" "$APP/deviceroot/atlas/device-profile"
WRAP="$APP/deviceroot/atlas/BrowserServer"
grep -q 'device-profile' "$WRAP" || awk '/^exec .*BrowserServer-atlas/ && !d { print "[ -r \"$ATLAS/device-profile\" ] && . \"$ATLAS/device-profile\""; d=1 } {print}' "$WRAP" > "$WRAP.n" && mv "$WRAP.n" "$WRAP"
sed -i 's/ -platform Minimal//' "$WRAP"; chmod 755 "$WRAP"
echo "=== 5. postinst self-heal (2.2.4 busybox-tar mode-in-name corruption) ==="
PI="$W/ctl/postinst"
if ! grep -q 'busybox-tar mode-in-name' "$PI"; then
# insert the repair right after DR= is defined, before anything uses the files
awk '{print} /^DR=/ && !d { print ""; print "# self-heal: webOS 2.2.4 ipkg/busybox-tar can append a file'\''s octal mode to its name"; print "# (libX.so -> libX.so0000775). Strip the trailing 7-digit mode so sonames resolve."; print "for _f in $(find \"$DR\" -regex \".*0000[0-7][0-7][0-7]\" 2>/dev/null); do mv \"$_f\" \"${_f%???????}\" 2>/dev/null; done"; d=1 }' "$PI" > "$PI.n" && mv "$PI.n" "$PI"; chmod 755 "$PI"
fi
echo "=== 6. control ==="
sed -i -E "s/^Version: .*/Version: $VER/" "$W/ctl/control"
sed -i -E "s/for webOS \(HP TouchPad\)\./for webOS (HP Pre 3, 512MB — low-memory + graphics bring-up)./" "$W/ctl/control"
echo "=== 7. repack (ustar: least busybox mangling; postinst self-heals the rest) ==="
mkdir -p "$OUT"
( cd "$W/data" && tar --format=ustar -czf "$W/data.tar.gz" --owner=0 --group=0 ./* )
( cd "$W/ctl" && tar --format=ustar -czf "$W/control.tar.gz" --owner=0 --group=0 ./* )
echo "2.0" > "$W/debian-binary"
IPK="$OUT/${APPNAME}_${VER}_pre3.ipk"; rm -f "$IPK"
( cd "$W" && ar rc "$IPK" debian-binary control.tar.gz data.tar.gz )
echo "=== done: $IPK ($(stat -c%s "$IPK") bytes) ==="
+13
View File
@@ -0,0 +1,13 @@
#!/bin/bash
# Build the Atlas ipk for STANDALONE distribution — WebOS Quick Install, a direct download, or installing
# by hand. No package manager is involved, so the package has to finish the job itself:
# - postinst restarts LunaSysMgr itself (it must reload before it can see the browser plugin). prerm
# never does, on either target -- it runs from inside LunaSysMgr before `ipkg remove`.
# Nothing is running under it to be killed, and there is no installer to defer the reload to.
# - No Depends. There is no feed to resolve them, and a dependency nothing can satisfy just makes the
# install fail. OpenSSL 1.1 (/usr/lib/ssl11) still has to be installed separately for HTTPS to work —
# postinst warns when it is missing.
#
# ./build-ipk-standalone.sh # -> atlas-browser-app/ipks/standalone/org.webosports.app.atlas_<ver>_all.ipk
set -eu
exec env ATLAS_PKG_TARGET=standalone "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/build-ipk-atlas.sh" "$@"
-68
View File
@@ -1,68 +0,0 @@
#!/bin/bash
# WPE WebKit 2.52.4 — HP Pre 3 FEATURE-STRIPPED variant (fresh build in a SEPARATE dir _b_pre3).
#
# Config = the working TouchPad engine's JIT / graphics-core / wasm flags kept IDENTICAL (so we inherit
# the ~3x DFG JIT + the softfp CCallHelpers patch that lives in Source/), with ONLY the heavy features
# dropped: video / media-source / media-stream / web-audio / webrtc / web-codecs / media-recorder /
# encrypted-media -> USE_GSTREAMER=OFF entirely; plus webgl / avif / jpegxl / speech-synth / gamepad.
# GPU_PROCESS already OFF. This is what the README calls the Phase-3 strip.
#
# Kept ON to match the proven build (do NOT change — softfp JIT is delicate): ENABLE_JIT, ENABLE_DFG_JIT,
# ENABLE_WEBASSEMBLY, ENABLE_C_LOOP=OFF, USE_SKIA=OFF, ENABLE_WPE_LEGACY_API=ON, USE_WOFF2=ON.
#
# Build dir _b_pre3 is separate from the working _b, and install goes to a DESTDIR destroot, so the
# TouchPad engine / staging-glibc-252 is never touched.
#
# ./build-webkit-252-pre3.sh configure # fresh cmake in _b_pre3 (~2-3 min; validates the config)
# ./build-webkit-252-pre3.sh build # ninja -j24 + DESTDIR install (long; run in background)
set -u
WPE="${WPE:-$HOME/webos/wpe}"; L="$WPE/logs"; mkdir -p "$L"
. "${WPE_ENV:-$WPE/env-glibc-gcc125.sh}"; S="$STAGING"
V=2.52.4
B="$WPE/build/wpewebkit-$V"
BP="$B/_b_pre3"
DESTROOT="$WPE/pre3-destroot"
STAGE="${1:-configure}"
[ -d "$B/Source" ] || { echo "ERROR: $B not extracted (softfp/single-process patches live here)"; exit 1; }
if [ "$STAGE" = configure ]; then
rm -rf "$BP"; mkdir -p "$BP"; cd "$BP"
nice -n 10 cmake .. -G Ninja \
-DCMAKE_TOOLCHAIN_FILE="${WPE_CMAKE_TC:-$WPE/cmake-toolchain-glibc-gcc125.cmake}" \
-DCMAKE_INSTALL_PREFIX="$S" -DCMAKE_BUILD_TYPE=Release -DPORT=WPE \
-DUNIFDEF_EXECUTABLE="$WPE/hostbin/unifdef" \
`# --- JIT / core: IDENTICAL to the working engine ---` \
-DENABLE_C_LOOP=OFF -DENABLE_JIT=ON -DENABLE_DFG_JIT=ON -DENABLE_FTL_JIT=OFF \
-DENABLE_WEBASSEMBLY=ON -DENABLE_SAMPLING_PROFILER=OFF \
-DUSE_GBM=OFF -DUSE_LIBDRM=OFF -DUSE_SKIA=OFF -DENABLE_WPE_LEGACY_API=ON -DENABLE_GPU_PROCESS=OFF \
-DUSE_WOFF2=ON -DUSE_LIBWPE=ON \
`# --- heavy features DROPPED for the 512MB Pre 3 ---` \
-DENABLE_VIDEO=OFF -DENABLE_MEDIA_SOURCE=OFF -DENABLE_MEDIA_STREAM=OFF -DENABLE_WEB_AUDIO=OFF \
-DENABLE_WEB_RTC=OFF -DUSE_GSTREAMER_WEBRTC=OFF -DUSE_GSTREAMER=OFF \
-DENABLE_WEB_CODECS=OFF -DENABLE_MEDIA_RECORDER=OFF -DENABLE_MEDIA_CAPTURE=OFF -DENABLE_MEDIA_SESSION=OFF \
-DENABLE_ENCRYPTED_MEDIA=OFF -DENABLE_THUNDER=OFF -DENABLE_SPEECH_SYNTHESIS=OFF \
-DENABLE_WEBGL=OFF -DENABLE_WEBGL2=OFF -DENABLE_GAMEPAD=OFF \
-DUSE_AVIF=OFF -DUSE_JPEGXL=OFF -DUSE_OPENJPEG=OFF -DUSE_LCMS=OFF \
`# --- misc off (match build-webkit-252.sh) ---` \
-DENABLE_WEBDRIVER=OFF -DENABLE_INTROSPECTION=OFF -DENABLE_DOCUMENTATION=OFF \
-DENABLE_BUBBLEWRAP_SANDBOX=OFF -DENABLE_SPELLCHECK=OFF -DUSE_ATK=OFF -DENABLE_ACCESSIBILITY=OFF \
-DUSE_LIBHYPHEN=OFF -DUSE_SYSTEMD=OFF -DUSE_LIBBACKTRACE=OFF -DUSE_SYSTEM_SYSPROF_CAPTURE=NO \
-DENABLE_MINIBROWSER=OFF -DENABLE_WEBXR=OFF -DENABLE_JOURNALD_LOG=OFF \
> "$L/webkit-252-pre3.cfg" 2>&1
rc=$?; echo "cmake configure rc=$rc"; tail -25 "$L/webkit-252-pre3.cfg"
echo "--- key flags in _b_pre3 ---"
grep -E "^(ENABLE_JIT|ENABLE_DFG_JIT|ENABLE_C_LOOP|ENABLE_WEBASSEMBLY|ENABLE_VIDEO|ENABLE_WEB_RTC|ENABLE_WEB_AUDIO|USE_GSTREAMER|ENABLE_WEBGL|USE_AVIF|USE_JPEGXL|ENABLE_MEDIA_STREAM):" CMakeCache.txt 2>/dev/null | sort
exit $rc
else
cd "$BP"
export RUBYOPT="-r$WPE/ruby-compat.rb"
nice -n 10 ninja -j 24 > "$L/webkit-252-pre3.make" 2>&1
rc=$?
if [ $rc -eq 0 ]; then
rm -rf "$DESTROOT"; mkdir -p "$DESTROOT"
nice -n 10 env DESTDIR="$DESTROOT" ninja install >> "$L/webkit-252-pre3.make" 2>&1; rc=$?
fi
echo "ninja+install rc=$rc"; tail -25 "$L/webkit-252-pre3.make"
[ $rc -eq 0 ] && { echo "=== stripped libWPEWebKit ==="; ls -la "$BP"/lib/libWPEWebKit-2.0.so.1* 2>/dev/null; }
exit $rc
fi
+177
View File
@@ -0,0 +1,177 @@
#!/bin/bash
# Cross-build WPE WebKit 2.52.4 for the Atlas engine.
#
# source env-atlas-cross.sh
# source hosttools-env.sh # ruby + unifdef (see stage-hosttools-atlas.sh)
# ./apply-webkit-patches.sh # extract + patch the tree first
# ./build-webkit-atlas.sh configure
# ./build-webkit-atlas.sh build # long: ~1-2 h on 12 cores
#
# The feature set below is NOT guesswork and NOT the old build-webkit-252.sh (which disables video,
# GStreamer, WebRTC and WebGL - that was an experiment, not what shipped). It is derived from the
# SHIPPED libWPEWebKit-2.0.so.1: its 65 NEEDED libraries include the full GStreamer stack, flite,
# libepoxy, avif/jxl/webp, woff2 and cairo, and its symbol table shows DFG JIT (343 refs, zero CLoop).
#
# HOW TO CHECK A FEATURE against the shipped library - this matters, because the obvious method is
# wrong. Grepping for the interface name ("ServiceWorker", "PaymentRequest") tells you nothing: those
# strings appear in IDL-derived name tables whether or not the feature is compiled in. Grep for the
# GENERATED BINDING CLASS instead - JSServiceWorkerContainer, JSPaymentRequest, JSMediaKeys - which is
# only linked in when the feature is enabled:
#
# strings -a libWPEWebKit-2.0.so.1 | grep -cx JSPaymentRequest
#
# By that test the shipped engine has ServiceWorker, PaymentRequest, EncryptedMedia (JSMediaKeys),
# WebGL/WebGL2, MediaStream, RTCPeerConnection, SpeechSynthesis, Gamepad and OffscreenCanvas ON, and
# WebDriver OFF. An earlier pass here used the plain-name grep and wrongly concluded ServiceWorker and
# EncryptedMedia were off.
#
# TWO SETTINGS THAT LOOK REDUNDANT BUT ARE NOT:
#
# FREETYPE_WOFF2_SUPPORT_IS_AVAILABLE=OFF - WebKit probes whether FreeType can decompress WOFF2 and,
# if so, turns USE_WOFF2 back off and relies on FreeType instead. Cross-compiling, that probe
# compiles against the DEBIAN FreeType headers we staged, which do have WOFF2 - but the FreeType the
# DEVICE ships does not (its NEEDED is just libpthread/libc, no brotli). Left alone, the build
# silently drops libwoff2dec and every WOFF2 web font fails at runtime. The shipped engine links
# libwoff2dec, which is the giveaway. Forcing the probe off restores that.
#
# USE_GSTREAMER_MPEGTS=ON - defaults OFF, but the shipped engine links libgstmpegts-1.0. Needed for
# AAC-in-MPEG-TS (and the HLS path).
#
# Both were found by diffing our libWPEWebKit's NEEDED list against the shipped one; do that after any
# change here, it catches this class of silent feature loss.
#
# Overridable: WK_SRC, STAGING, PREFIX, JOBS.
set -eu
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
REPOS="${REPOS:-$(dirname "$SCRIPT_DIR")}"
WK_SRC="${WK_SRC:-$REPOS/webkit-build}"
V=2.52.4
TREE="$WK_SRC/wpewebkit-$V"
BUILD="$TREE/_b"
STAGING="${STAGING:-$HOME/atlas-staging}"
# WebCore's unified sources are memory-hungry: a single cc1plus routinely passes 2 GB and the worst
# ones go higher, so -j$(nproc) on a 12-core/31 GB box can be OOM-killed. When that happens ninja
# reports only "fatal error: Killed signal terminated program cc1plus", which is easy to mistake for a
# compiler bug. Budget ~4 GB per job and cap at the core count; 3 GB/job resolved to -j10 on a 31 GB
# host, which consumed all headroom at peak.
if [ -z "${JOBS:-}" ]; then
_mem_gb=$(awk '/MemTotal/ {printf "%d", $2/1024/1024}' /proc/meminfo 2>/dev/null || echo 8)
_by_mem=$(( _mem_gb / 4 )); [ "$_by_mem" -lt 1 ] && _by_mem=1
_cores=$(nproc)
JOBS=$(( _by_mem < _cores ? _by_mem : _cores ))
fi
LOGDIR="${LOGDIR:-$WK_SRC/logs}"; mkdir -p "$LOGDIR"
# Install prefix is the DEVICE path, so WebKit bakes correct PKGLIBEXECDIR/PKGLIBDIR at build time and
# no binary prefix-patching is needed afterwards. /var/atlas252 is the short symlink that ipk-postinst.sh
# creates pointing at the cryptofs deviceroot (the real cryptofs path is too long to patch in place).
PREFIX="${PREFIX:-/var/atlas252}"
DESTROOT="${DESTROOT:-$WK_SRC/destroot}"
die(){ echo "build-webkit-atlas: $*" >&2; exit 1; }
[ -d "$TREE/Source" ] || die "no patched tree at $TREE — run apply-webkit-patches.sh first"
command -v ruby >/dev/null || die "ruby not on PATH — source hosttools-env.sh"
command -v unifdef >/dev/null || die "unifdef not on PATH — source hosttools-env.sh"
[ -d "$STAGING/webkitdeps/usr/include" ] || die "no $STAGING/webkitdeps — run stage-sysroot-atlas.sh webkit-deps"
# env-atlas-cross.sh exports CFLAGS/CXXFLAGS/LDFLAGS aimed at the BrowserServer build. CMake would
# append them to every compile and link, and -L$STAGING/lib is actively harmful here: that directory
# holds the DEVICE's libc.so, which shadows the toolchain's own and leaves __libc_csu_init/__libc_csu_fini
# undefined, so even CMake's "can the compiler build a trivial program" test fails. The toolchain file
# supplies the arch flags and the correct link paths (linklib, which excludes libc and friends).
unset CFLAGS CXXFLAGS LDFLAGS CPPFLAGS
case "${1:-configure}" in
configure)
rm -rf "$BUILD"; mkdir -p "$BUILD"; cd "$BUILD"
set +e
cmake .. -G Ninja \
-DCMAKE_TOOLCHAIN_FILE="$SCRIPT_DIR/cmake/atlas-arm-toolchain.cmake" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
-DPORT=WPE \
-DUSE_SKIA=OFF \
-DENABLE_WPE_LEGACY_API=ON -DUSE_LIBWPE=ON \
-DUSE_GBM=OFF -DUSE_LIBDRM=OFF -DENABLE_GPU_PROCESS=OFF \
-DENABLE_C_LOOP=OFF -DENABLE_JIT=ON -DENABLE_DFG_JIT=ON -DENABLE_FTL_JIT=OFF \
-DENABLE_WEBASSEMBLY=ON -DENABLE_SAMPLING_PROFILER=OFF \
-DENABLE_VIDEO=ON -DENABLE_WEB_AUDIO=ON -DENABLE_MEDIA_SOURCE=ON \
-DENABLE_MEDIA_STREAM=ON -DENABLE_WEB_RTC=ON -DUSE_GSTREAMER_WEBRTC=ON \
-DUSE_GSTREAMER=ON -DUSE_GSTREAMER_GL=OFF -DUSE_GSTREAMER_MPEGTS=ON \
-DENABLE_WEBGL=ON -DENABLE_WEBGL2=ON \
-DENABLE_SPEECH_SYNTHESIS=ON \
-DUSE_WOFF2=ON -DFREETYPE_WOFF2_SUPPORT_IS_AVAILABLE=OFF \
-DUSE_AVIF=ON -DUSE_JPEGXL=ON -DUSE_LCMS=OFF -DUSE_OPENJPEG=OFF \
-DENABLE_GAMEPAD=ON -DENABLE_PAYMENT_REQUEST=ON -DENABLE_OFFSCREEN_CANVAS=ON \
-DENABLE_DEVICE_ORIENTATION=ON \
-DENABLE_SERVICE_WORKER=ON -DENABLE_WEBDRIVER=OFF -DENABLE_ENCRYPTED_MEDIA=ON \
-DENABLE_THUNDER=OFF -DENABLE_WEBXR=OFF -DENABLE_MINIBROWSER=OFF \
-DENABLE_INTROSPECTION=OFF -DENABLE_DOCUMENTATION=OFF -DENABLE_API_TESTS=OFF \
-DENABLE_BUBBLEWRAP_SANDBOX=OFF -DENABLE_JOURNALD_LOG=OFF -DUSE_SYSTEMD=OFF \
-DENABLE_SPELLCHECK=OFF -DUSE_ATK=OFF -DENABLE_ACCESSIBILITY=OFF \
-DUSE_LIBHYPHEN=OFF -DUSE_LIBBACKTRACE=OFF -DUSE_SYSTEM_SYSPROF_CAPTURE=OFF \
-DENABLE_WEB_CRYPTO=ON \
> "$LOGDIR/configure.log" 2>&1
rc=$?
set -e
echo "== cmake configure rc=$rc (log: $LOGDIR/configure.log) =="
[ "$rc" = 0 ] || { grep -E "CMake Error|Could NOT find|error:" "$LOGDIR/configure.log" | head -30; exit $rc; }
grep -E "Could NOT find|-- Performing" "$LOGDIR/configure.log" | grep -i "could not" | head -20 || true
;;
build)
[ -d "$BUILD" ] || die "not configured — run '$0 configure' first"
# Refuse to start on top of a running build. Two ninjas sharing one log interleave their writes at
# independent file offsets, which produces a log full of NUL padding where the errors should be and
# makes a live build look like a mysterious failure.
if pgrep -x ninja >/dev/null 2>&1; then
die "a ninja is already running — wait for it, or stop it first (pgrep -x ninja)"
fi
cd "$BUILD"
LOG="$LOGDIR/build.log"
[ -e "$LOG" ] && mv -f "$LOG" "$LOG.prev" # keep the previous run instead of clobbering it
echo "== ninja -j$JOBS (log: $LOG) =="
set +e
nice -n 10 ninja -j"$JOBS" > "$LOG" 2>&1
rc=$?
set -e
echo "== ninja rc=$rc =="
[ "$rc" = 0 ] || { grep -E "error:|FAILED" "$LOG" | head -30; exit $rc; }
rm -rf "$DESTROOT"
DESTDIR="$DESTROOT" ninja install >> "$LOG" 2>&1
echo "== installed into $DESTROOT$PREFIX =="
ls -la "$DESTROOT$PREFIX/lib/" 2>/dev/null | head
;;
parity)
# Feature-parity check against a reference libWPEWebKit (the engine that shipped).
#
# Spot-checking a handful of features is not enough - ENABLE_DEVICE_ORIENTATION defaults OFF and was
# missing from this build for a while, which would have silently broken the motion/orientation sensors
# the app ships. Nothing in the NEEDED list catches that: the feature needs no extra library.
#
# Every enabled IDL interface contributes a generated JS<Name> binding class to the library, so
# diffing the full set of those names is a sensitive, cheap check for exactly this class of mistake.
REFLIB="${REFLIB:-$HOME/atlas-device-backup/ref/org.webosports.app.atlas/deviceroot/wpe-252/lib/libWPEWebKit-2.0.so.1}"
OURLIB="${OURLIB:-$DESTROOT$PREFIX/lib/libWPEWebKit-2.0.so.1}"
[ -f "$REFLIB" ] || die "no reference library at $REFLIB (set REFLIB=)"
[ -f "$OURLIB" ] || die "no built library at $OURLIB — run '$0 build' first"
tmp=$(mktemp -d); trap 'rm -rf "$tmp"' EXIT
strings -a "$OURLIB" | grep -xE 'JS[A-Z][A-Za-z0-9]+' \
| grep -vxE 'JS(Value|Object|String|Context|ContextGroup|GlobalContext|Class|PropertyName[A-Za-z]*|Type[A-Za-z]*|Garbage[A-Za-z]*|Check[A-Za-z]*|Evaluate[A-Za-z]*|Weak[A-Za-z]*|Export[A-Za-z]*|Retain|Release)[A-Za-z0-9]*' \
| sort -u > "$tmp/ours"
strings -a "$REFLIB" | grep -xE 'JS[A-Z][A-Za-z0-9]+' \
| grep -vxE 'JS(Value|Object|String|Context|ContextGroup|GlobalContext|Class|PropertyName[A-Za-z]*|Type[A-Za-z]*|Garbage[A-Za-z]*|Check[A-Za-z]*|Evaluate[A-Za-z]*|Weak[A-Za-z]*|Export[A-Za-z]*|Retain|Release)[A-Za-z0-9]*' \
| sort -u > "$tmp/ref"
echo "== binding classes: ours=$(wc -l < "$tmp/ours") reference=$(wc -l < "$tmp/ref") =="
missing=$(comm -13 "$tmp/ours" "$tmp/ref")
extra=$(comm -23 "$tmp/ours" "$tmp/ref")
[ -n "$extra" ] && { echo "-- enabled here but NOT in the reference:"; echo "$extra" | sed 's/^/ /'; }
if [ -n "$missing" ]; then
echo "-- MISSING relative to the reference (a feature is switched off):" >&2
echo "$missing" | sed 's/^/ /' >&2
die "feature parity check FAILED"
fi
echo " no features missing relative to the reference"
;;
*) die "usage: $(basename "$0") [configure|build|parity]";;
esac
+93
View File
@@ -0,0 +1,93 @@
# CMake cross-toolchain for the Atlas engine (HP TouchPad, webOS 3.0.5).
# Portable reconstruction of the unpublished cmake-toolchain-glibc-gcc125.cmake.
#
# cmake .. -DCMAKE_TOOLCHAIN_FILE=<this file>
#
# Reads the same environment as env-atlas-cross.sh, so source that first (or set TOOLCHAIN/STAGING).
# Nothing here is machine-specific.
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
# --- toolchain ---------------------------------------------------------------------------------
if(NOT DEFINED ATLAS_TOOLCHAIN)
if(DEFINED ENV{TOOLCHAIN})
set(ATLAS_TOOLCHAIN "$ENV{TOOLCHAIN}")
else()
file(GLOB _tc "$ENV{HOME}/x-tools/arm-*linux-gnueabi*")
list(GET _tc 0 ATLAS_TOOLCHAIN)
endif()
endif()
if(NOT DEFINED ATLAS_TARGET)
if(DEFINED ENV{TARGET})
set(ATLAS_TARGET "$ENV{TARGET}")
else()
set(ATLAS_TARGET "arm-cortex_a8-linux-gnueabi")
endif()
endif()
set(CMAKE_C_COMPILER "${ATLAS_TOOLCHAIN}/bin/${ATLAS_TARGET}-gcc")
set(CMAKE_CXX_COMPILER "${ATLAS_TOOLCHAIN}/bin/${ATLAS_TARGET}-g++")
set(CMAKE_AR "${ATLAS_TOOLCHAIN}/bin/${ATLAS_TARGET}-ar" CACHE FILEPATH "")
set(CMAKE_RANLIB "${ATLAS_TOOLCHAIN}/bin/${ATLAS_TARGET}-ranlib" CACHE FILEPATH "")
set(CMAKE_STRIP "${ATLAS_TOOLCHAIN}/bin/${ATLAS_TARGET}-strip" CACHE FILEPATH "")
# --- ABI (must match the device engine exactly) ------------------------------------------------
# softfp, not hardfp: webOS 3.0.5's system libraries are softfp, and JavaScriptCore's JIT is patched
# to match (wpewebkit-2.52.4-softfp-jit.patch). Getting this wrong yields a browser that links but
# passes doubles in the wrong registers.
set(ATLAS_ARCH_FLAGS "-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -mthumb")
# Debian multiarch keeps arch-dependent headers in /usr/include/<triplet>: gpg-error.h, ffi.h,
# jconfig.h (libjpeg), openssl/, libxslt/, libunwind*. pkg-config does not emit that directory, so
# without it <gpg-error.h> and friends are simply not found. Must be set before the flags below.
if(DEFINED ENV{STAGING})
set(_atlas_ma "$ENV{STAGING}/webkitdeps/usr/include/arm-linux-gnueabihf")
else()
set(_atlas_ma "$ENV{HOME}/atlas-staging/webkitdeps/usr/include/arm-linux-gnueabihf")
endif()
set(CMAKE_C_FLAGS_INIT "${ATLAS_ARCH_FLAGS} -isystem ${_atlas_ma}")
set(CMAKE_CXX_FLAGS_INIT "${ATLAS_ARCH_FLAGS} -isystem ${_atlas_ma}")
# --- sysroot / search paths --------------------------------------------------------------------
if(DEFINED ENV{STAGING})
set(ATLAS_STAGING "$ENV{STAGING}")
else()
set(ATLAS_STAGING "$ENV{HOME}/atlas-staging")
endif()
set(ATLAS_WEBKITDEPS "${ATLAS_STAGING}/webkitdeps")
# webkitdeps holds the extracted armhf dev debs (headers + .pc); its lib/*.so are symlinked to the
# real device libraries by stage-sysroot-atlas.sh, so -l resolves against what the device ships.
set(CMAKE_FIND_ROOT_PATH "${ATLAS_WEBKITDEPS}/usr" "${ATLAS_STAGING}")
# Deliberately NO CMAKE_SYSROOT here. --sysroot would replace the toolchain's own sysroot, so libc's
# headers (which live in the toolchain, not in webkitdeps) would stop resolving. Dependency headers
# come in as explicit -I from pkg-config, which prefixes them with PKG_CONFIG_SYSROOT_DIR below.
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # build tools (ruby, unifdef, gperf) come from the host
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
# pkg-config resolves against webkitdeps only — never the host's /usr.
set(ENV{PKG_CONFIG_SYSROOT_DIR} "${ATLAS_WEBKITDEPS}")
set(ENV{PKG_CONFIG_LIBDIR}
"${ATLAS_WEBKITDEPS}/usr/lib/arm-linux-gnueabihf/pkgconfig:${ATLAS_WEBKITDEPS}/usr/share/pkgconfig:${ATLAS_STAGING}/lib/pkgconfig")
unset(ENV{PKG_CONFIG_PATH})
# --- link paths ---------------------------------------------------------------------------------
# linklib = the engine's own libs (deviceroot/wpe-252/lib) minus the ones the toolchain provides.
#
# NOTE: $STAGING/rootfs is deliberately NOT on the link path here, unlike the BrowserServer build.
# rootfs is the device's SYSTEM /usr/lib + /lib, i.e. the ancient glibc 2.8 tree. Because linklib
# excludes libc/libpthread (so they cannot shadow the toolchain's), ld falls through to rootfs and
# picks up the 2.8 libpthread.so.0, which references GLIBC_PRIVATE symbols that do not exist in our
# glibc 2.23 (__default_sa_restorer_v2, h_errno, ...) and the link dies. Every WebKit dependency lives
# in the bundled engine lib dir, so linklib alone is correct; let libc/libpthread come from the
# toolchain's own sysroot.
set(ATLAS_LINK_FLAGS
"-L${ATLAS_STAGING}/linklib -L${ATLAS_WEBKITDEPS}/usr/lib/arm-linux-gnueabihf \
-Wl,-rpath-link,${ATLAS_STAGING}/linklib")
set(CMAKE_EXE_LINKER_FLAGS_INIT "${ATLAS_LINK_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS_INIT "${ATLAS_LINK_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS_INIT "${ATLAS_LINK_FLAGS}")
-47
View File
@@ -1,47 +0,0 @@
# Atlas WPE engine — HP Pre 3 (mantaray) low-memory device profile.
#
# Sourced by wrapper-BrowserServer near the very end, AFTER the TouchPad Phase-1 tuning block, so
# these values OVERRIDE it. Ship this file as "$ATLAS/device-profile" (the wrapper sources
# "$ATLAS/device-profile" if it exists — see wrapper-BrowserServer). On the TouchPad no such file is
# installed, so the TouchPad runs its Phase-1 values unchanged.
#
# HP Pre 3: 512MB RAM, single-core 1.4GHz (MSM8x55), Adreno 205, 480x800. The two big deltas vs the
# TouchPad (1GB, dual-core) are HALF the RAM and ONE core.
# JS heap budget: ~96MB (down from the TouchPad's ~192MB) so JSC sizes its heaps for a 512MB device.
export JSC_forceRAMSize=100663296
# Single core: raster on one thread (the TouchPad uses 2). A 2nd painting thread on a 1-core device
# just adds contention.
export WEBKIT_NICOSIA_PAINTING_THREADS=1
# Force viewport-only ("simple") rendering for EVERY page — no tall pan buffer. This is what makes the
# device usable on 512MB, and it works for the STOCK Mojo browser too (it can't send the atlas-simple:
# URL marker; the backend's bpwpe_force_low_mem() honours this env). See atlas-wpe-backend.
export BPWPE_FORCE_SIMPLE=1
# Exact-viewport buffer (mult=1) rather than the 2-screen simple default — minimum footprint.
export BPWPE_SIMPLE_SCREENS=1
# Real panel size. webOS 2.2.4 reports the legacy-compat logical size (320x480) in luna.conf, but the
# Pre 3 panel is physically 480x800 — without this the browser viewport is square (480x480) and pages lay
# out in half the height. The backend (BrowserPageWPE) honours these over luna.conf.
export BPWPE_SCREEN_W=480
export BPWPE_SCREEN_H=800
# Reap the WebProcess on every top-level navigation so a long-lived card doesn't accumulate memory across
# a session and thrash under pressure. Costs one cold WebProcess spawn per navigation; worth it on 512MB.
# Pairs with the DOCUMENT_VIEWER cache model + bf-cache disable the low-memory path enables in the backend.
export BPWPE_REAP_ON_NAV=0
# WebProcess memory-pressure cap ~160MB (TouchPad default is 480). Kept above a single heavy page's
# working set but low enough to trigger cache eviction / GC before the device OOMs.
export BPWPE_MEM_LIMIT=160
# Re-ENABLE the scroll-strip readback. The TouchPad disables it (BPWPE_NO_STRIP=1) because it renders a
# tall pan buffer where a full-buffer readback wins; with viewport-sized rendering the small-delta strip
# path is the faster one (per the wrapper's own note: "The strip only wins for viewport-sized rendering").
export BPWPE_NO_STRIP=0
# RGB565 tiles (16bpp) and MALLOC_ARENA_MAX=2 from the Phase-1 block are already correct for low memory
# and are intentionally NOT overridden here.
+5
View File
@@ -13,4 +13,9 @@ script
end script
respawn
# KEEP THIS UNLIMITED. Unlike atlas-sensord (capped at 5/60 so a missing binary can't crash-loop), the
# engine's recovery from a GPU wedge (#3) IS an abort + respawn: BrowserServer's deadlock watchdog aborts
# a wedged engine (-d 90000 in the wrapper) and relies on upstart bringing it straight back, after which
# the app's cards reload themselves. Any respawn cap here silently converts the Nth wedge of a session
# into a dead browser that only a reboot fixes — which is exactly what this recovery path exists to avoid.
respawn limit 0 0
-23
View File
@@ -1,23 +0,0 @@
# WPE engine server for the HP Pre 3 ENGINE-SWAP path (Path B): the WPE-backed BrowserServer-atlas
# takes over the STOCK browser socket so the unmodified webOS Mojo browser (com.palm.app.browser)
# drives it. The key difference vs the TouchPad `atlas` job is BROWSERSERVER_NAME=browser, which makes
# the server listen on /tmp/yapserver.browser — the socket the stock adapter mime (application/x-palm-
# browser, built with -DATLAS_STOCK_BROWSER) connects to.
#
# Deploy as /etc/event.d/browser-wpe (or replace the stock BrowserServer launch). Adjust the cd path to
# wherever the Pre 3 engine deviceroot is installed (this template assumes an internal-storage layout).
start on stopped fontconfig_cache
stop on started start_update
description "WPE BrowserServer (stock-socket engine swap, Pre 3)"
script
export BROWSERSERVER_NAME=browser
# Engine deviceroot on the Pre 3. The wrapper (wrapper-BrowserServer) derives $D=$DR/wpe-252 from its
# own location and sources $ATLAS/device-profile (device-profile-pre3) for the low-memory tuning.
cd /media/internal/atlas-engine/atlas
rm -f /tmp/yapserver.browser*
exec ./BrowserServer
end script
respawn
respawn limit 0 0
+40 -17
View File
@@ -80,13 +80,24 @@ export WEBKIT_NICOSIA_PAINTING_THREADS=2 # use BOTH cores for Cairo/Nicosia ti
# otherwise idle while BS blocks on the GPU readback, so it overlaps
# cleanly (readback ticks up only ~50ms from contention; net win).
export MALLOC_ARENA_MAX=2 # cap glibc per-thread arenas (GStreamer/fontconfig side)
export BPWPE_PRESPAWN=1 # Warm the WebProcess with about:blank at card-open (attachToBuffer)
# rather than on the first openUrl, so the ~3-4s WebProcess cold
# spawn (map 67MB libWPEWebKit + JSC/bundle init) overlaps the
# "open Atlas -> start page -> type URL" gap. The warm process is
# reused for the real navigation and REAPED on card close, so it
# costs no idle memory when Atlas isn't open. BS itself is a boot
# service (always up); this only moves the WebProcess spawn earlier.
# BPWPE_PRESPAWN — OFF (2026-08-04). It warms the WebProcess by loading about:blank at card-open
# (attachToBuffer) instead of on the first openUrl, so the ~3-4s cold spawn overlaps the "open Atlas
# -> start page -> type URL" gap. The idea is fine; the implementation is not INVISIBLE, and that
# breaks navigation:
# The warm-up goes through the ORDINARY load path in BrowserPageWPE. Nothing there consults
# m_prewarmBlank (it is read only in openUrl, to tear the view down for a private/simple card), so
# the throwaway load reports itself to the adapter as a real page: msgLoadStarted, clearToWhite +
# msgContentsSizeChanged at commit, and msgTitleAndUrlChanged("", "about:blank") twice over — once
# from onUriChanged the moment the URI flips, again at load-finished — then msgLoadStopped.
# The app believes all of it: Browser.pageTitleChanged assigns this.url = "about:blank", rewrites
# the address bar and sets changedUrl (which writes about:blank into history on the next progress
# tick), and loadStopped fires doPageLoadStopped for it.
# So a card opened WITH a target (launchParams / luna-send / a link from another app) has its URL
# overwritten by the warm-up that is racing it, and any card open blanks the buffer mid-flight.
# Turn this back on only together with a BrowserPageWPE that gates the adapter-facing messages on
# m_prewarmBlank (and drops the flag when the blank load ends or a real openUrl supersedes it). The
# backend ships it off by default for this reason; this line used to override that.
#export BPWPE_PRESPAWN=1
export BPWPE_NO_STRIP=1 # DISABLE the P2 scroll-strip readback — correct for the TALL pan
# buffer (default mult=4): on a fling the recenter always jumps
# ~slack/2 (delta ~960-1400px), so the "strip" is ~1/3-1/2 the
@@ -130,13 +141,25 @@ export ATLAS_CAMERA_NO_DECODEBIN=1 # getUserMedia: skip decodebin3 in th
# would be looked up under /media/internal (which we no longer populate).
export WEBKIT_EXEC_PATH=$D/libexec/wpe-webkit-2.0
export WEBKIT_INJECTED_BUNDLE_PATH=$D/lib/wpe-webkit-2.0/injected-bundle
# Optional per-DEVICE tuning override, sourced LAST so it wins over the Phase-1 block above. The Pre 3
# (mantaray) package ships "$ATLAS/device-profile" (= ipk-build/pull/device-profile-pre3) to lower the
# RAM/core/buffer knobs for a 512MB single-core phone. The TouchPad ships no such file -> no-op.
[ -r "$ATLAS/device-profile" ] && . "$ATLAS/device-profile"
# Deadlock watchdog: the default 15000ms aborts BS when the main thread stalls in a
# memory-pressure GC / swap-in under heavy accumulated state (idle "random crash" — confirmed
# via core: YapServerDeadlockPriv::deadlockThreadTimerCallback -> abort). A slow GC recovers in
# well under 45s, so raise the timeout so BS survives the stall instead of crash+respawn; a genuine
# deadlock is still caught, just later. Tune via -d / DeadlockTimeoutMs setting (-1 = disabled).
exec $D/BrowserServer-atlas -platform Minimal -d 600000 >>/media/ram/bs-atlas.log 2>&1
# Deadlock watchdog: OFF (-d 0). YapServer's detector calls the main loop deadlocked when its
# heartbeat counter has not advanced across one `-d` interval AND the process looks idle; both are
# also true of a perfectly healthy BrowserServer that simply had nothing to do, so it aborts a live
# engine. Observed on-device 2026-08-23 (webOS CE 3.1.0, Atlas 0.9.8, one idle card open):
# BrowserServer-atlas: Deadlock detected; aborting! (13 cpu ticks in the last 90000ms)
# BrowserServer-atlas: Deadlock detected; aborting! (155 cpu ticks in the last 90000ms)
# two aborts in six minutes with nobody touching the tablet. upstart respawns us each time, so the
# user's cards are torn down and reloaded at random — worse, in practice, than the failure the
# watchdog exists to recover.
#
# What it is giving up: the watchdog was the only thing that recovered the GPU wedge
# (atlas-wpe-env#3) without a reboot -- 14m30s of a dead browser, cut to ~63s once -d came down to
# 90s. With the detector off a wedge is permanent again until the engine is restarted by hand
# (`stop atlas; start atlas`) or the tablet reboots. That is the deliberate trade: a rare wedge that
# needs a manual restart beats frequent unprompted engine restarts during normal use.
#
# Nothing replaces it: Atlas does not try to detect a hang at all. Clearing one is a USER action --
# the Restart Browser Engine menu item, which asks atlas-sensord (root, and not dependent on BS) to
# restart this job. Re-enable -d here only with a detector that cannot fire at a healthy idle engine,
# i.e. an unconditional heartbeat proving the loop is ALIVE rather than BUSY.
# -d 0 = disabled (also -1; anything <= 0) -d 90000 = the old 90s CPU-gated behaviour
exec $D/BrowserServer-atlas -platform Minimal -d 0 >>/media/ram/bs-atlas.log 2>&1
+88 -7
View File
@@ -6,6 +6,39 @@ APP=/media/cryptofs/apps/usr/palm/applications/org.webosports.app.atlas
DR=$APP/deviceroot
log() { echo "atlas-postinst: $*"; }
# Packaging target — REWRITTEN AT BUILD TIME by build-ipk-atlas.sh (ATLAS_PKG_TARGET). Keep the literal
# assignment on one line; the builder rewrites it with sed.
# standalone : we restart LunaSysMgr ourselves at the end (WOQI / by-hand installs, no installer to do it)
# feed : we must NOT — Preware runs under LunaSysMgr and a mid-batch restart kills the installer;
# the feed declares PostInstallFlags=RestartLuna so it happens once, after the batch
PKG_TARGET=standalone
# 0a. Stop the engine FIRST, then sweep. Two reasons, and the order between them matters:
#
# UPGRADE. ipkg unpacks straight over a running install (Preware upgrades in place — the old package's
# prerm never runs), so the previous engine and its helper daemons are still live and still holding the
# files we just replaced. `start atlas` at the end would be a no-op on an already-running job, leaving
# the user on the OLD binaries until the next reboot.
#
# FUSE. /media/cryptofs renames a file that is still open to .fuse_hiddenXXXXXXXX instead of removing
# it. Those are dead weight (~9 MB in the engine lib dir), and while a helper holds one it cannot be
# deleted at all — which is why an uninstall used to leave an undeletable app folder behind. So kill
# the holders BEFORE sweeping, or the sweep quietly does nothing.
#
# The helpers (qcamd/qspkd/qmicd) are children of BrowserServer and outlive it; a stale one also makes
# the boot wrapper skip starting the new one. atlas-sensord is in the list for the same reason `start`
# is not enough on an upgrade — step 3 starts it again below. On a fresh install every command here is
# a no-op.
stop atlas 2>/dev/null
stop atlas-sensord 2>/dev/null
for _p in BrowserServer-atlas qcamd qspkd qmicd atlas-sensord; do killall "$_p" 2>/dev/null; done
sleep 2
for _p in BrowserServer-atlas qcamd qspkd qmicd atlas-sensord; do killall -9 "$_p" 2>/dev/null; done
# Deleting a file FUSE has hidden while somebody still holds it just re-hides it under a NEW
# .fuse_hidden name, so this only really clears once the holders are gone — which is why it runs here,
# after the kills, and why a stubborn remnant clears on the next install or reboot rather than now.
find "$APP" -name '.fuse_hidden*' -exec rm -f {} \; 2>/dev/null
# 0. prerequisite: community OpenSSL 1.1 lives in /usr/lib/ssl11 (NOT bundled — we depend on it for TLS 1.3).
[ -e /usr/lib/ssl11/libssl.so.1.1 ] || log "WARNING: /usr/lib/ssl11/libssl.so.1.1 missing — install the webOS OpenSSL 1.1 package first or HTTPS will not work."
@@ -14,10 +47,38 @@ log() { echo "atlas-postinst: $*"; }
# USB storage and must stay free of app internals. The boot wrapper derives its own $DR at runtime.
log "preparing WPE engine (in place on cryptofs deviceroot)..."
chmod 755 "$DR/wpe-252/BrowserServer-atlas" "$DR/atlas/BrowserServer" 2>/dev/null
# GPU: the engine links versioned sonames; supply them from the device's real Adreno driver (not bundled).
# cryptofs (like vfat) has no symlinks, so COPY the driver to the versioned names rather than symlink.
cp -f /usr/lib/libEGL.so "$DR/wpe-252/lib/libEGL.so.1"
cp -f /usr/lib/libGLESv2.so "$DR/wpe-252/lib/libGLESv2.so.2"
# GPU: stage the Adreno driver under every name the engine asks for. THREE names are needed, and a fresh
# install that is missing any of them gets a browser that renders nothing:
# libEGL.so.1 / libGLESv2.so.2 - what libWPEBackend-atlas.so NEEDs (verified with readelf).
# libEGL.so (unversioned) - what the vendor libGLESv2 blob itself NEEDs. Its SONAME is the
# unversioned "libEGL.so" too, so today this only resolves by luck:
# either the already-loaded libEGL.so.1 satisfies it under its SONAME,
# or the loader falls through to /usr/lib/libEGL.so. Stage it locally
# so neither piece of luck is required.
# cryptofs (like vfat) has no symlinks, so COPY rather than symlink.
#
# Prefer the DEVICE's driver (it matches this device's GPU), but fall back to the copy bundled in the ipk
# when /usr/lib has no unversioned name — the old unconditional `cp -f` failed silently in that case and
# left the app dir with no GL at all, which is the 0.9.8 "missing libEGL.so.1 / libGLESv2.so.2" report.
stage_gl() { # stage_gl <device source> <destination>
if [ -f "$1" ]; then
cp -f "$1" "$2" || log "WARNING: could not copy $1 -> $2 (keeping whatever is there)"
elif [ -s "$2" ]; then
log "note: $1 absent on this device — keeping the bundled $(basename "$2")"
else
log "ERROR: no $1 and no bundled $(basename "$2") — the browser will not render"
fi
}
stage_gl /usr/lib/libEGL.so "$DR/wpe-252/lib/libEGL.so.1"
stage_gl /usr/lib/libGLESv2.so "$DR/wpe-252/lib/libGLESv2.so.2"
# Unversioned alias, taken from what we just staged (NOT re-read from /usr/lib, so it is correct even on a
# device that has no /usr/lib/libEGL.so).
cp -f "$DR/wpe-252/lib/libEGL.so.1" "$DR/wpe-252/lib/libEGL.so" 2>/dev/null \
|| log "WARNING: could not stage the unversioned libEGL.so"
# Fail loud rather than leave the user with a browser that opens and renders nothing.
for _gl in libEGL.so.1 libGLESv2.so.2 libEGL.so; do
[ -s "$DR/wpe-252/lib/$_gl" ] || log "ERROR: $_gl is MISSING from the engine lib dir — WebGL/rendering will fail"
done
# Bridge symlink: libWPEWebKit's baked install prefix is length-limited (can't hold the long cryptofs path),
# so deploy prefix-patches it to the short /var/atlas252, which we point at the real engine dir on cryptofs.
# (/var is ext3 → supports symlinks; cryptofs/vfat do not.) Removed once WebKit is rebuilt with the cryptofs
@@ -60,9 +121,29 @@ log "registering db8 kinds..."
luna-send -n 1 palm://com.palm.configurator/run '{"types":["dbkinds"]}' 2>/dev/null
luna-send -n 1 palm://com.palm.configurator/run '{"types":["dbpermissions"]}' 2>/dev/null
# 6. start the engine + reload LunaSysMgr (picks up the new NPAPI plugin for application/x-atlas-browser).
log "starting atlas engine + reloading LunaSysMgr..."
# 6. start the engine, then reload LunaSysMgr so it picks up the new NPAPI plugin
# (application/x-atlas-browser) — but only when we are the ones who should do it.
#
# In a FEED build we must not: Preware and other batch installers run UNDER LunaSysMgr, so restarting it
# mid-batch kills the installer and abandons the rest of the dependency chain. Observed in the WOSA
# Modernize feed — Atlas is a dependency of atlas-default-browser, which also pulls tls-updates, and the
# restart fired the moment Atlas finished, so the rest never ran. There the feed declares
# PostInstallFlags=RestartLuna and the installer does it once, after the whole batch.
#
# In a STANDALONE build there is no installer to defer to (WOQI, or extracting by hand), so we do it here
# or the user is left with a browser that cannot render until they work out that Luna needs restarting.
#
# ATLAS_POSTINST_RESTART_LUNA=1 forces the restart regardless of target.
# The engine was stopped in step 0a (so an upgrade does not keep running the binaries we replaced);
# this starts the new one.
log "starting atlas engine..."
start atlas 2>/dev/null
killall LunaSysMgr 2>/dev/null
if [ "${ATLAS_POSTINST_RESTART_LUNA:-0}" = 1 ] || [ "$PKG_TARGET" = standalone ]; then
log "reloading LunaSysMgr (target=$PKG_TARGET) so it picks up the browser plugin..."
killall LunaSysMgr 2>/dev/null
else
log "NOTE: LunaSysMgr must reload before the browser can render — your installer should do this"
log " (PostInstallFlags=RestartLuna); otherwise restart Luna or reboot to finish."
fi
log "install complete."
exit 0
+34 -3
View File
@@ -1,12 +1,38 @@
#!/bin/sh
# Atlas Web — pre-removal. Runs as ROOT. Reverses postinst. The app dir itself is removed by the installer.
APP=/media/cryptofs/apps/usr/palm/applications/org.webosports.app.atlas
log() { echo "atlas-prerm: $*"; }
# Packaging target — REWRITTEN AT BUILD TIME by build-ipk-atlas.sh (ATLAS_PKG_TARGET). See ipk-postinst.sh.
# Kept for symmetry with postinst; removal behaves the same either way (see the note at the end).
PKG_TARGET=standalone
log "stopping engine..."
stop atlas 2>/dev/null
killall BrowserServer-atlas 2>/dev/null
stop atlas-sensord 2>/dev/null
killall atlas-sensord 2>/dev/null
# Kill the HELPER DAEMONS too, not just BrowserServer. The boot wrapper backgrounds qcamd/qspkd/qmicd
# and then execs BrowserServer-atlas, so they are its children — and when BS dies without reaping them
# (the deadlock watchdog's abort, a kill -9, an upstart respawn) they re-parent to init and keep running
# forever. The wrapper is fine with that (it skips a helper that is already up), but an UNINSTALL is not:
#
# /media/cryptofs is FUSE. Unlinking a file that some process still has open does not remove it — the
# filesystem renames it to .fuse_hiddenXXXXXXXX and keeps it until the last holder closes it. A helper
# left running holds its own binary and the engine libs open, so the installer's `rm -rf` of the app
# directory silently leaves those files behind and then cannot remove the directories containing them:
# rm: can't remove '.../deviceroot/atlas': Directory not empty
# rm: can't remove '.../deviceroot/wpe-252/lib': Directory not empty
# What the user is left with is an app folder holding an empty deviceroot skeleton — no app, no icon —
# and the next install unpacks on top of it. Observed on-device 2026-08-23.
#
# So: TERM everything, give it a moment, then KILL whatever ignored that.
for _p in BrowserServer-atlas qcamd qspkd qmicd atlas-sensord; do killall "$_p" 2>/dev/null; done
sleep 2
for _p in BrowserServer-atlas qcamd qspkd qmicd atlas-sensord; do killall -9 "$_p" 2>/dev/null; done
# Anything still holding a deleted file shows up as .fuse_hidden* under the app dir; with the holders
# gone these are ordinary files again, so remove them before the installer tries to drop the directory.
rm -f "$APP"/deviceroot/atlas/.fuse_hidden* \
"$APP"/deviceroot/wpe-252/lib/.fuse_hidden* 2>/dev/null
find "$APP" -name '.fuse_hidden*' -exec rm -f {} \; 2>/dev/null
log "removing rootfs components (rw)..."
mount -o remount,rw / 2>/dev/null
@@ -26,6 +52,11 @@ log "removing our db8 kind files..."
rm -f /etc/palm/db/kinds/org.webosports.logins /etc/palm/db/kinds/org.webosports.autofill
rm -f /etc/palm/db/permissions/org.webosports.logins /etc/palm/db/permissions/org.webosports.autofill
killall LunaSysMgr 2>/dev/null
# Do NOT restart LunaSysMgr here, on either target. com.palm.appinstaller runs this script as
# pmPreRemove.script SYNCHRONOUSLY, from inside LunaSysMgr, BEFORE `ipkg remove` — so killing Luna kills
# the removal itself: prerm runs, Luna restarts, the package is still installed. Observed 2026-08-23.
# (postinst is safe to restart Luna from: pmPostInstall.script runs AFTER ipkg has finished.)
# Nothing is lost by leaving it — the plugin file is already deleted above, and Luna drops it on its next
# restart or reboot.
log "removal complete."
exit 0
Binary file not shown.
+75 -1
View File
@@ -29,6 +29,9 @@
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <sys/wait.h>
#include <hal/hal_device.h>
#include <hal/hal_sensor_acceleration.h>
@@ -124,6 +127,49 @@ static void drain_lin(hal_device_handle_t h, float *x, float *y, float *z) /*
}
}
/* Engine control. The Enyo app runs as luna inside LunaSysMgr and cannot exec, and anything routed
* through BrowserServer is dead once BS wedges (atlas-wpe-env#3) — so a loopback HTTP GET here is how
* it asks for a restart. We are the only root daemon in the package and we do not depend on BS.
* Loopback-only; the one action it offers is restarting our own browser engine. */
#define CTL_PORT 8442
/* Detached so the poll loop keeps running. Never kills atlas-sensord — that is us.
* Double-fork: `start atlas` blocks until the job is up, and we never wait(), so a single fork
* would leave a zombie per restart. The grandchild is orphaned to init, which reaps it. */
static void restart_engine(void)
{
pid_t p = fork();
if (p < 0) return;
if (p > 0) { waitpid(p, NULL, 0); return; }
if (fork() != 0) _exit(0);
setsid();
system("/sbin/stop atlas >/dev/null 2>&1; "
"/usr/bin/killall -9 BrowserServer-atlas qcamd qspkd qmicd >/dev/null 2>&1; "
"/sbin/start atlas >/dev/null 2>&1");
_exit(0);
}
/* Answer one control request. Returns 1 if a restart was asked for. */
static int ctl_serve(int c)
{
struct timeval tv; tv.tv_sec = 0; tv.tv_usec = 300000;
setsockopt(c, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
char req[256]; int n = recv(c, req, sizeof req - 1, 0);
int ok = 0;
if (n > 0) {
req[n] = 0;
ok = (strstr(req, "/restart-engine") != NULL);
char rsp[192];
snprintf(rsp, sizeof rsp,
"HTTP/1.0 %s\r\nAccess-Control-Allow-Origin: *\r\n"
"Content-Type: text/plain\r\nContent-Length: 2\r\nConnection: close\r\n\r\n%s",
ok ? "200 OK" : "404 Not Found", ok ? "ok" : "no");
send(c, rsp, strlen(rsp), 0);
}
close(c);
return ok;
}
int main(int argc, char **argv)
{
if (argc > 1 && strcmp(argv[1], "-v") == 0) g_verbose = 1;
@@ -149,12 +195,31 @@ int main(int argc, char **argv)
listen(srv, MAX_CLIENTS);
if (g_verbose) fprintf(stderr, "sensord: listening on %s (accelFd=%d gyroFd=%d)\n", SOCK_PATH, fdAccel, fdGyro);
/* Control socket. Not fatal if it fails — the sensor bridge still works without it. */
int ctl = socket(AF_INET, SOCK_STREAM, 0);
if (ctl >= 0) {
int one = 1;
setsockopt(ctl, SOL_SOCKET, SO_REUSEADDR, &one, sizeof one);
struct sockaddr_in ca; memset(&ca, 0, sizeof ca);
ca.sin_family = AF_INET;
ca.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
ca.sin_port = htons(CTL_PORT);
if (bind(ctl, (struct sockaddr*)&ca, sizeof ca) < 0 || listen(ctl, 4) < 0) {
perror("sensord: ctl");
close(ctl); ctl = -1;
} else if (g_verbose) {
fprintf(stderr, "sensord: engine control on 127.0.0.1:%d\n", CTL_PORT);
}
}
int clients[MAX_CLIENTS]; int nclient = 0;
float ax=0,ay=0,az=0, gx=0,gy=0,gz=0, mx=0,my=0,mz=0, lx=0,ly=0,lz=0;
while (g_run) {
struct pollfd pfd[5 + MAX_CLIENTS]; int n = 0;
struct pollfd pfd[6 + MAX_CLIENTS]; int n = 0;
int iSrv = n; pfd[n].fd = srv; pfd[n].events = POLLIN; n++;
int iCtl = -1;
if (ctl >= 0) { iCtl = n; pfd[n].fd = ctl; pfd[n].events = POLLIN; n++; }
int iAcc = -1, iGyr = -1, iMag = -1, iLin = -1;
if (fdAccel >= 0) { iAcc = n; pfd[n].fd = fdAccel; pfd[n].events = POLLIN; n++; }
if (fdGyro >= 0) { iGyr = n; pfd[n].fd = fdGyro; pfd[n].events = POLLIN; n++; }
@@ -165,6 +230,15 @@ int main(int argc, char **argv)
int r = poll(pfd, n, 1000);
if (r < 0) { if (errno == EINTR) continue; break; }
/* engine restart request */
if (iCtl >= 0 && (pfd[iCtl].revents & POLLIN)) {
int c = accept(ctl, NULL, NULL);
if (c >= 0 && ctl_serve(c)) {
fprintf(stderr, "sensord: engine restart requested\n");
restart_engine();
}
}
/* accept new clients */
if (pfd[iSrv].revents & POLLIN) {
int c = accept(srv, NULL, NULL);
+54
View File
@@ -0,0 +1,54 @@
#!/bin/bash
# Stage the HOST-side build tools WPE WebKit needs that may not be installed (and that we cannot
# apt-get install without root): ruby and unifdef.
#
# WebKit's build runs ruby for its code generators (JavaScriptCore's offlineasm, the bindings
# generators) and unifdef for header post-processing. Both must be HOST (x86_64) binaries — they are
# build tools, not target code.
#
# ./stage-hosttools-atlas.sh # fetch + extract into $HOSTTOOLS (default ~/hosttools)
# . ./hosttools-env.sh # written by this script; puts them on PATH
#
# Unprivileged: `apt-get download` + `dpkg-deb -x` never touch the system. If your distro already has
# ruby and unifdef on PATH, you do not need this at all.
set -eu
HOSTTOOLS="${HOSTTOOLS:-$HOME/hosttools}"
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
mkdir -p "$HOSTTOOLS/debs" "$HOSTTOOLS/root"
need_ruby=1; need_unifdef=1
command -v ruby >/dev/null 2>&1 && need_ruby=0
command -v unifdef >/dev/null 2>&1 && need_unifdef=0
pkgs=""
[ "$need_ruby" = 1 ] && pkgs="$pkgs ruby3.2 libruby3.2"
[ "$need_unifdef" = 1 ] && pkgs="$pkgs unifdef"
if [ -n "$pkgs" ]; then
echo "== fetching host tools:$pkgs =="
( cd "$HOSTTOOLS/debs" && apt-get download $pkgs )
for d in "$HOSTTOOLS"/debs/*.deb; do dpkg-deb -x "$d" "$HOSTTOOLS/root"; done
# Debian/Ubuntu ship the interpreter as ruby3.2; WebKit's generators invoke plain `ruby`.
if [ -x "$HOSTTOOLS/root/usr/bin/ruby3.2" ] && [ ! -e "$HOSTTOOLS/root/usr/bin/ruby" ]; then
ln -sf ruby3.2 "$HOSTTOOLS/root/usr/bin/ruby"
fi
else
echo "== host already has ruby + unifdef; nothing to fetch =="
fi
# An extracted (not installed) ruby finds neither its shared lib nor its stdlib without help.
cat > "$SCRIPT_DIR/hosttools-env.sh" <<EOF
# Generated by stage-hosttools-atlas.sh — source this before configuring/building WebKit.
export PATH="$HOSTTOOLS/root/usr/bin:\$PATH"
export LD_LIBRARY_PATH="$HOSTTOOLS/root/usr/lib/x86_64-linux-gnu\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH}"
export RUBYLIB="$HOSTTOOLS/root/usr/lib/ruby/3.2.0:$HOSTTOOLS/root/usr/lib/x86_64-linux-gnu/ruby/3.2.0"
EOF
# shellcheck disable=SC1090
. "$SCRIPT_DIR/hosttools-env.sh"
echo "== verifying =="
ruby --version
ruby -e 'require "digest"; require "fileutils"; require "optparse"; require "stringio"; require "json"; puts " ruby stdlib OK"'
unifdef -V 2>&1 | head -1
echo "== host tools ready; source $SCRIPT_DIR/hosttools-env.sh =="
+90 -4
View File
@@ -14,7 +14,9 @@
# ./stage-sysroot-atlas.sh headers # network only, no device needed
# ./stage-sysroot-atlas.sh device # needs a TouchPad running Atlas, over novacom
# ./stage-sysroot-atlas.sh linklib # derives linklib/ + dev symlinks from lib/ (run after `device`)
# ./stage-sysroot-atlas.sh all # all three, in order
# ./stage-sysroot-atlas.sh webkit-deps # dev headers + .pc for building WebKit itself (network)
# ./stage-sysroot-atlas.sh all # headers + device + linklib
# ./stage-sysroot-atlas.sh everything # ... plus webkit-deps
#
# Overridable:
# STAGING sysroot to build (default $HOME/atlas-staging)
@@ -212,11 +214,95 @@ libresolv.so*|librt.so*|libstdc++.so*) continue;;
echo " linklib: $(ls "$STAGING/linklib" | wc -l) entries (lib/: $(ls "$STAGING/lib" | wc -l))"
}
# ---------------------------------------------------------------------------------------------------
# webkit-deps — headers + .pc files for building WPE WebKit itself
# ---------------------------------------------------------------------------------------------------
# Building WebKit needs dev headers and pkg-config files for ~40 libraries. We do NOT build those
# libraries: the engine links the ones the device already ships, so the headers only have to match
# their sonames. Versions are pinned in webkitdeps.list (see the notes in that file — ICU in
# particular MUST be 70.x or nothing links).
#
# An unprivileged apt root lets us pull armhf packages from three suites at once without touching
# the host system, and without hand-constructing pool URLs for 65 packages.
do_webkit_deps(){
local WD="$STAGING/webkitdeps"
local APTROOT="${APTROOT:-$STAGING/.apt}"
local LIST="$SCRIPT_DIR/webkitdeps.list"
[ -f "$LIST" ] || die "missing $LIST"
command -v apt-get >/dev/null || die "apt-get required (Debian/Ubuntu host)"
echo "== webkit-deps: unprivileged apt root =="
rm -rf "$APTROOT"
mkdir -p "$APTROOT"/{etc/apt/apt.conf.d,etc/apt/preferences.d,var/lib/apt/lists/partial,var/lib/dpkg,var/cache/apt/archives/partial}
: > "$APTROOT/var/lib/dpkg/status"
cat > "$APTROOT/etc/apt/sources.list" <<'EOF'
deb [arch=armhf trusted=yes] http://deb.debian.org/debian bookworm main
deb [arch=armhf trusted=yes] http://deb.debian.org/debian trixie main
deb [arch=armhf trusted=yes] http://ports.ubuntu.com/ubuntu-ports jammy main universe
EOF
cat > "$APTROOT/etc/apt/apt.conf" <<EOF
Dir "$APTROOT";
Dir::State "$APTROOT/var/lib/apt";
Dir::State::status "$APTROOT/var/lib/dpkg/status";
Dir::Cache "$APTROOT/var/cache/apt";
Dir::Etc "$APTROOT/etc/apt";
APT::Architecture "armhf";
APT::Architectures { "armhf"; };
Acquire::Languages "none";
EOF
export APT_CONFIG="$APTROOT/etc/apt/apt.conf"
( cd "$APTROOT" && apt-get update >/dev/null 2>&1 ) || die "apt-get update failed"
echo "== webkit-deps: fetching pinned packages =="
mkdir -p "$APTROOT/debs"
local n=0
while IFS='|' read -r pkgver sha; do
case "$pkgver" in ''|'#'*) continue;; esac
local pkg="${pkgver%%=*}"
# apt-get download aborts the WHOLE batch on one bad name, so fetch one at a time and report.
if ! ( cd "$APTROOT/debs" && apt-get download "$pkgver" >/dev/null 2>&1 ); then
die "could not fetch $pkgver (archive may have superseded it; update webkitdeps.list)"
fi
local f; f=$(ls "$APTROOT/debs/${pkg}"_*.deb 2>/dev/null | head -1)
[ -n "$f" ] || die "download reported success but no .deb for $pkg"
if [ -n "$sha" ] && [ "$(sha256sum "$f" | cut -d' ' -f1)" != "$sha" ]; then
die "sha256 MISMATCH for $pkg (expected $sha)"
fi
n=$((n+1))
done < "$LIST"
echo " fetched + verified $n packages"
echo "== webkit-deps: extracting (never installing) =="
rm -rf "$WD"; mkdir -p "$WD"
for d in "$APTROOT"/debs/*.deb; do dpkg-deb -x "$d" "$WD"; done
# The -dev packages ship libX.so symlinks pointing at runtime libs that live in the (uninstalled)
# runtime packages, so every one of them dangles. Repoint each at the real library the DEVICE ships,
# so -l resolves against the engine's actual ABI rather than a Debian build of the same library.
echo "== webkit-deps: repointing dev symlinks at the device libraries =="
local L="$WD/usr/lib/arm-linux-gnueabihf" fixed=0 miss=""
for f in "$L"/*.so; do
[ -L "$f" ] || continue
readlink -e "$f" >/dev/null && continue
local tgt base alt; tgt=$(readlink "$f"); base=$(basename "$f" .so)
if [ -e "$STAGING/lib/$tgt" ]; then ln -sfn "$STAGING/lib/$tgt" "$f"; fixed=$((fixed+1))
else
alt=$(ls "$STAGING/lib/$base".so.* 2>/dev/null | head -1)
if [ -n "$alt" ]; then ln -sfn "$alt" "$f"; fixed=$((fixed+1)); else miss="$miss $base"; fi
fi
done
echo " repointed $fixed; no device lib for:$miss"
echo " (gstgl/opencv/va/wayland and GL/GLESv1_CM are expected here — the engine ships none of them)"
echo "== webkit-deps: done -> $WD =="
}
case "${1:-all}" in
headers) do_headers;;
device) do_device;;
linklib) do_linklib;;
all) do_headers; do_device; do_linklib;;
*) die "usage: $(basename "$0") [headers|device|linklib|all]";;
linklib) do_linklib;;
webkit-deps) do_webkit_deps;;
all) do_headers; do_device; do_linklib;;
everything) do_headers; do_device; do_linklib; do_webkit_deps;;
*) die "usage: $(basename "$0") [headers|device|linklib|webkit-deps|all|everything]";;
esac
echo "== staging sysroot ready: $STAGING =="
+79
View File
@@ -0,0 +1,79 @@
# WPE WebKit cross-build dependencies — armhf dev packages, pinned by version + sha256.
# Generated from a working build; consumed by stage-sysroot-atlas.sh (phase: webkit-deps).
#
# Format: <package>=<version>|<sha256>
#
# Suites are declared in stage-sysroot-atlas.sh's sources.list. Versions are chosen to MATCH THE
# SONAMES THE DEVICE SHIPS, not to be current:
# libicu-dev 70.1 - ICU mangles every symbol with its major (u_strToUpper_70). Headers from
# any other ICU will not link against the device's libicuuc.so.70.
# libgstreamer* 1.20.1 - device ships GStreamer 1.20.7
# libjpeg62-turbo-dev - device ships libjpeg.so.62 (Debian naming; Ubuntu's is libjpeg.so.8)
# libcairo2-dev 1.18.4 - device ships cairo 1.18.0
# Most of the rest are transitive pkg-config dependencies: without their .pc files, pkg-config fails
# and WebKit's Find modules silently fall back to header-scraping and report bogus versions.
flite1-dev=2.2-5|6076109eb9635c5c4bb71677c493a48ee3dc5445131e60b790f5fab40cecaff1
libavif-dev=0.11.1-1+deb12u1|bceeeff7712c8db2d321ae04e8bcb3e37660a7b70d404cdf9aede471cd1de9d4
libblkid-dev=2.38.1-5+deb12u3|9de5af89041cf2d5f4b95c4e231d1a36f894223a88f85841142fa4453905dd38
libbrotli-dev=1.0.9-2+b6|5fe6b99d30abea044e5fafd67cf8d7adb13b0e5e48a78c5c52de68a5f9c819a9
libbz2-dev=1.0.8-5+b1|c72759e3b4e9b7da8794bd247aefa597478e17e8df3f3f597ba7d9730296e4f3
libcairo2-dev=1.18.4-1+b1|0d7405d5fce271f5bef1cd9e639f3943f2c71b3231eebc3c903294c4072e9c31
libdw-dev=0.188-2.1|d17e9bdde5a445b6eacf440070a4df6f9bbee9d0b6acdad23cb87ebd7a621639
libegl-dev=1.6.0-1|51a5deb65ec66157ed217a545bf3f2e28f620455e19f4a43761ee0292403243c
libelf-dev=0.188-2.1|b5677ce5da56d47ceca4f63a17058b7e6ab862a5a095fa79a4d4e04749e1e831
libepoxy-dev=1.5.10-1|713bda2bd0edeff62af151b28cdc389ba5aee62034267edd5d3f3978af82d506
libexpat1-dev=2.5.0-1+deb12u2|c3d4fe8692b82f447be3ca310e4d9b75bd9be09067bf6bcd09407174884bdff8
libffi-dev=3.4.4-1|063ae8a7cf5e7e9244f0913fcb322f5a3aff272ee974da6a4ce8bff932af801c
libfontconfig-dev=2.14.1-4|a3f262e8a9fde23a6f2781d0d4405a5762929127b9fe63284cf57d06f542a316
libfreetype-dev=2.12.1+dfsg-5+deb12u4|039711b58986b2a27e43571319eda4104fa411e00549f1e4ada7c903f13d7e44
libgcrypt20-dev=1.10.1-3+deb12u1|b2e687b392871832cb37ae0815a41859ae139e2b3e6544e671333cab1345eeb0
libgl-dev=1.6.0-1|6efd4d6ebc2dd24efc840d97bfef3cc7d172797d3b06c70dbcc0e315773315a0
libgles-dev=1.6.0-1|07730e7e37dba80952f45242058762c177df366bbdcde9743fc87be51fc8467b
libglib2.0-dev=2.74.6-2+deb12u9|c40d2bbff2f758a39ef2432468146b7e29af36e3cde349577e6e229a085fd752
libglib2.0-dev-bin=2.74.6-2+deb12u9|46501aba0dc01a66f6fac2d7eed89c003ec7da179a8fdb64c5da0a980d7387f7
libgpg-error-dev=1.46-1|112185bf23990175d4f7e6fc1017c52313523396b9e213ad949c1cf6cf6274a8
libgraphite2-dev=1.3.14-1+deb12u1|ad9197464699f116cfa4658749e231ec2bdcea9ebfa1561ada96baffffe0a8ed
libgstreamer1.0-dev=1.20.1-1|83cd39175ff45ca7dd6e26dad4af724f7004dd5f3557959bd09d4941616e7e4c
libgstreamer-plugins-bad1.0-dev=1.20.1-1ubuntu2|4edae2efc04b0bfabfde640bbdeb5383a4ae62c9958c57dd9357ce1cb1ae9f29
libgstreamer-plugins-base1.0-dev=1.20.1-1|8cac5b9139399e1bb14f843bc77b21f9ac1acfc77d005e923d5dd4750dcd46ad
libgstreamer-plugins-good1.0-dev=1.20.1-1ubuntu1|92ae99ba1105b65d31cec4670c5959a37d65ea8091169497a5bfc462f5f33e44
libharfbuzz-dev=6.0.0+dfsg-3|72ff3cda7f355f1a2754463d6a3a04dd9153dee27a9a5a2977a9e98aea452b4d
libhwy-dev=1.0.3-3+deb12u1|e43aa38f74df5b0e54ce8757661ebcd280d9ab4a115c7502391f7429d10f635a
libicu-dev=70.1-2|fa8476eb1352f5f6bafe46aadb3489319abf2b0c012e117ee46da12f8f41ddb1
libjpeg62-turbo-dev=1:2.1.5-2|49fd2fe01e77f9e97f572fd2f4184f89d3f052e3bb712d011083a3baad72f74d
libjxl-dev=0.7.0-10+deb12u1|a2880bb581790d37ab050407b7e202db3b94ab2050546cf9200937744df58720
liblcms2-dev=2.14-2+deb12u1|1a353480ba2d2404b20cdfc870ab7b2b23d19badff9e53cf6c47d73f583b2a3c
liblzma-dev=5.4.1-1+deb12u1|33680b21c5a648c47e27f310d4c8df0c15ad658704e58df44d21438fb6fbbb46
libmount-dev=2.38.1-5+deb12u3|a2196a758e16ee0f810a224ab79ebb57994fe91388ca045f2fb6caa176c1dbed
libnghttp2-dev=1.52.0-1+deb12u3|7f7220bf46b52ff1cc2849832aa34dd20af4b0f6e125b4f314da8afaeb1776af
liborc-0.4-dev=1:0.4.33-2|64e591b5801144e87a8122822a05cd4c2c172d266ccabecdd8c52e12b9dbb835
libpcre2-dev=10.42-1|878fdc77ee6ee3d11ada53c98bf576294c207e25bbb19c167b23917081277790
libpixman-1-dev=0.42.2-1|98b1372bb846f4e39083f9cc55fd57e30992eaaa6b5c78f4b094323da8243caa
libpng-dev=1.6.39-2+deb12u5|b5d8b45681688c8763c6e03fee8f142eb336bb4f68d680a9c25a8a8197658a64
libpsl-dev=0.21.2-1|d073840bd50303a079c1ee7fce6d12ae07c0d751a49bbe2bd342943486d411f2
libselinux1-dev=3.4-1+b6|882d6d82c31e57c69d91c7cb6e663f3c4e5eeb60ec11daefd14a046a95f39376
libsepol-dev=3.4-2.1|35ee5aa71f5923cfa0edf54a93b256cf47e78212761e45db08c61f3c0f546633
libsoup-3.0-dev=3.2.3-0+deb12u2|58178b710a210647abaff58b89211fed45bb418327f2cd96259633e3c3831f73
libsqlite3-dev=3.40.1-2+deb12u2|57d42d7216a57608c1a4e859d4560132d466e523e3c5534a69ff752c3310a3ee
libssl-dev=3.0.20-1~deb12u2|2454498e072aa19108c906e9a5e45c3dfc2c80266fe02cf7fd278b27d6faf0b5
libsysprof-capture-4-dev=48.0-2|a0ce36edace112e8e7c8ab8377bbf0db7d63beba5825b427c3d5551470bc7f32
libtasn1-6-dev=4.19.0-2+deb12u1|728e2bef058450ed25739b32c141353ee5f7e39e631f356b374d5608b96a02e3
libunwind-dev=1.6.2-3|cd25f4f1b26cf4b5e6057da852512db0de9dcde8c256df16ae1454c63fbbd399
libwayland-dev=1.21.0-1|74d7201dc1ca89e9b869559fb372d4f01689102d7c7df0116715c4b308bff996
libwebp-dev=1.2.4-0.2+deb12u1|7ab89864239d3b0b92deedd91eeef603732f251cd30d41ef50dd1030fd3bff43
libwoff-dev=1.0.2-2|fe658038877f6fec5af73cde9c15d53572a2478518bbd278dfa85692fa7379a8
libwpe-1.0-dev=1.14.0-1|b5c97f41ac992f2d4a1a5391b7f8fea7d95ff7c58b49dda4cc9be5dff00450df
libx11-dev=2:1.8.4-2+deb12u2|ab924f25aa1cc4fea0ad94c6c36f627d50b592507fd85b6fd3dae705244e64db
libxau-dev=1:1.0.9-1|03b0fa700b9e62e298af77eacabd097dc16d1bd19ae34d82140ac4f20c10d5c5
libxcb1-dev=1.15-1|602e69f7e452effc7b46ae53fc915ad325c8a769c5ec8d79dc043882fa77b0b6
libxcb-render0-dev=1.15-1|d8ccc5b8f231a9c35a3e2e9218f8f91cf2b67aa24601bc92bb6c5261a40654a7
libxcb-shm0-dev=1.15-1|35c592426630c4b366cbb6f94185426df31fba6b13f48c9f3bebf4cde43e271f
libxdmcp-dev=1:1.1.2-3|8b4f46daf5dcf91180444812be90174ae10001dbe0a8fbdceaba73a12469aa62
libxext-dev=2:1.3.4-1+b1|bd65822a11587918d25139fffbc30fc3b14d45138bdff95a96a68b48dfd3cfc6
libxkbcommon-dev=1.5.0-1|22f86a1c6c1b535d1c071885c41547cb4ec4beeddea8e9fc209a91ca80bc807b
libxml2-dev=2.9.14+dfsg-1.3~deb12u6|898c9cc0a634c35d2cb7553a41a0c6ff8f94d5d01e06d18745d6c4ce52c349c0
libxrender-dev=1:0.9.10-1.1|de8197a246f582af096a4ffa24260b252597a7e844a774ff667c38b5178a5848
libxslt1-dev=1.1.35-1+deb12u4|2cb0562bfccac98c250ad81a4b5271393a43d74439351875fb4c057254cdfbbc
libzstd-dev=1.5.4+dfsg2-5|cc53a5dcc3b1b060a3df5766322ab0fdacae376f8f5bee30601f0276b8e87d60
x11proto-dev=2022.1-1|3cab66a6591774188a568f9b54c4e7956f18da76e0e0fc4a779db5f6bcc3f148
zlib1g-dev=1:1.2.13.dfsg-1|4fbb63530bb52324d74f42f6d69b6b1c6e3c09bd2cb84cecc121f688191e04f5
+20
View File
@@ -0,0 +1,20 @@
--- a/Source/JavaScriptCore/runtime/MathCommon.cpp
+++ b/Source/JavaScriptCore/runtime/MathCommon.cpp
@@ -604,7 +604,16 @@
return std::nearbyint(operand);
}
-#if (OS(LINUX) && !defined(__GLIBC__)) || OS(HAIKU)
+// roundeven()/roundevenf() are C23 and only appeared in glibc 2.25. Upstream's guard assumes any glibc
+// has them and only compiles these fallbacks for non-glibc Linux (musl) and Haiku. The Atlas engine
+// targets the TouchPad's bundled glibc 2.23, so we need them there too.
+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+#if !__GLIBC_PREREQ(2, 25)
+#define ATLAS_NEEDS_ROUNDEVEN_FALLBACK 1
+#endif
+#endif
+
+#if (OS(LINUX) && !defined(__GLIBC__)) || OS(HAIKU) || defined(ATLAS_NEEDS_ROUNDEVEN_FALLBACK)
static inline float roundevenf(float operand)
{
float rounded = roundf(operand);
+96
View File
@@ -0,0 +1,96 @@
--- a/Source/WebCore/rendering/RenderView.cpp
+++ b/Source/WebCore/rendering/RenderView.cpp
@@ -79,6 +79,40 @@
namespace WebCore {
+// Atlas/TouchPad: the engine deliberately renders into a pan buffer several screens tall and the
+// browser adapter pans within it, because this Adreno cannot read back per scroll frame (see
+// BrowserPageWPE::ensureWebView). So the WPE view height is a PAINT extent, not the user-visible
+// viewport. Left alone the initial containing block becomes the whole buffer, and quirks-mode
+// `height: 100%` layouts resolve against ~4 screens - the page loads with its "centred" content
+// roughly a screen and a half below the fold.
+//
+// ATLAS_ICB_HEIGHT (exported by BrowserPageWPE before the WebProcess starts) is the real screen
+// height. Capping the ICB to it makes percentage heights resolve against one screen, while the view
+// size, the visible content rect, scrolling and the painted region are all left exactly as they were
+// - so the tall buffer and its smooth scrolling still work.
+static int atlasICBHeightCap()
+{
+ static const int cap = [] {
+ const char* env = getenv("ATLAS_ICB_HEIGHT");
+ int value = env ? atoi(env) : 0;
+ // Ignore nonsense; 4096 is the Adreno GL_MAX_TEXTURE_SIZE the buffer is capped to anyway.
+ return (value >= 200 && value <= 4096) ? value : 0;
+ }();
+ return cap;
+}
+
+// Viewport units (vh/svh/lvh/dvh) do NOT go through viewHeight(); they resolve via
+// LocalFrameView::sizeForCSS*ViewportUnits(). Capping only the ICB would fix `height: 100%` while
+// leaving `height: 100vh` resolving against the whole pan buffer - the same "content starts a screen
+// and a half down" bug, just on a different set of pages. Cap both, consistently.
+static inline FloatSize atlasCapViewportSize(FloatSize size)
+{
+ int cap = atlasICBHeightCap();
+ if (cap > 0 && size.height() > cap)
+ size.setHeight(cap);
+ return size;
+}
+
WTF_MAKE_TZONE_ALLOCATED_IMPL(RenderView);
RenderView::RenderView(Document& document, RenderStyle&& style)
@@ -163,7 +197,14 @@
if (document().isPluginDocument() && frameView->useFixedLayout())
return frameView->fixedLayoutSize().height();
#endif
- return isHorizontalWritingMode() ? frameView->layoutSize().height() : frameView->layoutSize().width();
+ if (!isHorizontalWritingMode())
+ return frameView->layoutSize().width();
+ // Same Atlas pan-buffer cap as viewHeight(); this path reads layoutSize() directly, so it needs it
+ // too or percentage heights would still resolve against the buffer.
+ int height = frameView->layoutSize().height();
+ if (int cap = atlasICBHeightCap(); cap > 0 && height > cap)
+ height = cap;
+ return height;
}
bool RenderView::isChildAllowed(const RenderObject& child, const RenderStyle&) const
@@ -791,6 +832,9 @@
Ref frameView = this->frameView();
height = frameView->layoutHeight();
height = frameView->useFixedLayout() ? ceilf(style().usedZoom() * float(height)) : height;
+ if (int cap = atlasICBHeightCap(); cap > 0 && height > cap)
+ height = cap; // Atlas pan-buffer: keep the ICB one screen tall
+
}
return height;
}
@@ -827,22 +871,22 @@
FloatSize RenderView::sizeForCSSSmallViewportUnits() const
{
- return frameView().sizeForCSSSmallViewportUnits();
+ return atlasCapViewportSize(frameView().sizeForCSSSmallViewportUnits());
}
FloatSize RenderView::sizeForCSSLargeViewportUnits() const
{
- return frameView().sizeForCSSLargeViewportUnits();
+ return atlasCapViewportSize(frameView().sizeForCSSLargeViewportUnits());
}
FloatSize RenderView::sizeForCSSDynamicViewportUnits() const
{
- return frameView().sizeForCSSDynamicViewportUnits();
+ return atlasCapViewportSize(frameView().sizeForCSSDynamicViewportUnits());
}
FloatSize RenderView::sizeForCSSDefaultViewportUnits() const
{
- return frameView().sizeForCSSDefaultViewportUnits();
+ return atlasCapViewportSize(frameView().sizeForCSSDefaultViewportUnits());
}
Node* RenderView::nodeForHitTest() const
+4 -3
View File
@@ -1,9 +1,10 @@
--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2026-07-10 13:26:13.099414225 +0200
+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2026-07-10 13:26:13.075413814 +0200
@@ -4415,7 +4415,17 @@
--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
@@ -4415,8 +4415,17 @@
// CPU videoconvert that playsink would auto-plug (which drops frames / renders black at >320p).
// m_videoSink BECOMES the bin [mdpdetile ! innerSink] (consistent identity with the pipeline
// video-sink); the inner sink's repaint/caps signals were already connected above and stay wired.
- // Env-gated for safe A/B.
- if (m_videoSink && g_getenv("ATLAS_MDPDETILE")) {
+ // Env-gated for safe A/B. ONLY for real decoder playback: mdpdetile de-tiles the OMX decoder's
+ // tiled NV12 (NV12_64Z32); a MediaStream/getUserMedia source delivers LINEAR frames, so de-tiling
@@ -0,0 +1,21 @@
--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp
+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp
@@ -4844,7 +4844,18 @@
m_selectionFlippingEnabled = store.getBoolValueForKey(WebPreferencesKey::selectionFlippingEnabledKey());
#endif
#if ENABLE(PAYMENT_REQUEST)
+#if ENABLE(APPLE_PAY)
settings.setPaymentRequestEnabled(store.getBoolValueForKey(WebPreferencesKey::applePayEnabledKey()));
+#else
+ /* Ports that build PAYMENT_REQUEST without APPLE_PAY (every non-Cocoa port, this one included)
+ * have no ApplePayEnabled preference: it is compiled out of the feature list, out of the
+ * set-by-name map, and defaults to false. Gating on it therefore hides window.PaymentRequest
+ * unconditionally, even though the whole Modules/paymentrequest implementation is built and
+ * linked in. Expose the API instead and let it behave normally - with no payment handler
+ * registered, canMakePayment() resolves false and show() rejects, which is the correct answer
+ * for a device that has no payment methods. */
+ settings.setPaymentRequestEnabled(true);
+#endif
#endif
#if PLATFORM(IOS_FAMILY)
@@ -0,0 +1,23 @@
--- a/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp
+++ b/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp
@@ -238,7 +238,9 @@
#endif
}
} else if (isUpdate == IsUpdate::No)
- details.shippingOptions = { { } };
+ // `= { { } }` is ambiguous to gcc 12 in C++23: the inner braces can initialise either the
+ // optional's contained Vector or the Vector's first element. Name the type instead.
+ details.shippingOptions = Vector<PaymentShippingOption> { };
} else if (isUpdate == IsUpdate::No)
details.shippingOptions = std::nullopt;
@@ -275,7 +277,8 @@
serializedModifierData.append(WTF::move(serializedData));
}
} else if (isUpdate == IsUpdate::No)
- details.modifiers = { { } };
+ // Same gcc 12 / C++23 ambiguity as details.shippingOptions above.
+ details.modifiers = Vector<PaymentDetailsModifier> { };
return std::make_tuple(WTF::move(selectedShippingOption), WTF::move(serializedModifierData));
}
@@ -0,0 +1,26 @@
--- a/Source/ThirdParty/libsysprof-capture/sysprof-platform.c
+++ b/Source/ThirdParty/libsysprof-capture/sysprof-platform.c
@@ -56,6 +56,7 @@
#include "config.h"
+#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/syscall.h>
@@ -64,6 +65,15 @@
#include "sysprof-capture-util-private.h"
#include "sysprof-platform.h"
+/* The mkostemp() fallback below is only compiled when the kernel headers predate memfd_create()
+ * (Linux 3.17). Everywhere modern that branch is dead, which is why it can reference O_BINARY and
+ * O_CLOEXEC without including <fcntl.h> and nobody notices. Atlas builds against 2.6.32 headers for
+ * the TouchPad's 2.6.35 kernel, so the fallback is the live path here. O_BINARY is a Windows-ism with
+ * no meaning on POSIX; upstream sysprof defines it to 0 for exactly this reason. */
+#ifndef O_BINARY
+# define O_BINARY 0
+#endif
+
#ifndef __NR_memfd_create
static const char *
get_tmpdir (void)
@@ -0,0 +1,60 @@
--- a/Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingMediaSourceGStreamer.h
+++ b/Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingMediaSourceGStreamer.h
@@ -58,6 +58,12 @@
GRefPtr<GstWebRTCRTPSender> sender() const { return m_sender; }
GRefPtr<GstElement> bin() const { return m_bin; }
+ // Stable per-sender SSRC, generated once at construction. GStreamerMediaEndpoint stamps it into the
+ // codec caps so webrtcbin emits a=ssrc in the OFFER, and allowedCaps() reuses it on the send path so
+ // the payloader does not mint a different one (see the atlas webrtc-receive-av / sendpath-ssrc
+ // patches, both of which reference this).
+ uint32_t ssrc() const { return m_ssrc; }
+
bool configurePacketizers(GRefPtr<GstCaps>&&);
GUniquePtr<GstStructure> parameters();
@@ -120,6 +126,7 @@
GRefPtr<GstWebRTCRTPSender> m_sender;
GRefPtr<GstPad> m_webrtcSinkPad;
RefPtr<UniqueSSRCGenerator> m_ssrcGenerator;
+ uint32_t m_ssrc { 0 };
GUniquePtr<GstStructure> m_parameters;
RTPHeaderExtensionMapping m_rtpHeaderExtensionMapping;
Vector<RefPtr<GStreamerRTPPacketizer>> m_packetizers;
--- a/Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingMediaSourceGStreamer.cpp
+++ b/Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingMediaSourceGStreamer.cpp
@@ -81,6 +81,12 @@
GST_DEBUG_CATEGORY_INIT(webkit_webrtc_outgoing_media_debug, "webkitwebrtcoutgoingmedia", 0, "WebKit WebRTC outgoing media");
});
+ // Generate this sender's stable SSRC once, up front. It has to exist before the first OFFER is
+ // built (GStreamerMediaEndpoint reads it via ssrc() to stamp a=ssrc onto the codec caps), which is
+ // well before any packetizer is created, so it cannot be taken from the packetizer.
+ if (m_ssrcGenerator)
+ m_ssrc = m_ssrcGenerator->generateSSRC();
+
m_bin = gst_bin_new(nullptr);
m_inputSelector = gst_element_factory_make("input-selector", nullptr);
g_object_set(m_inputSelector.get(), "sync-streams", FALSE, nullptr);
@@ -481,6 +487,21 @@
if (gst_caps_is_empty(codecPreferences.get()) || gst_caps_is_any(codecPreferences.get())) [[unlikely]]
return false;
+ // Stamp this sender's stable SSRC (the one already signalled as a=ssrc in the LOCAL SDP via
+ // allowedCaps()) onto every codec structure, so the packetizer's payloader emits RTP carrying the
+ // SAME ssrc webrtcbin negotiated. The transceiver's post-negotiation codec-preferences do NOT carry
+ // it back (a=ssrc lives on the SDP media, not the codec structure), so without this the payloader
+ // mints its own ssrc: webrtcbin's send pad then sees an unexpected ssrc, never forwards the RTP,
+ // and the resulting backpressure stalls the encoder -> packetsSent stays 0. See GStreamer{Audio,
+ // Video}RTPPacketizer::create(), which reuses a pre-set "ssrc" field instead of generating one.
+ if (m_ssrc) {
+ codecPreferences = adoptGRef(gst_caps_make_writable(codecPreferences.leakRef()));
+ unsigned totalStructures = gst_caps_get_size(codecPreferences.get());
+ for (unsigned i = 0; i < totalStructures; i++)
+ gst_structure_set(gst_caps_get_structure(codecPreferences.get(), i), "ssrc", G_TYPE_UINT, m_ssrc, nullptr);
+ GST_DEBUG_OBJECT(m_bin.get(), "Stamped sender SSRC %u onto codec preferences: %" GST_PTR_FORMAT, m_ssrc, codecPreferences.get());
+ }
+
auto inputSelectorSrcPad = adoptGRef(gst_element_get_static_pad(m_inputSelector.get(), "src"));
if (!gst_pad_is_linked(inputSelectorSrcPad.get()) && !gst_element_link(m_inputSelector.get(), m_tee.get()))
return false;