diff --git a/Makefile.distros b/Makefile.distros index 0e1381cc..9bc32922 100644 --- a/Makefile.distros +++ b/Makefile.distros @@ -1,4 +1,4 @@ -DISTROS := alma8 alma9 alpine316 alpine317 debian11 debian12 +DISTROS := alma8 alma9 alpine316 alpine317 debian11 debian12 rocky8 rocky9 # URLS URL_alma8 ?= https://repo.almalinux.org/almalinux/8/cloud/x86_64/images/AlmaLinux-8-OpenNebula-latest.x86_64.qcow2 @@ -7,6 +7,7 @@ URL_alpine316 ?= https://dl-cdn.alpinelinux.org/alpine/v3.16/releases/x86_64/alp URL_alpine317 ?= https://dl-cdn.alpinelinux.org/alpine/v3.17/releases/x86_64/alpine-virt-3.17.5-x86_64.iso URL_debian11 ?= https://cdimage.debian.org/cdimage/cloud/bullseye/latest/debian-11-generic-amd64.qcow2 URL_debian11 ?= https://cdimage.debian.org/cdimage/cloud/bullseye/latest/debian-11-generic-amd64.qcow2 -URL_debian12 ?= https://cdimage.debian.org/cdimage/cloud/bookworm/latest/debian-12-generic-amd64.qcow2 - +URL_debian12 ?= https://cdimage.debian.org/cdimage/cloud/bookworm/latest/debian-12-generic-amd64.qcow2 +URL_rocky8 ?= https://download.rockylinux.org/pub/rocky/8/isos/x86_64/Rocky-x86_64-boot.iso +URL_rocky9 ?= https://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-x86_64-boot.iso diff --git a/packer/alpine316/alpine317.json b/packer/alpine316/alpine317.json new file mode 120000 index 00000000..6cc06378 --- /dev/null +++ b/packer/alpine316/alpine317.json @@ -0,0 +1 @@ +alpine316.json \ No newline at end of file diff --git a/packer/rocky8/rocky8.json b/packer/rocky8/rocky8.json new file mode 100644 index 00000000..b3c0f165 --- /dev/null +++ b/packer/rocky8/rocky8.json @@ -0,0 +1,38 @@ +{ + "variables": { + "home": "{{ env `HOME` }}", + "serial": "stdio", + "appliance_name": "rocky" + }, + "builders": [{ + "name": "qemu", + "type": "qemu", + "accelerator": "kvm", + "headless": false, + "boot_command": [ + " append rd.live.check=0 inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rocky8.ks" + ], + "boot_wait": "10s", + "disk_size": 4096, + "disk_cache": "unsafe", + "output_directory": "{{ user `output_dir` }}", + "format": "qcow2", + "http_directory": "{{user `http_dir`}}", + "iso_url": "{{ user `base_image` }}", + "iso_checksum": "none", + "ssh_username": "root", + "ssh_password": "v-YC470*/9i2CX+y3fP:D+%Z-1g-|p4P", + "ssh_port": 22, + "ssh_wait_timeout": "10000s", + "net_device": "virtio-net", + "disk_interface": "virtio", + "vm_name": "{{ user `appliance_name` }}", + "shutdown_command": "poweroff", + "qemu_binary": "{{ user `qemu_binary`}}", + "qemuargs": [ + [ "-m", "1G" ], + [ "-serial", "{{ user `serial` }}" ], + ["-cpu", "host"] + ] + }] +} diff --git a/packer/rocky8/rocky8.ks b/packer/rocky8/rocky8.ks new file mode 100644 index 00000000..07d5e99d --- /dev/null +++ b/packer/rocky8/rocky8.ks @@ -0,0 +1,98 @@ +# more information is available at +# https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-kickstart-syntax.html +install +#cmdline + +# System authorization information +authconfig --enableshadow --passalgo=sha512 --enablefingerprint + +# Use net installation media +url --url="http://download.rockylinux.org/pub/rocky/8/BaseOS/x86_64/os/" +repo --name="BaseOS" --baseurl="http://download.rockylinux.org/pub/rocky/8/BaseOS/x86_64/os/" --cost=100 +repo --name="AppStream" --baseurl="http://download.rockylinux.org/pub/rocky/8/AppStream/x86_64/os/" --cost=100 +repo --name="extras" --baseurl="http://download.rockylinux.org/pub/rocky/8/extras/x86_64/os/" --cost=100 +#repo --name="updates" --baseurl="http://mirror.centos.org/centos/8/updates/x86_64/os/" --cost=100 + +# Run the Setup Agent on first boot +firstboot --disable + +# Keyboard layouts +keyboard --vckeymap=us --xlayouts='us' + +# System language +lang en_US.UTF-8 + +# Network information +network --bootproto=dhcp --device=enp0s3 --ipv6=auto --activate +# network --hostname=localhost.localdomain +firewall --disabled + +# Root password +rootpw --iscrypted $6$rounds=2000000$CZnmDr1iAnoCk$l5fEPfdtBpwfvOA1.Wn4Ipbh1Y.ahTPzNPZyXvaU2T4MtS907l8QqwMKLLa/8XMDpV2ZuXFUDX8aG2YqRX7mM1 +#selinux --permissive +selinux + +# System services +services --disabled="kdump" +%addon com_redhat_kdump --disable +%end + +# System timezone +timezone UTC --isUtc + +# System bootloader configuration +bootloader --location=mbr --timeout=1 +zerombr + +clearpart --all --initlabel +part / --fstype xfs --size=1024 --grow + +# Reboot the machine after successful installation +reboot --eject +#poweroff + +%post --erroronfail +yum -C -y remove linux-firmware +%end + +%packages --ignoremissing --excludedocs +@core +#deltarpm +openssh-clients +NetworkManager +dracut-config-generic +kernel +-firewalld +-aic94xx-firmware +-alsa-firmware +-alsa-lib +-alsa-tools-firmware +-biosdevname +-iprutils +#-linux-firmware +-ivtv-firmware +-iwl100-firmware +-iwl1000-firmware +-iwl105-firmware +-iwl135-firmware +-iwl2000-firmware +-iwl2030-firmware +-iwl3160-firmware +-iwl3945-firmware +-iwl4965-firmware +-iwl5000-firmware +-iwl5150-firmware +-iwl6000-firmware +-iwl6000g2a-firmware +-iwl6000g2b-firmware +-iwl6050-firmware +-iwl7260-firmware +-iwl7265-firmware +-libertas-sd8686-firmware +-libertas-sd8787-firmware +-libertas-usb8388-firmware +-plymouth +-dracut-config-rescue +-kexec-tools +-microcode_ctl +%end diff --git a/packer/rocky8/rocky9.json b/packer/rocky8/rocky9.json new file mode 100644 index 00000000..11e26ca6 --- /dev/null +++ b/packer/rocky8/rocky9.json @@ -0,0 +1,38 @@ +{ + "variables": { + "home": "{{ env `HOME` }}", + "serial": "stdio", + "appliance_name": "rocky" + }, + "builders": [{ + "name": "qemu", + "type": "qemu", + "accelerator": "kvm", + "headless": false, + "boot_command": [ + " append rd.live.check=0 inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rocky9.ks" + ], + "boot_wait": "10s", + "disk_size": 4096, + "disk_cache": "unsafe", + "output_directory": "{{ user `output_dir` }}", + "format": "qcow2", + "http_directory": "{{user `http_dir`}}", + "iso_url": "{{ user `base_image` }}", + "iso_checksum": "none", + "ssh_username": "root", + "ssh_password": "v-YC470*/9i2CX+y3fP:D+%Z-1g-|p4P", + "ssh_port": 22, + "ssh_wait_timeout": "10000s", + "net_device": "virtio-net", + "disk_interface": "virtio", + "vm_name": "{{ user `appliance_name` }}", + "shutdown_command": "poweroff", + "qemu_binary": "{{ user `qemu_binary`}}", + "qemuargs": [ + [ "-m", "1G" ], + [ "-serial", "{{ user `serial` }}" ], + ["-cpu", "host"] + ] + }] +} diff --git a/packer/rocky8/rocky9.ks b/packer/rocky8/rocky9.ks new file mode 100644 index 00000000..407afa1a --- /dev/null +++ b/packer/rocky8/rocky9.ks @@ -0,0 +1,97 @@ +# more information is available at +# https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-kickstart-syntax.html +#cmdline + +# System authorization information +authconfig --enableshadow --passalgo=sha512 --enablefingerprint + +# Use net installation media +url --url="https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/" +repo --name="BaseOS" --baseurl="https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/" --cost=100 +repo --name="AppStream" --baseurl="https://download.rockylinux.org/pub/rocky/9/AppStream/x86_64/os/" --cost=100 +repo --name="extras" --baseurl="https://download.rockylinux.org/pub/rocky/9/extras/x86_64/os/" --cost=100 + +# Run the Setup Agent on first boot +firstboot --disable + +# Keyboard layouts +keyboard --vckeymap=us --xlayouts='us' + +# System language +lang en_US.UTF-8 + +# Network information +network --bootproto=dhcp --device=enp0s3 --ipv6=auto --activate +# network --hostname=localhost.localdomain +firewall --disabled + +# Root password +rootpw --iscrypted $6$rounds=2000000$CZnmDr1iAnoCk$l5fEPfdtBpwfvOA1.Wn4Ipbh1Y.ahTPzNPZyXvaU2T4MtS907l8QqwMKLLa/8XMDpV2ZuXFUDX8aG2YqRX7mM1 +#selinux --permissive +selinux + +# System services +services --disabled="kdump" +%addon com_redhat_kdump --disable +%end + +# System timezone +timezone UTC --isUtc + +# System bootloader configuration +bootloader --location=mbr --timeout=1 +zerombr + +clearpart --all --initlabel +part / --fstype ext4 --size=1024 --grow + +# Reboot the machine after successful installation +reboot --eject +#poweroff + +%post --erroronfail +yum -C -y remove linux-firmware +echo "PermitRootLogin yes" > /etc/ssh/sshd_config.d/01-permitrootlogin.conf +%end + +%packages --ignoremissing --excludedocs +@core +#deltarpm +openssh-clients +NetworkManager +dracut-config-generic +kernel +-firewalld +-aic94xx-firmware +-alsa-firmware +-alsa-lib +-alsa-tools-firmware +-biosdevname +-iprutils +#-linux-firmware +-ivtv-firmware +-iwl100-firmware +-iwl1000-firmware +-iwl105-firmware +-iwl135-firmware +-iwl2000-firmware +-iwl2030-firmware +-iwl3160-firmware +-iwl3945-firmware +-iwl4965-firmware +-iwl5000-firmware +-iwl5150-firmware +-iwl6000-firmware +-iwl6000g2a-firmware +-iwl6000g2b-firmware +-iwl6050-firmware +-iwl7260-firmware +-iwl7265-firmware +-libertas-sd8686-firmware +-libertas-sd8787-firmware +-libertas-usb8388-firmware +-plymouth +-dracut-config-rescue +-kexec-tools +-microcode_ctl +%end diff --git a/packer/rocky8/run.sh b/packer/rocky8/run.sh new file mode 100755 index 00000000..1345c77f --- /dev/null +++ b/packer/rocky8/run.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# +# QEMU_BINARY should be exported already + +DISTRO=$1 +DST=$2 +DIR_CURR=$(dirname "$0") +BASE_IMAGE=$DIR_BASE/$DISTRO.img +PACKER_WORKING_DIR=$DIR_BUILD/_packer/$DISTRO +mkdir -p "$PACKER_WORKING_DIR" + +packer build -force \ + -var "base_image=${BASE_IMAGE}" \ + -var "qemu_binary=${QEMU_BINARY}" \ + -var "appliance_name=${DISTRO}" \ + -var "http_dir=${DIR_CURR}" \ + -var "output_dir=${PACKER_WORKING_DIR}" \ + "$DIR_CURR/$DISTRO.json" + +mv "$PACKER_WORKING_DIR/$DISTRO" "$DST" +rmdir "$DIR_BUILD/_packer/$DISTRO" ||: diff --git a/packer/rocky9 b/packer/rocky9 new file mode 120000 index 00000000..62ea184f --- /dev/null +++ b/packer/rocky9 @@ -0,0 +1 @@ +rocky8 \ No newline at end of file