Commit Graph

2650 Commits

Author SHA1 Message Date
Michael Marineau
4bc1c512b1 Merge pull request #38 from marineam/branch
fix(branch_release): Include new SDK_VERSION variable.
2013-07-17 17:41:40 -07:00
Michael Marineau
f3fad9c715 fix(branch_release): Include new SDK_VERSION variable.
Missed this script when I added SDK_VERISON to version.txt
2013-07-17 20:28:16 -04:00
Michael Marineau
8b24c8b282 Merge pull request #37 from marineam/sysroot
Sysroot and catalyst updates
2013-07-17 17:10:03 -07:00
Michael Marineau
b2f4f1a92e fix(update_chroot): Install sysroot-wrappers before updating toolchain.
sysroot-config will be called if anything is installed/upgraded so it
better be there and ready! :)
2013-07-17 19:25:46 -04:00
Michael Marineau
51f52bbca2 fix(bootstrap_sdk): Don't include cross toolchains in final tarball.
The packages have to be downloaded separately so don't waste space
including it in the stage4 tarball.
2013-07-17 19:25:46 -04:00
Michael Marineau
828a4e1710 cleanup(catalyst): Updates for catalystrc
Remove the catalystrc code that updated /etc/locale.gen, it wasn't
generally effective since catalyst installs things without
CONFIG_PROTECT and therefore locale.gen always got overwritten just
before it was going to be used. Add --load-average to MAKEOPTS so
builds better manage their parallelism when multiple independent jobs
are compiling code. Disable some locking to speed up builds that use
lots of binary packages.
2013-07-17 19:25:46 -04:00
Michael Marineau
6b336e17b2 fix(bootstrap_sdk): Move gsutil code to release_util.sh
Sync up bootstrap_sdk with other tools by using the common upload
functions. As part of this refactor release_util a bit to provide a
truly generic upload function.
2013-07-17 19:25:46 -04:00
polvi
d4543baaca Merge pull request #36 from philips/make-the-disk-bigger
Make the disk bigger
2013-07-17 16:25:13 -07:00
Brandon Philips
7cc09c349b feat(disk_layout): increase OEM size
increase the size of the OEM partition to 128M
2013-07-17 16:19:30 -07:00
Brandon Philips
938e0132d1 feat(legacy_disk_layout): increase boot metadata
increase the boot metadata size to 64M
2013-07-17 16:18:41 -07:00
Brandon Philips
4bd3273f14 Merge pull request #35 from coreos/image-to-vm-ami
feat(image_to_vm): AMI support
2013-07-17 14:28:12 -07:00
Alex Polvi
268a1efd3f feat(image_to_vm): AMI support
add support for the hybrid MBR and OEM partition on Amazon.
2013-07-17 14:27:38 -07:00
Brandon Philips
3a0121360d Merge pull request #34 from philips/remove-kernel-image-references
Remove kernel image references
2013-07-17 12:01:45 -07:00
Brandon Philips
f2a0ed323e chore(cros_make_image_bootable): remove rootfs_hash references
this was part of the kernel vblock stuff. Just remove it for now.
2013-07-17 11:56:47 -07:00
Brandon Philips
fc6717b653 chore(*): remove kernel_image references
we don't use a kernel_image and don't use vblocks so remove the logic
related to these things.
2013-07-17 11:50:50 -07:00
Michael Marineau
898ab93461 Merge pull request #33 from marineam/sdk-mounts
SDK script updates
2013-07-14 14:01:57 -07:00
Mike Frysinger
4bdab9f7fe enter_chroot: speed up entering by backgrounding locale generation
Half of the current time is spent on calling locale-gen even when there is
nothing to be done (all locales already generated).  Throw it into the bg
to unblock the main thread.

BUG=None
TEST=`cros_sdk` still works
TEST=`LANG=et_EE.UTF-8 cros_sdk` generates the new locale in the background

Change-Id: Ibe9a07bec60a59cab1cf4230358f7f8ff5b21c2e
Reviewed-on: https://gerrit.chromium.org/gerrit/58041
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2013-07-14 10:45:10 -07:00
Mike Frysinger
7f30c14bdc enter_chroot: bind mount /dev/pts
All devpts mounts are actually shared, even if you do:
	mount -t devpts none /dev/pts
	mount -t devpts none /mnt/foo
	mount -t devpts none /mnt/asdfasdf
These all provide the same data.

