Skip to content

Commit 7b5cb77

Browse files
authored
Merge pull request #700 from chrisperelstein/feature/ol8_support
Add support for oracle linux 8.
2 parents ee32d35 + 6e85530 commit 7b5cb77

File tree

3 files changed

+36
-6
lines changed

3 files changed

+36
-6
lines changed

examples/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Distro:
1111
- [`debian.yaml`](./debian.yaml): ⭐Debian GNU/Linux
1212
- [`fedora.yaml`](./fedora.yaml): ⭐Fedora
1313
- [`opensuse.yaml`](./opensuse.yaml): ⭐openSUSE Leap
14+
- [`oraclelinux.yaml`](./oraclelinux.yaml): Oracle Linux
1415
- [`rocky.yaml`](./rocky.yaml): Rocky Linux
1516
- [`ubuntu.yaml`](./ubuntu.yaml): Ubuntu (same as `default.yaml` but without extra YAML lines)
1617
- [`ubuntu-lts.yaml`](./ubuntu-lts.yaml): Ubuntu LTS (same as `ubuntu.yaml` but pinned to an LTS version)

examples/oraclelinux.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Oracle image licence: https://www.oracle.com/downloads/licenses/oracle-linux-license.html
2+
# Image source: https://yum.oracle.com/oracle-linux-templates.html
3+
arch: "x86_64"
4+
5+
images:
6+
- location: "https://yum.oracle.com/templates/OracleLinux/OL8/u5/x86_64/OL8U5_x86_64-olvm-b113.qcow2"
7+
arch: "x86_64"
8+
digest: "sha256:550db4100b38825d1778f23f8c457f3fc971d96be1326fb512a5e607032b2a24"
9+
mounts:
10+
- location: "~"
11+
- location: "/tmp/lima"
12+
writable: true
13+
firmware:
14+
legacyBIOS: true
15+
cpuType:
16+
# Workaround for "vmx_write_mem: mmu_gva_to_gpa XXXXXXXXXXXXXXXX failed" on Intel Mac
17+
# https://bugs.launchpad.net/qemu/+bug/1838390
18+
x86_64: "Haswell-v4"

pkg/cidata/cidata.TEMPLATE.d/boot/30-install-packages.sh

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ update_fuse_conf() {
1010
fi
1111
}
1212

13+
dnf_install() {
14+
if grep -q "Oracle Linux Server release 8" /etc/system-release; then
15+
dnf install --repo ol8_baseos_latest --repo ol8_codeready_builder "$@"
16+
else
17+
dnf install "$@"
18+
fi
19+
}
20+
1321
INSTALL_IPTABLES=0
1422
if [ "${LIMA_CIDATA_CONTAINERD_SYSTEM}" = 1 ] || [ "${LIMA_CIDATA_CONTAINERD_USER}" = 1 ]; then
1523
INSTALL_IPTABLES=1
@@ -39,26 +47,29 @@ if command -v apt-get >/dev/null 2>&1; then
3947
fi
4048
fi
4149
elif command -v dnf >/dev/null 2>&1; then
50+
if ! command -v tar >/dev/null 2>&1; then
51+
dnf_install -y tar
52+
fi
4253
if [ "${LIMA_CIDATA_MOUNTS}" -gt 0 ]; then
4354
if ! command -v sshfs >/dev/null 2>&1; then
44-
if grep -q "release 8" /etc/system-release; then
45-
dnf install --enablerepo powertools -y fuse-sshfs
55+
if grep -q "release 8" /etc/system-release && grep -qv "^Oracle" /etc/system-release; then
56+
dnf_install --enablerepo powertools -y fuse-sshfs
4657
else
47-
dnf install -y fuse-sshfs
58+
dnf_install -y fuse-sshfs
4859
fi
4960
fi
5061
fi
5162
if [ "${INSTALL_IPTABLES}" = 1 ]; then
5263
if [ ! -e /usr/sbin/iptables ]; then
53-
dnf install -y iptables
64+
dnf_install -y iptables
5465
fi
5566
fi
5667
if [ "${LIMA_CIDATA_CONTAINERD_USER}" = 1 ]; then
5768
if ! command -v newuidmap >/dev/null 2>&1; then
58-
dnf install -y shadow-utils
69+
dnf_install -y shadow-utils
5970
fi
6071
if ! command -v mount.fuse3 >/dev/null 2>&1; then
61-
dnf install -y fuse3
72+
dnf_install -y fuse3
6273
fi
6374
if [ ! -e /usr/bin/fusermount ]; then
6475
# Workaround for https://github.com/containerd/stargz-snapshotter/issues/340

0 commit comments

Comments
 (0)