Skip to content

Commit dfe4f7a

Browse files
authored
Merge pull request #108 from AkihiroSuda/dev-fix-archlinux-link
examples/archlinux.yaml: use more reliable image URL
2 parents 66464fc + 78407c4 commit dfe4f7a

File tree

6 files changed

+32
-8
lines changed

6 files changed

+32
-8
lines changed

examples/archlinux.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# This example requires Lima v0.5.0 or later
22
arch: "x86_64"
33
images:
4-
- location: "https://gitlab.archlinux.org/archlinux/arch-boxes/-/jobs/27546/artifacts/raw/output/Arch-Linux-x86_64-cloudimg-20210630.27546.qcow2"
4+
# NOTE: the image is periodically rotated, if you face 404, see https://mirror.pkgbuild.com/images/ to find the latest image.
5+
- location: "https://mirror.pkgbuild.com/images/v20210619.26314/Arch-Linux-x86_64-cloudimg-20210619.26314.qcow2"
56
arch: "x86_64"
67
mounts:
78
- location: "~"

hack/test-example.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,22 @@ if limactl ls -q | grep -q "$NAME"; then
6060
exit 1
6161
fi
6262

63+
function diagnose() {
64+
NAME="$1"
65+
set -x +e
66+
tail "$HOME/.lima/${NAME}"/*.log
67+
limactl shell "$NAME" systemctl status
68+
limactl shell "$NAME" systemctl
69+
limactl shell "$NAME" sudo cat /var/log/cloud-init-output.log
70+
set +x -e
71+
}
72+
6373
INFO "Starting \"$NAME\" from \"$FILE\""
6474
trap 'limactl delete -f $NAME' EXIT
6575
set -x
6676
if ! limactl start --tty=false "$FILE"; then
6777
ERROR "Failed to start \"$NAME\""
68-
tail "$HOME/.lima/${NAME}"/*.log
69-
limactl shell "$NAME" systemctl status || true
70-
limactl shell "$NAME" cat /var/log/cloud-init-output.log || true
78+
diagnose "$NAME"
7179
exit 1
7280
fi
7381

@@ -93,7 +101,7 @@ if [[ -n ${CHECKS["systemd"]} ]]; then
93101
set -x
94102
if ! limactl shell "$NAME" systemctl is-system-running --wait; then
95103
ERROR '"systemctl is-system-running" failed'
96-
limactl shell "$NAME" systemctl
104+
diagnose "$NAME"
97105
if [[ -z ${CHECKS["systemd-strict"]} ]]; then
98106
INFO 'Ignoring "systemctl is-system-running" failure'
99107
else
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
# Load modules as soon as the cloud-init starts up.
3+
# Because Arch Linux removes kernel module files when the kernel package was updated during running cloud-init :(
4+
5+
set -eu
6+
for f in \
7+
fuse \
8+
tun tap \
9+
bridge veth \
10+
ip_tables ip6_tables iptable_nat ip6table_nat iptable_filter ip6table_filter \
11+
nf_tables \
12+
x_tables xt_MASQUERADE xt_addrtype xt_comment xt_conntrack xt_mark xt_multiport xt_nat xt_tcpudp \
13+
overlay; do
14+
echo "Loading kernel module \"$f\""
15+
if ! modprobe "$f"; then
16+
echo >&2 "Faild to load \"$f\" (negligible if it is built-in the kernel)"
17+
fi
18+
done

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ elif command -v apk >/dev/null 2>&1; then
7979
apk update
8080
apk add sshfs
8181
fi
82-
modprobe fuse
8382
fi
8483
fi
8584

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ EOF
2525
fi
2626

2727
if [ "${LIMA_CIDATA_CONTAINERD_USER}" = 1 ]; then
28-
modprobe tap || true
29-
modprobe ip_tables || true
3028
if [ ! -e "/home/${LIMA_CIDATA_USER}.linux/.config/containerd/config.toml" ]; then
3129
mkdir -p "/home/${LIMA_CIDATA_USER}.linux/.config/containerd"
3230
cat >"/home/${LIMA_CIDATA_USER}.linux/.config/containerd/config.toml" <<EOF

0 commit comments

Comments
 (0)