Merge branch 'mint-22' into 'main'

Mint 22

Closes #35

See merge request greg/vms!18
This commit is contained in:
Greg Hellings
2025-01-27 21:26:05 +00:00
14 changed files with 201 additions and 18 deletions
@@ -28,7 +28,7 @@ boot_command = [
"<leftCtrlOn>x<leftCtrlOff>" "<leftCtrlOn>x<leftCtrlOff>"
] ]
cd_files = [ "distros/centos-stream/10/disc/*" ] cd_files = [ "distros/centos-stream/10/disc/*" ]
vbox_os_type = "RedHat10_64" vbox_os_type = "RedHat_64"
HERPDERP HERPDERP
rm -f cache/CentOS-Stream-10-latest-x86_64-boot.iso rm -f cache/CentOS-Stream-10-latest-x86_64-boot.iso
+1
View File
@@ -6,6 +6,7 @@
centos-stream = import ./centos-stream; centos-stream = import ./centos-stream;
debian = import ./debian; debian = import ./debian;
fedora = import ./fedora; fedora = import ./fedora;
mint = import ./mint;
nixos = import ./nixos; nixos = import ./nixos;
opensuse = import ./opensuse; opensuse = import ./opensuse;
rockylinux = import ./rockylinux; rockylinux = import ./rockylinux;
+17
View File
@@ -0,0 +1,17 @@
distro = "mint"
version = "22"
iso = {
url = "https://mirrors.kernel.org/linuxmint/stable/22.1/linuxmint-22.1-cinnamon-64bit.iso"
checksum = "ccf482436df954c0ad6d41123a49fde79352ca71f7a684a97d5e0a0c39d7f39f"
}
boot_command = [
"e<wait><down><down><down><end><bs><bs>",
"auto ",
"noprompt ",
"automatic-ubiquity ",
#"only-ubiquity ",
"url=http://{{.HTTPIP}}:{{ .HTTPPort }}/preseed.cfg ",
"<f10>",
]
http_directory = "distros/mint/22/http/"
vbox_os_type = "Debian12_64"
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -ex
# 5 minute timeout for the package lock to arrive
apt-get -o DPkg::Lock::Timeout=600 autoremove -y
# Configure sshd to be faster
cat << EOF > /etc/ssh/sshd_config.d/00-vagrant_accept_pubkey.conf
UseDNS no
PubkeyAcceptedKeyTypes +ssh-rsa
EOF
# Clean up after ourselves
apt-get clean
virt="$(systemd-detect-virt)"
if [ "${virt}" == "microsoft" ]; then
apt-get install -y hyperv-daemons
systemctl enable hv-fcopy-daemon
systemctl enable hv-kvp-daemon
systemctl enable hv-vss-daemon
fi
+92
View File
@@ -0,0 +1,92 @@
d-i debconf/frontend select Noninteractive
d-i debconf/priority select critical
d-i debian-installer/locale string en_US.UTF-8
# If you don't set locale separately, you will still get asked
d-i debian-installer/language string en
d-i debian-installer/country string US
d-i debconf/language string en
d-i console-setup/ask_detect boolean false
# Setup the keyboard
d-i keyboard-configuration/layout select English (US)
d-i keyboard-configuration/variant select English (US)
d-i keyboard-configuration/keyboardcode select English (US)
d-i keyboard-configuration/xkb-keymap select us
d-i keyboard-configuration/toggle select No toggling
d-i keyboard-configuration/layoutcode string us
# Choose whatever network seems good at the time
d-i netconfig/choose_interface select auto
d-i netcfg/get_hostname string vagrant
d-i netcfg/get_domain string vagrant
# Setup vagrant user with vagrant passwords and such
d-i passwd/root-password-again password vagrant
d-i passwd/root-password password vagrant
d-i passwd/user-fullname string vagrant
d-i passwd/username string vagrant
d-i passwd/user-password password vagrant
d-i passwd/user-password-again password vagrant
# Assume UTC time, to let user change if wanted
d-i clock-setup/utc boolean true
d-i time/zone string UTC
# Just use plain partitions
ubiquity partman-auto/method string regular
# Don't prompt removing LVM
ubiquity partman-lvm/device_remove_lvm boolean true
# Don't prompt removing software RAID
ubiquity partman-md/device_remove_md boolean true
# Put everything on one partition, then confirm
d-i partman-auto/choose_recipe select atomic
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
ubiquity partman/confirm boolean true
ubiquity partman-partitioning/confirm_write_new_label boolean true
ubiquity partman/choose_partition select finish
ubiquity partman/confirm boolean true
ubiquity partman/confirm_nooverwrite boolean true
# Install to MBR, regardless of disk contents
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i grub-installer/bootdev string default
#d-i grub-installer/force-efi-extra-removable boolean true
# Settings for package manager
d-i apt-setup/non-free boolean true
d-i apt-setup/contrib boolean true
d-i apt-setup/cdrom/set-first boolean false
d-i apt-setup/cdrom/set-next boolean false
d-i apt-setup/cdrom/set-failed boolean false
d-i mirror/country string manual
d-i mirror/http/proxy string
ubiquity ubiquity/use_nonfree boolean false
# Package selection
tasksel tasksel/first multiselect
#d-i pkgsel/include string curl openssh-server sudo python3 network-manager
popularity-contest popularity-contest/participate boolean false
# Skip final message about completed install
d-i finish-install/reboot_in_progress note
d-i ubiquity/summary note
ubiquity ubiquity/reboot boolean true
ubiquity ubiquity/success_command string \
echo 'Defaults:vagrant !requiretty' > /target/etc/sudoers.d/vagrant; \
echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /target/etc/sudoers.d/vagrant; \
chmod 440 /target/etc/sudoers.d/vagrant; \
sed -i -e 's/ens3/ens5/g' /target/etc/network/interfaces; \
IF=$(ip -br a|grep DOWN|head -1|awk '{print $1}'); \
ip link set up dev $IF; \
dhclient $IF; \
in-target apt-get update; \
in-target apt-get upgrade -y; \
in-target apt-get install -y openssh-server
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -ex
apt install -y qemu-guest-agent
systemctl start qemu-guest-agent
systemctl enable qemu-guest-agent
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -ex
packages=(bzip2 dkms build-essential "linux-headers-$(uname -r)")
apt install -y "${packages[@]}"
mount -t auto /home/vagrant/VBoxGuestAdditions.iso /mnt
/mnt/VBoxLinuxAdditions.run install 2>&1 | tee /root/vbox_addon_install.log
apt remove -y "${packages[@]}"
umount /mnt
rm /home/vagrant/VBoxGuestAdditions.iso
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -ex
apt install -y open-vm-tools
+8
View File
@@ -0,0 +1,8 @@
[
{
version = "22";
arch = "amd64";
eol = false;
}
]
@@ -4,7 +4,7 @@ set -x
name="${0%.sh}" name="${0%.sh}"
base="https://download.opensuse.org/tumbleweed/iso/openSUSE-Tumbleweed-DVD-x86_64-Current.iso" base="https://mirror.fcix.net/opensuse/tumbleweed/iso/openSUSE-Tumbleweed-DVD-x86_64-Current.iso"
# Working directory # Working directory
tmp="$(mktemp -d)" tmp="$(mktemp -d)"
+1 -1
View File
@@ -16,4 +16,4 @@ boot_command = [
cd_files = [ cd_files = [
"distros/ubuntu/24.04/disc/*" "distros/ubuntu/24.04/disc/*"
] ]
vbox_os_type = "Ubuntu24_64" vbox_os_type = "Ubuntu24_LTS_64"
+1 -1
View File
@@ -16,4 +16,4 @@ boot_command = [
cd_files = [ cd_files = [
"distros/ubuntu/24.10/disc/*" "distros/ubuntu/24.10/disc/*"
] ]
vbox_os_type = "Ubuntu24_64" vbox_os_type = "Ubuntu_64"
+36 -13
View File
@@ -61,47 +61,59 @@ func processStdin() []IsoInfo {
return isos return isos
} }
func downloadAndUploadIso(minioClient *minio.Client, iso IsoInfo) error { func downloadAndUploadIso(minioClient *minio.Client, iso IsoInfo, ch chan int) {
// Create the destination file path // Create the destination file path
destPath := "cache/" + iso.Hash + ".iso" destPath := "cache/" + iso.Hash + ".iso"
// Create cache directory if it doesn't exist // Create cache directory if it doesn't exist
err := os.MkdirAll("cache", 0755) err := os.MkdirAll("cache", 0755)
if err != nil { if err != nil {
return err log.Fatalln(err)
ch <- 1
return
} }
log.Println("Downloading " + iso.Url) log.Println("Downloading " + iso.Url)
// Download the ISO file // Download the ISO file
resp, err := http.Get(iso.Url) resp, err := http.Get(iso.Url)
if err != nil { if err != nil {
return err log.Fatalln(err)
ch <- 1
return
} }
defer resp.Body.Close() defer resp.Body.Close()
// Create the destination file // Create the destination file
destFile, err := os.Create(destPath) destFile, err := os.Create(destPath)
if err != nil { if err != nil {
return err log.Fatalln(err)
ch <- 1
return
} }
defer destFile.Close() defer destFile.Close()
// Copy the downloaded content to the file // Copy the downloaded content to the file
_, err = io.Copy(destFile, resp.Body) _, err = io.Copy(destFile, resp.Body)
if err != nil { if err != nil {
return err log.Fatalln(err)
ch <- 1
return
} }
// Reopen file for uploading // Reopen file for uploading
uploadFile, err := os.Open(destPath) uploadFile, err := os.Open(destPath)
if err != nil { if err != nil {
return err log.Fatalln(err)
ch <- 1
return
} }
defer uploadFile.Close() defer uploadFile.Close()
// Get file info for content-length // Get file info for content-length
fileInfo, err := uploadFile.Stat() fileInfo, err := uploadFile.Stat()
if err != nil { if err != nil {
return err log.Fatalln(err)
ch <- 1
return
} }
log.Println("Uploading " + destPath) log.Println("Uploading " + destPath)
@@ -111,10 +123,13 @@ func downloadAndUploadIso(minioClient *minio.Client, iso IsoInfo) error {
ContentType: "application/x-iso9660-image", ContentType: "application/x-iso9660-image",
}) })
if err != nil { if err != nil {
return err log.Fatalln(err)
ch <- 1
return
} }
return nil log.Println("Done with " + iso.Url)
ch <- 1
} }
func main() { func main() {
@@ -144,6 +159,8 @@ func main() {
isos := processStdin() isos := processStdin()
downloads := 0
dl_counter := make(chan int)
for _, iso := range isos { for _, iso := range isos {
// Check if ISO exists in Minio // Check if ISO exists in Minio
isoPath := "cache/" + iso.Distro + "/" + iso.Hash + ".iso" isoPath := "cache/" + iso.Distro + "/" + iso.Hash + ".iso"
@@ -157,10 +174,16 @@ func main() {
} }
if !exists { if !exists {
if err := downloadAndUploadIso(minioClient, iso); err != nil { downloads += 1
log.Println("Error downloading/uploading ISO:", err) go downloadAndUploadIso(minioClient, iso, dl_counter)
os.Exit(1) }
} }
for downloads > 0 {
if k := <-dl_counter; k == 1 {
downloads -= 1
} else {
log.Println("Received unknown message on channel: ", k)
} }
} }
} }
+1 -1
View File
@@ -131,7 +131,7 @@ locals {
cpus = var.cpus cpus = var.cpus
memory = var.memory memory = var.memory
disk_size = 10 disk_size = 20
ssh = { ssh = {
username = "vagrant" username = "vagrant"
password = "vagrant" password = "vagrant"