dshm-compat 0.1.8 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.10
4
+
5
+ - The generic S2 adapter now prefers an AArch64 worker when a package contains
6
+ both `runtime/linux-arm64` and `runtime/linux-x64`, instead of taking the
7
+ first file. Native AArch64 avoids the QEMU user-mode `openat2`/9p no-follow
8
+ behavior that makes `ops_stat` return `ELOOP`.
9
+ - x86_64 QEMU conversions now carry a warning that no-follow stat on 9p
10
+ mountpoints can fail with `ELOOP`; provide an AArch64 worker for that class.
11
+ - Offline regression suite: 31/31.
12
+
13
+ ## 0.1.9
14
+
15
+ - Fixed the 0.1.8 launch regression. Running `ld-linux` as the QEMU main binary
16
+ produced `Exec format error`; the wrapper now copies the x86_64 loader and
17
+ glibc libraries into the guest's real `/lib64` and `/lib/x86_64-linux-gnu`,
18
+ then runs `qemu-x86_64 <worker>` **without** `-L`. Absolute guest paths are no
19
+ longer prefixed, while the worker still gets its host-root symlink bridge.
20
+ If `/lib` is not writable, it falls back to `qemu -L` with rootfs symlinks.
21
+ - Offline regression suite: 30/30.
22
+
3
23
  ## 0.1.8
4
24
 
5
25
  - Fixed the x86_64 worker launch: QEMU's `-L <rootfs>` prefixes absolute guest
package/INSTALL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Installing dshm-compat
2
2
 
3
- The artifact is a normal DSH bundle package: `dshm-compat-0.1.8.tgz`.
3
+ The artifact is a normal DSH bundle package: `dshm-compat-0.1.10.tgz`.
4
4
  It is host-only, has no runtime dependencies, and adds twelve agent tools.
5
5
 
6
6
  ## A. DSHM (the tablet)
@@ -15,7 +15,7 @@ input calls `pnpm view` before installing and fails with
15
15
  `Command failed with EACCES: pnpm view ... spawn pnpm EACCES`. Use one of these
16
16
  instead:
17
17
 