This is problematic because most distros mount their host devpts like so:
	mount -t devpts devpts /dev/pts -o mode=620,gid=5

But when cros_sdk runs, it uses:
	mount -t devpts none /dev/pts

We aren't specifying a mode/gid, so it ends up using the defaults, and
this resets the host devpts mount as well.

Since we've already assumed that the system has devpts available, it's
fine to also assume that the system has it mounted at /dev/pts and we
can simply bind mount it.

BUG=None
TEST=`cros_sdk` no longer messes up host perms on /dev/pts

Change-Id: Ib594fc5e47707f296d97ac1edce32659ed2b2273
Reviewed-on: https://gerrit.chromium.org/gerrit/48018
Reviewed-by: Steev Klimaszewski <threeway@gmail.com>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2013-07-14 10:45:10 -07:00
Michael Spang
a7627f70d9 Use rbind for ChromeOS source directory
I use a mount at src/build/images to stop image builds from repeatedly
filling up my SSD. The chroot needs to respect this.

TEST=cros_sdk
BUG=none

Change-Id: I5c7a26c3b4f263bd683d3a897e6edccb83187bda
Reviewed-on: https://gerrit.chromium.org/gerrit/47178
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Michael Spang <spang@chromium.org>
Tested-by: Michael Spang <spang@chromium.org>
2013-07-14 10:45:10 -07:00
Mike Frysinger
0c0fea7b4d enter_chroot: handle /var/lock->/run/lock symlinks
Newer Gentoo builds have moved to /run which means /var/lock is a symlink
to /run/lock.  But since that is an absolute symlink, it points outside of
the chroot which doesn't work for us.  Use a stable path unrelated to the
chroot instead, but only with newer chroots.

We no longer have to worry about backwards compat because the code that
used to rely on this lock file (running sync processes) was punted a long
time ago.

BUG=chromium:218085
TEST=`cbuildbot chromiumos-sdk` passes

Change-Id: I38c6848dfb86386849050d7ccf3f90cbbe8e0e81
Reviewed-on: https://gerrit.chromium.org/gerrit/46231
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2013-07-14 10:45:10 -07:00
Paul Drews
b957c775ea Add capability to chroot to use proxies for git:// urls
This patch installs "socat" and a proxy gateway script into
the chroot so that git can use a proxy to access "git://"
protocol urls.  This is needed when performing builds from
behind a firewall that requires a proxy.  The script reads
the proxy environment variables all_proxy (SOCKS),
https_proxy (CONNECT), and http_proxy (CONNECT), in order of
preference, and supports no_proxy as a whitelist of target
hosts that must NOT go through the proxy.

This also updates enter_chroot.sh to automatically use this
script as GIT_PROXY_COMMAND when it sees the proxy
environment variables set.

The "socat" program is added to hard-host-depends as a
separate patch.  That handles socat installation in case of
building a chroot from scratch or upgrading.

The proxy-gw script is installed in the src/scripts/bin
directory which can be stably referenced within the chroot
as /mnt/host/source/src/scripts/bin/.  The
"/mnt/host/source" portion of this path is obtained from the
CHROOT_TRUNK_DIR environment variable which is set to a
suitable value by preexisting logic in common.sh.

This change became necessary to unbreak builds behind
proxies with the recent addition of two ebuilds using
egit.eclass with repositories using git:// URLs.

Original patch by Paul Drews <paul.drews@intel.com>;
modified version by Josh Triplett <josh@joshtriplett.org>.

CQ-DEPENDS=I1b01bce6f3e6a562b87f748e61508d142af576d9
BUG=none
TEST=git clone git://nv-tegra.nvidia.com/tools/cbootimage.git

Change-Id: Ic7fc917d1aa24f408bef6f102b6458114dded694
Reviewed-on: https://gerrit.chromium.org/gerrit/41659
Tested-by: paul drews <paul.drews@intel.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: paul drews <paul.drews@intel.com>
2013-07-14 10:45:10 -07:00
David James
e01374dc4b Fix 'too many levels of symbolic links' error.
In an Ubuntu Precise chroot on the Chromebook Pixel, /run/shm is a
symbolic link to /dev/shm, so bind-mounting /run/shm to /dev/shm
is really bind-mounting /dev/shm to itself, which causes a 'too many
levels of symbolic links' error. To fix this, we check for a symbolic
link prior to running this command.

