Autoinstall from a cidata drive instead of the configurator
Look for a drive labeled cidata at startup. If it carries the configurator's own output files, copy them into /root and skip the wizard -- everything downstream then runs the ordinary path against ordinary inputs. No drive, no change. The required pair matches what the orchestrator treats as mandatory, so a drive with less than that falls back to the wizard rather than failing the boot. Claude-Session: https://claude.ai/code/session_01Sy3HeoBqb13ahLuaiP2UkM
This commit is contained in:
1 parent
f5aa88b06c
commit
a4ec97d174
2 files changed
+41
-2
No files matched your search
@@ -90,8 +90,45 @@ warm_offline_mirror &
|
||||
warm_pid=$!
|
||||
trap 'kill "$warm_pid" 2>/dev/null' EXIT
|
||||
|
||||
# Autoinstall: a drive labeled cidata (the cloud-init NoCloud label, so Proxmox,
|
||||
# libvirt and Packer all know how to attach one) carrying the configurator's own
|
||||
# output stands in for the wizard. Copy those files into /root and everything
|
||||
# downstream runs the ordinary path against ordinary inputs.
|
||||
#
|
||||
# The required pair is the same one the orchestrator treats as mandatory; the
|
||||
# rest are optional there too, so don't be stricter here. Anything less than the
|
||||
# pair means this isn't an autoinstall drive, and we fall back to the wizard.
|
||||
load_cidata() {
|
||||
local device="" label mnt=/run/cidata
|
||||
|
||||
for label in cidata CIDATA; do
|
||||
[[ -e /dev/disk/by-label/$label ]] && { device=/dev/disk/by-label/$label; break; }
|
||||
done
|
||||
[[ -n $device ]] || return 1
|
||||
|
||||
mkdir -p "$mnt"
|
||||
mount -o ro "$device" "$mnt" || return 1
|
||||
|
||||
if [[ -f $mnt/user_configuration.json && -f $mnt/user_credentials.json ]]; then
|
||||
cp "$mnt"/user_configuration.json "$mnt"/user_credentials.json /root/
|
||||
for file in user_full_name.txt user_email_address.txt user_encrypt_installation.txt ssh.json; do
|
||||
[[ -f $mnt/$file ]] && cp "$mnt/$file" /root/
|
||||
done
|
||||
umount "$mnt"
|
||||
return 0
|
||||
fi
|
||||
|
||||
umount "$mnt"
|
||||
return 1
|
||||
}
|
||||
|
||||
cd /root
|
||||
./configurator
|
||||
if load_cidata; then
|
||||
echo "Autoinstall configuration found on cidata drive; skipping the configurator."
|
||||
export OMARCHY_UI_INTERACTIVE=no
|
||||
else
|
||||
./configurator
|
||||
fi
|
||||
|
||||
# The foreground dashboard is now the sole visible install UI owner. It starts
|
||||
# the actual installer as a non-interactive child, logs child output, waits for
|
||||
@@ -107,4 +144,5 @@ rm -f /run/omarchy-install/state.json
|
||||
--creds /root/user_credentials.json \
|
||||
--full-name-file /root/user_full_name.txt \
|
||||
--email-file /root/user_email_address.txt \
|
||||
--encrypt-file /root/user_encrypt_installation.txt
|
||||
--encrypt-file /root/user_encrypt_installation.txt \
|
||||
--ssh-keys-file /root/ssh.json
|
||||
@@ -16,6 +16,7 @@ while [[ $# -gt 0 ]]; do
|
||||
--full-name-file) export OMARCHY_INSTALL_FULL_NAME_FILE="$2"; shift 2 ;;
|
||||
--email-file) export OMARCHY_INSTALL_EMAIL_FILE="$2"; shift 2 ;;
|
||||
--encrypt-file) export OMARCHY_INSTALL_ENCRYPT_FILE="$2"; shift 2 ;;
|
||||
--ssh-keys-file) export OMARCHY_INSTALL_SSH_KEYS_FILE="$2"; shift 2 ;;
|
||||
*) echo "omarchy-iso-install: unknown arg $1" >&2; exit 2 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
Reference in new issue
Block a user