Skip to content
22 changes: 22 additions & 0 deletions oracle-linux-image-tools/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Release Notes

## August 2025

### New Features

- Update for OL9U6, support for UEK8
- Update for OL10U0
- Vagrant VirtualBox: if `VAGRANT_GUEST_ADDITIONS_KERNEL` is set to `yes`, do not install the VirtualBox Guest Additions
if the kernel already support these (UEK kernel). Default is `no` for backwards compatibility

### Changes

- `CPU_NUM` now accepts topology information using the `virt-install` syntax: `VCPUS[,maxvcpus=MAX][,sockets=#][,cores=#][,threads=#]`
- Vagrant VirtualBox: set display controller to `VMSVGA` (`VBoxVGA` being deprecated)
- Vagrant: remove/cleanup old dependencies

### Bug fixes

- Fixed issue when `ISO_URL` is referring to a file (#196, contributed by @retekdk)
- Vagrant: correctly set target kernel in motd, refactor installation of the
VirtualBox guest additions
- use `uname -m` instead of `uname -i` which is deprecated

## March 2025

Note: OL7 Premier Support ended on 31 December 2024, scripts will only be maintained for the OL8 and newer images.
Expand Down
14 changes: 7 additions & 7 deletions oracle-linux-image-tools/bin/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ load_env() {
local distr_name
# Note: OL7 media have space in the label which needs to be escaped
# shellcheck disable=SC2001
distr_name=$(sed -e 's/^.*OracleLinux-R\([[:digit:]]\)-U\([[:digit:]]\+\)\(-Server\)\?-\([^-]\+\)\(-dvd\)\?\(-[[:digit:]]\+\)\?\.iso$/OL\1U\2_\4/' <<< "${ISO_URL}")
if [[ $distr_name =~ ^OL[6789]U ]]; then
distr_name=$(sed -e 's/^.*OracleLinux-R\([[:digit:]]\+\)-U\([[:digit:]]\+\)\(-Server\)\?-\([^-]\+\)\(-dvd\)\?\(-[[:digit:]]\+\)\?\.iso$/OL\1U\2_\4/' <<< "${ISO_URL}")
if [[ $distr_name =~ ^OL(6|7|8|9|(10))U ]]; then
DISTR_NAME="${distr_name}"
fi

Expand Down Expand Up @@ -357,7 +357,7 @@ stage_kickstart() {
# OL installed based on the generated kickstart file.
# Globals:
# BOOT_COMMAND, BOOT_COMMAND_SERIAL_CONSOLE, BOOT_LOCATION, BOOT_MODE
# CPU_NUM, DISK_SIZE_MB, ISO_CHECKSUM, ISO_PATH, KS_FILE
# CPU_NUM, DISK_SIZE_MB, ISO_CHECKSUM, ISO_LABEL, ISO_PATH, KS_FILE
# MEM_SIZE, SERIAL_CONSOLE, VM_NAME, WORKSPACE
# Arguments:
# None
Expand Down Expand Up @@ -393,15 +393,15 @@ image_create() {
fi

# shellcheck disable=SC2294
virt-install --os-type linux --os-variant "${OS_VARIANT}" --name "${VM_NAME}" \
--cpus "${CPU_NUM}" --memory "${MEM_SIZE}" \
virt-install --os-type linux --os-variant "${OS_VARIANT}" --name "${VM_NAME}" \
--vcpus "${CPU_NUM}" --memory "${MEM_SIZE}" \
--controller "scsi,model=virtio-scsi" \
--disk "path=${WORKSPACE}/${VM_NAME}/${VM_NAME}.qcow2,size=${DISK_SIZE_GB},bus=scsi,cache=unsafe" \
--network default \
--graphics none \
--location "${iso_path}${location}" \
--initrd-inject="${WORKSPACE}/${VM_NAME}/${KS_FILE}" \
--extra-args="$(eval echo "${BOOT_COMMAND[@]}")" \
--initrd-inject "${WORKSPACE}/${VM_NAME}/${KS_FILE}" \
--extra-args "$(eval echo "${BOOT_COMMAND[@]}")" \
--transient \
"${virt_install_args[@]}"
}
Expand Down
2 changes: 2 additions & 0 deletions oracle-linux-image-tools/bin/provision-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ common::ks_log() {
cat /root/ks-post.log
rm /root/ks-post.log
common::echo_message "Kickstart post log - End"
else
common::echo_message "No Kickstart post log found"
fi
}

Expand Down
1 change: 1 addition & 0 deletions oracle-linux-image-tools/cloud/oci/ol10-aarch54
1 change: 1 addition & 0 deletions oracle-linux-image-tools/cloud/oci/ol10-slim
28 changes: 15 additions & 13 deletions oracle-linux-image-tools/cloud/oci/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Provisioning script for OCI
#
# Copyright (c) 2020, 2024 Oracle and/or its affiliates.
# Copyright (c) 2020, 2025 Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at
# https://oss.oracle.com/licenses/upl
#
Expand All @@ -26,18 +26,20 @@
cloud::config()
{
common::echo_message "Setup network"
# simple eth0 configuration
cat > /etc/sysconfig/network-scripts/ifcfg-eth0 <<-EOF
DEVICE="eth0"
BOOTPROTO="dhcp"
ONBOOT="yes"
TYPE="Ethernet"
USERCTL="yes"
PEERDNS="yes"
IPV6INIT="no"
PERSISTENT_DHCLIENT="1"
EOF

if [[ -d /etc/sysconfig/network-scripts ]]; then
# simple eth0 configuration
cat > /etc/sysconfig/network-scripts/ifcfg-eth0 <<-EOF
DEVICE="eth0"
BOOTPROTO="dhcp"
ONBOOT="yes"
TYPE="Ethernet"
USERCTL="yes"
PEERDNS="yes"
IPV6INIT="no"
PERSISTENT_DHCLIENT="1"
EOF
fi

if [[ "${OCI_REPO_MAPPER,,}" =~ "yes" ]]; then
common::echo_message "Install repo mapper scripts"
yum install -y "${YUM_VERBOSE}" jq
Expand Down
2 changes: 1 addition & 1 deletion oracle-linux-image-tools/cloud/olvm/image-scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ cloud::image_package() {
-v "${BUILD_NUMBER}" \
-s "${DISK_SIZE_GB}" \
-i "${VM_NAME}.qcow2" \
-c "${CPU_NUM}" \
-c "${CPU_NUM%%,*}" \
-m "${MEM_SIZE}" \
>"${package_filename}.ovf"

Expand Down
3 changes: 2 additions & 1 deletion oracle-linux-image-tools/cloud/olvm/mk-envelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
Generate OLVM compatible OVF file.

Copyright (c) 2020, 2022 Oracle and/or its affiliates.
Copyright (c) 2020, 2025 Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at
https://oss.oracle.com/licenses/upl

Expand All @@ -27,6 +27,7 @@
'OL7': 5003,
'OL8': 5006,
'OL9': 5007,
'OL10': 5007,
}


Expand Down
22 changes: 12 additions & 10 deletions oracle-linux-image-tools/cloud/olvm/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,18 @@ cloud::config()
{
common::echo_message "Setup network"
# simple eth0 configuration
cat > /etc/sysconfig/network-scripts/ifcfg-eth0 <<-EOF
DEVICE="eth0"
BOOTPROTO="dhcp"
ONBOOT="yes"
TYPE="Ethernet"
USERCTL="yes"
PEERDNS="yes"
IPV6INIT="no"
PERSISTENT_DHCLIENT="1"
EOF
if [[ -d /etc/sysconfig/network-scripts ]]; then
cat > /etc/sysconfig/network-scripts/ifcfg-eth0 <<-EOF
DEVICE="eth0"
BOOTPROTO="dhcp"
ONBOOT="yes"
TYPE="Ethernet"
USERCTL="yes"
PEERDNS="yes"
IPV6INIT="no"
PERSISTENT_DHCLIENT="1"
EOF
fi
}

#######################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ cloud::sysprep_args() {
# None
#######################################
cloud::image_package() {
local cpus="${VAGRANT_LIBVIRT_CPU_NUM:-$CPU_NUM}"
local cpus="${VAGRANT_LIBVIRT_CPU_NUM:-${CPU_NUM%%,*}}"
local memory="${VAGRANT_LIBVIRT_MEM_SIZE:-$MEM_SIZE}"

pushd "${WORKSPACE}/${VM_NAME}" || common::error "can't cd to image directory"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ VAGRANT_DEVELOPER_REPOS="no"
# URL can be a local file (file:// URI)
# VAGRANT_GUEST_ADDITIONS_URL=""
# VAGRANT_GUEST_ADDITIONS_SHA256=""
# If "yes", do not install the Guest Additions if the VirtualBox kernel
# modules are already provided by the kernel
# Set to no by default for backward compatibility
VAGRANT_GUEST_ADDITIONS_KERNEL="no"
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ vagrant::config()
sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers

# sshd: disable password authentication and DNS checks
if [[ "${ORACLE_RELEASE}" = "9" ]]; then
if [[ "${ORACLE_RELEASE}" =~ ^(9|10)$ ]]; then
cat > /etc/ssh/sshd_config.d/90-vagrant.conf <<-EOF
PasswordAuthentication no
UseDNS no
Expand All @@ -44,12 +44,6 @@ vagrant::config()
EOF
fi

# For OL9 re-enable SHA1 as the vagrant embedded ssh client insists to use
# SHA1 for RSA keys -- See hashicorp/vagrant#12344
if [[ "${ORACLE_RELEASE}" = "9" ]]; then
/bin/update-crypto-policies --set DEFAULT:SHA1
fi

cat >>/etc/sysconfig/sshd <<EOF

# Decrease connection time by preventing reverse DNS lookups
Expand Down Expand Up @@ -92,17 +86,18 @@ EOF
chcon system_u:object_r:modules_conf_t:s0 /etc/modprobe.d/nofloppy.conf

# Customize the initramfs
if [[ "${ORACLE_RELEASE}" != "9" && "${UEK_RELEASE}" != "7" ]]; then
local default_kernel
default_kernel=$(common::default_kernel)
if [[ $(find "/lib/modules/${default_kernel}/" -name "mptspi.ko*" -print -quit) ]]; then
# Enable VMware PVSCSI support for VMware Fusion guests.
# It is unlikely that we need this, but leave it for backwards compatibility
echo 'add_drivers+=" mptspi "' > /etc/dracut.conf.d/vmware-fusion-drivers.conf
restorecon /etc/dracut.conf.d/vmware-fusion-drivers.conf
fi
# There's no floppy controller, but probing for it generates timeouts
echo 'omit_drivers+=" floppy "' > /etc/dracut.conf.d/nofloppy.conf
restorecon /etc/dracut.conf.d/nofloppy.conf
# Regenerate initrd
local default_kernel
default_kernel=$(common::default_kernel)
${DRACUT_CMD} -f "/boot/initramfs-${default_kernel}.img" "${default_kernel}"

# Disabling firewalld on vagrant boxes
Expand Down Expand Up @@ -135,16 +130,14 @@ EOF
yum-config-manager --enable ol7_developer_EPEL >/dev/null
elif [[ "${ORACLE_RELEASE}" = "6" ]]; then
yum install -y "${YUM_VERBOSE}" oraclelinux-developer-release-el6
elif [[ "${ORACLE_RELEASE}" = "8" ]]; then
dnf install -y oracle-epel-release-el8
elif [[ "${ORACLE_RELEASE}" = "9" ]]; then
dnf install -y oracle-epel-release-el9
elif [[ "${ORACLE_RELEASE}" =~ ^(8|9|10)$ ]]; then
dnf install -y "oracle-epel-release-el${ORACLE_RELEASE}"
fi
fi

# Add login banner
echo "
Welcome to Oracle Linux Server release $(grep ^VERSION= /etc/os-release | grep -o "[0-9].[0-9]\+") (GNU/Linux $(uname -r))
Welcome to Oracle Linux Server release $(grep ^VERSION= /etc/os-release | grep -o "[0-9]\+.[0-9]\+") (GNU/Linux $(common::default_kernel))

The Oracle Linux End-User License Agreement can be viewed here:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ cloud::validate() {
[[ ${VAGRANT_GUEST_ADDITIONS_URL%%:*} =~ ^((https?)|(file))$ ]] || common::error "invalid VirtualBox GA ISO URL: ${VAGRANT_GUEST_ADDITIONS_URL}"
[[ -z "${VAGRANT_GUEST_ADDITIONS_SHA256}" ]] && common::error "missing VirtualBox GA ISO checksum"
[[ ${#VAGRANT_GUEST_ADDITIONS_SHA256} -eq 64 ]] || common::error "VAGRANT_GUEST_ADDITIONS_SHA256 must be SHA256"
readonly VAGRANT_GUEST_ADDITIONS_URL VAGRANT_GUEST_ADDITIONS_SHA256
[[ ${VAGRANT_GUEST_ADDITIONS_KERNEL,,} =~ ^((yes)|(no))$ ]] || common::error "VAGRANT_GUEST_ADDITIONS_KERNEL must be Yes or No"
readonly VAGRANT_GUEST_ADDITIONS_URL VAGRANT_GUEST_ADDITIONS_SHA256 VAGRANT_GUEST_ADDITIONS_KERNEL
# Retrieve GA during validation to "fail fast"
declare -g VAGRANT_GUEST_ADDITIONS_PATH
common::retrieve_iso "${VAGRANT_GUEST_ADDITIONS_URL}" "${VAGRANT_GUEST_ADDITIONS_SHA256}" VAGRANT_GUEST_ADDITIONS_PATH
Expand Down Expand Up @@ -95,7 +96,7 @@ cloud::sysprep_args() {
#######################################
cloud::image_package() {
local mk_envelope="${CLOUD_DIR}/${CLOUD}/mk-envelope.py"
local cpu="${VAGRANT_VIRTUALBOX_CPU_NUM:-$CPU_NUM}"
local cpu="${VAGRANT_VIRTUALBOX_CPU_NUM:-${CPU_NUM%%,*}}"
local memory="${VAGRANT_VIRTUALBOX_MEM_SIZE:-$MEM_SIZE}"
local -a extra_disk=()
local -a mk_envelope_params=()
Expand Down Expand Up @@ -144,7 +145,7 @@ cloud::image_package() {
load include_vagrantfile if File.exist?(include_vagrantfile)
EOF

if [[ "${ORACLE_RELEASE}" =~ ^[89]$ ]]; then
if [[ "${ORACLE_RELEASE}" =~ ^(8|9|(10))$ ]]; then
# For the latest uek kernels (UEK7) we install kernel-uek-core which only has virtio drivers...
mkdir "${WORKSPACE}/${VM_NAME}/include"
cat > "${WORKSPACE}/${VM_NAME}/include/_Vagrantfile" <<-EOF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,11 @@ def generate_ovf(args):
attr={"controller": "QemuRamFB", "VRAMSize": "20"},
)
else:
document.createOvfElement("Display", parent=ms_hardware, attr={"VRAMSize": "4"})
document.createOvfElement(
"Display",
parent=ms_hardware,
attr={"controller": "VMSVGA", "VRAMSize": "8"},
)

if not args.aarch64:
ms_hardware_rd = document.createOvfElement(
Expand Down
53 changes: 29 additions & 24 deletions oracle-linux-image-tools/cloud/vagrant-virtualbox/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,17 @@ cloud::config()
cloud::install_agent()
{
common::echo_message "Install Guest Additions"
if [[ ${VAGRANT_GUEST_ADDITIONS_KERNEL,,} == "yes" ]]; then
common::echo_message "Checking for existing kernel modules"
local target_kernel
target_kernel=$(common::default_kernel)
if [[ $(find "/lib/modules/${target_kernel}/" -name "vboxguest.ko*" -print -quit) ]]; then
common::echo_message "Found guest additions, skipping install"
return
fi
fi
local additions
if [[ $(uname -i) == "aarch64" ]]; then
if [[ $(uname -m) == "aarch64" ]]; then
additions="/mnt/VBoxLinuxAdditions-arm64.run"
else
additions="/mnt/VBoxLinuxAdditions.run"
Expand All @@ -58,12 +67,6 @@ cloud::install_agent()
yum install -y "${YUM_VERBOSE}" kernel-devel
fi

# Orabug 34811820 for OL8 UEK7 -- for the current install
case $(common::default_kernel) in
5.15.0-*.el8uek*)
export PATH="/opt/rh/gcc-toolset-11/root/usr/bin:$PATH"
esac

# Search for guest additions ISO -- it is typically labeled VBox_...
# Note: use "blkid -s" as "--match-tag" is not supported on OL7
local label
Expand All @@ -83,26 +86,28 @@ cloud::install_agent()

[[ -f ${additions} ]] || common::error "Guest additions not found"

# Installation will fail when running in libguestfs environment
# Fake uname to build the kernel modules
local default_kernel
default_kernel=$(common::default_kernel)
mv /usr/bin/uname /usr/bin/uname.orig
cat > /usr/bin/uname <<-EOF
#!/usr/bin/bash
if [[ \$1 == "-r" ]]; then
echo "${default_kernel}"
else
/usr/bin/uname.orig "\$@"
fi
EOF
chmod 0755 /usr/bin/uname
chcon --reference=/usr/bin/uname.orig /usr/bin/uname

# Installation might fail when running in libguestfs environment
sh "${additions}" || :
umount /mnt

# Orabug 34811820 for OL8 UEK7 -- for subsequent rebuilds
case $(common::default_kernel) in
5.15.0-*.el8uek*)
# shellcheck disable=SC2016
sed -i '/PATH=$PATH/a PATH="/opt/rh/gcc-toolset-11/root/usr/bin:$PATH"' /usr/sbin/rcvboxadd
for ga in /opt/VBoxGuestAdditions*; do
cp /usr/sbin/rcvboxadd "${ga}/init/vboxadd"
done
esac

# Ensure modules are built for the target kernel
if [[ $(uname -r) != $(common::default_kernel) ]]; then
common::echo_message "Building Guest Additions for $(common::default_kernel)"
/sbin/rcvboxadd quicksetup "$(common::default_kernel)"
fi

# Restore uname
rm /usr/bin/uname
mv /usr/bin/uname.orig /usr/bin/uname
}

#######################################
Expand Down
Loading