Skip to content

Commit 40c5c77

Browse files
authored
Merge pull request #348 from afbjorklund/centos-example
Add example of running centos distribution
2 parents 9ca11fc + 80f9b16 commit 40c5c77

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

examples/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Distro:
77
- [`archlinux.yaml`](./archlinux.yaml): Arch Linux
88
- [`debian.yaml`](./debian.yaml): Debian GNU/Linux
99
- [`fedora.yaml`](./fedora.yaml): Fedora
10+
- [`centos.yaml`](./centos.yaml): CentOS Linux
1011
- [`opensuse.yaml`](./opensuse.yaml): openSUSE Leap
1112
- [`ubuntu.yaml`](./ubuntu.yaml): Ubuntu (same as `default.yaml` but without bogus YAML lines)
1213

examples/centos.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This example requires Lima v0.7.0 or later.
2+
3+
# Hint: If QEMU crashes with error "vmx_write_mem: mmu_gva_to_gpa XXXXXXXXXXXXXXXX failed" on Intel Mac,
4+
# try setting environment variable QEMU_SYSTEM_X86_64="qemu-system-x86_64 -cpu Haswell-v4"
5+
# https://bugs.launchpad.net/qemu/+bug/1838390
6+
images:
7+
- location: "https://cloud.centos.org/centos/8/x86_64/images/CentOS-8-GenericCloud-8.4.2105-20210603.0.x86_64.qcow2"
8+
arch: "x86_64"
9+
digest: "sha256:3510fc7deb3e1939dbf3fe6f65a02ab1efcc763480bc352e4c06eca2e4f7c2a2"
10+
- location: "https://cloud.centos.org/centos/8/aarch64/images/CentOS-8-GenericCloud-8.4.2105-20210603.0.aarch64.qcow2"
11+
arch: "aarch64"
12+
digest: "sha256:8029d9ec018c54dc48f02d01200002b36ba69c6c6ea58334857eb172ab32e5d7"
13+
mounts:
14+
- location: "~"
15+
writable: false
16+
- location: "/tmp/lima"
17+
writable: true
18+
firmware:
19+
legacyBIOS: true

pkg/cidata/cidata.TEMPLATE.d/boot/20-rootless-base.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ for f in /etc/subuid /etc/subgid; do
4646
done
4747

4848
# Start systemd session
49+
systemctl start systemd-logind.service
4950
loginctl enable-linger "${LIMA_CIDATA_USER}"

pkg/cidata/cidata.TEMPLATE.d/boot/40-install-containerd.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,12 @@ EOF
5353
sudo -iu "${LIMA_CIDATA_USER}" "XDG_RUNTIME_DIR=/run/user/${LIMA_CIDATA_UID}" "PATH=${PATH}" containerd-rootless-setuptool.sh install
5454
sudo -iu "${LIMA_CIDATA_USER}" "XDG_RUNTIME_DIR=/run/user/${LIMA_CIDATA_UID}" "PATH=${PATH}" containerd-rootless-setuptool.sh install-buildkit
5555
sudo -iu "${LIMA_CIDATA_USER}" "XDG_RUNTIME_DIR=/run/user/${LIMA_CIDATA_UID}" "PATH=${PATH}" containerd-rootless-setuptool.sh install-fuse-overlayfs
56-
if ! sudo -iu "${LIMA_CIDATA_USER}" "XDG_RUNTIME_DIR=/run/user/${LIMA_CIDATA_UID}" "PATH=${PATH}" containerd-rootless-setuptool.sh install-stargz; then
57-
echo >&2 "WARNING: rootless stargz does not seem supported on this host (kernel older than 5.11?)"
56+
if grep -q "release 8" /etc/system-release; then
57+
echo >&2 "WARNING: the guest seems EL8-compatible OS. Skipping installing rootless stargz"
58+
else
59+
if ! sudo -iu "${LIMA_CIDATA_USER}" "XDG_RUNTIME_DIR=/run/user/${LIMA_CIDATA_UID}" "PATH=${PATH}" containerd-rootless-setuptool.sh install-stargz; then
60+
echo >&2 "WARNING: rootless stargz does not seem supported on this host (kernel older than 5.11?)"
61+
fi
5862
fi
5963
if [ -n "$selinux" ]; then
6064
echo "Restoring SELinux"

0 commit comments

Comments
 (0)