Skip to content

Commit

Permalink
Barebones QEMU test script, remove ultramarine user, set defautl ta…
Browse files Browse the repository at this point in the history
…rget to graphical to enable initial-setup-gui
  • Loading branch information
korewaChino committed May 19, 2024
1 parent 86046f3 commit 621f393
Show file tree
Hide file tree
Showing 17 changed files with 171 additions and 76 deletions.
12 changes: 6 additions & 6 deletions katsu/modules/base/base-disk-aarch64.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
builder: dnf
distro: Ultramarine Linux 40

users:
- username: ultramarine
# plaintext password: ultramarine
password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
groups:
- wheel
# users:
# - username: ultramarine
# # plaintext password: ultramarine
# password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
# groups:
# - wheel

import:
- base.yaml
Expand Down
12 changes: 6 additions & 6 deletions katsu/modules/base/base-disk-x86_64.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
builder: dnf
distro: Ultramarine Linux 40

users:
- username: ultramarine
# plaintext password: ultramarine
password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
groups:
- wheel
# users:
# - username: ultramarine
# # plaintext password: ultramarine
# password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
# groups:
# - wheel

import:
- base.yaml
Expand Down
6 changes: 6 additions & 0 deletions katsu/modules/base/base-disk.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
scripts:
post:
- id: initial-setup
name: Enable Initial Setup
file: initial-setup.sh
dnf:
releasever: 40
options:
Expand All @@ -8,6 +13,7 @@ dnf:
- fedora-release*
- generic-release*
packages:
- initial-setup-gui
- filesystem
- setup
- lvm2
Expand Down
3 changes: 3 additions & 0 deletions katsu/modules/base/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ scripts:
- id: buildstamp
name: Generate buildstamp
file: buildstamp.sh
- id: initial-setup
name: Enable Initial Setup
file: initial-setup.sh

dnf:
releasever: 40
Expand Down
3 changes: 0 additions & 3 deletions katsu/modules/base/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,3 @@ rm -f /etc/machine-id
touch /etc/machine-id

rm -f /var/lib/rpm/__db*
# Set up initial setup, might be redundant idk
systemctl enable initial-setup
touch /var/lib/gdm/run-initial-setup || true
8 changes: 8 additions & 0 deletions katsu/modules/base/initial-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
# Set up initial setup, might be redundant idk
systemctl enable initial-setup
touch /var/lib/gdm/run-initial-setup || true


# Set default target to graphical
systemctl set-default graphical.target
12 changes: 6 additions & 6 deletions katsu/modules/flagship/base-disk-aarch64.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
builder: dnf
distro: Ultramarine Linux 40 (Flagship Edition)

users:
- username: ultramarine
# plaintext password: ultramarine
password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
groups:
- wheel
# users:
# - username: ultramarine
# # plaintext password: ultramarine
# password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
# groups:
# - wheel

import:
- ../base/base.yaml
Expand Down
12 changes: 6 additions & 6 deletions katsu/modules/flagship/base-disk-x86_64.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
builder: dnf
distro: Ultramarine Linux 40 (Flagship Edition)

users:
- username: ultramarine
# plaintext password: ultramarine
password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
groups:
- wheel
# users:
# - username: ultramarine
# # plaintext password: ultramarine
# password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
# groups:
# - wheel

import:
- ../base/base.yaml
Expand Down
12 changes: 6 additions & 6 deletions katsu/modules/gnome/base-disk-aarch64.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
builder: dnf
distro: Ultramarine Linux 40 (GNOME Edition)

users:
- username: ultramarine
# plaintext password: ultramarine
password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
groups:
- wheel
# users:
# - username: ultramarine
# # plaintext password: ultramarine
# password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
# groups:
# - wheel

import:
- ../base/base.yaml
Expand Down
12 changes: 6 additions & 6 deletions katsu/modules/gnome/base-disk-x86_64.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
builder: dnf
distro: Ultramarine Linux 40 (GNOME Edition)

users:
- username: ultramarine
# plaintext password: ultramarine
password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
groups:
- wheel
# users:
# - username: ultramarine
# # plaintext password: ultramarine
# password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
# groups:
# - wheel

import:
- ../base/base.yaml
Expand Down
14 changes: 7 additions & 7 deletions katsu/modules/kde/base-disk-aarch64.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
builder: dnf
distro: Ultramarine Linux 40 (KDE Edition)

