diff --git a/oraclelinux/cloud/aarch64/README.md b/oraclelinux/cloud/aarch64/README.md deleted file mode 100644 index f89cc24..0000000 --- a/oraclelinux/cloud/aarch64/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# Oracle Linux Cloud Images - -## Oracle Linux 9 - -``` -cd oraclelinux/cloud/aarch64 -packer init . -PACKER_LOG=1 packer build \ - -var-file oracle-linux-9-aarch64.pkrvars.hcl \ - oracle-linux.pkr.hcl -``` - -``` -$ sudo qemu-img convert \ - -f qcow2 \ - -O qcow2 \ - output-oracle-linux-9-aarch64/oracle-linux-9-aarch64.qcow2 \ - /var/lib/libvirt/images/oracle-linux-9-aarch64.qcow2 -$ sudo qemu-img resize \ - -f qcow2 \ - /var/lib/libvirt/images/oracle-linux-9-aarch64.qcow2 \ - 32G -``` - -``` -osinfo-query os -``` - -``` -virt-install \ - --connect qemu:///system \ - --name oracle-linux-9 \ - --boot uefi \ - --memory 4096 \ - --vcpus 2 \ - --os-variant ol8.0 \ - --disk /var/lib/libvirt/images/oracle-linux-9-aarch64.qcow2,bus=virtio \ - --network network=host-network,model=virtio \ - --noautoconsole \ - --console pty,target_type=serial \ - --import \ - --debug - -virsh console oracle-linux-9 - -# login with packer user - -# Check networking - you may notice that the network interface is down and -# the name of the interface generated in netplan doesn't match. If not -# correct, can regenerate with cloud-init - -$ ip --brief a -lo UNKNOWN 127.0.0.1/8 ::1/128 -eth0 UP 10.63.34.53/22 fe80::5054:ff:fed1:cf06/64 - -# Check cloud-init version -$ cloud-init --version -/usr/bin/cl -oud-init 23 -.4-7.0.1.el -9_4 - -# Regenerate only the network config -$ sudo cloud-init clean --configs network -$ sudo cloud-init init --local - -$ sudo reboot - -$ ip --brief a -lo UNKNOWN 127.0.0.1/8 ::1/128 -eth0 UP 10.63.34.53/22 fe80::5054:ff:fed1:cf06/64 - -$ sudo cloud-init status -status: done - -# Disable cloud-init -$ sudo touch /etc/cloud/cloud-init.disabled - -$ sudo cloud-init status -status: disabled - -$ sudo shutdown -h now -``` - -``` -$ virsh shutdown oracle-linux-9 -$ virsh undefine oracle-linux-9 --nvram --remove-all-storage -``` diff --git a/oraclelinux/cloud/aarch64/oracle-linux-9-aarch64.pkrvars.hcl b/oraclelinux/cloud/aarch64/oracle-linux-9-aarch64.pkrvars.hcl deleted file mode 100644 index 41a3b3a..0000000 --- a/oraclelinux/cloud/aarch64/oracle-linux-9-aarch64.pkrvars.hcl +++ /dev/null @@ -1,3 +0,0 @@ -iso_checksum = "1f4e20190e87c76e8c3b4a9e15e660972386cbfa4f128e5cdcd8faa43a713d44" -iso_url = "https://yum.oracle.com/templates/OracleLinux/OL9/u4/aarch64/OL9U4_aarch64-kvm-cloud-b90.qcow2" -vm_name = "oracle-linux-9-aarch64" diff --git a/oraclelinux/cloud/aarch64/oracle-linux.pkr.hcl b/oraclelinux/cloud/aarch64/oracle-linux.pkr.hcl deleted file mode 100644 index 85b868b..0000000 --- a/oraclelinux/cloud/aarch64/oracle-linux.pkr.hcl +++ /dev/null @@ -1,102 +0,0 @@ -packer { - required_plugins { - qemu = { - version = "~> 1" - source = "github.com/hashicorp/qemu" - } - } -} - -variable "ssh_username" { - type = string - default = "packer" -} - -variable "ssh_password" { - type = string - default = "packer" -} - -variable "vm_name" { - type = string - default = "oracle-linux-9-aarch64" -} - -source "file" "user_data" { - content = <meta-data < user-data -#cloud-config -password: superseekret -chpasswd: - expire: False -ssh_pwauth: True -EOF -``` - -Create the cloud-init ISO - -``` -sudo apt-get update -sudo apt-get install genisoimage -genisoimage \ - -input-charset utf-8 \ - -output cloud-init.iso \ - -volid cidata -rational-rock -joliet \ - user-data meta-data network-config -``` - -Create a firmware image - -``` -# Qemu expects aarch firmware images to be 64M so the firmware -# images can't be used as is, some padding is needed to -# create an image for pflash -dd if=/dev/zero of=flash0.img bs=1M count=64 -dd if=/usr/share/AAVMF/AAVMF_CODE.fd of=flash0.img conv=notrunc -dd if=/dev/zero of=flash1.img bs=1M count=64 -``` - -Run the VM with QEMU - -``` -# login: opc -qemu-system-aarch64 \ - -name oracle-linux-9 \ - -machine virt,accel=kvm,gic-version=3,kernel-irqchip=on \ - -cpu host \ - -smp 2 \ - -m 2G \ - -device virtio-keyboard \ - -device virtio-mouse \ - -device virtio-gpu-pci \ - -nographic \ - -device virtio-net-pci,netdev=net0 \ - -netdev user,id=net0,hostfwd=tcp::2222-:22 \ - -drive file=oracle-linux-9.qcow2,if=virtio,format=qcow2 \ - -cdrom cloud-init.iso \ - -drive if=pflash,format=raw,readonly=on,unit=0,file=flash0.img \ - -drive if=pflash,format=raw,unit=1,file=flash1.img - -Ctrl-a h: Show help (displays all available commands). -Ctrl-a x: Exit QEMU. -Ctrl-a c: Switch between the monitor and the console. -Ctrl-a s: Send a break signal. -``` - -Login to the image - -``` -# opc / superseekret -ssh cloud-user@localhost -p 2222 -``` diff --git a/oraclelinux/cloud/scripts/cloud-init-wait.sh b/oraclelinux/cloud/scripts/cloud-init-wait.sh deleted file mode 100644 index 048e265..0000000 --- a/oraclelinux/cloud/scripts/cloud-init-wait.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# https://bugs.launchpad.net/cloud-init/+bug/1890528 -# cloud-init can return an exit status on wait other than 0 -# so eat the exit status for now so it doesn't error packer -cloud_init_status=0 -cloud-init status --wait || cloud_init_status=$? - -if [ "$cloud_init_status" = "0" ]; then - echo "cloud-init succeeded" -else - echo "cloud-init exit=${cloud_init_status}" -fi diff --git a/oraclelinux/oraclelinux-7-x86_64.pkrvars.hcl b/oraclelinux/oraclelinux-7-x86_64.pkrvars.hcl deleted file mode 100644 index 33f79c3..0000000 --- a/oraclelinux/oraclelinux-7-x86_64.pkrvars.hcl +++ /dev/null @@ -1,3 +0,0 @@ -iso_checksum = "sha256:f15f95b30f059ba744ecb32d724a25c323291c12a2398ad472c545da1f757e8c" -iso_url = "https://yum.oracle.com/templates/OracleLinux/OL7/u9/x86_64/OL7U9_x86_64-kvm-b145.qcow" -vm_name = "oraclelinux-7-x86_64" diff --git a/oraclelinux/oraclelinux-8-x86_64.pkrvars.hcl b/oraclelinux/oraclelinux-8-x86_64.pkrvars.hcl deleted file mode 100644 index e7f9107..0000000 --- a/oraclelinux/oraclelinux-8-x86_64.pkrvars.hcl +++ /dev/null @@ -1,3 +0,0 @@ -iso_checksum = "sha256:67b644451efe5c9c472820922085cb5112e305fedfb5edb1ab7020b518ba8c3b" -iso_url = "https://yum.oracle.com/templates/OracleLinux/OL8/u8/x86_64/OL8U8_x86_64-kvm-b198.qcow" -vm_name = "oraclelinux-8-x86_64" diff --git a/oraclelinux/oraclelinux-9-x86_64.pkrvars.hcl b/oraclelinux/oraclelinux-9-x86_64.pkrvars.hcl deleted file mode 100644 index f128617..0000000 --- a/oraclelinux/oraclelinux-9-x86_64.pkrvars.hcl +++ /dev/null @@ -1,3 +0,0 @@ -iso_checksum = "840345cb866837ac7cc7c347cd9a8196c3a17e9c054c613eda8c2a912434c956" -iso_url = "https://yum.oracle.com/templates/OracleLinux/OL9/u2/x86_64/OL9U2_x86_64-kvm-b197.qcow" -vm_name = "oraclelinux-9-x86_64" diff --git a/oraclelinux/oraclelinux.pkr.hcl b/oraclelinux/oraclelinux.pkr.hcl deleted file mode 100644 index 8ad9fb8..0000000 --- a/oraclelinux/oraclelinux.pkr.hcl +++ /dev/null @@ -1,72 +0,0 @@ -variable "ssh_username" { - type = string - default = "packer" -} - -variable "ssh_password" { - type = string - default = "packer" -} - -source "file" "user_data" { - content = <