From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6596658663135379456 X-Received: by 2002:a19:4e98:: with SMTP id u24-v6mr554384lfk.7.1535904283788; Sun, 02 Sep 2018 09:04:43 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:98d4:: with SMTP id s20-v6ls1599865ljj.3.gmail; Sun, 02 Sep 2018 09:04:43 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZxyUBb7BwZ6DoteQJj87dRKaTpZN5+wU28Tt4UlvSj9M4Q9Lk84d7WjvBByE07L//BNXrp X-Received: by 2002:a2e:7a17:: with SMTP id v23-v6mr1052543ljc.18.1535904283205; Sun, 02 Sep 2018 09:04:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535904283; cv=none; d=google.com; s=arc-20160816; b=XhtCm2MA0eM2NUabQP5Rw0fv8pvdIBFFFZEdEEC+KXd1jrEWbiCL2L/aTmn3fhqqwX LEWNQx20Sg1UViQY+CAUzJd/QFuBwWjSeSJSvECCyMPbtGE6+M8dnvOjuCPckkyb8++o awhXGJkND7qZsyFN68SRCrTwfQ7lnIBSPUDO/stSljLpcm7D937eRZg9OrGTbbNZTdPP 7a6ah5CpNgmEblPy6cH8jWptU+MIt792v4G8+2PUMuQKrnirFqeYfoJtroaHNo5oyFU4 wa8WyAkSdOMna45ihYK6Xe53FZQNN7KkCYqZkQS6fKDgZ2KSe6vY5xnCSdTcn55VxRKr qeSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:references:in-reply-to:message-id:date :subject:to:from:arc-authentication-results; bh=WOOCUZVQWcr9y2m72kDw4sOoiO7oh73Oy1iTbEJqPrM=; b=JzNyttZqRLLrnKiSEFMbEAewXoPVOSlnCQmWneD89mQt50v+0Sk+568txFhYOXRmNV ozEQFzchp7R36CnJyCFWoJ3l0DalfkA4v7AMg//odFzD+jli2VyZ57IYk+yRKK337wLL tjyMydp1qMdtwErJ0eiES3Kd1PEqu97ynvO0ub2oqg/B4JzM5mjYqBUBMhu+VLZnp+aC PRJmu/Xn9COogOxW+lfe0GIwj5xUXV3CFruNwU5KYALmp+tqs2lzMUyXrr3XaSPmhg6x LOhnsCH2nmgDocBhSoCZNRyWshNNtTz/RwAkvyTLd/eqf8qTOE4Mx/36/KsxVmftOqsE kv+Q== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from gecko.sbs.de (gecko.sbs.de. [194.138.37.40]) by gmr-mx.google.com with ESMTPS id q4-v6si437183ljj.5.2018.09.02.09.04.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Sep 2018 09:04:43 -0700 (PDT) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.40 as permitted sender) client-ip=194.138.37.40; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id w82G4g9Q002065 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sun, 2 Sep 2018 18:04:42 +0200 Received: from md1f2u6c.ad001.siemens.net ([139.22.32.125]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id w82G4fqr004352 for ; Sun, 2 Sep 2018 18:04:42 +0200 From: Jan Kiszka To: isar-users Subject: [PATCH 5/6] dpkg, linux-custom: Split dependency installation from build preparations Date: Sun, 2 Sep 2018 18:04:39 +0200 Message-Id: X-Mailer: git-send-email 2.16.4 In-Reply-To: References: In-Reply-To: References: X-TUID: NccIrqykgnw+ From: Jan Kiszka Only the former needs locking, and the latter benefits from clearer naming: do_prepare_build is supposed to run prior to the build. The dependency installation task is now from the user perspective part of the build again, even when run separately directly before it. Signed-off-by: Jan Kiszka --- meta/classes/dpkg-base.bbclass | 24 +++++++++--------------- meta/classes/dpkg-raw.bbclass | 4 ++-- meta/classes/dpkg.bbclass | 8 ++++++-- meta/recipes-kernel/linux-module/module.inc | 2 +- meta/recipes-kernel/linux/linux-custom.inc | 6 ++++-- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass index 6299ef8..a2d2ff0 100644 --- a/meta/classes/dpkg-base.bbclass +++ b/meta/classes/dpkg-base.bbclass @@ -15,7 +15,7 @@ python __anonymous() { dep = "buildchroot-host:do_build" rootfs = d.getVar('BUILDCHROOT_HOST_DIR', True) - d.setVarFlag('do_prepare', 'depends', dep) + d.setVarFlag('do_prepare_build', 'depends', dep) d.setVar('BUILDCHROOT_DIR', rootfs) } @@ -48,11 +48,17 @@ PPS ?= "${@get_package_srcdir(d)}" BUILDROOT = "${BUILDCHROOT_DIR}/${PP}" do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" -# Empty do_prepare() implementation, to be overwritten if needed -dpkg_prepare() { +# Empty do_prepare_build() implementation, to be overwritten if needed +do_prepare_build() { true } +addtask prepare_build after do_patch before do_build +do_prepare_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" +# If Isar recipes depend on each other, they typically need the package +# deployed to isar-apt +do_prepare_build[deptask] = "do_deploy_deb" + MOUNT_LOCKFILE = "${BUILDCHROOT_DIR}/mount.lock" # Wrap the function dpkg_runbuild with the bind mount for buildroot @@ -75,18 +81,6 @@ dpkg_undo_mounts() { sudo rmdir ${BUILDROOT} 2>/dev/null || true } -do_prepare() { - dpkg_do_mounts - dpkg_prepare - dpkg_undo_mounts -} - -addtask prepare after do_patch before do_build -do_prepare[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" -# If Isar recipes depend on each other, they typically need the package -# deployed to isar-apt -do_prepare[deptask] = "do_deploy_deb" - # Placeholder for actual dpkg_runbuild() implementation dpkg_runbuild() { die "This should never be called, overwrite it in your derived class" diff --git a/meta/classes/dpkg-raw.bbclass b/meta/classes/dpkg-raw.bbclass index c5f1c88..c848f3d 100644 --- a/meta/classes/dpkg-raw.bbclass +++ b/meta/classes/dpkg-raw.bbclass @@ -14,7 +14,7 @@ do_install() { } do_install[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" -addtask install after do_unpack before do_prepare +addtask install after do_unpack before do_prepare_build deb_package_prepare() { sudo rm -rf ${D}/DEBIAN @@ -48,7 +48,7 @@ deb_package_conffiles() { test -s $CONFFILES || rm $CONFFILES } -dpkg_prepare() { +do_prepare_build() { deb_package_prepare deb_package_conffiles } diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass index 2e53c1b..da0b40d 100644 --- a/meta/classes/dpkg.bbclass +++ b/meta/classes/dpkg.bbclass @@ -4,13 +4,17 @@ inherit dpkg-base # Install build dependencies for package -dpkg_prepare() { +do_install_builddeps() { + dpkg_do_mounts E="${@ bb.utils.export_proxies(d)}" sudo -E chroot ${BUILDCHROOT_DIR} /isar/deps.sh ${PP}/${PPS} ${DISTRO_ARCH} + dpkg_undo_mounts } +addtask install_builddeps after do_prepare_build before do_build # apt and reprepro may not run in parallel, acquire the Isar lock -do_prepare[lockfiles] += "${DEPLOY_DIR_APT}/isar.lock" +do_install_builddeps[lockfiles] += "${DEPLOY_DIR_APT}/isar.lock" +do_install_builddeps[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" # Build package from sources using build script dpkg_runbuild() { diff --git a/meta/recipes-kernel/linux-module/module.inc b/meta/recipes-kernel/linux-module/module.inc index 7bc29a8..08d2c25 100644 --- a/meta/recipes-kernel/linux-module/module.inc +++ b/meta/recipes-kernel/linux-module/module.inc @@ -17,7 +17,7 @@ AUTOLOAD ?= "0" inherit dpkg -do_prepare_prepend() { +do_prepare_build() { cp -r ${WORKDIR}/debian ${S}/ sed -i -e 's/@PN@/${PN}/g' -e 's/@PV@/${PV}/g' \ -e 's/@KERNEL_NAME@/${KERNEL_NAME}/g' \ diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc index 57f2f82..4144b67 100644 --- a/meta/recipes-kernel/linux/linux-custom.inc +++ b/meta/recipes-kernel/linux/linux-custom.inc @@ -28,7 +28,7 @@ KBUILD_DEPENDS ?= "libssl-dev libelf-dev bc git" KERNEL_DEBIAN_DEPENDS ?= "initramfs-tools | linux-initramfs-tool, kmod, linux-base (>= 4.3~)" KERNEL_HEADERS_DEBIAN_DEPENDS ?= "libc6, libssl1.1" -dpkg_prepare() { +do_install_builddeps() { E="${@ bb.utils.export_proxies(d)}" sudo -E chroot ${BUILDCHROOT_DIR} \ apt-get install \ @@ -36,8 +36,10 @@ dpkg_prepare() { --no-install-recommends ${KBUILD_DEPENDS} } +addtask install_builddeps after do_prepare_build before do_build # apt and reprepro may not run in parallel, acquire the Isar lock -do_prepare[lockfiles] += "${DEPLOY_DIR_APT}/isar.lock" +do_install_builddeps[lockfiles] += "${DEPLOY_DIR_APT}/isar.lock" +do_install_builddeps[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" dpkg_runbuild() { # Install package builder script -- 2.16.4