Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libvirt/nerdctl: use UNPACKDIR #2

Merged
merged 2 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions recipes-containers/nerdctl/nerdctl_git.bb
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,22 @@ DEPENDS = " \
SRCREV_FORMAT="nerdcli_cgroups"
SRCREV_nerdcli = "265d6b9cf526ce7d9ed8d34a0e3c3066901cc463"

SRC_URI = "git://github.com/containerd/nerdctl.git;name=nerdcli;branch=main;protocol=https;destsuffix=${GO_SRCURI_DESTSUFFIX}"
SRC_URI = "git://github.com/containerd/nerdctl.git;name=nerdcli;branch=main;protocol=https;destsuffix=${UNPACKDIR}"

include src_uri.inc

# patches and config
SRC_URI += "file://0001-Makefile-allow-external-specification-of-build-setti.patch;patchdir=src/${GO_IMPORT} \
SRC_URI += "file://0001-Makefile-allow-external-specification-of-build-setti.patch;patchdir=${UNPACKDIR} \
file://modules.txt \
"

LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
LIC_FILES_CHKSUM = "file://${UNPACKDIR}/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"

GO_IMPORT = "import"

# S = "${WORKDIR}/git"
UNPACKDIR = "${WORKDIR}/${BP}/src/${GO_IMPORT}"

PV = "v2.0.0-beta.1"

Expand All @@ -53,7 +54,7 @@ PIEFLAG = "${@bb.utils.contains('GOBUILDFLAGS', '-buildmode=pie', '-buildmode=pi

