fix(installer): add logging to guided installer and fix NVMe partition naming
- Add full session logging (tee to logfile) to archbaseos-guided-install.sh, matching the pattern already in arch-autoinstall.sh; copy log to /mnt/boot/ at the end so it survives into the new system - Add part() helper to both installers so NVMe/eMMC drives use the correct 'p' separator (e.g. /dev/nvme0n1p1 instead of the broken /dev/nvme0n11) - Add disk size guard to arch-autoinstall.sh: fail early with a clear message if ROOT_GIB would be < 8GiB instead of passing a nonsense value to parted Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>main
parent
95617dd673
commit
319af7bde7
|
|
@ -49,6 +49,8 @@ get_mac_suffix() {
|
||||||
printf '%s' "${mac//:/}"
|
printf '%s' "${mac//:/}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
part() { [[ "$1" == *nvme* || "$1" == *mmcblk* ]] && echo "${1}p${2}" || echo "${1}${2}"; }
|
||||||
|
|
||||||
if $AF_MODE; then
|
if $AF_MODE; then
|
||||||
echo "Answerfile detected: $ANSWERFILE"
|
echo "Answerfile detected: $ANSWERFILE"
|
||||||
# Ensure jq is available
|
# Ensure jq is available
|
||||||
|
|
@ -165,6 +167,10 @@ SWAP_SIZE="${RAM_GB}GiB"
|
||||||
DISK_SIZE=$(lsblk -b -dn -o SIZE "$DRIVE")
|
DISK_SIZE=$(lsblk -b -dn -o SIZE "$DRIVE")
|
||||||
DISK_GIB=$((DISK_SIZE / 1024 / 1024 / 1024))
|
DISK_GIB=$((DISK_SIZE / 1024 / 1024 / 1024))
|
||||||
ROOT_GIB=$((DISK_GIB - RAM_GB - 15))
|
ROOT_GIB=$((DISK_GIB - RAM_GB - 15))
|
||||||
|
if (( ROOT_GIB < 8 )); then
|
||||||
|
echo "ERROR: Not enough disk space. Root would be only ${ROOT_GIB}GiB (need ≥8GiB)."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Partition plan:"
|
echo "Partition plan:"
|
||||||
echo " Boot: ${BOOT_SIZE}"
|
echo " Boot: ${BOOT_SIZE}"
|
||||||
|
|
@ -180,9 +186,9 @@ parted "$DRIVE" --script mklabel gpt \
|
||||||
mkpart ROOT 15GiB "$((15 + ROOT_GIB))"GiB \
|
mkpart ROOT 15GiB "$((15 + ROOT_GIB))"GiB \
|
||||||
mkpart SWAP "$((15 + ROOT_GIB))"GiB 100%
|
mkpart SWAP "$((15 + ROOT_GIB))"GiB 100%
|
||||||
|
|
||||||
BOOT_PART="${DRIVE}1"
|
BOOT_PART=$(part "$DRIVE" 1)
|
||||||
ROOT_PART="${DRIVE}2"
|
ROOT_PART=$(part "$DRIVE" 2)
|
||||||
SWAP_PART="${DRIVE}3"
|
SWAP_PART=$(part "$DRIVE" 3)
|
||||||
|
|
||||||
############################################
|
############################################
|
||||||
# FORMAT BOOT + SWAP
|
# FORMAT BOOT + SWAP
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,19 @@
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
############################################
|
||||||
|
# LOGGING
|
||||||
|
############################################
|
||||||
|
LOGFILE="$HOME/archbaseos-guided-install.log"
|
||||||
|
{
|
||||||
|
echo
|
||||||
|
echo "############################################"
|
||||||
|
echo " Arch Guided Install Log - Started $(date)"
|
||||||
|
echo "############################################"
|
||||||
|
echo
|
||||||
|
} >> "$LOGFILE"
|
||||||
|
exec > >(tee -a "$LOGFILE") 2>&1
|
||||||
|
|
||||||
############################################
|
############################################
|
||||||
# Helper Functions
|
# Helper Functions
|
||||||
############################################
|
############################################
|
||||||
|
|
@ -27,6 +40,10 @@ pause() {
|
||||||
read -rp "Press ENTER to continue..."
|
read -rp "Press ENTER to continue..."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Returns the correct partition device for a given drive and partition number.
|
||||||
|
# NVMe and eMMC use a 'p' separator (e.g. /dev/nvme0n1p1), others don't.
|
||||||
|
part() { [[ "$1" == *nvme* || "$1" == *mmcblk* ]] && echo "${1}p${2}" || echo "${1}${2}"; }
|
||||||
|
|
||||||
############################################
|
############################################
|
||||||
# ANSWERFILE
|
# ANSWERFILE
|
||||||
############################################
|
############################################
|
||||||
|
|
@ -157,9 +174,9 @@ parted -s "$DRIVE" mklabel gpt \
|
||||||
mkpart ROOT "${EFI_SIZE}GiB" "$((EFI_SIZE + ROOT_SIZE))GiB" \
|
mkpart ROOT "${EFI_SIZE}GiB" "$((EFI_SIZE + ROOT_SIZE))GiB" \
|
||||||
mkpart SWAP "$((EFI_SIZE + ROOT_SIZE))GiB" 100%
|
mkpart SWAP "$((EFI_SIZE + ROOT_SIZE))GiB" 100%
|
||||||
|
|
||||||
EFI_PART="${DRIVE}1"
|
EFI_PART=$(part "$DRIVE" 1)
|
||||||
ROOT_PART="${DRIVE}2"
|
ROOT_PART=$(part "$DRIVE" 2)
|
||||||
SWAP_PART="${DRIVE}3"
|
SWAP_PART=$(part "$DRIVE" 3)
|
||||||
|
|
||||||
mkfs.fat -F32 "$EFI_PART"
|
mkfs.fat -F32 "$EFI_PART"
|
||||||
mkswap "$SWAP_PART"
|
mkswap "$SWAP_PART"
|
||||||
|
|
@ -359,7 +376,9 @@ if $AF_MODE && [[ -f /mnt/answerfile.json ]]; then
|
||||||
rm -f /mnt/answerfile.json
|
rm -f /mnt/answerfile.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Installation complete!"
|
cp "$LOGFILE" /mnt/boot/ 2>/dev/null || true
|
||||||
|
|
||||||
|
echo "Installation complete! Log saved to /mnt/boot/$(basename "$LOGFILE")"
|
||||||
echo " umount -R /mnt && reboot"
|
echo " umount -R /mnt && reboot"
|
||||||
if [[ "${_DO_TUI^^}" != "YES" ]]; then
|
if [[ "${_DO_TUI^^}" != "YES" ]]; then
|
||||||
echo
|
echo
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue