aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-01-23 23:58:07 -0600
committerCraig Jennings <c@cjennings.net>2026-01-23 23:58:07 -0600
commit322cdf56dc984aed4da7166ccfa1990e09445b08 (patch)
treeaa9a564296448477185f32f719bc07b1852e8a52 /scripts
parente6b958f97ecee9d7cd18c6c295e34c34bcdb8bba (diff)
downloadarchangel-322cdf56dc984aed4da7166ccfa1990e09445b08.tar.gz
archangel-322cdf56dc984aed4da7166ccfa1990e09445b08.zip
Fix btrfs bugs from VM testing
- Fix GRUB config path (remove GRUB_BTRFS_GRUB_DIRNAME, use default) - Create snapper config manually (D-Bus not available in chroot) - Create genesis snapshot with btrfs command (not snapper) - Add btrfs-single.conf test config - Update test-install.sh to copy lib/ directory - Update test-install.sh to handle btrfs verification VM test now passes for btrfs single-disk installation.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/test-configs/btrfs-single.conf13
-rwxr-xr-xscripts/test-install.sh66
2 files changed, 55 insertions, 24 deletions
diff --git a/scripts/test-configs/btrfs-single.conf b/scripts/test-configs/btrfs-single.conf
new file mode 100644
index 0000000..44b0f26
--- /dev/null
+++ b/scripts/test-configs/btrfs-single.conf
@@ -0,0 +1,13 @@
+# Test config: Btrfs single disk install
+
+HOSTNAME=test-btrfs
+TIMEZONE=UTC
+LOCALE=en_US.UTF-8
+KEYMAP=us
+
+FILESYSTEM=btrfs
+DISKS=/dev/vda
+
+ROOT_PASSWORD=testpass
+
+ENABLE_SSH=yes
diff --git a/scripts/test-install.sh b/scripts/test-install.sh
index de308f2..798c301 100755
--- a/scripts/test-install.sh
+++ b/scripts/test-install.sh
@@ -224,16 +224,18 @@ run_install() {
local config_name
config_name=$(basename "$config" .conf)
- # Copy latest install-archzfs script to VM (in case ISO is outdated)
+ # Copy latest archangel script and lib/ to VM (in case ISO is outdated)
sshpass -p "$SSH_PASSWORD" scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
- -P "$SSH_PORT" "$PROJECT_DIR/custom/install-archzfs" root@localhost:/usr/local/bin/install-archzfs 2>/dev/null
+ -P "$SSH_PORT" "$PROJECT_DIR/custom/archangel" root@localhost:/usr/local/bin/archangel 2>/dev/null
+ sshpass -p "$SSH_PASSWORD" scp -r -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
+ -P "$SSH_PORT" "$PROJECT_DIR/custom/lib" root@localhost:/usr/local/bin/ 2>/dev/null
# Copy config file to VM
sshpass -p "$SSH_PASSWORD" scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
-P "$SSH_PORT" "$config" root@localhost:/root/test.conf 2>/dev/null
# Run the installer (NO_ENCRYPT is set in the config file, not via flag)
- ssh_cmd "install-archzfs --config-file /root/test.conf" || return 1
+ ssh_cmd "archangel --config-file /root/test.conf" || return 1
return 0
}
@@ -242,45 +244,61 @@ run_install() {
verify_install() {
local config="$1"
local enable_ssh
+ local filesystem
enable_ssh=$(grep "^ENABLE_SSH=" "$config" | cut -d= -f2)
+ filesystem=$(grep "^FILESYSTEM=" "$config" | cut -d= -f2)
+ filesystem="${filesystem:-zfs}" # Default to ZFS
# Basic checks via SSH (if enabled)
if [[ "$enable_ssh" == "yes" ]]; then
- # Check if we can still SSH (install script reboots, so this won't work)
- # Instead, check the install log for success indicators
- if ssh_cmd "grep -q 'Installation complete' /tmp/install-archzfs-*.log 2>/dev/null"; then
+ # Check install log for success indicators
+ if ssh_cmd "grep -q 'Installation complete' /tmp/archangel-*.log 2>/dev/null"; then
info "Install log shows success"
else
warn "Could not verify install log"
fi
- # Check pool was created
- if ssh_cmd "zpool list zroot" >/dev/null 2>&1; then
- info "ZFS pool 'zroot' exists"
- else
- error "ZFS pool 'zroot' not found"
- return 1
- fi
-
- # Check genesis snapshot
- if ssh_cmd "zfs list -t snapshot | grep -q genesis"; then
- info "Genesis snapshot exists"
- else
- warn "Genesis snapshot not found (may not have completed)"
+ if [[ "$filesystem" == "zfs" ]]; then
+ # ZFS-specific checks
+ if ssh_cmd "zpool list zroot" >/dev/null 2>&1; then
+ info "ZFS pool 'zroot' exists"
+ else
+ error "ZFS pool 'zroot' not found"
+ return 1
+ fi
+
+ if ssh_cmd "zfs list -t snapshot | grep -q genesis"; then
+ info "ZFS genesis snapshot exists"
+ else
+ warn "ZFS genesis snapshot not found"
+ fi
+ elif [[ "$filesystem" == "btrfs" ]]; then
+ # Btrfs-specific checks
+ if ssh_cmd "btrfs subvolume list /mnt" >/dev/null 2>&1; then
+ info "Btrfs subvolumes exist"
+ else
+ error "Btrfs subvolumes not found"
+ return 1
+ fi
+
+ if ssh_cmd "arch-chroot /mnt snapper -c root list 2>/dev/null | grep -q genesis"; then
+ info "Btrfs genesis snapshot exists"
+ else
+ warn "Btrfs genesis snapshot not found"
+ fi
fi
- # Check Avahi mDNS packages installed on target system
+ # Check Avahi mDNS packages
if ssh_cmd "arch-chroot /mnt pacman -Q avahi nss-mdns >/dev/null 2>&1"; then
info "Avahi packages installed"
else
- warn "Avahi packages not found on installed system"
+ warn "Avahi packages not found"
fi
- # Check avahi-daemon enabled on target system
if ssh_cmd "arch-chroot /mnt systemctl is-enabled avahi-daemon >/dev/null 2>&1"; then
info "Avahi daemon enabled"
else
- warn "Avahi daemon not enabled on installed system"
+ warn "Avahi daemon not enabled"
fi
else
# For no-SSH tests, check serial console output
@@ -356,7 +374,7 @@ run_test() {
stop_vm "$config_name"
# Save logs
- ssh_cmd "cat /tmp/install-archzfs-*.log" > "$LOG_DIR/${config_name}-install.log" 2>/dev/null || true
+ ssh_cmd "cat /tmp/archangel-*.log" > "$LOG_DIR/${config_name}-install.log" 2>/dev/null || true
cp "$SERIAL_LOG" "$LOG_DIR/${config_name}-serial.log" 2>/dev/null || true
cleanup_disks "$config_name"