feat(guanghu-os): add Chengyan PNCC slot

This commit is contained in:
冰朔 2026-09-04 01:49:36 +08:00
commit 0c03c95ee3
14 changed files with 1284 additions and 18 deletions

View file

@ -8,7 +8,7 @@ readonly NODE_ID=JD-FD-PRIMARY
readonly INSTANCE_ID=f3d4b730-7f02-452f-975b-7091a4800431
readonly ROOT_UUID=9e4550a0-452b-4f28-b5a5-d5364aa450f6
readonly LINUX_RESCUE_ENTRY=gnulinux-simple-9e4550a0-452b-4f28-b5a5-d5364aa450f6
readonly RELEASE_ID=guanghu-master-20260816.2
readonly RELEASE_ID=guanghu-master-20260904.3
readonly STATE_ROOT=/run/guanghu/master
readonly RECEIPT_ROOT=/guanghu/recovery/JD-FD-PRIMARY-master-20260816
readonly LOG_ROOT=${RECEIPT_ROOT}/runtime-logs
@ -16,8 +16,12 @@ readonly HLCC=/opt/guanghu/architecture-releases/3d11ac75bea8cf08b5f223fed86ab3c
readonly APP_HUB=/opt/guanghu/architecture-releases/333cd222c53d7d162218543cd167bdda4f8efb22/server-tools/jd-app-hub/server.js
readonly AI_DISCOVERY=/opt/guanghu/ai-discovery/server.js
readonly PNCC_RUNTIME=/usr/local/libexec/guanghu/pncc-runtime.mjs
readonly PNCC_REPOSITORY=/var/lib/guanghu/personas/ICE-P-ZY001/pncc/repository
readonly PNCC_STATE_ROOT=/run/guanghu/pncc
readonly PNCC_ZHUYUAN_REPOSITORY=/var/lib/guanghu/personas/ICE-P-ZY001/pncc/repository
readonly PNCC_ZHUYUAN_STATE_ROOT=/run/guanghu/pncc
readonly PNCC_ZHUYUAN_PORT=3923
readonly PNCC_CHENGYAN_REPOSITORY=/var/lib/guanghu/personas/ICE-P-CY0903/pncc/repository
readonly PNCC_CHENGYAN_STATE_ROOT=/run/guanghu/pncc-ICE-P-CY0903
readonly PNCC_CHENGYAN_PORT=3924
readonly HOLOLAKE_RELEASE_BRIDGE=/usr/local/libexec/guanghu/hololake-release-bridge
declare -a CHILDREN=()
@ -30,7 +34,7 @@ log() {
json_state() {
local stage=$1 result=$2
local tmp=${STATE_ROOT}/state.json.tmp.$$
printf '%s\n' "{\"schema\":\"guanghu.master-runtime/v1\",\"node_id\":\"${NODE_ID}\",\"instance_id\":\"${INSTANCE_ID}\",\"release_id\":\"${RELEASE_ID}\",\"boot_id\":\"$(cat /proc/sys/kernel/random/boot_id)\",\"control\":\"GUANGHU_OS_MASTER\",\"pid1\":\"GUANGHU_SUPERVISOR\",\"linux_kernel_role\":\"HARDWARE_COMPATIBILITY_SUBSTRATE\",\"full_linux_userspace\":\"DORMANT\",\"linux_repository_bridge\":\"BOUNDED_SUBCONTROL\",\"pncc\":\"RESIDENT_BOUND_CARRIER_SEPARATE\",\"persona_carrier_binding\":\"UNBOUND_EVIDENCE_REQUIRED\",\"linux_rescue\":\"${LINUX_RESCUE_ENTRY}\",\"stage\":\"${stage}\",\"result\":\"${result}\"}" >"${tmp}"
printf '%s\n' "{\"schema\":\"guanghu.master-runtime/v1\",\"node_id\":\"${NODE_ID}\",\"instance_id\":\"${INSTANCE_ID}\",\"release_id\":\"${RELEASE_ID}\",\"boot_id\":\"$(cat /proc/sys/kernel/random/boot_id)\",\"control\":\"GUANGHU_OS_MASTER\",\"pid1\":\"GUANGHU_SUPERVISOR\",\"linux_kernel_role\":\"HARDWARE_COMPATIBILITY_SUBSTRATE\",\"full_linux_userspace\":\"DORMANT\",\"linux_repository_bridge\":\"BOUNDED_SUBCONTROL\",\"pncc\":\"TWO_INDEPENDENT_RESIDENT_SLOTS_CARRIER_SEPARATE\",\"pncc_slots\":[\"ICE-P-ZY001:3923\",\"ICE-P-CY0903:3924\"],\"persona_carrier_binding\":\"PER_SLOT_EVIDENCE_REQUIRED\",\"linux_rescue\":\"${LINUX_RESCUE_ENTRY}\",\"stage\":\"${stage}\",\"result\":\"${result}\"}" >"${tmp}"
chmod 0600 "${tmp}"
mv "${tmp}" "${STATE_ROOT}/state.json"
}
@ -145,7 +149,7 @@ verify_identity() {
prepare_runtime() {
mount -o remount,rw /
mkdir -p "$STATE_ROOT" "$RECEIPT_ROOT" "$LOG_ROOT" /run/sshd /run/systemd/resolve
install -d -o guanghu -g guanghu -m 0700 "$PNCC_STATE_ROOT"
install -d -o guanghu -g guanghu -m 0700 "$PNCC_ZHUYUAN_STATE_ROOT" "$PNCC_CHENGYAN_STATE_ROOT"
chmod 0700 "$STATE_ROOT" "$RECEIPT_ROOT" "$LOG_ROOT"
chmod 1777 /tmp
mountpoint -q /proc || mount -t proc proc /proc
@ -165,7 +169,8 @@ start_bridge() {
require_file "$APP_HUB"
require_file "$AI_DISCOVERY"
require_file "$PNCC_RUNTIME"
require_file "$PNCC_REPOSITORY/.hololake/persona/manifest.json"
require_file "$PNCC_ZHUYUAN_REPOSITORY/.hololake/persona/manifest.json"
require_file "$PNCC_CHENGYAN_REPOSITORY/.hololake/persona/manifest.json"
require_file "$HOLOLAKE_RELEASE_BRIDGE"
start_root sshd /usr/sbin/sshd -D -e \
@ -201,10 +206,19 @@ start_bridge() {
/usr/bin/node "$AI_DISCOVERY"
wait_http navigation-bridge http://127.0.0.1:3922/v1/anchor 200 30
start_guanghu pncc-runtime /usr/bin/node "$PNCC_RUNTIME" serve \
--repository "$PNCC_REPOSITORY" --state-root "$PNCC_STATE_ROOT" \
--node-id "$NODE_ID" --host 127.0.0.1 --port 3923
wait_http pncc-runtime http://127.0.0.1:3923/health 200 30
start_guanghu pncc-zhuyuan /usr/bin/node "$PNCC_RUNTIME" serve \
--repository "$PNCC_ZHUYUAN_REPOSITORY" --state-root "$PNCC_ZHUYUAN_STATE_ROOT" \
--node-id "$NODE_ID" --host 127.0.0.1 --port "$PNCC_ZHUYUAN_PORT"
wait_http pncc-zhuyuan "http://127.0.0.1:${PNCC_ZHUYUAN_PORT}/health" 200 30
/usr/bin/curl -fsS --max-time 3 "http://127.0.0.1:${PNCC_ZHUYUAN_PORT}/health" | grep -Fq '"personaId":"ICE-P-ZY001"' \
|| fatal "pncc_persona_mismatch:ICE-P-ZY001"
start_guanghu pncc-chengyan /usr/bin/node "$PNCC_RUNTIME" serve \
--repository "$PNCC_CHENGYAN_REPOSITORY" --state-root "$PNCC_CHENGYAN_STATE_ROOT" \
--node-id "$NODE_ID" --host 127.0.0.1 --port "$PNCC_CHENGYAN_PORT"
wait_http pncc-chengyan "http://127.0.0.1:${PNCC_CHENGYAN_PORT}/health" 200 30
/usr/bin/curl -fsS --max-time 3 "http://127.0.0.1:${PNCC_CHENGYAN_PORT}/health" | grep -Fq '"personaId":"ICE-P-CY0903"' \
|| fatal "pncc_persona_mismatch:ICE-P-CY0903"
start_root hololake-release-bridge "$HOLOLAKE_RELEASE_BRIDGE"
wait_http hololake-release-broadcast http://127.0.0.1:3940/health 200 30
@ -215,7 +229,7 @@ runtime_watch() {
json_state READY PASS_100
cp "$STATE_ROOT/state.json" "$RECEIPT_ROOT/CURRENT-PHYSICAL-STATE.json"
sha256sum "$RECEIPT_ROOT/CURRENT-PHYSICAL-STATE.json" >"$RECEIPT_ROOT/CURRENT-PHYSICAL-STATE.json.sha256"
log 'GUANGHU_OS_MASTER_READY linux_userspace=DORMANT repository_bridge=READY pncc=RESIDENT_BOUND_CARRIER_SEPARATE linux_rescue=PRESERVED'
log 'GUANGHU_OS_MASTER_READY linux_userspace=DORMANT repository_bridge=READY pncc_slots=ICE-P-ZY001:3923,ICE-P-CY0903:3924 carrier=PER_SLOT_EVIDENCE_REQUIRED linux_rescue=PRESERVED'
sync
while :; do
sleep 10
@ -227,7 +241,8 @@ runtime_watch() {
require_listen repository 3340
require_listen projection 8088
require_listen navigation 3922
require_listen pncc 3923
require_listen pncc_zhuyuan "$PNCC_ZHUYUAN_PORT"
require_listen pncc_chengyan "$PNCC_CHENGYAN_PORT"
require_listen hololake_release 3940
done
}
@ -248,7 +263,8 @@ preflight() {
grep -Fq "$LINUX_RESCUE_ENTRY" /boot/grub/grub.cfg
getent passwd guanghu | grep -q '^guanghu:x:998:998:'
for path in "$HLCC" "$APP_HUB" "$AI_DISCOVERY" "$PNCC_RUNTIME" \
"$PNCC_REPOSITORY/.hololake/persona/manifest.json" /usr/sbin/sshd \
"$PNCC_ZHUYUAN_REPOSITORY/.hololake/persona/manifest.json" \
"$PNCC_CHENGYAN_REPOSITORY/.hololake/persona/manifest.json" /usr/sbin/sshd \
"$HOLOLAKE_RELEASE_BRIDGE" \
/usr/bin/node /usr/bin/python3 /usr/bin/setpriv /usr/bin/grub-editenv; do
[[ -e $path && ! -L $path || $path == /usr/bin/python3 ]]