install: stage pxe-setup.sh at /usr/local/sbin/vetting-pxe-setup
proxmox-install.sh tarball-extracts into a tempdir that gets wiped on EXIT, so after the one-liner there's no pxe-setup.sh on disk for the operator to run. Have install.sh drop the script + ipxe-shas.txt into /usr/local/share/vetting/ and symlink it as /usr/local/sbin/vetting-pxe-setup (in PATH). pxe-setup.sh now readlink -f's BASH_SOURCE so the symlink resolves to the share dir where ipxe-shas.txt lives, and gracefully handles the case where install.sh already staged vmlinuz + initrd.img into LIVE_DIR (no bundle live-image/ needed at that point). Update the trailing hint in proxmox-install.sh and the operations runbook to surface the new `sudo vetting-pxe-setup ...` command. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -144,6 +144,18 @@ else
|
|||||||
fi
|
fi
|
||||||
install -m 0644 "${SCRIPT_DIR}/vetting.service" /etc/systemd/system/vetting.service
|
install -m 0644 "${SCRIPT_DIR}/vetting.service" /etc/systemd/system/vetting.service
|
||||||
|
|
||||||
|
# Install pxe-setup.sh + its pinned iPXE SHAs into a stable path so the
|
||||||
|
# operator can run `vetting-pxe-setup ...` after the one-liner install.
|
||||||
|
# The bundle's tempdir gets wiped by proxmox-install.sh on exit, so
|
||||||
|
# without this the script would be inaccessible.
|
||||||
|
if [[ -f "${SCRIPT_DIR}/pxe-setup.sh" && -f "${SCRIPT_DIR}/ipxe-shas.txt" ]]; then
|
||||||
|
echo "==> installing pxe-setup.sh and ipxe-shas.txt"
|
||||||
|
install -d -m 0755 /usr/local/share/vetting
|
||||||
|
install -m 0755 "${SCRIPT_DIR}/pxe-setup.sh" /usr/local/share/vetting/pxe-setup.sh
|
||||||
|
install -m 0644 "${SCRIPT_DIR}/ipxe-shas.txt" /usr/local/share/vetting/ipxe-shas.txt
|
||||||
|
ln -sfn /usr/local/share/vetting/pxe-setup.sh /usr/local/sbin/vetting-pxe-setup
|
||||||
|
fi
|
||||||
|
|
||||||
# Stage the live image into LIVE_DIR if we can find one. Two layouts:
|
# Stage the live image into LIVE_DIR if we can find one. Two layouts:
|
||||||
# - release bundle: ${SCRIPT_DIR}/live-image/{vmlinuz,initrd.img}
|
# - release bundle: ${SCRIPT_DIR}/live-image/{vmlinuz,initrd.img}
|
||||||
# - repo-tree dev run: ${REPO_ROOT}/live-image/build/{vmlinuz,initrd.img}
|
# - repo-tree dev run: ${REPO_ROOT}/live-image/build/{vmlinuz,initrd.img}
|
||||||
|
|||||||
@@ -78,7 +78,12 @@ To pin a specific build:
|
|||||||
${REGISTRY_URL}/${PACKAGE_OWNER}/Vetting/raw/branch/main/deploy/proxmox-install.sh \\
|
${REGISTRY_URL}/${PACKAGE_OWNER}/Vetting/raw/branch/main/deploy/proxmox-install.sh \\
|
||||||
| sudo bash
|
| sudo bash
|
||||||
|
|
||||||
For PXE support, the bundle also ships deploy/pxe-setup.sh — see
|
For PXE support, run:
|
||||||
docs/operations.md for the flow.
|
sudo vetting-pxe-setup \\
|
||||||
|
--interface eth0 \\
|
||||||
|
--subnet 192.168.1.0/24 \\
|
||||||
|
--orchestrator-url http://<lxc-lan-ip>:8080
|
||||||
|
|
||||||
|
See docs/operations.md for the full flow.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
+15
-5
@@ -38,7 +38,10 @@ BUNDLE_DIR=""
|
|||||||
FORCE=0
|
FORCE=0
|
||||||
SERVICE_USER="vetting"
|
SERVICE_USER="vetting"
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
# Resolve symlinks so `vetting-pxe-setup` (a symlink into /usr/local/sbin
|
||||||
|
# installed by install.sh) finds ipxe-shas.txt alongside the real script
|
||||||
|
# in /usr/local/share/vetting/.
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)"
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
sed -n '2,28p' "${BASH_SOURCE[0]}"
|
sed -n '2,28p' "${BASH_SOURCE[0]}"
|
||||||
@@ -176,10 +179,17 @@ for cand in \
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [[ -z "${LIVE_SRC}" ]]; then
|
if [[ -z "${LIVE_SRC}" ]]; then
|
||||||
echo "WARN: no live image found under ${BUNDLE_DIR}/live-image or" >&2
|
# install.sh already stages vmlinuz + initrd.img into LIVE_DIR during
|
||||||
echo " ${BUNDLE_DIR}/../live-image/build — skipping live_dir staging." >&2
|
# the one-liner install, so a missing bundle/live-image/ is expected
|
||||||
echo " Build with 'wsl make live-image' or use a release tarball," >&2
|
# when pxe-setup.sh is run from /usr/local/sbin.
|
||||||
echo " then copy vmlinuz + initrd.img into ${LIVE_DIR} manually." >&2
|
if [[ -f "${LIVE_DIR}/vmlinuz" && -f "${LIVE_DIR}/initrd.img" ]]; then
|
||||||
|
echo "==> live image already staged in ${LIVE_DIR} (from install.sh)"
|
||||||
|
else
|
||||||
|
echo "WARN: no live image found under ${BUNDLE_DIR}/live-image," >&2
|
||||||
|
echo " ${BUNDLE_DIR}/../live-image/build, or ${LIVE_DIR}." >&2
|
||||||
|
echo " The orchestrator will fail PXE startup validation until" >&2
|
||||||
|
echo " vmlinuz + initrd.img land in ${LIVE_DIR}." >&2
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "==> staging live image from ${LIVE_SRC} into ${LIVE_DIR}"
|
echo "==> staging live image from ${LIVE_SRC} into ${LIVE_DIR}"
|
||||||
install -d -m 0755 -o "${SERVICE_USER}" -g "${SERVICE_USER}" "${LIVE_DIR}"
|
install -d -m 0755 -o "${SERVICE_USER}" -g "${SERVICE_USER}" "${LIVE_DIR}"
|
||||||
|
|||||||
+7
-3
@@ -73,15 +73,19 @@ That means **no dedicated bridge, no VLAN, no cabling changes**. The
|
|||||||
LXC just needs an interface on the same L2 segment as the hosts
|
LXC just needs an interface on the same L2 segment as the hosts
|
||||||
you're repairing — typically `eth0` on the LAN bridge.
|
you're repairing — typically `eth0` on the LAN bridge.
|
||||||
|
|
||||||
On the LXC, inside the extracted bundle:
|
On the LXC, after the one-liner install completes:
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo ./pxe-setup.sh \
|
sudo vetting-pxe-setup \
|
||||||
--interface eth0 \
|
--interface eth0 \
|
||||||
--subnet 192.168.1.0/24 \
|
--subnet 192.168.1.0/24 \
|
||||||
--orchestrator-url http://<lxc-lan-ip>:8080
|
--orchestrator-url http://<lxc-lan-ip>:8080
|
||||||
```
|
```
|
||||||
|
|
||||||
|
(`vetting-pxe-setup` is a symlink installed into `/usr/local/sbin/` by
|
||||||
|
`install.sh`, pointing at the `pxe-setup.sh` script and `ipxe-shas.txt`
|
||||||
|
staged under `/usr/local/share/vetting/`.)
|
||||||
|
|
||||||
The script:
|
The script:
|
||||||
|
|
||||||
- Fetches `ipxe.efi` + `undionly.kpxe` from boot.ipxe.org and verifies
|
- Fetches `ipxe.efi` + `undionly.kpxe` from boot.ipxe.org and verifies
|
||||||
@@ -103,7 +107,7 @@ exists, iPXE binaries are on disk, `subnet` parses as CIDR) and
|
|||||||
exits non-zero with a clear error if anything's wrong, instead of
|
exits non-zero with a clear error if anything's wrong, instead of
|
||||||
failing silently when a host first PXE-boots.
|
failing silently when a host first PXE-boots.
|
||||||
|
|
||||||
`pxe-setup.sh` is idempotent — safe to re-run. Pass `--force` to
|
`vetting-pxe-setup` is idempotent — safe to re-run. Pass `--force` to
|
||||||
overwrite a hand-edited `pxe:` block.
|
overwrite a hand-edited `pxe:` block.
|
||||||
|
|
||||||
**Router caveat.** Most home/prosumer routers (UniFi, Asus, Netgear,
|
**Router caveat.** Most home/prosumer routers (UniFi, Asus, Netgear,
|
||||||
|
|||||||
Reference in New Issue
Block a user