Skip to content

Commit 78407c4

Browse files
committed
cidata: load modules in 00-modprobe.sh
Load modules as soon as the cloud-init starts up. Because Arch Linux removes kernel modules when the kernel package was updated during running cloud-init :( Signed-off-by: Akihiro Suda <[email protected]>
1 parent 28a89b3 commit 78407c4

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed
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)