Skip to content

Commit

Permalink
Create /proc/sys/fs/binfmt_misc and setup /etc/init.d/procfs
Browse files Browse the repository at this point in the history
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 <jan.dubois@suse.com>
  • Loading branch information
jandubois committed May 25, 2023
1 parent e7967f6 commit aed9360
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion genapkovl-lima.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ if [ "${LIMA_INSTALL_DOCKER}" == "true" ]; then
echo xz >> "$tmp"/etc/apk/world
fi

# /proc/sys/fs/binfmt_misc must exist for /etc/init.d/procfs to load
# the binfmt-misc kernel module, which will then mount the filesystem.
# This is needed for Rosetta to register.
mkdir -p "${tmp}/proc/sys/fs/binfmt_misc"
rc_add procfs default

if [ "${LIMA_INSTALL_BINFMT_MISC}" == "true" ]; then
# install qemu-aarch64 on x86_64 and vice versa
OTHERARCH=aarch64
Expand Down Expand Up @@ -283,6 +289,7 @@ if [ "${LIMA_INSTALL_CRI_DOCKERD}" == "true" ]; then
fi

mkdir -p "${tmp}/etc"
mkdir -p "${tmp}/proc"
mkdir -p "${tmp}/usr"

tar -c -C "$tmp" etc usr | gzip -9n > $HOSTNAME.apkovl.tar.gz
tar -c -C "$tmp" etc proc usr | gzip -9n > $HOSTNAME.apkovl.tar.gz
1 change: 1 addition & 0 deletions lima-init.openrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
depend() {
after lima-init-local
after net
after procfs
provide lima-init
}

Expand Down

0 comments on commit aed9360

Please sign in to comment.