- Bump bareOsCtxApiVersion to 1.37.0; sync syscalls.example.json and ctx helper - Add ctx.bareOsReadSnapshotHintsJson mirroring snapshot_hints proc JSON - Gate blind_relay_router / blind_pairing_sketch / relay_geo_hint behind BARE_OS_PROC_BLIND_PEER_RELAY_HINTS; passthrough + env appendix docs - Add POSIX link(1) via coreutils (link.js, man, commands list, kernel bin) - Fix JSDoc in verify-runtime-no-incomplete-markers (avoid */ in glob text) - Align posix-conformance-matrix bareOsSyscallOps with getconf (select, umask) - Add verify-holepunch-clone-drift.mjs (opt-in pretest), holepunch-drift-repos.json, originMainHead in sync-holepunch-clones report - Tests: warm /bin cache clear, blind proc stub, protomux pool schema 2, glob cap - Docs: systemctl man, compatibility matrix boot.policy pins, handbook ch.5 vault/proc note, package-bare-os-booter, kernel-extensions, developer-guide ctx - CHANGELOG and bare-os-ctx.d.ts updates for subprocess bridge and mirror mounts
40 lines
1.2 KiB
JavaScript
40 lines
1.2 KiB
JavaScript
/**
|
|
* POSIX `link` utility — delegates to `ctx.bareOsSyscall('link', …)` (copy-on-Hyperdrive semantics).
|
|
*/
|
|
async function run(ctx, argv) {
|
|
const args = argv.slice(1).filter((a) => a !== '--')
|
|
if (args.length === 1 && (args[0] === '-h' || args[0] === '--help')) {
|
|
ctx.console.log(
|
|
'usage: link FILE1 FILE2\nCreate FILE2 linked to FILE1 (hard link semantics; on Hyperdrive this copies bytes unless the host enforces EOPNOTSUPP).'
|
|
)
|
|
return
|
|
}
|
|
if (args.length !== 2) {
|
|
ctx.console.error('usage: link FILE1 FILE2')
|
|
ctx.exitCode = 1
|
|
return
|
|
}
|
|
if (args[0].startsWith('-') || args[1].startsWith('-')) {
|
|
ctx.console.error('link: unsupported option or operand order')
|
|
ctx.exitCode = 1
|
|
return
|
|
}
|
|
let existing = args[0]
|
|
let newPath = args[1]
|
|
if (ctx.vfs && typeof ctx.vfs.resolveLogical === 'function') {
|
|
existing = ctx.vfs.resolveLogical(existing)
|
|
newPath = ctx.vfs.resolveLogical(newPath)
|
|
}
|
|
if (typeof ctx.bareOsSyscall !== 'function') {
|
|
ctx.console.error('link: bareOsSyscall unavailable')
|
|
ctx.exitCode = 1
|
|
return
|
|
}
|
|
try {
|
|
await ctx.bareOsSyscall('link', { existing, newPath })
|
|
} catch (e) {
|
|
ctx.console.error('link: ' + ((e && e.message) || e))
|
|
ctx.exitCode = 1
|
|
}
|
|
}
|