18
- - ask the DSHM Agent to run `pnpm add dshm-compat@0.1.8` in its bash tool (the
18
+ - ask the DSHM Agent to run `pnpm add dshm-compat@0.1.10` in its bash tool (the
19
19
  bundled pnpm shim routes that command to the host install queue); or
20
20
  - install from a GitHub repository URL; or
21
21
  - after any working install, use the plugin's own `compat_install` tool for
@@ -28,7 +28,7 @@ not accept local paths, `file:` or `http://` specs.
28
28
 
29
29
  ### A2. HTTPS tarball
30
30
 
31
- Put `dshm-compat-0.1.8.tgz` on any HTTPS host (GitHub Release, Gitee Release,
31
+ Put `dshm-compat-0.1.10.tgz` on any HTTPS host (GitHub Release, Gitee Release,
32
32
  object storage) and paste the `.tgz` URL into the same Add plugin input. DSHM's
33
33
  installer accepts tarball specs; if the current market UI refuses a plain URL,
34
34
  use A1.
@@ -38,7 +38,7 @@ use A1.
38
38
  If `hdc` is available and the app can read the path:
39
39
 
40
40
  ```sh
41
- hdc file send dshm-compat-0.1.8.tgz /data/storage/el2/base/haps/entry/files/dshm-compat-0.1.8.tgz
41
+ hdc file send dshm-compat-0.1.10.tgz /data/storage/el2/base/haps/entry/files/dshm-compat-0.1.10.tgz
42
42
  ```
43
43
 
44
44
  Then enter the absolute path (or `file:/...`) in the Add plugin input. This
@@ -47,7 +47,7 @@ depends on the DSHM build's local-file support; A1 is safer.
47
47
  ## B. Desktop DSH (for testing only)
48
48
 
49
49
  ```powershell
50
- & 'D:\安装\dsh-desktop\resources\runtime\cli\bin\dsh.cmd' plugin --profile desktop add 'D:\dsh\dsh-26-09-30\dshm-compat\dshm-compat-0.1.8.tgz'
50
+ & 'D:\安装\dsh-desktop\resources\runtime\cli\bin\dsh.cmd' plugin --profile desktop add 'D:\dsh\dsh-26-09-30\dshm-compat\dshm-compat-0.1.10.tgz'
51
51
  ```
52
52
 
53
53
  If the profile reports `ERR_PNPM_UNEXPECTED_VIRTUAL_STORE`, its `node_modules`
package/README.md CHANGED
@@ -5,10 +5,13 @@ them through the least invasive strategy that can work.
5
5
 
6
6
  ## Current phase
7
7
 
8
- 0.1.8 fixes the x86_64 worker launch: QEMU's `-L` prefixed guest absolute
9
- paths with the glibc rootfs, so every host path looked missing. The wrapper now
10
- runs `ld-linux --library-path` directly. It also keeps the host app-files prefix
11
- bridge to `/mnt/share` for native worker roots. 0.1.5 added non-`-c`
8
+ 0.1.10 prefers a native AArch64 worker when both architectures are present, so
9
+ QEMU's 9p/no-follow `ELOOP` limitation does not apply. 0.1.9 installs the x86_64
10
+ loader and glibc libraries into the guest's real `/lib64` and
11
+ `/lib/x86_64-linux-gnu`, then runs `qemu-x86_64` without `-L`. This avoids
12
+ QEMU's absolute-path prefixing (0.1.7 `NOT_FOUND`) and the 0.1.8 `ld-linux`
13
+ `Exec format error`. The host app-files prefix bridge to `/mnt/share` is kept
14
+ for worker roots. 0.1.5 added non-`-c`
12
15
  spawn wrappers, release fallbacks, and `compat_uninstall`; 0.1.4 added the
13
16
  generic S2 adapter with x86_64 QEMU and GitHub Release acquisition. Phase 1
14
17
  ships the analyzer, the S0/S1 converter, the generic S2 engine, guest
package/lib/s2-native.js CHANGED
@@ -89,13 +89,15 @@ export async function convertS2Native(spec, options = {}) {
89
89
  }
90
90
  }
91
91
  if (workerBinary === undefined) {
92
- const candidate = files.find(file => file.type === 'file'
93
- && /^runtime\/linux-(?:arm64|x64)\//.test(file.path)
94
- && !file.path.endsWith('/provenance.json')
95
- && elfArch(file.data) !== undefined)
96
- if (candidate !== undefined) {
97
- workerBinary = candidate.data
98
- workerName = basename(candidate.path)
92
+ const candidates = files
93
+ .filter(file => file.type === 'file'
94
+ && /^runtime\/linux-(?:arm64|x64)\//.test(file.path)
95
+ && !file.path.endsWith('/provenance.json')
96
+ && elfArch(file.data) !== undefined)
97
+ .sort((a, b) => (elfArch(a.data) === 'arm64' ? 0 : 1) - (elfArch(b.data) === 'arm64' ? 0 : 1))
98
+ if (candidates.length > 0) {
99
+ workerBinary = candidates[0].data
100
+ workerName = basename(candidates[0].path)
99
101
  }
100
102
  }
101
103
  let acquiredAsset
@@ -244,7 +246,15 @@ export async function convertS2Native(spec, options = {}) {
244
246
  'set -e',
245
247
  ...hostFilesLink,
246
248
  'DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)',
247
- `exec "$DIR/qemu-x86_64" "$DIR/rootfs/lib64/ld-linux-x86-64.so.2" --library-path "$DIR/rootfs/lib/x86_64-linux-gnu" "$DIR/${realName}" "$@"`,
249
+ 'ROOTFS="$DIR/rootfs"',
250
+ 'if mkdir -p /lib64 /lib/x86_64-linux-gnu 2>/dev/null \\',
251
+ ' && cp -f "$ROOTFS/lib64/ld-linux-x86-64.so.2" /lib64/ld-linux-x86-64.so.2 2>/dev/null \\',
252
+ ' && cp -f "$ROOTFS/lib/x86_64-linux-gnu/libc.so.6" /lib/x86_64-linux-gnu/libc.so.6 2>/dev/null \\',
253
+ ' && cp -f "$ROOTFS/lib/x86_64-linux-gnu/libgcc_s.so.1" /lib/x86_64-linux-gnu/libgcc_s.so.1 2>/dev/null; then',
254
+ ` exec "$DIR/qemu-x86_64" "$DIR/${realName}" "$@"`,
255
+ 'fi',
256
+ 'for d in storage mnt data; do [ -e "$ROOTFS/$d" ] || ln -s "/$d" "$ROOTFS/$d" 2>/dev/null || true; done',
257
+ `exec "$DIR/qemu-x86_64" -L "$ROOTFS" "$DIR/${realName}" "$@"`,
248
258
  '',
249
259
  ].join('\n'))
250
260
  workerSource = 'x86_64 worker executed through the bundled qemu-x86_64 and glibc rootfs'
@@ -291,7 +301,7 @@ export async function convertS2Native(spec, options = {}) {
291
301
  ? `staged ${workerName} as a shell wrapper over qemu-x86_64 + glibc rootfs`
292
302
  : `staged ${workerName} as a shell wrapper over ${workerName}-bin`,
293
303
  'mapped /data/storage/el2/base/haps/entry/files to the guest /mnt/share mount',
294
- ...(workerArch === 'x64' ? ['ran the x86_64 loader directly instead of qemu -L, so guest absolute paths are not prefixed with the glibc rootfs'] : []),
304
+ ...(workerArch === 'x64' ? ['prefers guest-native x86_64 loader/libs; falls back to qemu -L only when /lib is not writable'] : []),
295
305
  ]
296
306
 
297
307
  const output = files.filter(file => file.path !== workerPath).map(file => {
@@ -318,7 +328,10 @@ export async function convertS2Native(spec, options = {}) {
318
328
  bytes: packed.length,
319
329
  sha256: createHash('sha256').update(packed).digest('hex'),
320
330
  changed,
321
- warnings: validation.warnings,
331
+ warnings: [
332
+ ...(workerArch === 'x64' ? ['the worker runs under QEMU; no-follow stat on 9p mountpoints can return ELOOP. Prefer an AArch64 worker when one is available.'] : []),
333
+ ...(validation.warnings ?? []),
334
+ ],
322
335
  validation,
323
336
  worker: { target: workerArch === 'arm64' ? TARGET : 'x86_64-linux-gnu', arch: workerArch, sha256 },
324
337
  ...(acquisition?.ok === true ? { acquisition: { asset: acquisition.asset, sha256: acquisition.sha256 } } : {}),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dshm-compat",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "Analyze and convert DSH plugins that cannot be installed or run on HarmonyOS DSHM.",
5
5
  "type": "module",
6
6
  "main": "index.js",