Compare commits
2 Commits
8bac02357c
...
4eff9d7e22
| Author | SHA1 | Date | |
|---|---|---|---|
| 4eff9d7e22 | |||
| 7bfab2ac5b |
@@ -233,19 +233,31 @@ class InstallerWindow(Adw.ApplicationWindow):
|
||||
|
||||
finish_page = Adw.StatusPage()
|
||||
finish_page.set_title(message)
|
||||
|
||||
btn = Gtk.Button()
|
||||
btn.set_halign(Gtk.Align.CENTER)
|
||||
|
||||
if success:
|
||||
finish_page.set_icon_name("emblem-ok-symbolic")
|
||||
finish_page.set_description("You can now restart your computer.")
|
||||
btn_label = "Restart"
|
||||
btn.set_label("Restart System")
|
||||
btn.add_css_class("suggested-action")
|
||||
btn.add_css_class("pill")
|
||||
|
||||
def on_restart(b):
|
||||
import subprocess
|
||||
try:
|
||||
subprocess.run(["systemctl", "reboot"])
|
||||
except Exception as e:
|
||||
print(f"Failed to reboot: {e}")
|
||||
self.close()
|
||||
|
||||
btn.connect("clicked", on_restart)
|
||||
else:
|
||||
finish_page.set_icon_name("dialog-error-symbolic")
|
||||
finish_page.set_description("An error occurred during installation.")
|
||||
btn_label = "Close"
|
||||
|
||||
btn = Gtk.Button(label=btn_label)
|
||||
btn.set_halign(Gtk.Align.CENTER)
|
||||
btn.add_css_class("suggested-action")
|
||||
btn.connect("clicked", lambda b: self.close())
|
||||
btn.set_label("Close Installer")
|
||||
btn.connect("clicked", lambda b: self.close())
|
||||
|
||||
finish_page.set_child(btn)
|
||||
|
||||
|
||||
40
run_vm_uefi.sh
Executable file
40
run_vm_uefi.sh
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Configuration
|
||||
ISO_PATH="${1:-/home/n0va/Downloads/Fedora-Workstation-Live-43-1.6.x86_64.iso}"
|
||||
DISK_PATH="${2:-/home/n0va/.local/share/iridium-installer-vm/test-disk.qcow2}"
|
||||
OVMF_CODE="/usr/share/edk2/x64/OVMF_CODE.4m.fd"
|
||||
OVMF_VARS_TEMPLATE="/usr/share/edk2/x64/OVMF_VARS.4m.fd"
|
||||
OVMF_VARS_LOCAL="/tmp/iridium_vm_vars.fd"
|
||||
|
||||
# Ensure OVMF vars exist
|
||||
if [ ! -f "$OVMF_VARS_LOCAL" ]; then
|
||||
if [ -f "$OVMF_VARS_TEMPLATE" ]; then
|
||||
cp "$OVMF_VARS_TEMPLATE" "$OVMF_VARS_LOCAL"
|
||||
else
|
||||
echo "Warning: OVMF VARS template not found at $OVMF_VARS_TEMPLATE"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Starting Iridium VM with UEFI support..."
|
||||
echo "ISO: $ISO_PATH"
|
||||
echo "Disk: $DISK_PATH"
|
||||
|
||||
# QEMU Command with UEFI (OVMF) enabled
|
||||
qemu-system-x86_64 \
|
||||
-enable-kvm \
|
||||
-m 4G \
|
||||
-smp 2 \
|
||||
-cpu host \
|
||||
-drive if=pflash,format=raw,readonly=on,file="$OVMF_CODE" \
|
||||
-drive if=pflash,format=raw,file="$OVMF_VARS_LOCAL" \
|
||||
-drive file="$DISK_PATH",format=qcow2,if=virtio \
|
||||
-cdrom "$ISO_PATH" \
|
||||
-boot once=d \
|
||||
-netdev user,id=net0 \
|
||||
-device virtio-net-pci,netdev=net0 \
|
||||
-vga virtio \
|
||||
-display gtk,gl=on \
|
||||
-monitor unix:$HOME/.local/share/iridium-installer-vm/monitor.sock,server,nowait \
|
||||
-name "Iridium Installer Test VM (UEFI)" \
|
||||
# -loadvm clean-state
|
||||
19
take_snapshot.sh
Executable file
19
take_snapshot.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
SOCKET="$HOME/.local/share/iridium-installer-vm/monitor.sock"
|
||||
SNAPSHOT_NAME="${1:-clean-state}"
|
||||
|
||||
if [ ! -S "$SOCKET" ]; then
|
||||
echo "Error: QEMU monitor socket not found at $SOCKET"
|
||||
echo "Is the VM running?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Taking snapshot: $SNAPSHOT_NAME"
|
||||
echo "savevm $SNAPSHOT_NAME" | nc -U "$SOCKET"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Snapshot command sent successfully."
|
||||
else
|
||||
echo "Failed to send snapshot command. Ensure 'nc' (netcat) with -U support is installed."
|
||||
fi
|
||||
Reference in New Issue
Block a user