* [PATCH] linux-custom: Add lock to dependency installation
@ 2018-02-22 21:25 Jan Kiszka
2018-03-04 19:50 ` Jan Kiszka
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Jan Kiszka @ 2018-02-22 21:25 UTC (permalink / raw)
To: isar-users
From: Jan Kiszka <jan.kiszka@siemens.com>
The build script of linux-custom requires the same lock protection as
build.sh of the dpkg builder class. Otherwise, we see the infamous build
failures again due to contention on the dpkg database lock.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta/recipes-kernel/linux/files/build-kernel.sh | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/meta/recipes-kernel/linux/files/build-kernel.sh b/meta/recipes-kernel/linux/files/build-kernel.sh
index 94897ec..42c8ff6 100644
--- a/meta/recipes-kernel/linux/files/build-kernel.sh
+++ b/meta/recipes-kernel/linux/files/build-kernel.sh
@@ -13,8 +13,10 @@ REPACK_DIR="$1/../repack"
REPACK_LINUX_IMAGE_DIR="${REPACK_DIR}/linux-image"
REPACK_LINUX_HEADERS_DIR="${REPACK_DIR}/linux-headers"
-apt-get install -y -o Debug::pkgProblemResolver=yes --no-install-recommends \
- ${KBUILD_DEPENDS}
+# 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
--
2.13.6
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] linux-custom: Add lock to dependency installation
2018-02-22 21:25 [PATCH] linux-custom: Add lock to dependency installation Jan Kiszka
@ 2018-03-04 19:50 ` Jan Kiszka
2018-03-05 7:16 ` Alexander Smirnov
2018-03-05 9:58 ` Alexander Smirnov
2 siblings, 0 replies; 5+ messages in thread
From: Jan Kiszka @ 2018-03-04 19:50 UTC (permalink / raw)
To: Alexander Smirnov; +Cc: isar-users
On 2018-02-22 22:25, [ext] Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> The build script of linux-custom requires the same lock protection as
> build.sh of the dpkg builder class. Otherwise, we see the infamous build
> failures again due to contention on the dpkg database lock.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> meta/recipes-kernel/linux/files/build-kernel.sh | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-kernel/linux/files/build-kernel.sh b/meta/recipes-kernel/linux/files/build-kernel.sh
> index 94897ec..42c8ff6 100644
> --- a/meta/recipes-kernel/linux/files/build-kernel.sh
> +++ b/meta/recipes-kernel/linux/files/build-kernel.sh
> @@ -13,8 +13,10 @@ REPACK_DIR="$1/../repack"
> REPACK_LINUX_IMAGE_DIR="${REPACK_DIR}/linux-image"
> REPACK_LINUX_HEADERS_DIR="${REPACK_DIR}/linux-headers"
>
> -apt-get install -y -o Debug::pkgProblemResolver=yes --no-install-recommends \
> - ${KBUILD_DEPENDS}
> +# 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
>
Could you have a look at this fix? It's essential when building custom
kernels and it's needed to reduce my queue to 0.
Thanks
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] linux-custom: Add lock to dependency installation
2018-02-22 21:25 [PATCH] linux-custom: Add lock to dependency installation Jan Kiszka
2018-03-04 19:50 ` Jan Kiszka
@ 2018-03-05 7:16 ` Alexander Smirnov
2018-03-05 7:20 ` Jan Kiszka
2018-03-05 9:58 ` Alexander Smirnov
2 siblings, 1 reply; 5+ messages in thread
From: Alexander Smirnov @ 2018-03-05 7:16 UTC (permalink / raw)
To: Jan Kiszka, isar-users
On 02/23/2018 12:25 AM, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> The build script of linux-custom requires the same lock protection as
> build.sh of the dpkg builder class. Otherwise, we see the infamous build
> failures again due to contention on the dpkg database lock.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> meta/recipes-kernel/linux/files/build-kernel.sh | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-kernel/linux/files/build-kernel.sh b/meta/recipes-kernel/linux/files/build-kernel.sh
> index 94897ec..42c8ff6 100644
> --- a/meta/recipes-kernel/linux/files/build-kernel.sh
> +++ b/meta/recipes-kernel/linux/files/build-kernel.sh
> @@ -13,8 +13,10 @@ REPACK_DIR="$1/../repack"
> REPACK_LINUX_IMAGE_DIR="${REPACK_DIR}/linux-image"
> REPACK_LINUX_HEADERS_DIR="${REPACK_DIR}/linux-headers"
>
> -apt-get install -y -o Debug::pkgProblemResolver=yes --no-install-recommends \
> - ${KBUILD_DEPENDS}
> +# 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}
The same stuff as in "meta/recipes-devtools/buildchroot/files/build.sh",
but different style. Can we keep things similar as much as possible?
Why not
(
...
) 42>/dpkg.lock
?
Alex
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] linux-custom: Add lock to dependency installation
2018-03-05 7:16 ` Alexander Smirnov
@ 2018-03-05 7:20 ` Jan Kiszka
0 siblings, 0 replies; 5+ messages in thread
From: Jan Kiszka @ 2018-03-05 7:20 UTC (permalink / raw)
To: Alexander Smirnov, isar-users
On 2018-03-05 08:16, Alexander Smirnov wrote:
>
>
> On 02/23/2018 12:25 AM, Jan Kiszka wrote:
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> The build script of linux-custom requires the same lock protection as
>> build.sh of the dpkg builder class. Otherwise, we see the infamous build
>> failures again due to contention on the dpkg database lock.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>> ---
>> meta/recipes-kernel/linux/files/build-kernel.sh | 6 ++++--
>> 1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/meta/recipes-kernel/linux/files/build-kernel.sh
>> b/meta/recipes-kernel/linux/files/build-kernel.sh
>> index 94897ec..42c8ff6 100644
>> --- a/meta/recipes-kernel/linux/files/build-kernel.sh
>> +++ b/meta/recipes-kernel/linux/files/build-kernel.sh
>> @@ -13,8 +13,10 @@ REPACK_DIR="$1/../repack"
>> REPACK_LINUX_IMAGE_DIR="${REPACK_DIR}/linux-image"
>> REPACK_LINUX_HEADERS_DIR="${REPACK_DIR}/linux-headers"
>> -apt-get install -y -o Debug::pkgProblemResolver=yes
>> --no-install-recommends \
>> - ${KBUILD_DEPENDS}
>> +# 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}
>
> The same stuff as in "meta/recipes-devtools/buildchroot/files/build.sh",
> but different style. Can we keep things similar as much as possible?
>
> Why not
>
> (
> ...
> ) 42>/dpkg.lock
>
> ?
This is
if (x)
y;
vs.
if (x) {
y;
z;
}
See also the man page of flock.
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] linux-custom: Add lock to dependency installation
2018-02-22 21:25 [PATCH] linux-custom: Add lock to dependency installation Jan Kiszka
2018-03-04 19:50 ` Jan Kiszka
2018-03-05 7:16 ` Alexander Smirnov
@ 2018-03-05 9:58 ` Alexander Smirnov
2 siblings, 0 replies; 5+ messages in thread
From: Alexander Smirnov @ 2018-03-05 9:58 UTC (permalink / raw)
To: Jan Kiszka, isar-users
On 02/23/2018 12:25 AM, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> The build script of linux-custom requires the same lock protection as
> build.sh of the dpkg builder class. Otherwise, we see the infamous build
> failures again due to contention on the dpkg database lock.
>
Applied to next, thanks.
Alex
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-03-05 9:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-22 21:25 [PATCH] linux-custom: Add lock to dependency installation Jan Kiszka
2018-03-04 19:50 ` Jan Kiszka
2018-03-05 7:16 ` Alexander Smirnov
2018-03-05 7:20 ` Jan Kiszka
2018-03-05 9:58 ` Alexander Smirnov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox