Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion oracle-linux-image-tools/cloud/oci/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,24 @@ cloud::cloud_init()
touch /etc/cloud/cloud-init.disabled
yum install -y "${YUM_VERBOSE}" cloud-init
rm /etc/cloud/cloud-init.disabled
cat > /etc/cloud/cloud.cfg.d/90_ol.cfg <<-EOF
# Provide sensible defaults for OL - see Orabug 34821447
system_info:
default_user:
name: cloud-user
lock_passwd: true
gecos: Cloud User
groups: [adm, systemd-journal]
sudo: ["ALL=(ALL) NOPASSWD:ALL"]
shell: /bin/bash
distro: rhel
paths:
cloud_dir: /var/lib/cloud
templates_dir: /etc/cloud/templates
ssh_svcname: sshd
EOF
if [[ -n "${CLOUD_USER}" ]]; then
sed -i -e "s/\(^\s\+name:\).*/\1 ${CLOUD_USER}/" /etc/cloud/cloud.cfg
sed -i -e "s/\(^\s\+name:\).*/\1 ${CLOUD_USER}/" /etc/cloud/cloud.cfg.d/90_ol.cfg
fi
fi
}
Expand Down
18 changes: 17 additions & 1 deletion oracle-linux-image-tools/cloud/olvm/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,24 @@ cloud::cloud_init()
touch /etc/cloud/cloud-init.disabled
yum install -y "${YUM_VERBOSE}" cloud-init
rm /etc/cloud/cloud-init.disabled
cat > /etc/cloud/cloud.cfg.d/90_ol.cfg <<-EOF
# Provide sensible defaults for OL - see Orabug 34821447
system_info:
default_user:
name: cloud-user
lock_passwd: true
gecos: Cloud User
groups: [adm, systemd-journal]
sudo: ["ALL=(ALL) NOPASSWD:ALL"]
shell: /bin/bash
distro: rhel
paths:
cloud_dir: /var/lib/cloud
templates_dir: /etc/cloud/templates
ssh_svcname: sshd
EOF
if [[ -n "${CLOUD_USER}" ]]; then
sed -i -e "s/\(^\s\+name:\).*/\1 ${CLOUD_USER}/" /etc/cloud/cloud.cfg
sed -i -e "s/\(^\s\+name:\).*/\1 ${CLOUD_USER}/" /etc/cloud/cloud.cfg.d/90_ol.cfg
fi
fi
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#######################################
# Configure Vagrant instance
# Globals:
# None
# ORACLE_RELEASE, UEK_RELEASE
# Arguments:
# None
# Returns:
Expand Down Expand Up @@ -93,7 +93,7 @@ EOF
chcon -u system_u -r object_r -t modules_conf_t /etc/modprobe.d/nofloppy.conf

# Customize the initramfs
if [[ "${ORACLE_RELEASE}" != "9" ]]; then
if [[ "${ORACLE_RELEASE}" != "9" && "${UEK_RELEASE}" != "7" ]]; then
# Enable VMware PVSCSI support for VMware Fusion guests.
echo 'add_drivers+=" mptspi "' > /etc/dracut.conf.d/vmware-fusion-drivers.conf
restorecon /etc/dracut.conf.d/vmware-fusion-drivers.conf
Expand Down Expand Up @@ -169,16 +169,11 @@ For additional packages, updates, documentation and community help, see:
#######################################
vagrant::cleanup()
{
if [[ "${ORACLE_RELEASE}" != "6" ]]; then
# On OL6 we need to keep psmisc and checkpolicy for dependencies; other
# packages are not installed.
distr::remove_rpms usermode \
rhn\* \
m2crypto \
checkpolicy \
iptables-services
if [[ -z "${RESCUE_KERNEL}" || "${RESCUE_KERNEL,,}" = "no" ]]; then
distr::remove_rpms dracut-config-rescue
fi
distr::remove_rpms usermode \
rhn\* \
m2crypto \
iptables-services
if [[ -z "${RESCUE_KERNEL}" || "${RESCUE_KERNEL,,}" = "no" ]]; then
distr::remove_rpms dracut-config-rescue
fi
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,19 @@ cloud::image_package() {
vboxmanage storageattach "${VM_NAME}" --storagectl "SATA Controller" --port 1 --device 0 --type hdd --medium ./extra_disk.vdi
fi
# Create the box
vagrant package --base "${VM_NAME}" --output "${VM_NAME}.box"
if [[ "${ORACLE_RELEASE}" =~ ^[89]$ ]]; then
# For the latest uek kernels (UEK7) we install kernel-uek-core which only has virtio drivers...
cat > Vagrantfile <<-EOF
Vagrant.configure("2") do |config|
config.vm.provider :virtualbox do |v|
v.default_nic_type = "virtio"
end
end
EOF
vagrant package --base "${VM_NAME}" --output "${VM_NAME}.box" --vagrantfile Vagrantfile
rm -rf Vagrantfile .vagrant
else
vagrant package --base "${VM_NAME}" --output "${VM_NAME}.box"
fi
vboxmanage unregistervm "${VM_NAME}" --delete
}
16 changes: 15 additions & 1 deletion oracle-linux-image-tools/cloud/vagrant-virtualbox/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ cloud::config()
#######################################
# Install Virtualbox guest agent
# Globals:
# YUM_VERBOSE
# KERNEL, YUM_VERBOSE
# Arguments:
# None
# Returns:
Expand All @@ -53,6 +53,12 @@ cloud::install_agent()
yum install -y "${YUM_VERBOSE}" kernel-devel
fi

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

# Search for guest additions on cd devices
for cdrom in /dev/sr*; do
if mount -o ro "${cdrom}" /mnt; then
Expand All @@ -71,6 +77,14 @@ cloud::install_agent()

sh "${additions}" || :
umount /mnt

# Orabug 34811820 for OL8 UEK7 -- for subsequent rebuilds
case $(uname -r) 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
esac

}

