Commit 16a2751
feat(wasm): synthesize standard /dev character devices in the host-backed guest fs
Threaded wasm guests use the host-backed fs (wasm.rs open_wasm_guest_file), which
bypasses the kernel device_layer, so opening /dev/null, /dev/urandom, etc. failed
with ENOENT. The GTK/X clients never noticed (they use getrandom()), but dbus-daemon
opens these device FILES at startup ("setting up standard fds" + UUID generation).
Fix (constraint #5, runtime layer):
- wasm.rs: a WasmCharDevice table (Null/Zero/Full/Random) parallel to open_files;
open synthesizes a device fd, read produces EOF (null) / zeros (zero,full) /
getrandom bytes (random,urandom), write is discarded (ENOSPC for full).
- node_import_cache.rs: the path_open override now routes the /dev device paths
through openGuestFileForPathOpen -> fsModule.openSync (the device handler)
regardless of O_CREAT; the default WASI path_open over the sandbox preopens
would return ENOENT. Asset version bumped.
dbus-daemon now starts past /dev/null + /dev/urandom. No regression: the LXDE
openbox client still renders. General fix: any Linux guest needing /dev devices.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent d950db4 commit 16a2751
3 files changed
Lines changed: 99 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
9645 | 9645 | | |
9646 | 9646 | | |
9647 | 9647 | | |
| 9648 | + | |
| 9649 | + | |
| 9650 | + | |
| 9651 | + | |
| 9652 | + | |
| 9653 | + | |
| 9654 | + | |
| 9655 | + | |
| 9656 | + | |
| 9657 | + | |
| 9658 | + | |
| 9659 | + | |
| 9660 | + | |
| 9661 | + | |
9648 | 9662 | | |
9649 | 9663 | | |
9650 | 9664 | | |
9651 | | - | |
9652 | | - | |
9653 | | - | |
9654 | | - | |
9655 | 9665 | | |
9656 | 9666 | | |
9657 | 9667 | | |
9658 | 9668 | | |
| 9669 | + | |
| 9670 | + | |
| 9671 | + | |
| 9672 | + | |
9659 | 9673 | | |
9660 | 9674 | | |
9661 | 9675 | | |
9662 | 9676 | | |
9663 | | - | |
| 9677 | + | |
9664 | 9678 | | |
9665 | 9679 | | |
9666 | 9680 | | |
| |||
12953 | 12967 | | |
12954 | 12968 | | |
12955 | 12969 | | |
12956 | | - | |
| 12970 | + | |
12957 | 12971 | | |
12958 | 12972 | | |
12959 | 12973 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
353 | 373 | | |
354 | 374 | | |
355 | 375 | | |
| |||
360 | 380 | | |
361 | 381 | | |
362 | 382 | | |
| 383 | + | |
363 | 384 | | |
364 | 385 | | |
365 | 386 | | |
| |||
900 | 921 | | |
901 | 922 | | |
902 | 923 | | |
| 924 | + | |
903 | 925 | | |
904 | 926 | | |
905 | 927 | | |
| |||
993 | 1015 | | |
994 | 1016 | | |
995 | 1017 | | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
996 | 1029 | | |
997 | 1030 | | |
998 | 1031 | | |
| |||
1081 | 1114 | | |
1082 | 1115 | | |
1083 | 1116 | | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
1084 | 1123 | | |
1085 | 1124 | | |
1086 | 1125 | | |
| |||
1379 | 1418 | | |
1380 | 1419 | | |
1381 | 1420 | | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
1382 | 1433 | | |
1383 | 1434 | | |
1384 | 1435 | | |
| |||
1403 | 1454 | | |
1404 | 1455 | | |
1405 | 1456 | | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
1406 | 1482 | | |
1407 | 1483 | | |
1408 | 1484 | | |
| |||
4590 | 4666 | | |
4591 | 4667 | | |
4592 | 4668 | | |
| 4669 | + | |
4593 | 4670 | | |
4594 | 4671 | | |
4595 | 4672 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
0 commit comments