BUG=none
TEST=cros_sdk no longer prints errors on Chromebook Pixel
Change-Id: Ib46cde2b4a0e00b69bd187488967e445b228ae80
Reviewed-on: https://gerrit.chromium.org/gerrit/45048
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2013-07-14 10:45:10 -07:00
Marc MERLIN
a1f5ee388d Remove a warning when $HOME is on NFS
If ~/.subversion doesn't exist, the code didn't run, but if it existed
there is no reason to re-create it, nor is it necessary to change its
permissions since they are inherited by the bind mount source.
However user_mkdir was trying to run chown as root which does not work
over NFS with root_squash or krb-nfs.
Therefore, the un-needed call to user_mkdir is removed.
(this is an issue because cros_sdk  --replace does call this code path
multiple times).

BUG=None
TEST=Built the chroot, and the permission denied on 'install' went away.
Change-Id: I01e9a7baf51a99a96d790c9613e26e652379e6df
Reviewed-on: https://gerrit.chromium.org/gerrit/44880
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Marc MERLIN <merlin@chromium.org>
Tested-by: Marc MERLIN <merlin@chromium.org>
2013-07-14 10:45:10 -07:00
Mike Frysinger
99d8dde1d6 make_chroot: clobber existing /etc/mtab
If our sdk has an /etc/mtab file already, then clobber it.  This fixes
build problems where chromeos-base now installs /etc/mtab for us, but
the sdk build isn't expecting it leading to the error:

