debian support

This commit is contained in:
Patrick 2024-11-10 18:03:47 +01:00
parent de19951611
commit f31aa555e7
12 changed files with 203 additions and 56 deletions

View file

@ -0,0 +1,9 @@
{
"identifier": "debian-bookworm-gnome-amd64",
"rootfs_type": "debootstrap",
"download_link": "http://deb.debian.org/debian/",
"download_name": "bookworm",
"packages": "grub-pc linux-image-amd64 task-gnome-desktop",
"script": "configs/scripts/install.sh",
"package_manager": "apt"
}

View file

@ -0,0 +1,9 @@
{
"identifier": "debian-bookworm-kde-amd64",
"rootfs_type": "debootstrap",
"download_link": "http://deb.debian.org/debian/",
"download_name": "bookworm",
"packages": "grub-pc linux-image-amd64 task-kde-desktop",
"script": "configs/scripts/install.sh",
"package_manager": "apt"
}

View file

@ -0,0 +1,9 @@
{
"identifier": "debian-bookworm-server-amd64",
"rootfs_type": "debootstrap",
"download_link": "http://deb.debian.org/debian/",
"download_name": "bookworm",
"packages": "nginx grub-pc linux-image-amd64",
"script": "configs/scripts/install.sh",
"package_manager": "apt"
}

View file

@ -1,7 +0,0 @@
{
"identifier": "noble-kubuntu-amd64",
"link": "https://cdimage.ubuntu.com/ubuntu-base/noble/daily/current/noble-base-amd64.tar.gz",
"download_name": "noble-base-amd64.tar.gz",
"packages": "grub-pc linux-image-generic kubuntu-desktop",
"script": "install.sh"
}

View file

@ -1,7 +0,0 @@
{
"identifier": "noble-server-amd64",
"link": "https://cdimage.ubuntu.com/ubuntu-base/noble/daily/current/noble-base-amd64.tar.gz",
"download_name": "noble-base-amd64.tar.gz",
"packages": "nginx grub-pc linux-image-generic",
"script": "install.sh"
}

View file

@ -1,7 +0,0 @@
{
"identifier": "noble-ubuntu-amd64",
"link": "https://cdimage.ubuntu.com/ubuntu-base/noble/daily/current/noble-base-amd64.tar.gz",
"download_name": "noble-base-amd64.tar.gz",
"packages": "grub-pc linux-image-generic ubuntu-desktop",
"script": "install.sh"
}

79
configs/scripts/install.sh Executable file
View file

@ -0,0 +1,79 @@
#!/bin/bash
# linux-deployment-scripts
# Copyright (C) 2024 VM-Experiments
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
trap '' SIGINT SIGTERM
parted -s /dev/sda mklabel msdos
parted -s /dev/sda mkpart primary linux-swap 0% 2GiB
parted -s /dev/sda mkpart primary ext4 2GiB 100%
mkswap /dev/sda1
mkfs.ext4 /dev/sda2
mount /dev/sda2 /mnt
swapon /dev/sda1
tar -xzvf /rootfs.tar.gz -C /mnt
genfstab -U /mnt >>/mnt/etc/fstab
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
if command -v grub2-mkconfig &>/dev/null; then
chroot /mnt /bin/bash -c "grub2-mkconfig -o /boot/grub/grub.cfg"
elif command -v grub-mkconfig &>/dev/null; then
chroot /mnt /bin/bash -c "grub-mkconfig -o /boot/grub/grub.cfg"
fi
if command -v grub2-install &>/dev/null; then
chroot /mnt /bin/bash -c "grub2-install /dev/sda"
elif command -v grub-install &>/dev/null; then
chroot /mnt /bin/bash -c "grub-install /dev/sda"
fi
while true; do
read -p "Enter a username (lowercase letters, digits, underscores and hyphens): " username
chroot /mnt /bin/bash -c "useradd -m '$username'"
if [ $? -eq 0 ]; then
break
fi
done
while true; do
chroot /mnt /bin/bash -c "passwd '$username'"
if [ $? -eq 0 ]; then
break
fi
done
while true; do
read -p "Enter the hostname: " hostname
chroot /mnt /bin/bash -c "echo $hostname > /etc/hostname"
if [ $? -eq 0 ]; then
break
fi
done
umount -R /mnt
reboot

View file

@ -0,0 +1,9 @@
{
"identifier": "ubuntu-noble-gnome-amd64",
"rootfs_type": "download",
"download_link": "https://cdimage.ubuntu.com/ubuntu-base/noble/daily/current/noble-base-amd64.tar.gz",
"download_name": "noble-base-amd64.tar.gz",
"packages": "grub-pc linux-image-generic ubuntu-desktop",
"script": "configs/scripts/install.sh",
"package_manager": "apt"
}

View file

@ -0,0 +1,9 @@
{
"identifier": "ubuntu-noble-kde-amd64",
"rootfs_type": "download",
"download_link": "https://cdimage.ubuntu.com/ubuntu-base/noble/daily/current/noble-base-amd64.tar.gz",
"download_name": "noble-base-amd64.tar.gz",
"packages": "grub-pc linux-image-generic kubuntu-desktop",
"script": "configs/scripts/install.sh",
"package_manager": "apt"
}

View file

@ -0,0 +1,9 @@
{
"identifier": "ubuntu-noble-server-amd64",
"rootfs_type": "download",
"download_link": "https://cdimage.ubuntu.com/ubuntu-base/noble/daily/current/noble-base-amd64.tar.gz",
"download_name": "noble-base-amd64.tar.gz",
"packages": "nginx grub-pc linux-image-generic",
"script": "configs/scripts/install.sh",
"package_manager": "apt"
}