#######################################
Expand Down
4 changes: 2 additions & 2 deletions oracle-linux-image-tools/distr/ol8-aarch64/env.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# env file.

# Distribution name
DISTR_NAME="OL8U6_aarch64"
DISTR_NAME="OL8U7_aarch64"

# Distribution release
readonly ORACLE_RELEASE=8
Expand All @@ -15,7 +15,7 @@ SETUP_SWAP="yes"
ROOT_FS="xfs"

# Label of the ISO image
ISO_LABEL="OL-8-6-0-BaseOS-aarch64"
ISO_LABEL="OL-8-7-0-BaseOS-aarch64"

# Boot command
# Variables MUST be escaped as they are evaluated at build time.
Expand Down
4 changes: 2 additions & 2 deletions oracle-linux-image-tools/distr/ol8-slim/env.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# env file.

# Distribution name
DISTR_NAME="OL8U6_x86_64"
DISTR_NAME="OL8U7_x86_64"

# Distribution release
readonly ORACLE_RELEASE=8
Expand All @@ -22,7 +22,7 @@ BOOT_COMMAND=( '<up><tab>${CONSOLE} inst.text inst.ks=${KS_CONFIG} setup_swap=${
KERNEL="uek"

# UEK release: 6, 7
UEK_RELEASE=6
UEK_RELEASE=7

# Keep rescue kernel: yes, no
# Keeping rescue kernel will increase the image size and is most propbalbly
Expand Down
2 changes: 1 addition & 1 deletion oracle-linux-image-tools/distr/ol8-slim/ol8-ks.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ zerombr
clearpart --all --initlabel

# Disk partitioning information
part /boot --fstype="xfs" --ondisk=sda --size=500 --label=/boot
part /boot --fstype="xfs" --ondisk=sda --size=1024 --label=/boot
part swap --fstype="swap" --ondisk=sda --size=4096 --label=swap
part / --fstype="xfs" --ondisk=sda --size=4096 --label=root --grow

Expand Down
4 changes: 2 additions & 2 deletions oracle-linux-image-tools/distr/ol9-aarch64/env.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# env file.

# Distribution name
DISTR_NAME="OL9U0_aarch64"
DISTR_NAME="OL9U1_aarch64"

# Distribution release
readonly ORACLE_RELEASE=9
Expand All @@ -15,7 +15,7 @@ SETUP_SWAP="yes"
ROOT_FS="xfs"

# Label of the ISO image
ISO_LABEL="OL-9-0-0-BaseOS-aarch64"
ISO_LABEL="OL-9-1-0-BaseOS-aarch64"

# Boot command
# Variables MUST be escaped as they are evaluated at build time.
Expand Down
2 changes: 1 addition & 1 deletion oracle-linux-image-tools/distr/ol9-slim/env.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# env file.

# Distribution name
DISTR_NAME="OL9U0_x86_64"
DISTR_NAME="OL9U1_x86_64"

# Distribution release
readonly ORACLE_RELEASE=9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ source "qemu" "aarch64" {
ssh_password = var.ssh_password
ssh_private_key_file = var.ssh_private_key_file
ssh_port = 22
ssh_wait_timeout = "120m"
ssh_wait_timeout = "180m"
http_directory = local.http_directory
boot_wait = "20s"
boot_command = var.boot_command
Expand Down