Skip to content

Commit

Permalink
app-emulation/qemu: Dynamically create binfmt.d/qemu.conf
Browse files Browse the repository at this point in the history
This file is stored in /usr/share/qemu/binfmt.d/qemu.conf and can be
symlinked to /etc/binfmt.d

Package-Manager: Portage-2.3.3, Repoman-2.3.1
  • Loading branch information
tamiko committed Feb 23, 2017
1 parent c4e87a6 commit 34e99aa
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions app-emulation/qemu/qemu-9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -563,12 +563,15 @@ qemu_python_install() {
python_doscript "${S}/scripts/qmp/qemu-ga-client"
}

# Generate the /etc/init.d/qemu-binfmt script which registers the user handlers.
# Generate binfmt support files.
# - /etc/init.d/qemu-binfmt script which registers the user handlers (openrc)
# - /usr/share/qemu/binfmt.d/qemu.conf (for use with systemd-binfmt)
generate_initd() {
local out="${T}/qemu-binfmt"
local out_systemd="${T}/qemu.conf"
local d="${T}/binfmt.d"

einfo "Generating qemu init.d script"
einfo "Generating qemu binfmt scripts and configuration files"

# Generate the debian fragments first.
mkdir -p "${d}"
Expand Down Expand Up @@ -604,6 +607,9 @@ generate_initd() {
echo ':${package}:M::${magic}:${mask}:${interpreter}:'"\${QEMU_BINFMT_FLAGS}" >/proc/sys/fs/binfmt_misc/register
fi
EOF

echo ":${package}:M::${magic}:${mask}:${interpreter}:OC" >>"${out_systemd}"

done
cat "${FILESDIR}"/qemu-binfmt.initd.tail >>"${out}" || die
}
Expand All @@ -616,6 +622,10 @@ src_install() {
# Install binfmt handler init script for user targets.
generate_initd
doinitd "${T}/qemu-binfmt"

# Install binfmt/qemu.conf.
insinto "/usr/share/qemu/binfmt.d"
doins "${T}/qemu.conf"
fi

if [[ -n ${softmmu_targets} ]]; then
Expand Down

0 comments on commit 34e99aa

Please sign in to comment.