From 5eefcb24f2742ccd85fe44ec25f5831951a48550 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 5 Nov 2024 17:47:45 +0100 Subject: [PATCH] Add a script for testing the Arch installation --- scripts/test/arch-install.fish | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 scripts/test/arch-install.fish diff --git a/scripts/test/arch-install.fish b/scripts/test/arch-install.fish new file mode 100755 index 00000000..fdcaed80 --- /dev/null +++ b/scripts/test/arch-install.fish @@ -0,0 +1,28 @@ +#!/bin/env fish +set -l dir (status dirname) +set -l container valhalla-test +set -l containerDir "/var/lib/lxc/$container" +set -l valhallaRoot "opt/PortValhalla" +sudo lxc-stop "$container" +sudo lxc-destroy "$container" +sudo lxc-create "$container" -t download -- --dist archlinux --release current --arch amd64 +sudo mkdir -p "$containerDir/rootfs/$valhallaRoot" + +begin + printf "%s\n" \ + "# For docker" \ + "lxc.apparmor.profile = unconfined" \ + "" \ + "# Shared Folder" \ + "lxc.mount.entry = $(realpath "$dir/../..") $valhallaRoot none bind 0 0" +end | sudo tee -a "$containerDir/config" > /dev/null + +sudo lxc-start "$container" + +while not sudo lxc-attach "$container" -- ping -q -c1 5.9.164.112 &>/dev/null + sleep .1 +end + +sudo lxc-attach "$container" -- systemctl start systemd-networkd-wait-online.service +sudo lxc-attach "$container" -- pacman --noconfirm -Syu fish +sudo lxc-attach "$container" -- "/$valhallaRoot/scripts/arch-install.fish"