Skip to content

Commit

Permalink
Add rocky8, rocky9
Browse files Browse the repository at this point in the history
  • Loading branch information
xorel committed Oct 17, 2023
1 parent 9f1a91e commit 19d6f97
Show file tree
Hide file tree
Showing 8 changed files with 298 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Makefile.distros
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

1 change: 1 addition & 0 deletions packer/alpine316/alpine317.json
38 changes: 38 additions & 0 deletions packer/rocky8/rocky8.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"variables": {
"home": "{{ env `HOME` }}",
"serial": "stdio",
"appliance_name": "rocky"
},
"builders": [{
"name": "qemu",
"type": "qemu",
"accelerator": "kvm",
"headless": false,
"boot_command": [
"<tab><bs><bs><bs><bs><bs> append rd.live.check=0 inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rocky8.ks<enter><wait>"
],
"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"]
]
}]
}
98 changes: 98 additions & 0 deletions packer/rocky8/rocky8.ks
Original file line number Diff line number Diff line change
@@ -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
38 changes: 38 additions & 0 deletions packer/rocky8/rocky9.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"variables": {
"home": "{{ env `HOME` }}",
"serial": "stdio",
"appliance_name": "rocky"
},
"builders": [{
"name": "qemu",
"type": "qemu",
"accelerator": "kvm",
"headless": false,
"boot_command": [
"<tab><bs><bs><bs><bs><bs> append rd.live.check=0 inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rocky9.ks<enter><wait>"
],
"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"]
]
}]
}
97 changes: 97 additions & 0 deletions packer/rocky8/rocky9.ks
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions packer/rocky8/run.sh
Original file line number Diff line number Diff line change
@@ -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" ||:
1 change: 1 addition & 0 deletions packer/rocky9

0 comments on commit 19d6f97

Please sign in to comment.