void

- enter the void 🪐
git clone git://git.acid.vegas/archlinux.git
Log | Files | Refs | Archive

commit 32ad0f1b81f2d3010bd1c6b0d4928869b55313b6
parent 5c2f8c51a77902494dc2586a20e291859e000d6f
Author: acidvegas <acid.vegas@acid.vegas>
Date: Thu, 6 Jun 2024 13:11:10 -0400

LXD to incus for vps setup script

Diffstat:
Mscripts/vps | 69+++++++++++++++++++++++----------------------------------------------

1 file changed, 23 insertions(+), 46 deletions(-)

diff --git a/scripts/vps b/scripts/vps
@@ -44,7 +44,7 @@ setup_chroot() {
 
 	xbps-install -u xbps
 	xbps-remove -y base-system openssh
-	xbps-install -Syu curl dropbear git htop lxd iptables nano net-tools runit-iptables tmux socklog-void wget
+	xbps-install -Syu curl dropbear git htop incus incus-client incus-tools iptables nano net-tools runit-iptables tmux socklog-void wget
 
 	# Set up networking
 	IP_ADDR=$(ip addr show eth0 | grep 'inet ' | awk '{print $2}' | cut -d'/' -f1)
@@ -77,7 +77,10 @@ setup_chroot() {
 	chsh -s /bin/bash
 
 	useradd -m -s /bin/bash $USERNAME && passwd $USERNAME
-	gpasswd -a $USERNAME lxd
+	gpasswd -a $USERNAME _incus
+	gpasswd -a $USERNAME _incus-admin
+	printf "root:1000000:65536\n$USERNAME:165536:65536" > /etc/subgid
+	printf "root:1000000:65536\n$USERNAME:165536:65536" > /etc/subuid
 	cp vps /home/$USERNAME/ && chown $USERNAME:$USERNAME /home/$USERNAME/vps
 
 	if [ ! $ARCH = 'x86_64-musl' ]; then
@@ -91,52 +94,26 @@ setup_chroot() {
 	echo "proc /proc proc defaults,hidepid=2 0 0" >> /etc/fstab
 	mount -o remount /proc
 
-	# Preseed LXD initialization
-	{
-		echo "config:"
-		echo "  images.auto_update_interval: \"0\""
-		echo "networks:"
-		echo "- config:"
-		echo "    ipv4.address: auto"
-		echo "    ipv6.address: none" # Do we need IPv6
-		echo "  description: \"\""
-		echo "  name: lxdbr0"
-		echo "  type: \"\""
-		echo "  project: default"
-		echo "storage_pools: []"
-		echo "profiles:"
-		echo "- config: {}"
-		echo "  description: \"\""
-		echo "  devices:"
-		echo "    eth0:"
-		echo "      name: eth0"
-		echo "      network: lxdbr0"
-		echo "      type: nic"
-		echo "  name: default"
-		echo "projects: []"
-		echo "cluster: null"
-	} | lxd init --preseed
-
 	# Add the official SuperNETs seal of HARD FUCKIGN CORE INTERNET USAGE into the MOTD
 	{
-		echo ""
-		echo "      \033[37;104m                                  \033[0m        \033[0m"
-		echo "    \033[37;104m    \033[37;101m                              \033[37;104m    \033[0m      \033[0m"
-		echo "  \033[37;104m    \033[37;101m      \033[37;103m  \033[37;101m    \033[37;103m        \033[37;101m    \033[37;103m  \033[37;101m        \033[37;104m    \033[0m    \033[0m"
-		echo "\033[37;104m    \033[37;101m      \033[37;103m  \033[37;101m    \033[37;103m            \033[37;101m      \033[37;103m  \033[37;101m      \033[37;104m    \033[0m  \033[0m"
-		echo "\033[37;104m    \033[37;101m    \033[37;103m    \033[37;101m    \033[37;103m                      \033[37;101m    \033[37;104m    \033[0m  \033[0m"
-		echo "  \033[37;104m    \033[37;101m    \033[37;103m  \033[37;101m                      \033[37;103m    \033[37;101m  \033[37;104m    \033[0m    \033[0m"
-		echo "    \033[37;104m    \033[37;101m                              \033[37;104m    \033[0m      \033[0m"
-		echo "      \033[37;104m    \033[37;101m    \033[37;103m              \033[37;101m        \033[37;104m    \033[0m        \033[0m"
-		echo "        \033[37;104m    \033[37;101m      \033[37;103m  \033[37;101m  \033[37;103m      \033[37;101m      \033[37;104m    \033[0m          \033[0m"
-		echo "          \033[37;104m    \033[37;101m                  \033[37;104m    \033[0m            \033[0m"
-		echo "            \033[37;104m    \033[37;101m    \033[37;103m      \033[37;101m    \033[37;104m    \033[0m              \033[0m"
-		echo "              \033[37;104m    \033[37;101m    \033[37;103m  \033[37;101m    \033[37;104m    \033[0m                \033[0m"
-		echo "                \033[37;104m    \033[37;101m      \033[37;104m    \033[0m                  \033[0m"
-		echo "┏┓┳┳┏┓┏┓┳┓        \033[37;104m    \033[37;101m  \033[37;104m    \033[0m         ┳┓┏┓┏┳┓┏┓"
-		echo "┗┓┃┃┣┛┣ ┣┫          \033[37;104m      \033[0m           ┃┃┣  ┃ ┗┓"
-		echo "┗┛┗┛┻ ┗┛┛┗            \033[37;104m  \033[0m\033[0m             ┛┗┗┛ ┻ ┗┛"
-		echo ""
+		echo -e ""
+		echo -e "      \033[37;104m                                  \033[0m        \033[0m"
+		echo -e "    \033[37;104m    \033[37;101m                              \033[37;104m    \033[0m      \033[0m"
+		echo -e "  \033[37;104m    \033[37;101m      \033[37;103m  \033[37;101m    \033[37;103m        \033[37;101m    \033[37;103m  \033[37;101m        \033[37;104m    \033[0m    \033[0m"
+		echo -e "\033[37;104m    \033[37;101m      \033[37;103m  \033[37;101m    \033[37;103m            \033[37;101m      \033[37;103m  \033[37;101m      \033[37;104m    \033[0m  \033[0m"
+		echo -e "\033[37;104m    \033[37;101m    \033[37;103m    \033[37;101m    \033[37;103m                      \033[37;101m    \033[37;104m    \033[0m  \033[0m"
+		echo -e "  \033[37;104m    \033[37;101m    \033[37;103m  \033[37;101m                      \033[37;103m    \033[37;101m  \033[37;104m    \033[0m    \033[0m"
+		echo -e "    \033[37;104m    \033[37;101m                              \033[37;104m    \033[0m      \033[0m"
+		echo -e "      \033[37;104m    \033[37;101m    \033[37;103m              \033[37;101m        \033[37;104m    \033[0m        \033[0m"
+		echo -e "        \033[37;104m    \033[37;101m      \033[37;103m  \033[37;101m  \033[37;103m      \033[37;101m      \033[37;104m    \033[0m          \033[0m"
+		echo -e "          \033[37;104m    \033[37;101m                  \033[37;104m    \033[0m            \033[0m"
+		echo -e "            \033[37;104m    \033[37;101m    \033[37;103m      \033[37;101m    \033[37;104m    \033[0m              \033[0m"
+		echo -e "              \033[37;104m    \033[37;101m    \033[37;103m  \033[37;101m    \033[37;104m    \033[0m                \033[0m"
+		echo -e "                \033[37;104m    \033[37;101m      \033[37;104m    \033[0m                  \033[0m"
+		echo -e "┏┓┳┳┏┓┏┓┳┓        \033[37;104m    \033[37;101m  \033[37;104m    \033[0m         ┳┓┏┓┏┳┓┏┓"
+		echo -e "┗┓┃┃┣┛┣ ┣┫          \033[37;104m      \033[0m           ┃┃┣  ┃ ┗┓"
+		echo -e "┗┛┗┛┻ ┗┛┛┗            \033[37;104m  \033[0m\033[0m             ┛┗┗┛ ┻ ┗┛"
+		echo -e ""
 	} > /etc/motd
 
 	# Set up user SSH keys