From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6498671579909586944 X-Received: by 10.25.0.197 with SMTP id 188mr472348lfa.42.1513788136535; Wed, 20 Dec 2017 08:42:16 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.46.48.20 with SMTP id w20ls2865233ljw.15.gmail; Wed, 20 Dec 2017 08:42:15 -0800 (PST) X-Google-Smtp-Source: ACJfBovVNT2dafmfE9IhIZvElzrbASZiGDMGAe4Ig27BRQ2uPhjWWiYGSmSjKzrVQZhZbryBZ2rk X-Received: by 10.46.91.212 with SMTP id m81mr541425lje.8.1513788135903; Wed, 20 Dec 2017 08:42:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513788135; cv=none; d=google.com; s=arc-20160816; b=Q66GM0kB4M6wshBhftPPZNz2ttXFfFzQsRHIYQF2NcLyTJYSPVCLpCjaUG6nZ8y/pH sJQOLCj//v5lKDEvQtbJg88Ng0NKCiaIQ+Gsy/NjNhaQUXYH64Vz2Kz0HegZETb/D/qE 4nS6SBzWfnufH3zrgRB8bwX0uV+NKKIeGwEJbHUdu4GEwAo/oT3mYQk5K3d4Eym5Wtm1 Rs3YmLJQdRi1+aBX09vRj+7a28uyqI26ptbAUY5aN8nw5eSf24FnDiGXwj4kCpFX6z0u KxLnNIQho4wz0gWATU/wAN+ZHC0qfeOn6aBjHuclBGZOR7SuvQE3hRshBm5h9QouEB6c 2vdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=a85f4PlOjbu0A9gziv/XNVbTxEYm3eLn/xz9dbBgYBk=; b=rCQcK5wVyhjWpPhgx4+5MQO/fjv/9ZRozJS62OV6Zh5lm8IrQ9pQ+taV8TrFOWk7fL evAstFPQodLXm2B6FOLt46I6l1y8UFI1VXDiHM94HecV1Fvo+1uyPM90AZ4ImnO3t5gO SqxaRPkQjkZRJwZ23dNtng8964e0TklembNsG0sD/kviRo/PZPfEpPCpXNxc7XX+9SRW 0O5f3B1bKiwfKdLf0MloNF/KSNDAhERaTysCN1ny4XOdY5X04Pv3ixgRGNb//Me/bS+t Yaf2n0gx81Bwr+SC4JqR2gUABscZOwoe2Fr/VPfCyh3vCnIxsHNjOuoXSxF9dmDcuHxo 3e5g== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id 64si1941820ljz.5.2017.12.20.08.42.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Dec 2017 08:42:15 -0800 (PST) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id vBKGgF2H025405 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Dec 2017 17:42:15 +0100 Received: from md1pvb1c.ad001.siemens.net (md1pvb1c.ad001.siemens.net [139.25.68.40] (may be forged)) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id vBKGgFvu018461; Wed, 20 Dec 2017 17:42:15 +0100 From: Henning Schild To: bitbake-devel@lists.openembedded.org Cc: isar-users@googlegroups.com, Henning Schild Subject: [PATCH] fetch/git: add support for disabling shared clones on unpack Date: Wed, 20 Dec 2017 17:42:09 +0100 Message-Id: <20171220164209.9609-1-henning.schild@siemens.com> X-Mailer: git-send-email 2.13.6 X-TUID: RDE2W3Qx5+OO 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. Probably something that hardly anyone would want to do. 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. Signed-off-by: Henning Schild --- lib/bb/fetch2/git.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py index 5ef8cd69..7b7f02b2 100644 --- a/lib/bb/fetch2/git.py +++ b/lib/bb/fetch2/git.py @@ -53,6 +53,13 @@ Supported SRC_URI options are: For local git:// urls to use the current branch HEAD as the revision for use with AUTOREV. Implies nobranch. +- noshared + When unpacking do not clone with the parameter "--shared". This option will + allow the unpacked copy to work stand-alone i.e. if your recipe runs in a + chroot where the "alternate" can not be found. Setting this will increase + the unpack-time and the disk-usage. + The default is "0", set noshared=1 if needed. + """ #Copyright (C) 2005 Richard Purdie @@ -159,6 +166,8 @@ class Git(FetchMethod): ud.nobranch = ud.parm.get("nobranch","0") == "1" + ud.noshared = ud.parm.get("noshared","0") == "1" + # usehead implies nobranch ud.usehead = ud.parm.get("usehead","0") == "1" if ud.usehead: @@ -176,7 +185,9 @@ 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.cloneflags = "-n" + if not ud.noshared: + ud.cloneflags += " -s" if ud.bareclone: ud.cloneflags += " --mirror" -- 2.13.6