@ohos-ports/mountutils 2.0.8-beta.0 → 2.0.8-beta.1

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/OHOS-PORTS.md CHANGED
@@ -1,15 +1,24 @@
1
- # @ohos-ports/mountutils (openharmony port)
1
+ # @ohos-ports/mountutils
2
2
 
3
- Upstream: mountutils@2.0.8
3
+ OpenHarmony port of [mountutils](https://github.com/balena-io-modules/mountutils) 2.0.8.
4
4
 
5
- Changes vs upstream:
6
- - build/Release/MountUtils.node: natively compiled from the upstream C++ sources with
7
- node-gyp + clang on openharmony arm64 (host build, node 26.5.1 / nan in-tree),
8
- then self-signed with binary-sign-tool (-selfSign). No Linux prebuilt is reused.
9
- Dependencies: libc.so + libc++_shared.so only (see llvm-readelf -d).
10
- - package.json: prebuildify/bindings dev-only dependencies dropped; scripts emptied.
11
- nan + node-gyp-build kept so `node-gyp rebuild` still works from source.
5
+ ## What changed vs upstream
12
6
 
13
- Verified on openharmony arm64 (node 26.5.1):
14
- - `require('@ohos-ports/mountutils')` loads via node-gyp-build (build/Release fallback)
15
- - `typeof unmountDisk === 'function'` and unmountDisk('/dev/null', cb) invokes callback
7
+ - `nan` runtime dependency replaced with `@ohos-ports/nan@^2.22.0-gk.1-beta.1` (upstream `nan` cannot build on OpenHarmony); `binding.gyp` include_dirs updated to `require('@ohos-ports/nan')` accordingly.
8
+ - Native addon compiled from source on OpenHarmony arm64 (`src/linux/functions.cpp` — the linux sources are the correct ones for OpenHarmony; gyp routes `openharmony` to the `OS=="linux"` condition via `sys.platform`).
9
+ - Ships `prebuilds/openharmony-arm64/MountUtils.node` (built with Node.js 26.x headers; the addon uses nan/V8 API and is ABI-specific — other Node ABI versions fall back to source compilation via `node-gyp-build`/`node-gyp`, which requires the OpenHarmony native toolchain).
10
+ - Upstream `prebuilds/linux-x64/` prebuild dropped (wrong platform for OpenHarmony).
11
+
12
+ ## ⚠️ Known system-side limitation (not a porting defect)
13
+
14
+ `mount(2)` and `umount2(2)` are **SIGSYS-killed by the app-sandbox seccomp filter** in third-party app contexts on HarmonyOS (verified: standalone C probe exit 159 "Bad system call"). Consequence:
15
+
16
+ - The addon **installs, loads and exports** `eject`/`unmountDisk` correctly; 21/21 executable tests pass, `/proc/mounts` is readable, error paths propagate.
17
+ - **Calling `unmountDisk`/`eject` on a real device inside a third-party app kills the Node.js process** (SIGSYS, no errno return). No public HarmonyOS API maps to unmount/eject (`@ohos.file.volumeManager` is a system API). Usage from system/root contexts is expected to work but is unverified.
18
+ - Full evidence and attribution: see the `issue-system-side-mountutils@2.0.8.pptx` / migration report in the ohos-ports archives.
19
+
20
+ ## Install
21
+
22
+ ```bash
23
+ npm install @ohos-ports/mountutils
24
+ ```
package/binding.gyp CHANGED
@@ -3,7 +3,7 @@
3
3
  {
4
4
  "target_name": "MountUtils",
5
5
  "include_dirs" : [
6
- "<!(node -e \"require('nan')\")"
6
+ "<!(node -e \"require('@ohos-ports/nan')\")"
7
7
  ],
8
8
  "sources": [
9
9
  "src/mountutils.cpp",
package/example/eject.js CHANGED
File without changes
File without changes
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@ohos-ports/mountutils",
3
- "version": "2.0.8-beta.0",
3
+ "version": "2.0.8-beta.1",
4
4
  "main": "index.js",
5
- "description": "[openharmony port] Cross platform mount related utilities",
5
+ "description": "Cross platform mount related utilities",
6
6
  "homepage": "https://github.com/balena-io-modules/mountutils",
7
7
  "repository": {
8
8
  "type": "git",
@@ -25,23 +25,40 @@
25
25
  "src",
26
26
  "docs",
27
27
  "example",
28
- "prebuilds",
29
28
  "binding.gyp",
30
- "LICENSE",
31
29
  "README.md",
32
30
  "requirements.txt",
33
- "build",
31
+ "prebuilds",
34
32
  "OHOS-PORTS.md"
35
33
  ],
36
34
  "directories": {
37
35
  "test": "tests"
38
36
  },
39
- "scripts": {},
37
+ "scripts": {
38
+ "configure": "node-gyp configure",
39
+ "build": "node-gyp-build && npm run prebuildify",
40
+ "prebuildify": "prebuildify -t 20.18.1 -t 22.13.0 --strip",
41
+ "rebuild": "node-gyp rebuild",
42
+ "readme": "jsdoc2md --template docs/README.hbs index.js > README.md",
43
+ "lint-js": "eslint *.js",
44
+ "lint-cpp": "cpplint --recursive src",
45
+ "lint": "npm run lint-js && npm run lint-cpp",
46
+ "test": "npm rebuild && mocha tests -R spec",
47
+ "install": "node-gyp-build"
48
+ },
40
49
  "author": "Juan Cruz Viotti <juan@resin.io>",
41
50
  "license": "Apache-2.0",
51
+ "devDependencies": {
52
+ "chai": "6.2.2",
53
+ "eslint": "9.39.5",
54
+ "jsdoc-to-markdown": "9.1.3",
55
+ "mocha": "11.8.0"
56
+ },
42
57
  "dependencies": {
43
- "nan": "^2.22.0",
44
- "node-gyp-build": "^4.8.4"
58
+ "bindings": "^1.3.0",
59
+ "@ohos-ports/nan": "^2.22.0-gk.1-beta.1",
60
+ "node-gyp-build": "^4.8.4",
61
+ "prebuildify": "^6.0.1"
45
62
  },
46
63
  "gypfile": true,
47
64
  "bugs": {
Binary file