forked from upstream/atlas-wpe-env
Compare commits
28
Commits
pre3-lowmem
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df79df8404 | ||
|
|
6fa6fc40ec | ||
|
|
b846b82cab | ||
|
|
b290f43dc0 | ||
|
|
947c6649bc | ||
|
|
bd03a428b5 | ||
|
|
9fce179af4 | ||
|
|
b874cf0798 | ||
|
|
88e4e14da9 | ||
|
|
fc8c7df4d3 | ||
|
|
b2277c7173 | ||
|
|
afc8b83514 | ||
|
|
c5d8aa9088 | ||
|
|
2ef420908c | ||
|
|
d794de193c | ||
|
|
79af640eff | ||
|
|
41fe97076a | ||
|
|
6c66ea71a6 | ||
|
|
074e7d5432 | ||
|
|
29a7250b47 | ||
|
|
4260bed726 | ||
|
|
83f34c2768 | ||
|
|
8b1c661928 | ||
|
|
3196db2434 | ||
|
|
3bce385bfd | ||
|
|
144a278c2a | ||
|
|
ab34b01de6 | ||
|
|
7f439fe503 |
No files matched your search
@@ -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
@@ -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.
|
||||
@@ -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).
|
||||
|
||||
Executable
+81
@@ -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 =="
|
||||
@@ -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
@@ -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)."
|
||||
Executable
+22
@@ -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" "$@"
|
||||
Executable
+13
@@ -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" "$@"
|
||||
Executable
+177
@@ -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
|
||||
@@ -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}")
|
||||
@@ -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
|
||||
@@ -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,9 +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
|
||||
# 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
@@ -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
@@ -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
@@ -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);
|
||||
|
||||
Executable
+54
@@ -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
@@ -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 =="
|
||||
@@ -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
|
||||
@@ -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);
|
||||
@@ -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
|
||||
@@ -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;
|
||||
Reference in new issue
Block a user