install_incus

This commit is contained in:
Milan Meduna 2024-12-17 11:40:44 +00:00
parent 152009fe6d
commit 9f9482c22e

View file

@ -49,12 +49,39 @@ zfs create crypt/lxd
zfs create crypt/lxd/dir zfs create crypt/lxd/dir
zfs create crypt/lxd/storage zfs create crypt/lxd/storage
echo "Installing Incus"
curl -fsSL https://pkgs.zabbly.com/key.asc -o /etc/apt/keyrings/zabbly.asc
sh -c 'cat <<EOF > /etc/apt/sources.list.d/zabbly-incus-lts-6.0.sources
Enabled: yes
Types: deb
URIs: https://pkgs.zabbly.com/incus/lts-6.0
Suites: $(. /etc/os-release && echo ${VERSION_CODENAME})
Components: main
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/zabbly.asc
EOF'
apt update
apt install incus -y
incus ls
incus admin shutdown
systemctl stop incus
systemctl stop incus.socket
systemctl stop incus-user.socket
echo "Deleting everything in /var/lib/incus/*" echo "Deleting everything in /var/lib/incus/*"
rm /var/lib/incus/* -r rm /var/lib/incus/* -r
echo "Setting mountpoint /var/lib/incus to crypt/lxd/dir" echo "Setting mountpoint /var/lib/incus to crypt/lxd/dir"
zfs set mountpoint=/var/lib/incus crypt/lxd/dir zfs set mountpoint=/var/lib/incus crypt/lxd/dir
echo "Starting Incus"
systemctl start incus.socket
systemctl start incus-user.socket
systemctl start incus
incus ls
echo "Configuring sysctl" echo "Configuring sysctl"
echo "vm.swappiness = 1" > /etc/sysctl.d/50-usi-mm.conf echo "vm.swappiness = 1" > /etc/sysctl.d/50-usi-mm.conf
echo "vm.min_free_kbytes = 131072" >> /etc/sysctl.d/50-usi-mm.conf echo "vm.min_free_kbytes = 131072" >> /etc/sysctl.d/50-usi-mm.conf
@ -139,10 +166,6 @@ reboot
} }
post_reboot_script () { post_reboot_script () {
echo "Disabling lxd and delete /var/snap/lxd/common/lxd/*"
snap disable lxd
rm /var/snap/lxd/common/lxd/* -r
echo "Executing /root/onstart" echo "Executing /root/onstart"
bash /root/onstart bash /root/onstart