Skip to content

Commit aed9360

Browse files
committed
Create /proc/sys/fs/binfmt_misc and setup /etc/init.d/procfs
Without this change the binfmt_misc filesystem isn't mounted and rosetta cannot be registered. This isn't needed for /etc/init.d/qemu-binfmt because it loads the binfmt-misc kernel module itself if the filesystem isn't yet mounted. Signed-off-by: Jan Dubois <[email protected]>
1 parent e7967f6 commit aed9360

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

genapkovl-lima.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,12 @@ if [ "${LIMA_INSTALL_DOCKER}" == "true" ]; then
171171
echo xz >> "$tmp"/etc/apk/world
172172
fi
173173

174+
# /proc/sys/fs/binfmt_misc must exist for /etc/init.d/procfs to load
175+
# the binfmt-misc kernel module, which will then mount the filesystem.
176+
# This is needed for Rosetta to register.
177+
mkdir -p "${tmp}/proc/sys/fs/binfmt_misc"
178+
rc_add procfs default
179+
174180
if [ "${LIMA_INSTALL_BINFMT_MISC}" == "true" ]; then
175181
# install qemu-aarch64 on x86_64 and vice versa
176182
OTHERARCH=aarch64
@@ -283,6 +289,7 @@ if [ "${LIMA_INSTALL_CRI_DOCKERD}" == "true" ]; then
283289
fi
284290

285291
mkdir -p "${tmp}/etc"
292+
mkdir -p "${tmp}/proc"
286293
mkdir -p "${tmp}/usr"
287294

288-
tar -c -C "$tmp" etc usr | gzip -9n > $HOSTNAME.apkovl.tar.gz
295+
tar -c -C "$tmp" etc proc usr | gzip -9n > $HOSTNAME.apkovl.tar.gz

lima-init.openrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
depend() {
44
after lima-init-local
55
after net
6+
after procfs
67
provide lima-init
78
}
89

0 commit comments

Comments
 (0)