installer 1.33.0 (pushed, not published): the data volume by the ruled table; step 5b the internal data place; OMV guide second-disk line
gates / gates (push) Successful in 6m42s
gates / gates (push) Successful in 6m42s
architecture/16 §5, §7 (build B). Publishing (tag + webpage.yaml, R-110) waits for the operator's vouch of agent 0.158.1. Claude-Session: https://claude.ai/code/session_012qRErfCoiTkvDK9N5XHbzb
This commit is contained in:
1 parent
394498d06e
commit
d45384bf95
4 files changed
+199
-16
No files matched your search
@@ -184,7 +184,7 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_VERSION="1.32.0" # the SINGLE version source (F-1): -h and the run banners follow it.
|
||||
SCRIPT_VERSION="1.33.0" # the SINGLE version source (F-1): -h and the run banners follow it.
|
||||
# The hub used to carry a copy for its Setup tab; R-94 DELETED it
|
||||
# (2026-08-02) because the hub cannot know which version a box runs —
|
||||
# the Setup command fetches this script at run time. scripts/
|
||||
@@ -866,6 +866,10 @@ _uninstall_statement() {
|
||||
else
|
||||
echo " - the enrolled drives + ALL data under /mnt/felhom-drives — left MOUNTED (remaining guests may use them)"
|
||||
fi
|
||||
if lvs pve/felhom-belso >/dev/null 2>&1; then # 1.33.0 (`16` §5)
|
||||
echo " - the internal data place (LV pve/felhom-belso, household data) — NEVER removed by an uninstall; once the"
|
||||
echo " data is saved elsewhere: lvremove pve/felhom-belso"
|
||||
fi
|
||||
if pvesm status 2>/dev/null | awk '$2=="pbs"{found=1} END{exit !found}'; then
|
||||
echo " - the PBS backups + this customer's namespace on the PBS side — delete there if wanted"
|
||||
fi
|
||||
@@ -1353,6 +1357,8 @@ run_uninstall() {
|
||||
if [[ -f /usr/local/sbin/felhom-backup-target-apply ]]; then run rm -f /usr/local/sbin/felhom-backup-target-apply; else log_skip " felhom-backup-target-apply already absent"; fi
|
||||
# agent v0.156.1 (R-1006): the dead half-written vzdump remover the config bundle installs.
|
||||
if [[ -f /usr/local/sbin/felhom-vzdump-partial-clean ]]; then run rm -f /usr/local/sbin/felhom-vzdump-partial-clean; else log_skip " felhom-vzdump-partial-clean already absent"; fi
|
||||
# 1.33.0 (`16` §5): the internal-place helper. Its VOLUME (pve/felhom-belso) holds household data and is KEPT.
|
||||
if [[ -f /usr/local/sbin/felhom-internal-place ]]; then run rm -f /usr/local/sbin/felhom-internal-place; else log_skip " felhom-internal-place already absent"; fi
|
||||
if [[ -f /usr/local/sbin/felhom-os-apply ]]; then run rm -f /usr/local/sbin/felhom-os-apply; else log_skip " felhom-os-apply already absent"; fi
|
||||
# R-881: the content checker the config bundle installs since agent v0.146.1 (R-861).
|
||||
if [[ -f /usr/local/sbin/felhom-priv-apply ]]; then run rm -f /usr/local/sbin/felhom-priv-apply; else log_skip " felhom-priv-apply already absent"; fi
|
||||
@@ -2245,6 +2251,16 @@ step_token() {
|
||||
_state_mark token
|
||||
}
|
||||
|
||||
# felhom_datavol_gib <thin pool GiB> → the guest's data volume (mp0) in GiB (felhom.eu architecture/16 §7, ruled
|
||||
# 2026-10-16): 50 below a 300 GiB pool, 100 up to 800, 130 from 800. Pinned by scripts/test_hostinstall.py.
|
||||
felhom_datavol_gib() {
|
||||
local pool=${1:-0}
|
||||
if (( pool >= 800 )); then echo 130
|
||||
elif (( pool >= 300 )); then echo 100
|
||||
else echo 50
|
||||
fi
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# STEP 3 — compute grows (floors) if not passed
|
||||
#-------------------------------------------------------------------------------
|
||||
@@ -2259,20 +2275,16 @@ step_grows() {
|
||||
# space. (Before R-165 this same block already did the deriving; the merge only collapsed its
|
||||
# 80/20 docker-vs-sysdata split into a single total.)
|
||||
if [[ -z "$ROOTFS_GROW$DATAVOL_GROW$SYSDATA_GROW" ]]; then
|
||||
local free_gib
|
||||
free_gib=$(lvs --noheadings --units g -o lv_size,data_percent /dev/pve/data 2>/dev/null | awk '{gsub(/[^0-9.]/,"",$1); used=$2; print int($1*(100-used)/100)}' 2>/dev/null || echo 0)
|
||||
# Reserve headroom; the totals below are the pre-merge pair SUMMED, so an appliance gets the
|
||||
# same capacity it did before — it is simply no longer split by a wall.
|
||||
# 1.33.0 (felhom.eu architecture/16 §7, sizes ruled by the operator 2026-10-16 after the build B space check,
|
||||
# audits/storage-identity-buildB-2026-10-15/SPACE-CHECK.md): the data volume is sized by the thin POOL, and
|
||||
# capped — the whole catalog needs ≈ 74 GB; the rest of the pool goes to the internal data place (step 5b),
|
||||
# which is outside every whole-box copy. Before 1.33.0: 70/130/250 by FREE space.
|
||||
local pool_gib
|
||||
pool_gib=$(lvs --noheadings --units g --nosuffix -o lv_size /dev/pve/data 2>/dev/null | awk '{print int($1)}' 2>/dev/null || echo 0)
|
||||
ROOTFS_GROW=0
|
||||
if [[ "${free_gib:-0}" -ge 300 ]]; then
|
||||
DATAVOL_GROW=226 # 184+42 -> the standard 250G appliance (was 200G+50G)
|
||||
elif [[ "${free_gib:-0}" -ge 150 ]]; then
|
||||
DATAVOL_GROW=106 # 84+22
|
||||
else
|
||||
DATAVOL_GROW=46 # 34+12 — minimal floor
|
||||
fi
|
||||
DATAVOL_GROW=$(( $(felhom_datavol_gib "${pool_gib:-0}") - 24 )) # the golden's data volume is 24G
|
||||
SYSDATA_GROW=0
|
||||
log_info " auto-computed from ~${free_gib} GiB free (ONE volume since R-165)"
|
||||
log_info " auto-computed from a ${pool_gib:-?} GiB thin pool (16 §7: 50/100/130 GiB)"
|
||||
fi
|
||||
ROOTFS_GROW="${ROOTFS_GROW:-0}"; DATAVOL_GROW="${DATAVOL_GROW:-0}"; SYSDATA_GROW="${SYSDATA_GROW:-0}"
|
||||
# A hand-passed --sysdata-grow is still ACCEPTED and still counts: the agent folds it into the one
|
||||
@@ -2281,6 +2293,65 @@ step_grows() {
|
||||
_state_mark grows
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# STEP 5b — the internal data place („Belső tárhely", felhom.eu architecture/16 §5, §7; installer 1.33.0)
|
||||
#-------------------------------------------------------------------------------
|
||||
# A second thin volume in local-lvm for the household's own data (films, photos, documents): media and data-folder
|
||||
# apps install there with no extra step, and it is outside every whole-box copy (a host mount, like a drive). The
|
||||
# root helper from the agent's config bundle (felhom-internal-place) does the work — the SAME helper a signed
|
||||
# add_internal_place job runs on an old box — so the size rule and the only mkfs live in one place. The installer
|
||||
# passes the thin space the guest will still take (32 + the data volume) and writes the record the agent mounts from.
|
||||
# Never fatal: a box without the place still works (a media app then asks for a drive in words, `16` §5).
|
||||
step_internal_place() {
|
||||
log_step "5b/8 internal data place (Belső tárhely)"
|
||||
if [[ "$MODE" != "appliance" ]]; then
|
||||
log_skip " byo: the host owner's thin pool is not ours to divide — no internal place"
|
||||
_state_mark internal_place; return 0
|
||||
fi
|
||||
local helper=/usr/local/sbin/felhom-internal-place
|
||||
if [[ ! -x "$helper" ]]; then
|
||||
log_warn " the vouched agent's config bundle has no internal-place helper (agent older than 0.158.0) — skipped; a signed add_internal_place job can add it later"
|
||||
_state_mark internal_place; return 0
|
||||
fi
|
||||
local planned=$(( 32 + ROOTFS_GROW + 24 + DATAVOL_GROW + SYSDATA_GROW ))
|
||||
# A guest that already exists (a re-run after provision) is counted by the helper itself — plan nothing twice.
|
||||
[[ -n "$(felhom_guests)" ]] && planned=0
|
||||
if $DRY_RUN; then
|
||||
log_dry "$helper create $planned ; write $AGENT_STATE_DIR/internal-place.json (0600, $AGENT_USER)"
|
||||
log_info " $("$helper" plan "$planned" 2>&1 | head -1)"
|
||||
return 0
|
||||
fi
|
||||
local out
|
||||
if ! out=$("$helper" create "$planned" 2>&1); then
|
||||
log_warn " the internal place was NOT made: ${out}"
|
||||
_state_mark internal_place; return 0
|
||||
fi
|
||||
case "$out" in
|
||||
created\ *|existing\ *|formatted\ *)
|
||||
local uuid gib
|
||||
uuid=$(sed -n 's/.* uuid=\([0-9a-fA-F-]*\) .*/\1/p' <<<"$out")
|
||||
gib=$(sed -n 's/.* gib=\([0-9]*\)$/\1/p' <<<"$out")
|
||||
[[ -n "$uuid" && -n "$gib" ]] || { log_warn " unexpected helper output: $out"; _state_mark internal_place; return 0; }
|
||||
install -d -o "$AGENT_USER" -g "$AGENT_USER" -m 0700 "$AGENT_STATE_DIR"
|
||||
UUID="$uuid" GIB="$gib" OUT="$AGENT_STATE_DIR/internal-place.json" python3 - <<'PY'
|
||||
import json, os, time
|
||||
rec = {"fs_uuid": os.environ["UUID"], "gib": int(os.environ["GIB"]), "made_by": "installer",
|
||||
"made_at": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime())}
|
||||
tmp = os.environ["OUT"] + ".tmp"
|
||||
with open(tmp, "w") as f:
|
||||
json.dump(rec, f, indent=2); f.write("\n")
|
||||
os.chmod(tmp, 0o600)
|
||||
os.replace(tmp, os.environ["OUT"])
|
||||
PY
|
||||
chown "$AGENT_USER:$AGENT_USER" "$AGENT_STATE_DIR/internal-place.json"
|
||||
log_success " internal place: ${out%% *}, ${gib} GiB (the agent mounts it at /mnt/belso)"
|
||||
;;
|
||||
skipped\ *) log_info " no internal place: ${out#skipped }" ;;
|
||||
*) log_warn " unexpected helper output: $out" ;;
|
||||
esac
|
||||
_state_mark internal_place
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# STEP 4 — host enroll (option C; single secret, no global key)
|
||||
#-------------------------------------------------------------------------------
|
||||
@@ -3541,6 +3612,7 @@ else
|
||||
log_skip "break-glass (step 4b) SKIPPED (byo: the host owner manages break-glass; root@pam untouched, nothing vaulted)"
|
||||
fi
|
||||
should_skip agent_install || step_agent_install
|
||||
should_skip internal_place || step_internal_place
|
||||
should_skip agent_config || step_agent_config
|
||||
should_skip golden || step_golden
|
||||
if $SKIP_PROVISION; then
|
||||
|
||||
Reference in new issue
Block a user