INFO    cros_sdk:make_chroot: Running init_setup()...
ln: creating symbolic link `/b/cbuild/new-sdk-chroot/etc/mtab': File exists
Running ['/b/cbuild/src/scripts/sdk_lib/make_chroot.sh', '--stage3_path',
	'/b/cbuild/built-sdk.tar.xz', '--chroot', '/b/cbuild/new-sdk-chroot',
	'--cache_dir', '/b/cbuild/.cache', '--nousepkg'] failed!

BUG=None
TEST=`cros_sdk --chroot foo` still works

Change-Id: I539cf329e93e28534e6ff00577ce415d76918b85
Reviewed-on: https://gerrit.chromium.org/gerrit/43641
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2013-07-14 10:45:10 -07:00
Michael Marineau
e03e9dbfdc Merge pull request #32 from marineam/sdk-version
fix(catalyst): Use new COREOS_SDK_VERSION var from version.txt
2013-07-13 18:35:35 -07:00
Michael Marineau
f24a02e034 fix(catalyst): Use new COREOS_SDK_VERSION var from version.txt
The current SDK version is now provided by the manifest's version.txt
file which is already sourced by common.sh.
2013-07-13 21:06:29 -04:00
Michael Marineau
c707f8ed92 Merge pull request #31 from marineam/toolchain
Script updates
2013-07-10 17:08:17 -07:00
Michael Marineau
ddb92a0887 feat(build_library): Add --upload_path option to override default
This will be used to upload the latest images built from master, we
don't need every build so we just want to upload to a 'master'
directory, not one named for the current version.
2013-07-10 19:44:40 -04:00
Michael Marineau
15b637aa78 fix(catalyst): Take advantage of binary packages for cross toolchains.
The previous logic here only skipped the bootstrap if the toolchain
packages were already installed (which won't happen on the build host)
but we can also skip the bootstrap if binary packages are available
(which will happen on the build host). This will help avoid needless gcc
rebuilds :)
2013-07-10 17:31:22 -04:00
Michael Marineau
25f91de8e6 Merge pull request #30 from marineam/toolchain
Build cross toolchain
2013-07-10 11:42:35 -07:00
Michael Marineau
2a082de150 feat(bootstrap_sdk): Build cross toolchains
Until now we haven't built our own cross toolchains and used old
packages from Google. It is time to break free and move on!
2013-07-09 19:35:13 -04:00
Michael Marineau
d3e741b807 fix(bootstrap_sdk): Rename catalyst_stage4.sh since it is sdk specific
About to become a lot more sdk specific too. :)
2013-07-09 15:57:21 -04:00
Michael Marineau
380f66c19c Merge pull request #29 from marineam/semver
fix(common): Adopt semver formatted version strings.
2013-07-09 11:47:04 -07:00
Michael Marineau
680c40ad81 fix(common): Adopt semver formatted version strings.
Drop zero padding and format versions as described by the semver spec.
The terminology is a little awkward because we inherited the backwards
meaning of 'BUILD' and 'BRANCH' version identifiers but that the version
strings themselves conform to semver.

(This doesn't change the current version, that'll happen with our next
branch cut)
2013-07-09 11:31:39 -07:00
Brandon Philips
250fa30197 Merge pull request #28 from marineam/updates
Updates for au-generator.zip
2013-07-09 06:41:28 -07:00
Michael Marineau
ef7aea86a9 fix(generate_au_zip): Add core-admin to au-generator.zip
Forgot to add this in previous commits, so here it is!
2013-07-08 21:54:57 -07:00
Michael Marineau
ea8ed8f5da fix(core_upload_update): Set PATH for au-generator.zip bundles.
The tools provided by au-generator.zip are expected to be in the PATH by
this script and the scripts it calls. Make it so.
2013-07-08 21:50:22 -07:00
Michael Marineau
c9a6956f6f fix(core_upload_update): Add to au-generator.zip, move some operations.
Add core_upload_update to au-generator.zip which requires some extra
logic to make it runnable anywhere it may be. To organize the code a
little better all the delta_generator calls have been moved to
cros_generate_update_payload. core_upload_update is now just a wrapper
around cros_generate_update_payload and core-admin.
2013-07-08 21:39:05 -07:00
Michael Marineau
12935743b6 fix(common.sh): Fallback to loading version.txt from current directory.
This makes version handling continue to work normally with
au-generator.zip
2013-07-08 21:39:04 -07:00
Michael Marineau
12149d8421 fix(generate_au_zip): Remove unused scripts from au-generator.zip
We have no need to ship convert_recovery_to_ssd.sh with builds.
2013-07-08 21:39:04 -07:00
Don Garrett
048b3cecdf Update generate_au_zip.py location for cgpt.
Cgpt was moved and a symlink based wrapper was added. That wrapper will
be improved soon, when when that's true we'll need to change this back.

A specific note... cgpt is currently statically linked. If that wrapper does
not remain statically linked, then a simple revert won't be enough.

BUG=chromium-os:39814
TEST=Manual au-generate.zip creation.

Change-Id: I2705b1eddd8ef28c7eb099512513daf80f586218
Reviewed-on: https://gerrit.chromium.org/gerrit/45128
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
2013-07-08 21:35:36 -07:00
Michael Marineau
7320602927 Merge pull request #27 from marineam/rootfs
Rootfs by UUID
2013-07-08 13:38:21 -07:00
Michael Marineau
3fa29024e1 fix(build_image): Configure legacy bootloaders to set root by UUID.
Make use of the new partition UUIDs for ROOT-A and ROOT-B in the root=
kernel parameters provided by the legacy (non-kexec) bootloaders. This
makes all of our images bootable as-is without having to pass them
through image_to_vm.sh. :-D
2013-07-08 16:28:12 -04:00
Michael Marineau
21b9f711a4 feat(cgpt): Statically allocate UUIDs for ROOT partitions.
Before we can switch from using device names in root= to partition table
UUIDs we need some values that will remain consistent across upgrades
since the partition table is not updated when filesystems are.
2013-07-08 15:49:39 -04:00
Brandon Philips
711f7bd028 Merge pull request #25 from philips/print-image_to_vm-for-dev
fix(build_image): print out image_to_vm for dev image
2013-07-07 22:14:50 -07:00
Brandon Philips
fce31ab6fe fix(build_image): print out image_to_vm for dev image
this broke accidently in a previous commit. Fix it by printing the
instructions to build a vm again.
2013-07-07 21:41:28 -07:00
Brandon Philips
d786023292 Merge pull request #24 from philips/use-coreos-prefix
fix(build_library/legacy_disk_layout): Use coreos- prefixes
2013-07-07 21:35:41 -07:00
Brandon Philips
31cd4c47a9 fix(build_library/legacy_disk_layout): Use coreos- prefixes
vboot_reference now recognizes coreos-reserved and coreos-rootfs. Use
these prefixes so we stop using the chromeos GUIDs.

Test-plan: Tested on a VM and it boots and updates.
2013-07-07 21:18:49 -07:00
Michael Marineau
32a58da5de Merge pull request #23 from marineam/images
Upload official filesystem images
2013-07-05 22:13:20 -07:00
Michael Marineau
6c1e03c06e fix(bootstrap_sdk): Report the time it took to complete 2013-07-05 23:57:04 -04:00