From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6592507174472122368 X-Received: by 2002:a1f:852:: with SMTP id 79-v6mr3879303vki.32.1535264511952; Sat, 25 Aug 2018 23:21:51 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1f:a90b:: with SMTP id s11-v6ls731331vke.7.gmail; Sat, 25 Aug 2018 23:21:51 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZVKH+qD+oavHGOXrBv1+3iMA88wIIiFJlc9tkP2CYDa62YTZb3JHLT5Tdyr8Jrjk8XacwM X-Received: by 2002:a1f:852:: with SMTP id 79-v6mr3879301vki.32.1535264511738; Sat, 25 Aug 2018 23:21:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535264511; cv=none; d=google.com; s=arc-20160816; b=mMEUPh86tAvuOntv5jkUBlbRy4r0VqAwHrq0lixXil/NdkZLIANI3vaMTgHqm3vYTJ 16vuXXOeHHZ3DhWINpa/kTQ40OwzcJuvPfblhWtBOzN1qKRQyzc3pcLik/+9LkU1njt3 wCFfMf+U9B8myMNFqOgq/O5qMIbu3oowilHY8QXPuB+N1fKCUmfC8KoXoD2zUgsaA+WR 77U1wXhdEUPL+oremwFyrNMevpc2T0icmDPG0el7s9t9D0q9bOGzr2lCa34DItJYpdy2 yTPxJGoVwUb/voh5Xh4RuWTSTxmpaQdddAk19tZLXnbyaVszHt7OkTkKne+KKQXW1JwL OEfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:arc-authentication-results; bh=mH8RHBrhlyKZZZ96oLiRAM6rXle+5w84GMHnjoXqcgw=; b=wEbZ2W0rbZDJUrjEvJ0Z/aJWfG7+lrC421Umku2yrTSOzfnM8UcIp6eKnPRUyo565s nVGvqq2Y+3VxAp9IThWgnLwzFaS57vlvDQ3Sws1Jg6CB7wQyAaS7pFyL5tlk5fig5Yxu DbeVzQD48kQL9Dpm4PKteu0Kix79NP1iuo6+qr3NP5RnjQYtorwdlM1mdIaK41a60fvH tLOhIt/XaDTwQgGCQDiAWfdNQzmd7IBw5G9I4QHt5Xw/Wz4MBKXgmpsnQRi/parncTMh 81QU1n7Ag7LxuQxLK+FcM+EJyfxZHBqFAzDyuXQDvmIPf/Ovk8UxIu9LjCe8gByuACwF BN+Q== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 192.94.38.131 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com Return-Path: Received: from relay1.mentorg.com (relay1.mentorg.com. [192.94.38.131]) by gmr-mx.google.com with ESMTPS id y6-v6si494766vkg.2.2018.08.25.23.21.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Aug 2018 23:21:51 -0700 (PDT) Received-SPF: pass (google.com: domain of cedric_hombourger@mentor.com designates 192.94.38.131 as permitted sender) client-ip=192.94.38.131; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 192.94.38.131 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-02.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1ftoQn-0000Je-Vf from Cedric_Hombourger@mentor.com for isar-users@googlegroups.com; Sat, 25 Aug 2018 23:21:49 -0700 Received: from FRG-W10-HOMBOUR.world.mentorg.com (137.202.0.90) by svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Sun, 26 Aug 2018 07:21:46 +0100 From: Cedric Hombourger To: CC: Cedric Hombourger Subject: [PATCH v3 2/3] linux: leverage dpkg_prepare to install build dependencies Date: Sun, 26 Aug 2018 08:21:27 +0200 Message-ID: <1535264488-128-2-git-send-email-Cedric_Hombourger@mentor.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535264488-128-1-git-send-email-Cedric_Hombourger@mentor.com> References: <20180822154145.07d4a2ca@md1pvb1c.ad001.siemens.net> <1535264488-128-1-git-send-email-Cedric_Hombourger@mentor.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) To svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) X-TUID: ztQPnvwqaHfL To prepare removal of flock calls around dpkg/apt operations, move the code installing build dependencies to dpkg_prepare() Signed-off-by: Cedric Hombourger --- meta/recipes-kernel/linux/files/build-kernel.sh | 5 ----- meta/recipes-kernel/linux/linux-custom.inc | 8 ++++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/meta/recipes-kernel/linux/files/build-kernel.sh b/meta/recipes-kernel/linux/files/build-kernel.sh index 8b58e93..498067c 100644 --- a/meta/recipes-kernel/linux/files/build-kernel.sh +++ b/meta/recipes-kernel/linux/files/build-kernel.sh @@ -33,11 +33,6 @@ REPACK_DIR="$1/../repack" REPACK_LINUX_IMAGE_DIR="${REPACK_DIR}/linux-image" REPACK_LINUX_HEADERS_DIR="${REPACK_DIR}/linux-headers" -# Lock-protected because apt and dpkg do not wait in case of contention -flock /dpkg.lock \ - apt-get install -y -o Debug::pkgProblemResolver=yes \ - --no-install-recommends ${KBUILD_DEPENDS} - cd $1 make olddefconfig diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc index 87d4377..26c6ad8 100644 --- a/meta/recipes-kernel/linux/linux-custom.inc +++ b/meta/recipes-kernel/linux/linux-custom.inc @@ -28,6 +28,14 @@ KBUILD_DEPENDS ?= "libssl-dev libelf-dev bc" KERNEL_DEBIAN_DEPENDS ?= "initramfs-tools | linux-initramfs-tool, kmod, linux-base (>= 4.3~)" KERNEL_HEADERS_DEBIAN_DEPENDS ?= "libc6, libssl1.1" +dpkg_prepare() { + # Lock-protected because apt and dpkg do not wait in case of contention + sudo -E chroot ${BUILDCHROOT_DIR} \ + flock /dpkg.lock apt-get install \ + -y -o Debug::pkgProblemResolver=yes \ + --no-install-recommends ${KBUILD_DEPENDS} +} + dpkg_runbuild() { # Install package builder script sudo install -m 755 ${WORKDIR}/build-kernel.sh ${BUILDCHROOT_DIR} -- 2.11.0