Skip to content

Commit de7d51a

Browse files
authored
Merge pull request #176 from AmedeeBulle/uefi-serial
UEFI boot, Serial Console and Vagrant aarch64 support
2 parents 31c79e5 + 667b203 commit de7d51a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+780
-337
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"MD013": false,
3+
"MD024": {
4+
"siblings_only": true
5+
}
6+
}

oracle-linux-image-tools/CHANGELOG.md

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,57 @@
11
# Release Notes
22

3+
## March 2025
4+
5+
Note: OL7 Premier Support ended on 31 December 2024, scripts will only be maintained for the OL8 and newer images.
6+
7+
### New Features
8+
9+
- aarch64 support for vagrant-virtualbox (on Apple silicon)
10+
- UEFI support for x86_64.
11+
`BOOT_MODE` can be set to `bios`, `uefi` or `hybrid`. In hybrid mode the image is compatible with both Legacy BIOS and UEFI
12+
- new `SERIAL_CONSOLE_RUNTIME` build parameter to configure serial console in the generated image
13+
14+
### Changes
15+
16+
- The partition layout is now [GPT](https://en.wikipedia.org/wiki/GUID_Partition_Table) for all images
17+
- Install the audit package (allow SELinux auditing)
18+
19+
### Bug fixes
20+
21+
- OL9: update BLS files when grub config is updated
22+
- OLVM OL9 templates have now the correct OS id (was set to OL8 for compatibility reason)
23+
24+
### Refactor
25+
26+
- The partitioning in the _kickstart_ files is generated dynamically in the `%pre` section
27+
28+
## November 2024
29+
30+
### New Features
31+
32+
- Update for OL9.5
33+
34+
### Bug fixes
35+
36+
- Fix regression for Vagrant Virtualbox boxes (set default NIC type to `virtio`)
37+
38+
## September 2024
39+
40+
### Bug fixes
41+
42+
- Use a version-based sort on the output of osinfo-query to ensure we always use the latest available variant on the build host when creating the initial VM
43+
44+
## May 2024
45+
46+
### New Features
47+
48+
- OL 8.10 & OL9.4 update
49+
50+
### Bug fixes
51+
52+
- Truncate `/etc/resolv.conf` in cleanup
53+
- Pin `kernel-uek-core` to prevent accidental removal
54+
355
## March 30, 2024
456

557
### Bug fixes
@@ -33,7 +85,7 @@ As of this release, we have:
3385

3486
Notable code changes:
3587

36-
- Drop support for [VirtualBox](https://www.virtualbox.org/) as **builder** (you can still create Vagrant VirtualBox **images**)
88+
- Drop support for [VirtualBox](https://www.virtualbox.org/) as __builder__ (you can still create Vagrant VirtualBox __images__)
3789
- `image-scripts.sh` `::seal()` functions obsolete; code moved to `provision.sh` `::cleanup()` functions.
3890
We don't need anymore a separate _offline_ cleanup as `virt-customize` doesn't actually run the built VM.
3991
- Simplify `provision.sh` `::cleanup()` functions as most parts are now handled by `virt-sysprep` operations.

oracle-linux-image-tools/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ The tools are architected around _distribution flavours_ and _target clouds_.
1010
They currently support:
1111

1212
- Distributions:
13-
- Oracle Linux 7 update 9 -- Slim (x86_64 only)
13+
- Oracle Linux 7 update 9 -- Slim (x86_64 only; deprecated)
1414
- Oracle Linux 8 update 10 -- Slim (x86_64 and aarch64)
15-
- Oracle Linux 9 update 4 -- Slim (x86_64 and aarch64)
15+
- Oracle Linux 9 update 5 -- Slim (x86_64 and aarch64)
1616
- Clouds:
1717
- Microsoft Azure cloud (x86_64)
1818
Target packages: WALinuxAgent
@@ -27,7 +27,7 @@ They currently support:
2727
- Oracle VM Server (OVM) (x86_64)
2828
Target packages: oracle-template-config + vmapi
2929
Image format: OVM OVA
30-
- Vagrant (VirtualBox provider) (x86_64)
30+
- Vagrant (VirtualBox provider) (x86_64 and aarch64)
3131
Target packages: VirtualBox guest additions
3232
Image format: box
3333
- Vagrant (libvirt provider) (x86_64)
@@ -110,7 +110,7 @@ In that case, you will have to provide an URL to an installation tree and option
110110
Example for an Oracle Linux 9 using the UEK boot ISO:
111111

112112
```Shell
113-
ISO_URL="https://yum.oracle.com/ISOS/OracleLinux/OL9/u4/x86_64/OracleLinux-R9-U4-x86_64-boot-uek.iso"
113+
ISO_URL="https://yum.oracle.com/ISOS/OracleLinux/OL9/u5/x86_64/OracleLinux-R9-U5-x86_64-boot-uek.iso"
114114
REPO_URL="https://yum.oracle.com/repo/OracleLinux/OL9/baseos/latest/x86_64"
115115
REPO[AppStream]="https://yum.oracle.com/repo/OracleLinux/OL9/appstream/x86_64"
116116
REPO[ol9_UEKR7]="https://yum.oracle.com/repo/OracleLinux/OL9/UEKR7/x86_64"

oracle-linux-image-tools/bin/build-image.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Create minimal Oracle Linux images
55
#
6-
# Copyright (c) 2019, 2024 Oracle and/or its affiliates.
6+
# Copyright (c) 2019, 2025 Oracle and/or its affiliates.
77
# Licensed under the Universal Permissive License v 1.0 as shown at
88
# https://oss.oracle.com/licenses/upl.
99
#
@@ -189,8 +189,11 @@ load_env() {
189189

190190
[[ "${SERIAL_CONSOLE,,}" =~ ^((yes)|(no))$ ]] || common::error "SERIAL_CONSOLE must be yes or no"
191191
readonly SERIAL_CONSOLE
192+
[[ "${SERIAL_CONSOLE_RUNTIME,,}" =~ ^((yes)|(no))$ ]] || common::error "SERIAL_CONSOLE_RUNTIME must be yes or no"
193+
readonly SERIAL_CONSOLE_RUNTIME
192194

193-
[[ "${BOOT_MODE,,}" =~ ^((bios)|(uefi))$ ]] || common::error "BOOT_MODE must be bios or uefi"
195+
196+
[[ "${BOOT_MODE,,}" =~ ^((bios)|(uefi)|(hybrid))$ ]] || common::error "BOOT_MODE must be bios, uefi or hybrid"
194197
readonly BOOT_MODE
195198

196199
if [[ -z ${OS_VARIANT} ]]; then
@@ -263,7 +266,7 @@ stage_files() {
263266
[[ -r "${env_file}" ]] && cat "${env_file}" >> "${GLOBAL_ENV_FILE}"
264267
done
265268

266-
# Main provisionning script
269+
# Main provisioning script
267270
cp "${BIN_DIR}/provision.sh" "${provision_path}/"
268271
cp "${BIN_DIR}/provision-common.sh" "${provision_path}/"
269272

@@ -317,6 +320,8 @@ stage_kickstart() {
317320

318321
cp "${DISTR_DIR}/${DISTR}/"*-ks.cfg "${ks_path}"
319322

323+
# This shouldn't be necessary with the current partitioning method, but we
324+
# leave it for backward compatibility (OL7)
320325
if [[ "${SETUP_SWAP,,}" = "no" ]]; then
321326
sed -i -e '/^part swap /d' "${ks_path}"
322327
fi
@@ -368,14 +373,14 @@ image_create() {
368373
ISO_LABEL=$(file "${ISO_PATH}" | sed -e "s/.* '\(.*\)' .*/\1/" -e 's/ /\\x20/g')
369374

370375
declare -ga virt_install_args
371-
# Set Serial conole
376+
# Set Serial console
372377
if [[ "${SERIAL_CONSOLE,,}" = "yes" ]]; then
373378
BOOT_COMMAND+=( "${BOOT_COMMAND_SERIAL_CONSOLE[@]}" )
374379
else
375380
virt_install_args+=(--wait "${INSTALL_WAIT_TIME}" --noautoconsole)
376381
fi
377382

378-
if [[ ${BOOT_MODE,,} == uefi ]]; then
383+
if [[ ${BOOT_MODE,,} != bios ]]; then
379384
virt_install_args+=(--boot uefi)
380385
fi
381386

@@ -403,7 +408,7 @@ image_create() {
403408
}
404409

405410
#######################################
406-
# Customize Oracle Linux: run provisionning scripts
411+
# Customize Oracle Linux: run provisioning scripts
407412
# Uses libguestfs to update the ${WORKSPACE}/${VM_NAME}/${VM_NAME}.qcow2
408413
# Globals:
409414
# BUILD_INFO, MEM_SIZE, PROVISION_DIR, PROVISION_SCRIPT, SELINUX, VM_NAME, WORKSPACE

oracle-linux-image-tools/bin/provision-common.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env bash
22
#
3-
# Common functions for provisionning the VM
3+
# Common functions for provisioning the VM
44
#
5-
# Copyright (c) 2024 Oracle and/or its affiliates.
5+
# Copyright (c) 2024, 2025 Oracle and/or its affiliates.
66
# Licensed under the Universal Permissive License v 1.0 as shown at
77
# https://oss.oracle.com/licenses/upl.
88
#
@@ -114,7 +114,7 @@ common::remove_kernels() {
114114
# None
115115
#######################################
116116
common::distr_cleanup() {
117-
common::echo_message "Stoppping services"
117+
common::echo_message "Stopping services"
118118
systemctl stop rsyslog || true
119119
systemctl stop auditd || true
120120

oracle-linux-image-tools/cloud/azure/image-scripts.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
#
33
# Cleanup and package image for Azure
44
#
5-
# Copyright (c) 2019, 2024 Oracle and/or its affiliates.
5+
# Copyright (c) 2019, 2025 Oracle and/or its affiliates.
66
# Licensed under the Universal Permissive License v 1.0 as shown at
77
# https://oss.oracle.com/licenses/upl
88
#
99
# Description: this module provides the following functions which are run on
1010
# the host:
11-
# cloud::validate: called at the very begining to validate project parameters
11+
# cloud::validate: called at the very beginning to validate project parameters
1212
# (optional)
1313
# cloud::customize_args: arguments to pass to virt-customize (optional)
1414
# cloud::sysprep_args: arguments to pass to virt-sysprep (optional)

oracle-linux-image-tools/cloud/none/image-scripts.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
#
33
# Cleanup and package image for the "None" image
44
#
5-
# Copyright (c) 2019, 2024 Oracle and/or its affiliates.
5+
# Copyright (c) 2019, 2025 Oracle and/or its affiliates.
66
# Licensed under the Universal Permissive License v 1.0 as shown at
77
# https://oss.oracle.com/licenses/upl
88
#
99
# Description: this module provides the following functions which are run on
1010
# the host:
11-
# cloud::validate: called at the very begining to validate project parameters
11+
# cloud::validate: called at the very beginning to validate project parameters
1212
# (optional)
1313
# cloud::customize_args: arguments to pass to virt-customize (optional)
1414
# cloud::sysprep_args: arguments to pass to virt-sysprep (optional)
@@ -20,7 +20,7 @@
2020

2121
#######################################
2222
# Image packaging: do nothing
23-
# (Provide stub as we need a packaging fnction)
23+
# (Provide stub as we need a packaging function)
2424
# Globals:
2525
# None
2626
# Arguments:

oracle-linux-image-tools/cloud/oci/image-scripts.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
#
33
# Cleanup and package image for OCI
44
#
5-
# Copyright (c) 2020, 2024 Oracle and/or its affiliates.
5+
# Copyright (c) 2020, 2025 Oracle and/or its affiliates.
66
# Licensed under the Universal Permissive License v 1.0 as shown at
77
# https://oss.oracle.com/licenses/upl
88
#
99
# Description: this module provides the following functions which are run on
1010
# the host:
11-
# cloud::validate: called at the very begining to validate project parameters
11+
# cloud::validate: called at the very beginning to validate project parameters
1212
# (optional)
1313
# cloud::customize_args: arguments to pass to virt-customize (optional)
1414
# cloud::sysprep_args: arguments to pass to virt-sysprep (optional)

oracle-linux-image-tools/cloud/olvm/image-scripts.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
#
33
# Cleanup and package image for OLVM
44
#
5-
# Copyright (c) 2020, 2022 Oracle and/or its affiliates.
5+
# Copyright (c) 2020, 2025 Oracle and/or its affiliates.
66
# Licensed under the Universal Permissive License v 1.0 as shown at
77
# https://oss.oracle.com/licenses/upl
88
#
99
# Description: this module provides the following functions which are run on
1010
# the host:
11-
# cloud::validate: called at the very begining to validate project paramters
11+
# cloud::validate: called at the very beginning to validate project parameters
1212
# (optional)
1313
# cloud::customize_args: arguments to pass to virt-customize (optional)
1414
# cloud::sysprep_args: arguments to pass to virt-sysprep (optional)

oracle-linux-image-tools/cloud/olvm/mk-envelope.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
'OL6': 5002,
2727
'OL7': 5003,
2828
'OL8': 5006,
29-
'OL9': 5006, # Use OL8 ID for now, to support older OLVM versions
29+
'OL9': 5007,
3030
}
3131

3232

0 commit comments

Comments
 (0)