users:
- username: ultramarine
# plaintext password: ultramarine
password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
groups:
- wheel
# users:
# - username: ultramarine
# # plaintext password: ultramarine
# password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
# groups:
# - wheel

import:
- ../base/base.yaml
Expand Down Expand Up @@ -39,4 +39,4 @@ disk:

dnf:
releasever: 40
arch: aarch64
arch: aarch64
12 changes: 6 additions & 6 deletions katsu/modules/kde/base-disk-x86_64.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
builder: dnf
distro: Ultramarine Linux 40 (KDE Edition)

users:
- username: ultramarine
# plaintext password: ultramarine
password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
groups:
- wheel
# users:
# - username: ultramarine
# # plaintext password: ultramarine
# password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
# groups:
# - wheel

import:
- ../base/base.yaml
Expand Down
12 changes: 6 additions & 6 deletions katsu/modules/pantheon/base-disk-aarch64.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
builder: dnf
distro: Ultramarine Linux 40 (Pantheon Edition)

users:
- username: ultramarine
# plaintext password: ultramarine
password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
groups:
- wheel
# users:
# - username: ultramarine
# # plaintext password: ultramarine
# password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
# groups:
# - wheel

import:
- ../base/base.yaml
Expand Down
12 changes: 6 additions & 6 deletions katsu/modules/pantheon/base-disk-x86_64.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
builder: dnf
distro: Ultramarine Linux 40 (Pantheon Edition)

users:
- username: ultramarine
# plaintext password: ultramarine
password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
groups:
- wheel
# users:
# - username: ultramarine
# # plaintext password: ultramarine
# password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
# groups:
# - wheel

import:
- ../base/base.yaml
Expand Down
12 changes: 6 additions & 6 deletions katsu/modules/xfce/base-disk-aarch64.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
builder: dnf
distro: Ultramarine Linux 40 (Xfce Edition)

users:
- username: ultramarine
# plaintext password: ultramarine
password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
groups:
- wheel
# users:
# - username: ultramarine
# # plaintext password: ultramarine
# password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
# groups:
# - wheel

import:
- ../base/base.yaml
Expand Down
12 changes: 6 additions & 6 deletions katsu/modules/xfce/base-disk-x86_64.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
builder: dnf
distro: Ultramarine Linux 40 (Xfce Edition)

users:
- username: ultramarine
# plaintext password: ultramarine
password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
groups:
- wheel
# users:
# - username: ultramarine
# # plaintext password: ultramarine
# password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
# groups:
# - wheel

import:
- ../base/base.yaml
Expand Down
81 changes: 81 additions & 0 deletions test.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/usr/bin/env fish

set fish_trace 1

# This script is used to aid in testing Katsu builds. It will help you quickly set up a VM test environment so
# you can manually test builds. This script shouldn't be used in prod and is meant
# for development only.


# Variables for test environment
set KATSU_BIN "katsu"

# Directory for test data
set TEST_HOME (pwd)/.test

# katsu-work
set KATSU_WORK (pwd)/katsu-work

# Get testing mode from second argument
# Can be `qemu` or `wipe`
function get_mode
if test (count $argv) -eq 0
echo "qemu-disk"
else
echo $argv[1]
end
end

set -x SCRIPT_MODE (get_mode $argv)

function find_iso
set iso_path (find $KATSU_WORK -name "*.iso" | head -n 1)
if test -z $iso_path
echo "No ISO found in $KATSU_WORK"
exit 1
end
echo $iso_path
end

function _qemu_arg_1
if test $SCRIPT_MODE = "qemu-disk"
echo "-drive"
else
echo "-cdrom"
end
end
set KATSU_IMG_PATH "$KATSU_WORK/image/katsu.img"
function _qemu_arg_2
if test $SCRIPT_MODE = "qemu-disk"
echo "file=$KATSU_IMG_PATH,format=raw,if=virtio"
else
echo (find_iso)
end
end

# Quickly get the absolute path of a file
function abs_path
echo (realpath $argv)
end


# Create a test directory
mkdir -p $TEST_HOME



sudo chown $USER $KATSU_IMG_PATH

qemu-kvm -display gtk \
-machine type=q35,accel=kvm \
-cpu host \
-smp 4 \
-m 4G \
-enable-kvm \
-device virtio-net,netdev=vmnic -netdev user,id=vmnic \
-bios /usr/share/OVMF/OVMF_CODE.fd \
(_qemu_arg_1) (_qemu_arg_2)




0 comments on commit 621f393

Please sign in to comment.