Testing
This document shows a list of test cases that can be used to check the correctness of the environment.
Manual environment installation
Boot into Athena Live Environment by using Athena ISO.
Create the needed partitions.
sudo -i
parted /dev/sda -- mklabel gptparted /dev/sda -- mkpart ESP fat32 1MiB 512MiBparted /dev/sda -- set 1 esp onparted /dev/sda -- mkpart swap linux-swap 512MiB 8GBparted /dev/sda -- mkpart primary 8GB 100%
parted /dev/sda -- mklabel msdosparted /dev/sda -- mkpart primary 1MiB 512MiBparted /dev/sda -- mkpart primary linux-swap 512MiB 8GBparted /dev/sda -- mkpart primary 8GB 100%parted /dev/sda -- set 1 boot on
The created partitions are:
- /dev/sda1 -> Boot partition
- /dev/sda2 -> Swap partition
- /dev/sda3 -> Root partition
Format the partitions:
mkfs.btrfs -L arch /dev/sda3mount /dev/disk/by-label/arch /mnt
cryptsetup -y -v luksFormat /dev/sda3cryptsetup open /dev/sda3 cryptedmkfs.btrfs -L arch /dev/mapper/cryptedmount /dev/mapper/crypted /mnt
Format the boot partition:
mkfs.fat -F 32 -n BOOT /dev/sda1
mkfs.ext4 /dev/sda1
and mount it:
mount --mkdir /dev/sda1 /mnt/boot
Format the swap partition
mkswap -L swap /dev/sda2swapon /dev/sda2
If you need to test the deployment of an Arch environment, please follow the Arch Installation section, otherwise, for Nix environment, follow the Nix Installation section.
Minimal Arch Installation
Now proceed to the minimal Arch installation:
pacman-key --initpacman-key --populatepacstrap /mnt basegenfstab -U /mnt >> /mnt/etc/fstab
Now, take the UUID of the root partition (i.e., sda3) that will be used later:
lsblk -no name,uuid
and you will get:
sda|-sda1 733f5e5e-e53e-48aa-b975-3176e685c199|-sda2 2c29bffd-a015-4485-9571-72fb1c5102f8`-sda3 7ab2a484-95a8-4ded-b483-b0bf086c7e41 `-crypted 506a895e-2e87-4955-ba47-8c25029b994d
Enter in the mounted partition by arch-chroot
:
arch-chroot /mnt
pacman -S nano mkinitcpio linux-lts linux-lts-headers grub efibootmgr
pacman -S nano mkinitcpio linux-lts linux-lts-headers grub
Then, edit /etc/default/grub
and add the rd.luks.name
to GRUB_CMDLINE_LINUX_DEFAULT
as:
GRUB_CMDLINE_LINUX_DEFAULT="rd.luks.name=7ab2a484-95a8-4ded-b483-b0bf086c7e41=crypted root=/dev/mapper/crypted loglevel=3 quiet"
Save it and run:
echo "en_US.UTF-8 UTF-8" > /etc/locale.genlocale-genecho "LANG=en_US.UTF-8" > /etc/locale.confln -sf /usr/share/zoneinfo/Europe/Zurich /etc/localtimeecho "athenaos" > /etc/hostnameecho "KEYMAP=us" > /etc/vconsole.conf
Edit /etc/mkinitcpio.conf
and edit HOOKS
as:
HOOKS=(base systemd autodetect modconf kms keyboard sd-vconsole sd-encrypt block filesystems fsck)
Save it and run:
mkinitcpio -Psed -i "s/#GRUB_ENABLE_CRYPTODISK=.*/GRUB_ENABLE_CRYPTODISK=y/g" /etc/default/grub
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
grub-install --target=i386-pc --recheck --boot-directory=/boot /dev/sda
grub-mkconfig -o /boot/grub/grub.cfgpasswdexitumount -R /mntreboot
Nix Installation
Add Nix channels as:
nix-channel --add https://nixos.org/channels/nixos-unstable nixpkgsnix-channel --update
Then, generate the hardware configuration and get the Athena Nix configuration:
mkdir -p /mnt/etc/nixosnix-shell -p nixos-install-tools --command "nixos-generate-config --root /mnt"curl -o /tmp/athena-nix.zip https://codeload.github.com/Athena-OS/athena-nix/zip/refs/heads/mainunzip /tmp/athena-nix.zip -d /tmp/cp -rf /tmp/athena-nix-main/nixos/home-manager /tmp/athena-nix-main/nixos/hosts /tmp/athena-nix-main/nixos/modules /tmp/athena-nix-main/nixos/pkgs /tmp/athena-nix-main/nixos/users /tmp/athena-nix-main/nixos/configuration.nix /tmp/athena-nix-main/nixos/default.nix /mnt/etc/nixos/sed -i "s/\/etc\/nixos\/hardware-configuration.nix/.\/hardware-configuration.nix/g" /mnt/etc/nixos/configuration.nix
If you are in a GRUB BIOS/Legacy environment, run:
sed -i "s/bootloader = \"systemd\"/bootloader = \"grub\"/g" /mnt/etc/nixos/configuration.nix
Finally, run the Athena Nix installation:
nix-shell -p nixos-install-tools --run "nixos-install --no-root-password --cores 2 --max-jobs 16 --keep-going"