Compare commits
2 commits
8c9db904df
...
8382174219
Author | SHA1 | Date | |
---|---|---|---|
8382174219 | |||
84dad2bcaa |
5 changed files with 47 additions and 2 deletions
|
@ -57,6 +57,9 @@ pkg = [
|
|||
"micro"
|
||||
]
|
||||
|
||||
# Custom kernel
|
||||
kernel = "linux-lts"
|
||||
|
||||
# Enable virtualization
|
||||
virtualization = true
|
||||
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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
15
test/min.toml
Normal 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
22
test/test.sh
Normal 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%.*}"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue