Compare commits

...

2 commits

Author SHA1 Message Date
8382174219
custom kernel
Some checks failed
ci/woodpecker/push/build Pipeline failed
2025-04-15 00:16:53 +02:00
84dad2bcaa
⚗️ automated testing 2025-04-15 00:16:46 +02:00
5 changed files with 47 additions and 2 deletions

View file

@ -57,6 +57,9 @@ pkg = [
"micro"
]
# Custom kernel
kernel = "linux-lts"
# Enable virtualization
virtualization = true

View file

@ -59,6 +59,8 @@ pub struct PackageConfig {
pub virtualization: Option<bool>,
/// Enable docker
pub docker: Option<bool>,
/// Custom kernel package
pub kernel: Option<String>,
}
#[derive(Debug, Clone, Deserialize)]

View file

@ -48,9 +48,7 @@ pub fn pacstrap(conf: &PackageConfig) {
"-K",
"/mnt",
"base",
"linux",
"linux-firmware",
"linux-headers",
"git",
"networkmanager",
"nano",
@ -61,6 +59,11 @@ pub fn pacstrap(conf: &PackageConfig) {
"plymouth",
];
let linux_kernel = "linux".to_string();
let kernel = conf.kernel.as_ref().unwrap_or(&linux_kernel);
let headers = format!("{kernel}-headers");
cmd.extend(&[kernel.as_str(), headers.as_str()]);
#[cfg(target_arch = "aarch64")]
{
cmd.extend(&["archlinuxarm-keyring"]);

15
test/min.toml Normal file
View file

@ -0,0 +1,15 @@
[drive]
disk = "/dev/vda"
[general]
mode = "Base"
locale = "de_DE.UTF-8"
keyboard_layout = "de"
keyboard_variant = "mac"
timezone = "Europe/Berlin"
hostname = "navos_min"
root_password = "root"
firewall = false
[pkg]
pkg = []

22
test/test.sh Normal file
View file

@ -0,0 +1,22 @@
function test_config() {
echo "Testing $1"
mkdir "${1%.*}"
cd "${1%.*}"
echo "Creating ISO"
doas navinstall create-iso --install "../$1"
mv -v *.iso nav.iso
echo "Starting QEMU"
qemu-img create -f qcow2 disk.qcow2 16G
qemu-system-x86_64 -m 4G \
-drive file=$(pwd)/disk.qcow2,if=virtio,format=qcow2 \
-drive file=$(pwd)/nav.iso,media=cdrom,if=virtio,id=raw \
-boot d -cpu host -enable-kvm -smp 4 -display sdl \
-bios /usr/share/ovmf/x64/OVMF.4m.fd -machine q35,accel=kvm
cd ..
echo "Cleaning up test env"
doas rm -rv "${1%.*}"
}