From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6498671579909586944 X-Received: by 2002:ac2:58d1:: with SMTP id u17mr23678893lfo.440.1618326176506; Tue, 13 Apr 2021 08:02:56 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:9b0e:: with SMTP id u14ls1744576lji.5.gmail; Tue, 13 Apr 2021 08:02:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+ImYEizSCR3StGgrrNWuW8OrrmMUTrTatgSCe5jFhMyu/RltkOk+h90MZ3hnDTAC0Eqjf X-Received: by 2002:a05:6512:555:: with SMTP id h21mr17582230lfl.645.1618326175448; Tue, 13 Apr 2021 08:02:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618326175; cv=none; d=google.com; s=arc-20160816; b=GqPMAsVh45A+aMJ1ol8O4zUwFY7u8sIAWbS8teWSlw69wXNYXVBmJoP2yQB60g475k lhSLFAYfHfsrNROt1HQejIU1bfy89a4/jEwa51fk1yMKRAvKp1RkXctAkVrO5jTOb8OV XSWXDTEhDfdw1OVY8OpANzxLF3halm5TZKL6sN0nP79yekoqCduBEZDv2mz8ybt2Obqv 8KS/p9y8GAoy+S6gV2GDduA+YcU4lm3XmKucbbPaGMeB3q8z/PhDDY3OEgw2eQ7EoGP1 G00lXyg0tUQSWWz8yM2IdP2STnhEEk7M1Jdc/CE8OP9FsGrpRY7FAZp6Muj28kEFacVu 3qWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=+E0ub95PikeB1KBRtBC9+Zi9X5EY14N0l/v4OP73gSo=; b=lD6cmLOGoo51ZP+Cjr3uo0AD3uAuLqUhHxfJIrt4wj8oQgQ1UCCrIgg2u1sB/+hII+ yIMz7bMARZIhO+ZLJwgOOkn3Vl98rTjmOVfwKFBIVsYV0/RnArf75hnu1WXSj+pT0M8A qvpiqHFGYE81pJPvcxn9PAqp+1aNDrAKl+BY0+9FSvWDpHbX8TRLXf1P/kmWc/6+Fto7 Fve9wiCQI1/6h00MAGoEbNlza3AZ3vjRV5ir6BbCXlhd8XzAoqNd8FqcdicVgG9waioy CV/QTCx/++B9suRol2Yk1O6XnbJJ3b/NoP9vhCnHmaG45gkacfkruX2tn4/cqyOH+fk1 AzTg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from gecko.sbs.de (gecko.sbs.de. [194.138.37.40]) by gmr-mx.google.com with ESMTPS id j7si528399ljc.6.2021.04.13.08.02.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Apr 2021 08:02:55 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@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 henning.schild@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id 13DF2sX5008165 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Apr 2021 17:02:54 +0200 Received: from localhost.localdomain ([167.87.48.83]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 13DF2rM2021528; Tue, 13 Apr 2021 17:02:53 +0200 From: Henning Schild To: bitbake-devel@lists.openembedded.org Cc: isar-users@googlegroups.com, Richard Purdie , Cedric Hombourger , Chris Larson , Henning Schild Subject: [PATCH v2 1/3] fetch/git: add support for disabling shared clones on unpack Date: Tue, 13 Apr 2021 17:02:49 +0200 Message-Id: <20210413150251.1969-1-henning.schild@siemens.com> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: sEGOLDlnKAop By default the unpacker will create a "shared" clone when cloning from the DL_DIR to the WORKDIR. This patch introduces an option to control that behaviour. Imagine some recipe steps are executed in a namespace that is different from the one your downloader and unpacker ran in. (chroot) Because a "shared" clone has an absolute reference to its "alternate" you now have to make that "alternate" visible in that new namespace (chroot) at the exact place. With this patch you can unpack "noshared" and get a stand-alone copy. This copy will also work if the "alternate" is not visible or existant. The switch is a global bitbake switch and will affect all git urls. Build systems that need "noshared" most likely need it for everything they do with git. Signed-off-by: Henning Schild --- lib/bb/fetch2/git.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py index e3ba80a3f52a..3e25b4b6047c 100644 --- a/lib/bb/fetch2/git.py +++ b/lib/bb/fetch2/git.py @@ -168,7 +168,11 @@ class Git(FetchMethod): if len(branches) != len(ud.names): raise bb.fetch2.ParameterError("The number of name and branch parameters is not balanced", ud.url) - ud.cloneflags = "-s -n" + ud.noshared = d.getVar("BB_GIT_NOSHARED") == "1" + + ud.cloneflags = "-n" + if not ud.noshared: + ud.cloneflags += " -s" if ud.bareclone: ud.cloneflags += " --mirror" -- 2.26.3