code wiki / _hdl_build / nx_deploy_stage_lib.nx

nx_deploy_stage_lib.nx

buildroot/runtime/_hdl_build/nx_deploy_stage_lib.nx

15017 B321 linesdepth 6pulls 6 transitivereach 5 importersview sourcekind librarytopic deploy
docsdependenciesstructsconstsfunctions

about

ELF-magic admission and exact-byte staging into a .new slot. This preserves ordinary source permissions and verifies copied bytes; it does not establish that an ELF is valid for execution. Legacy1024-byte admission remains explicit pending format-aware admission; no64MiB content ceiling. Caller owns trusted stage directories. File and directory sync outcomes are recorded separately from visibility. Promotion and runtime health are separate. license_tier: ORIGINAL

dependencies 1 imports · 5 importers

nx_fio.nx nx_deploy_stage_lib.nx nx_deploy_stage.nx nx_deploy_stage_gate.nx nx_stage_canonical_gate_t188.nx nx_stage_emitter_canonical_gate_t1 nx_stage_emitter_note_gate_t188.nx

imports: nx_fio.nx

imported by: nx_deploy_stage.nxnx_deploy_stage_gate.nxnx_stage_canonical_gate_t188.nxnx_stage_emitter_canonical_gate_t188.nxnx_stage_emitter_note_gate_t188.nx

structs

37struct NxDeployStageResult

consts

9const DS_MAGIC_1024: i64 = 1024
10const DS_MAGIC_4096: i64 = 4096
11const DS_MAGIC_2000: i64 = 2000
13const DS_MINSZ: i64 = 1024 // smallest plausible ELF; a smaller "binary" is a failed/torn build

functions

15func ds_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main
16func ds_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
17func ds_cat(d: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; var o: i64=off; while s[i]!=(0 as u8){d[o]=s[i]; o=o+1; i=i+1} return o }
called by 1: ds_stage_core
18func ds_catn(d: *u8, off: i64, v: i64) -> i64
25func ds_dst_is_new(dst: *u8) -> i64
called by 2: mainds_stage_core calls 1: ds_len
40func ds_stat_word(stat:*u8,offset:i64)->i64
43func ds_stage_result_init(r:*NxDeployStageResult)->i64
46func ds_source_prepare(src:*u8,region:*NxFileReadRegion,stat:*u8,digest:*u8,r:*NxDeployStageResult)->i64
81func ds_src_size(src:*u8)->i64
95func ds_stage_core(src:*u8,dst:*u8,r:*NxDeployStageResult)->i64
221func ds_stage(src:*u8,dst:*u8)->i64
called by 2: mainds_selftest calls 1: ds_stage_core
229func ds_out_fd(fd:i64,s:*u8,n:i64)->i64
233func ds_text_fd(fd:i64,s:*u8)->i64{return ds_out_fd(fd,s,ds_len(s))}
234func ds_json_fd(fd:i64,s:*u8)->i64
called by 1: ds_emit_result calls 2: ds_text_fdds_out_fd
252func ds_digits_fd(fd:i64,v:i64)->i64
257func ds_num_fd(fd:i64,v:i64)->i64
260func ds_emit_result(fd:i64,src:*u8,dst:*u8,r:*NxDeployStageResult)->i64
278func ds_emit(src:*u8,dst:*u8,rc:i64,sz:i64)->i64
287func ds_selftest() -> i64
called by 2: mainmain calls 1: ds_stage