Establish clean homelab infrastructure baseline
Reorganize the brownfield repository, remove retired and generated artifacts, harden ignore rules, and record the GitOps/IaC redesign.
This commit is contained in:
Executable
+81
@@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
|
||||
cat << EOF
|
||||
|
||||
#########################################################################################################
|
||||
# Create PXE bootable Proxmox image including ISO #
|
||||
# #
|
||||
# Author: mrballcb @ Proxmox Forum (06-12-2012) #
|
||||
# Thread: http://forum.proxmox.com/threads/8484-Proxmox-installation-via-PXE-solution?p=55985#post55985 #
|
||||
# Modified: morph027 @ Proxmox Forum (23-02-2015) to work with 3.4 #
|
||||
#########################################################################################################
|
||||
|
||||
EOF
|
||||
|
||||
if [ ! $# -eq 1 ]; then
|
||||
echo -ne "Usage: bash pve-iso-2-pxe.sh /path/to/pve.iso\n\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BASEDIR="$(dirname "$(readlink -f "$1")")"
|
||||
pushd "$BASEDIR" >/dev/null || exit 1
|
||||
|
||||
[ -L "proxmox.iso" ] && rm proxmox.iso &>/dev/null
|
||||
|
||||
for ISO in *.iso; do
|
||||
if [ "$ISO" = "*.iso" ]; then continue; fi
|
||||
if [ "$ISO" = "proxmox.iso" ]; then continue; fi
|
||||
echo "Using ${ISO}..."
|
||||
ln -s "$ISO" proxmox.iso
|
||||
done
|
||||
|
||||
if [ ! -f "proxmox.iso" ]; then
|
||||
echo "Couldn't find a proxmox iso, aborting."
|
||||
echo "Add /path/to/iso_dir to the commandline."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
rm -rf pxeboot
|
||||
[ -d pxeboot ] || mkdir pxeboot
|
||||
|
||||
pushd pxeboot >/dev/null || exit 1
|
||||
echo "extracting kernel..."
|
||||
if [ -x $(which isoinfo) ] ; then
|
||||
isoinfo -i ../../infrastructure/proxmox.iso -R -x /boot/linux26 > linux26 || exit 3
|
||||
else
|
||||
7z x ../../infrastructure/proxmox.iso boot/linux26 -o/tmp || exit 3
|
||||
mv /tmp/boot/linux26 /tmp/
|
||||
fi
|
||||
echo "extracting initrd..."
|
||||
if [ -x $(which isoinfo) ] ; then
|
||||
isoinfo -i ../../infrastructure/proxmox.iso -R -x /boot/initrd.img > /tmp/initrd.img
|
||||
else
|
||||
7z x ../../infrastructure/proxmox.iso boot/initrd.img -o/tmp
|
||||
mv /tmp/boot/initrd.img /tmp/
|
||||
fi
|
||||
|
||||
mimetype="$(file --mime-type --brief /tmp/initrd.img)"
|
||||
case "${mimetype##*/}" in
|
||||
"zstd"|"x-zstd")
|
||||
decompress="zstd -d /tmp/initrd.img -c"
|
||||
;;
|
||||
"gzip"|"x-gzip")
|
||||
decompress="gzip -S img -d /tmp/initrd.img -c"
|
||||
;;
|
||||
*)
|
||||
echo "unable to detect initrd compression method, exiting"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
$decompress > initrd || exit 4
|
||||
echo "adding iso file ..."
|
||||
if [ -x $(which cpio) ] ; then
|
||||
echo "../../infrastructure/proxmox.iso" | cpio -L -H newc -o >> initrd || exit 5
|
||||
else
|
||||
7z x "../../infrastructure/proxmox.iso" >> initrd || exit 5
|
||||
fi
|
||||
popd >/dev/null 2>&1 || exit 1
|
||||
|
||||
echo "Finished! pxeboot files can be found in ${PWD}."
|
||||
popd >/dev/null 2>&1 || true # don't care if these pops fail
|
||||
popd >/dev/null 2>&1 || true
|
||||
@@ -0,0 +1,33 @@
|
||||
#!ipxe
|
||||
# ─────────────────────────────────────────────────────────────────────────
|
||||
# Proxmox VE 9.2 install — pve1 (Intel NUC) → 192.168.10.4, target sdb
|
||||
#
|
||||
# The NUC's UEFI CANNOT unpack a ~1.8GB initramfs — it dies with
|
||||
# "initramfs unpacking failed: write error", leaving a TRUNCATED /proxmox.iso,
|
||||
# which then fails to loop-mount → "no device with valid ISO found".
|
||||
# (The ISO itself is fine and the HTTP transfer completes — verified in the
|
||||
# nginx log. RAM is fine too: 15881 MB. It's a firmware/early-boot limit.)
|
||||
#
|
||||
# So we DON'T ship the ISO in the initrd here. We boot only the kernel + a
|
||||
# lean initrd augmented with e1000e (the stock installer initrd has NO network
|
||||
# drivers at all). The ISO search fails, init drops to a debug shell, and you
|
||||
# run ONE command:
|
||||
#
|
||||
# sh /netfetch.sh
|
||||
#
|
||||
# which brings up the NIC, streams the ISO onto /dev/sda (the 1TB HDD), and
|
||||
# re-execs init — which then finds it via the normal block-device path and
|
||||
# auto-installs to sdb. Nothing oversized ever goes through initramfs.
|
||||
# ─────────────────────────────────────────────────────────────────────────
|
||||
echo
|
||||
echo Proxmox VE 9.2 — pve1 (NUC) network-staged install
|
||||
echo Loading kernel + net-enabled initrd (no ISO in initramfs)...
|
||||
echo
|
||||
echo ">>> At the debug shell that appears, type: sh /netfetch.sh"
|
||||
echo
|
||||
kernel http://192.168.10.127:8080/proxmox/linux26 ro ramdisk_size=16777216 rw quiet splash=silent proxmox-start-auto-installer
|
||||
initrd http://192.168.10.127:8080/proxmox/initrd-net.img
|
||||
boot || goto failed
|
||||
:failed
|
||||
echo Proxmox netboot failed. Dropping to shell.
|
||||
shell
|
||||
@@ -0,0 +1,16 @@
|
||||
#!ipxe
|
||||
# ─────────────────────────────────────────────────────────────────────────
|
||||
# Proxmox VE 9.2 AUTOMATED install — pve1 → 192.168.10.4 (target: sdb, the SATA SSD)
|
||||
# Same --pxe-style method: lean kernel + gzip initrd, then the answer-embedded
|
||||
# ISO as a second initrd (proxmox.iso). WIPES sdb (HDD sda untouched).
|
||||
# NOTE: pve1 is the SSH jump host / build box — reinstall it LAST.
|
||||
# ─────────────────────────────────────────────────────────────────────────
|
||||
echo
|
||||
echo Proxmox VE 9.2 AUTOMATED install: pve1 -> 192.168.10.4 (wipes sdb)
|
||||
kernel http://192.168.10.127:8080/proxmox/linux26 ro ramdisk_size=16777216 rw quiet splash=silent proxmox-start-auto-installer
|
||||
initrd http://192.168.10.127:8080/proxmox/initrd.img
|
||||
initrd http://192.168.10.127:8080/proxmox/prepared-pve1.iso proxmox.iso
|
||||
boot || goto failed
|
||||
:failed
|
||||
echo Proxmox netboot failed. Dropping to shell.
|
||||
shell
|
||||
@@ -0,0 +1,16 @@
|
||||
#!ipxe
|
||||
# ─────────────────────────────────────────────────────────────────────────
|
||||
# Proxmox VE 9.2 AUTOMATED install — pve2 → 192.168.10.7 (target: nvme0n1)
|
||||
# Same --pxe-style method as pve3: lean kernel + gzip initrd, then the
|
||||
# answer-embedded ISO as a second initrd (proxmox.iso). WIPES nvme0n1.
|
||||
# Reinstalling pve2 also vacates the contested 192.168.10.5.
|
||||
# ─────────────────────────────────────────────────────────────────────────
|
||||
echo
|
||||
echo Proxmox VE 9.2 AUTOMATED install: pve2 -> 192.168.10.7 (wipes nvme0n1)
|
||||
kernel http://192.168.10.127:8080/proxmox/linux26 ro ramdisk_size=16777216 rw quiet splash=silent proxmox-start-auto-installer
|
||||
initrd http://192.168.10.127:8080/proxmox/initrd.img
|
||||
initrd http://192.168.10.127:8080/proxmox/prepared-pve2.iso proxmox.iso
|
||||
boot || goto failed
|
||||
:failed
|
||||
echo Proxmox netboot failed. Dropping to shell.
|
||||
shell
|
||||
@@ -0,0 +1,19 @@
|
||||
#!ipxe
|
||||
# ─────────────────────────────────────────────────────────────────────────
|
||||
# Proxmox VE 9.2 AUTOMATED install — pve3 → 192.168.10.9 (target: nvme0n1)
|
||||
# Replicates the (unreleased) `proxmox-auto-install-assistant --pxe` method:
|
||||
# lean kernel + lean gzip initrd, then the answer-embedded ISO loaded as a
|
||||
# SECOND initrd named proxmox.iso (iPXE's native multi-initrd = correct cpio).
|
||||
# The installer finds /proxmox.iso, loop-mounts it, reads the embedded answer,
|
||||
# and installs unattended (proxmox-start-auto-installer). WIPES nvme0n1.
|
||||
# ─────────────────────────────────────────────────────────────────────────
|
||||
echo
|
||||
echo Proxmox VE 9.2 AUTOMATED install: pve3 -> 192.168.10.9 (wipes nvme0n1)
|
||||
echo Loading kernel + lean initrd + ISO (as proxmox.iso)...
|
||||
kernel http://192.168.10.127:8080/proxmox/linux26 ro ramdisk_size=16777216 rw quiet splash=silent proxmox-start-auto-installer
|
||||
initrd http://192.168.10.127:8080/proxmox/initrd.img
|
||||
initrd http://192.168.10.127:8080/proxmox/prepared-pve3.iso proxmox.iso
|
||||
boot || goto failed
|
||||
:failed
|
||||
echo Proxmox netboot failed. Dropping to shell.
|
||||
shell
|
||||
Reference in New Issue
Block a user