diff options
| -rwxr-xr-x | build.sh | 14 | ||||
| -rwxr-xr-x | custom/install-archzfs | 21 | ||||
| -rwxr-xr-x | scripts/test-vm.sh | 13 |
3 files changed, 46 insertions, 2 deletions
@@ -130,9 +130,21 @@ fzf dialog EOF +# Get kernel version for ISO naming +info "Querying kernel version..." +KERNEL_VER=$(pacman -Si linux-lts 2>/dev/null | grep "^Version" | awk '{print $3}' | cut -d- -f1) +if [[ -z "$KERNEL_VER" ]]; then + KERNEL_VER="unknown" + warn "Could not determine kernel version, using 'unknown'" +fi +info "LTS Kernel version: $KERNEL_VER" + # Update profiledef.sh with our ISO name info "Updating ISO metadata..." -sed -i 's/^iso_name=.*/iso_name="archzfs-claude"/' "$PROFILE_DIR/profiledef.sh" +# Format: archzfs-vmlinuz-6.12.65-lts-2026-01-18-x86_64.iso +ISO_DATE=$(date +%Y-%m-%d) +sed -i "s/^iso_name=.*/iso_name=\"archzfs-vmlinuz-${KERNEL_VER}-lts\"/" "$PROFILE_DIR/profiledef.sh" +sed -i "s/^iso_version=.*/iso_version=\"${ISO_DATE}\"/" "$PROFILE_DIR/profiledef.sh" # Create airootfs directories mkdir -p "$PROFILE_DIR/airootfs/usr/local/bin" diff --git a/custom/install-archzfs b/custom/install-archzfs index 6b62d90..dfba090 100755 --- a/custom/install-archzfs +++ b/custom/install-archzfs @@ -949,6 +949,25 @@ configure_initramfs() { # ZFS doesn't use fsck - remove it to avoid confusing error messages sed -i 's/^HOOKS=.*/HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block zfs filesystems)/' /mnt/etc/mkinitcpio.conf + # Get the installed kernel version (not the running kernel) + local kernel_ver + kernel_ver=$(ls /mnt/usr/lib/modules | grep lts | head -1) + if [[ -z "$kernel_ver" ]]; then + error "Could not find LTS kernel modules" + fi + info "Installed kernel: $kernel_ver" + + # Ensure kernel module dependencies are up to date after DKMS build + # Must specify kernel version since running kernel differs from installed kernel + info "Updating module dependencies..." + arch-chroot /mnt depmod "$kernel_ver" + + # Verify ZFS module exists + if ! [[ -f "/mnt/usr/lib/modules/$kernel_ver/updates/dkms/zfs.ko.zst" ]]; then + error "ZFS module not found! DKMS build may have failed." + fi + info "ZFS module verified for kernel $kernel_ver" + info "Regenerating initramfs..." arch-chroot /mnt mkinitcpio -P } @@ -966,7 +985,7 @@ GRUB_DEFAULT=0 GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR="Arch Linux (ZFS)" GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3" -GRUB_CMDLINE_LINUX="root=ZFS=$POOL_NAME/ROOT/default spl.spl_hostid=$host_id" +GRUB_CMDLINE_LINUX="root=ZFS=$POOL_NAME/ROOT/default spl.spl_hostid=0x$host_id" GRUB_PRELOAD_MODULES="part_gpt part_msdos zfs" GRUB_TERMINAL_OUTPUT="console" GRUB_DISABLE_OS_PROBER=true diff --git a/scripts/test-vm.sh b/scripts/test-vm.sh index c5ff5e8..4c56570 100755 --- a/scripts/test-vm.sh +++ b/scripts/test-vm.sh @@ -29,6 +29,9 @@ OVMF_CODE="/usr/share/edk2/x64/OVMF_CODE.4m.fd" OVMF_VARS_ORIG="/usr/share/edk2/x64/OVMF_VARS.4m.fd" OVMF_VARS="$VM_DIR/OVMF_VARS.fd" +# QEMU monitor socket for automation +MONITOR_SOCKET="$VM_DIR/qemu-monitor.sock" + # Colors RED='\033[0;31m' GREEN='\033[0;32m' @@ -138,8 +141,12 @@ boot_iso() { echo " - Serial console output appears in this terminal" echo " - SSH: ssh -p 2222 root@localhost (password: archzfs)" echo " - Run 'install-archzfs' to start installation" + echo " - Monitor socket: $MONITOR_SOCKET" echo "" + # Remove stale monitor socket + rm -f "$MONITOR_SOCKET" + # Build disk arguments local disk_args=(-drive "file=$VM_DISK,format=qcow2,if=virtio") if [[ "$MULTI_DISK" == true ]]; then @@ -165,6 +172,7 @@ boot_iso() { -device virtio-vga-gl \ -display gtk,gl=on \ -serial mon:stdio \ + -monitor unix:"$MONITOR_SOCKET",server,nowait \ -audiodev pipewire,id=audio0 \ -device ich9-intel-hda \ -device hda-duplex,audiodev=audio0 \ @@ -194,8 +202,12 @@ boot_disk() { echo "" echo "SSH access: ssh -p 2222 root@localhost" echo "Serial console output appears in this terminal" + echo "Monitor socket: $MONITOR_SOCKET" echo "" + # Remove stale monitor socket + rm -f "$MONITOR_SOCKET" + # Build disk arguments local disk_args=(-drive "file=$VM_DISK,format=qcow2,if=virtio") if [[ "$MULTI_DISK" == true ]]; then @@ -220,6 +232,7 @@ boot_disk() { -device virtio-vga-gl \ -display gtk,gl=on \ -serial mon:stdio \ + -monitor unix:"$MONITOR_SOCKET",server,nowait \ -audiodev pipewire,id=audio0 \ -device ich9-intel-hda \ -device hda-duplex,audiodev=audio0 \ |