do_compile() {

cd ${S}/src/import
cd ${UNPACKDIR}

export GOPATH="$GOPATH:${S}/src/import/.gopath"

Expand All @@ -69,14 +70,14 @@ do_compile() {
# our copied .go files are to be used for the build
ln -sf vendor.copy vendor
# inform go that we know what we are doing
cp ${WORKDIR}/modules.txt vendor/
cp ${UNPACKDIR}/modules.txt vendor/

oe_runmake GO=${GO} BUILDTAGS="${BUILDTAGS}" binaries
}

do_install() {
install -d "${D}${BIN_PREFIX}${base_bindir}"
install -m 755 "${S}/src/import/_output/nerdctl" "${D}${BIN_PREFIX}${base_bindir}"
install -m 755 "${UNPACKDIR}/_output/nerdctl" "${D}${BIN_PREFIX}${base_bindir}"
}

INHIBIT_PACKAGE_STRIP = "1"
Expand Down
2 changes: 1 addition & 1 deletion recipes-containers/nerdctl/relocation.inc
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export sites="gotest.tools/v3:gotest.tools/v3:force \
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp:go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/instrumentation/net/http/otelhttp:force"

do_compile:prepend() {
cd ${S}/src/import
cd ${UNPACKDIR}
for s in $sites; do
site_dest=$(echo $s | cut -d: -f1)
site_source=$(echo $s | cut -d: -f2)
Expand Down
4 changes: 2 additions & 2 deletions recipes-extended/libvirt/libvirt-python.inc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ do_compile:append() {
# the syroot staged pkgconfig entries. So we clear the sysroot
# for just this portion.
export PKG_CONFIG_SYSROOT_DIR=
cd ${WORKDIR}/${BPN}-python-${PV} && \
cd ${UNPACKDIR}/${BPN}-python-${PV} && \
${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py build
fi
}
Expand All @@ -57,7 +57,7 @@ do_install:append() {
# the syroot staged pkgconfig entries. So we clear the sysroot
# for just this portion.
export PKG_CONFIG_SYSROOT_DIR=
cd ${WORKDIR}/${BPN}-python-${PV} && \
cd ${UNPACKDIR}/${BPN}-python-${PV} && \
${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py install \
--install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${LIBVIRT_INSTALL_ARGS}
fi
Expand Down
26 changes: 13 additions & 13 deletions recipes-extended/libvirt/libvirt_10.0.0.bb
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ do_install:append() {
install -d ${D}/etc/libvirt
install -d ${D}/etc/dnsmasq.d

install -m 0755 ${WORKDIR}/libvirtd.sh ${D}/etc/init.d/libvirtd
install -m 0644 ${WORKDIR}/libvirtd.conf ${D}/etc/libvirt/libvirtd.conf
install -m 0755 ${UNPACKDIR}/libvirtd.sh ${D}/etc/init.d/libvirtd
install -m 0644 ${UNPACKDIR}/libvirtd.conf ${D}/etc/libvirt/libvirtd.conf

if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
# This will wind up in the libvirtd package, but will NOT be invoked by default.
Expand Down Expand Up @@ -255,12 +255,12 @@ do_install:append() {
mkdir -p ${D}/etc/libvirt/hooks
for hook in "daemon" "lxc" "network" "qemu"
do
install -m 0755 ${WORKDIR}/hook_support.py ${D}/etc/libvirt/hooks/${hook}
install -m 0755 ${UNPACKDIR}/hook_support.py ${D}/etc/libvirt/hooks/${hook}
done

# Force the main dnsmasq instance to bind only to specified interfaces and
# to not bind to virbr0. Libvirt will run its own instance on this interface.
install -m 644 ${WORKDIR}/dnsmasq.conf ${D}/${sysconfdir}/dnsmasq.d/libvirt-daemon
install -m 644 ${UNPACKDIR}/dnsmasq.conf ${D}/${sysconfdir}/dnsmasq.d/libvirt-daemon

# remove .la references to our working diretory
for i in `find ${D}${libdir} -type f -name *.la`; do
Expand All @@ -286,21 +286,21 @@ do_install:append() {

if ${@bb.utils.contains('PACKAGECONFIG','gnutls','true','false',d)}; then
# Generate sample keys and certificates.
cd ${WORKDIR}
${WORKDIR}/gnutls-helper.py -y
cd ${UNPACKDIR}
${UNPACKDIR}/gnutls-helper.py -y

# Deploy all sample keys and certificates of CA, server and client
# to target so that libvirtd is able to boot successfully and local
# connection via 127.0.0.1 is available out of box.
install -d ${D}/etc/pki/CA
install -d ${D}/etc/pki/libvirt/private
install -m 0755 ${WORKDIR}/gnutls-helper.py ${D}/${bindir}
install -m 0644 ${WORKDIR}/cakey.pem ${D}/${sysconfdir}/pki/libvirt/private/cakey.pem
install -m 0644 ${WORKDIR}/cacert.pem ${D}/${sysconfdir}/pki/CA/cacert.pem
install -m 0644 ${WORKDIR}/serverkey.pem ${D}/${sysconfdir}/pki/libvirt/private/serverkey.pem
install -m 0644 ${WORKDIR}/servercert.pem ${D}/${sysconfdir}/pki/libvirt/servercert.pem
install -m 0644 ${WORKDIR}/clientkey.pem ${D}/${sysconfdir}/pki/libvirt/private/clientkey.pem
install -m 0644 ${WORKDIR}/clientcert.pem ${D}/${sysconfdir}/pki/libvirt/clientcert.pem
install -m 0755 ${UNPACKDIR}/gnutls-helper.py ${D}/${bindir}
install -m 0644 ${UNPACKDIR}/cakey.pem ${D}/${sysconfdir}/pki/libvirt/private/cakey.pem
install -m 0644 ${UNPACKDIR}/cacert.pem ${D}/${sysconfdir}/pki/CA/cacert.pem
install -m 0644 ${UNPACKDIR}/serverkey.pem ${D}/${sysconfdir}/pki/libvirt/private/serverkey.pem
install -m 0644 ${UNPACKDIR}/servercert.pem ${D}/${sysconfdir}/pki/libvirt/servercert.pem
install -m 0644 ${UNPACKDIR}/clientkey.pem ${D}/${sysconfdir}/pki/libvirt/private/clientkey.pem
install -m 0644 ${UNPACKDIR}/clientcert.pem ${D}/${sysconfdir}/pki/libvirt/clientcert.pem

# Force the connection to be tls.
sed -i -e 's/^\(listen_tls\ =\ .*\)/#\1/' -e 's/^\(listen_tcp\ =\ .*\)/#\1/' ${D}/etc/libvirt/libvirtd.conf
Expand Down