The gcc-config file name could be different from the gcc atom that creates it.
Changed the logic to first find out the binary path of gcc and then to query
portage to see what package owns that path.
BUG=none
TEST=cros_sdk --bootstrap --replace
cros_sdk -- ./setup_board --board=x86-zgb --nousepkg
Change-Id: I3ccfa9948aaba6ba28107f150523c8a5d7cf1260
Reviewed-on: https://gerrit.chromium.org/gerrit/15556
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Tested-by: asharif <asharif@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: asharif <asharif@chromium.org>
First, add a enable_strict_sudo helpers that scripts that are
sudo strict can invoke. This does a sanity check bailing immediately
if invoked from a non sudo-keep-alive context.
Second, update enter_chroot.sh and make_chroot.sh to be strict.
While this is strict, that's the point. The aim of this is to block
the previous sudo interactive mess for spreading, let alone reappearing
in scripts/code that has been cleansed.
BUG=chromium-os:18393
TEST=cros_sdk --replace; in the midst of it, do sudo -k.
cros_sdk should thus bail out w/ an appropriate error.
CQ-DEPEND=I01bb1466cf027401fa387af7fad15e42fd33aea4
Change-Id: I76c5b87a812cc78c30a2eb1a0c56b9e438f4a98f
Reviewed-on: https://gerrit.chromium.org/gerrit/15294
Commit-Ready: Brian Harring <ferringb@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
Via distfiles bind mounting, chrome build output was being cached
across chroot replacements. This potentially is desirable, but
wasn't explicitly planned for and violates an assumption of the
canaries.
As such move the content to it's new location.
BUG=None
TEST=emerge-<board> chromeos-chrome
CQ-DEPEND=Ibfc5d42e74861ff498dd2cb6cc2d7be6ec0ded60
Change-Id: I18e384f0fc1cedb3c70ab85178103765322370eb
Reviewed-on: https://gerrit.chromium.org/gerrit/15383
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
Purpose of this is to allow us to avoid re-downloading everything
every time we rebuild the chroot.
This maintains two directories; host and target. Future enhancement
involves collapsing this into one- this requires some host work however,
and has some potential gotchas in doing so.
Meanwhile, we now store distfiles in repo/distfiles/{host,target},
and mount bind repo/distfiles into /var/cache/distfiles.
An upgrade script in turn optimistically tries to move the content
into the new location; if it can't complete the move, it wipes the
content and the user has to redownload it (acceptable, if annoying).
BUG=chromium-os:13115
TEST=cbuildbot x86-generic-full
Change-Id: Iea96429df0e1fdc4ac0860fbce0daabc90c4c2a3
Reviewed-on: https://gerrit.chromium.org/gerrit/15189
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Brian Harring <ferringb@chromium.org>
Now that make_chroot.sh lives alongside enter_chroot, we're able
to invoke it directly and use internal options not exposed through
cros_sdk. Thus enter_chroot grows a --early_make_chroot flag.
This flag bypasses the normal sudo usage, and runs the command
as root. It is needed and used by make_chroot for when sudo
may not yet exist (--bootstrap via stage3 lacks sudo).
For where sudo exists and we need access to the source tree,
distfiles, or profile sourcing, enter_chroot is directly used.
For all other invocations we use a single sudo chroot call to
bypass the overhead of enter_chroot.
This is a complete fix to chromium-os:25697 while addressing
all refactoring requests that came up in I8a6c5a26.
Finally, convert all comments into complete sentences, upper
case the leading word, etc to keep reviewers happy.
BUG=chromium-os:25697
TEST=Within a trybot, cros_sdk --bootstrap --replace
TEST=cros_sdk --replace
TEST=cros_sdk --delete
TEST=cros_sdk
Change-Id: I270ee7fc325ef0bea74c61505d25cdbb49a9a333
Reviewed-on: https://gerrit.chromium.org/gerrit/15322
Commit-Ready: Brian Harring <ferringb@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
Imported as of 09d3117c483c60f55f552694b84b0964dfc17477.
Only modification is so that it can find common.sh.
BUG=chromium-os:25697
TEST=None
Change-Id: Idb43f1ecff3dff10a61396629a344c8bd10f505e
Reviewed-on: https://gerrit.chromium.org/gerrit/15317
Tested-by: Brian Harring <ferringb@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Brian Harring <ferringb@chromium.org>