[PATCH v4 3/4] bootstrap: create lock for downloads/deb without sudo

11 views
Skip to first unread message

Cedric Hombourger

unread,
Sep 25, 2025, 2:54:46 AMSep 25
to isar-...@googlegroups.com, cedric.h...@siemens.com
From: "cedric.h...@siemens.com" <cedric.h...@siemens.com>

The syncin/syncout commands passed to mmdebstrap will create a lock
file in downloads/deb if it does not exist. As mmdebstrap is being
executed as root, the lock would also be owned by root and this will
cause problems for rootless commands that may be executed later (such
as downloading of Debian packages). Create the lock file without
sudo prior to running mmdebstrap for it to be owned by the build user
rather than root.

Signed-off-by: Cedric Hombourger <cedric.h...@siemens.com>
---
meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc b/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
index 931f6f13..b2de61ad 100644
--- a/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
+++ b/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
@@ -181,6 +181,10 @@ do_bootstrap() {
&& sudo umount $base_apt_tmp \
&& rm -rf --one-file-system $base_apt_tmp' EXIT

+ # Create lock file so that it is owned by the user running the build (not root)
+ mkdir -p ${DEBDIR}
+ touch ${DEB_DL_LOCK}
+
sudo TMPDIR="${BOOTSTRAP_TMPDIR}" mmdebstrap $bootstrap_args \
$arch_param \
--mode=unshare \
--
2.47.3

Andreas Naumann

unread,
Oct 1, 2025, 3:22:58 AMOct 1
to Cedric Hombourger, isar-...@googlegroups.com

Am 25.09.25 um 08:54 schrieb 'Cedric Hombourger' via isar-users:
Tested-by: Andreas Naumann <anau...@emlix.com>

Actually by a collegue of mine.

> sudo TMPDIR="${BOOTSTRAP_TMPDIR}" mmdebstrap $bootstrap_args \
> $arch_param \
> --mode=unshare \

--
Andreas Naumann

emlix GmbH
Headquarters: Berliner Str. 12, 37073 Goettingen, Germany
Phone +49 (0)551 30664-0, e-mail in...@emlix.com
District Court of Goettingen, Registry Number HR B 3160
Managing Directors: Heike Jordan, Dr. Uwe Kracke
VAT ID No. DE 205 198 055
Office Berlin: Panoramastr. 1, 10178 Berlin, Germany
Office Bonn: Bachstr. 6, 53115 Bonn, Germany
http://www.emlix.com

Reply all
Reply to author
Forward
0 new messages