Commit Graph

1091 Commits

Author SHA1 Message Date
Michael Marineau
5417bd7ae3 fix(vm_image_util): Set correct group in Vagrant metadata. 2014-05-09 11:52:11 -07:00
Michael Marineau
17bde8aa12 refactor(build_image_util): Move prod specific code to prod_image_util 2014-05-09 11:18:20 -07:00
Michael Marineau
56b550dc21 cleanup(build_image_util): Delete unused code 2014-05-09 11:18:19 -07:00
Michael Marineau
1c5393b78e refactor(build_image_util): Merge with base_image_util
There isn't a base image now, and less file clutter is nice.
2014-05-09 11:16:48 -07:00
Michael Marineau
1836d5998d refactor(base_image_util): Split into two functions.
Use what was the base image build function as setup/finalize steps in
the dev and prod build functions. This eliminates duplicate code
that mounted and unmounted the filesystem images.
2014-05-09 11:13:54 -07:00
Michael Marineau
39086358bf refactor(build_image): Build dev and prod images independently
We need some more control over exactly what lands in dev vs prod images
which will require letting them diverge in what is currently the common
base image step. There isn't any real need for the base image in the
first place other than to speed up building both dev and prod images at
the same time but that isn't common enough to worry about.

As part of this cleanup also remove references to CHROMEOS_* variables
and the recovery image that never actually existed in CoreOS.
2014-05-09 10:55:09 -07:00
Michael Marineau
9dd0a9d87f Merge pull request #245 from marineam/set-group
add(image_set_group): New script to set the update group in prod images.
2014-05-07 16:58:24 -07:00
Michael Marineau
a7e1e5a177 add(image_set_group): New script to set the update group in prod images.
For generating images for groups other than the one given to build_image
run this script along with the usual image_to_vm.sh commands. To avoid
ambiguity with the 'latest' symlink, this script creates $group-latest
symlinks instead. build_image creates the new symlink too.
2014-05-07 15:07:14 -07:00
Michael Marineau
b4d6fb9597 fix(set_lsb_release): Set default GROUP= from arg again.
This makes sure developer builds stick to the developer group. After
commit c3d07e94 developer PXE/ISO images would report as 'alpha'.
2014-05-07 12:52:05 -07:00
Michael Marineau
af8e6da2da Merge pull request #242 from marineam/c10n
maint(generate_au_zip): Drop old update service uploader
2014-05-07 11:31:17 -07:00
Michael Marineau
c3d07e942c feat(set_lsb_release): Write configured group to /etc instead of /usr
The /usr images must be identical across groups so that information is
static. Eventually the default will be 'stable'
2014-05-06 13:21:10 -07:00
Michael Marineau
6d165f8a7c maint(generate_au_zip): Drop old update service uploader 2014-05-05 15:14:46 -07:00
Michael Marineau
33858859fb Merge pull request #238 from marineam/insecure
fix(vm_image_util): Don't use the full vagrant OEM on vmware_insecure
2014-05-03 14:19:20 -07:00
Michael Marineau
fccefb278e Merge pull request #236 from marineam/vagrant
Vagrant related script updates
2014-05-03 14:18:39 -07:00
Michael Marineau
c4984b3c7c fix(vm_image_util): Don't use the full vagrant OEM on vmware_insecure
Only the key is needed, and currently the vagrant OEM is completely
broken outside of vagrant. This gets vmware_insecure images back into
the state that they were before cloud config came along. :)
2014-05-02 15:30:49 -07:00
Michael Marineau
75999b5e2a fix(build_image): Add group prefix to image output directories. 2014-05-01 10:21:51 -07:00
Michael Marineau
4e85b172df feat(build_image): Optionally generate update payload with prod images. 2014-05-01 09:59:58 -07:00
Michael Marineau
e1d7b29436 feat(disk_util): Add support for extracting partitions.
This will simplify the process of generating update payloads.
2014-04-30 19:04:42 -07:00
Michael Marineau
7a7494e999 fix(prod_image_util): Do not install update test key anymore.
Leave this to the ebuild, no reason for it to be done here.
2014-04-30 17:12:59 -07:00
Michael Marineau
3fdfe92b5d fix(vm_image_util): Fix building vagrant vmware fusion images. 2014-04-29 03:48:56 -04:00
Michael Marineau
20f191a804 maint(set_lsb_release): Remove gentoo-release (again)
We now require Vagrant 1.5.0 both in documentation and in code which
uses os-release instead of gentoo-release.
2014-04-29 01:44:47 -04:00
Michael Marineau
8183430f6c feat(vm_image_util): Add Vagrant metadata file
This is required for Vagrant to recognize box versions:
http://docs.vagrantup.com/v2/boxes/versioning.html
2014-04-29 01:44:47 -04:00
Michael Marineau
39951946ca feat(vm_image_util): Add new build steps, update vagrant builds
This adds two new optional build steps.  The first user of these is the
vagrant images but many of the targets can be simplified now.

- fs_hook: Anything that needs to happen before unmounting the image.
  This happens after the OEM is installed but before disk images are
  made. It can be used to copy any data out of the image.
- bundle_format: Many VM types ship as some sort of archive format
  rather than plain disk images as this script originally assumed.
  Adding this final step lets us stop using the conf step awkwardly.

Vagrant now ships with a Vagrantfile and related code included in the
OEM package. This lets us version our vagrant-side code along with the
images themselves as well making the coreos-vagrant repo optional again.
The coreos-vagrant code will still be useful for handling the fancier
cluster configuration stuff but no longer has to carry the plugin code.
2014-04-28 19:52:24 -04:00
Michael Marineau
7f5b5baf22 maint(build_library): Remove special case code for -usr disk layouts
More cleanup now that amd64-generic is gone.
2014-04-26 14:45:28 -07:00
Michael Marineau
1c328d7c0d Merge pull request #233 from marineam/mbr
fix(disk_util): Switch back to gptmbr.bin for our MBR boot code.
2014-04-25 16:35:38 -07:00
Michael Marineau
d5c5544cca fix(syslinux): Display boot: prompt for a half second.
This should make it less difficult for people to add kernel options for
debugging. Without a prompt/timeout the user must be holding down space
or some other key while syslinux loads but it may not be possible for
the user to do so provide input quite that fast. Only a half second to
avoid needlessly increasing boot times in the common case.
2014-04-25 14:45:21 -07:00
Michael Marineau
476bae747e fix(disk_util): Switch back to gptmbr.bin for our MBR boot code.
Using the classic mbr.bin was only needed during the transition from
syslinux 3 to 6 because the behavior of gptmbr.bin changed after 3.
Now that the transition is done and cgpt supports the new scheme now it
is time we switched back. This avoids depending on using a hybrid MBR.
2014-04-25 11:15:17 -07:00
Michael Marineau
2f8f0159f8 maint(*): Delete special case code for amd64-generic 2014-04-23 16:14:50 -07:00
Michael Marineau
46e2e17697 maint(toolchain_util): Drop amd64-generic from list of valid boards.
The cleanup begins...
2014-04-23 16:02:39 -07:00
Michael Marineau
e02f49b410 feat(release_util): Add support for signing individual file uploads.
The .DIGESTS format is clunky and annoying. It also requires uses to
perform two steps to verify images using GPG. Instead support signing
all files directly so there is no need for .DIGESTS.

The old DIGESTS code will remain in place for now but after a few
releases I plan on deleting it.
2014-04-18 16:56:50 -07:00
Brandon Philips
e9896acc29 Merge pull request #218 from philips/new-update-url
fix(build_library): use https://public.update.core-os.net now
2014-04-18 10:58:33 -07:00
Alex Crawford
7d0c08971e Merge pull request #228 from crawford/ld.so
feat(prod_image_util): Adding support for ld.so configs on tmpfs roots
2014-04-17 13:08:17 -07:00
Alex Crawford
ba45a2bfb2 feat(prod_image_util): Moving ld.so configs to /usr
Moving the ld.so configs to /usr and symlinking them to /. This allows
images with a tmpfiles root (e.g. PXE) to have ld.so config support.
2014-04-17 12:48:25 -07:00
Alex Crawford
2662d0c784 Merge pull request #229 from crawford/master
fix(vm_image_util): Minor comment fix
2014-04-16 18:41:23 -07:00
Alex Crawford
9e72f6d187 fix(vm_image_util): Minor comment fix 2014-04-16 18:16:26 -07:00
Michael Marineau
b9c72ecda1 fix(vm_image_util): Fix DIGESTS path for compressed vhd images.
Missed this in eb72b6e5
2014-04-16 17:32:11 -07:00
Michael Marineau
71f005f9dc Merge pull request #214 from marineam/units
Config drive for QEMU
2014-04-16 10:17:02 -07:00
Michael Marineau
eb72b6e570 fix(release_util): Compress vhd images. 2014-04-12 14:13:35 -07:00
Michael Marineau
12c0008ad9 feat(qemu_template): Add support for user-provided configs.
A custom cloud config can be provided directly via -u or as an existing
config drive image via -c.
2014-04-11 18:06:18 -07:00
Michael Marineau
150ab005e0 feat(qemu_template): Provide SSH keys via config drive
Moving away from our old behavior of loading 'authorized_keys' on virtfs
volumes. Still using virtfs to avoid depending on mkisofs or similar.
2014-04-11 18:06:18 -07:00
Michael Marineau
0d0c7c7578 fix(qemu_template): Replace getopts with simple pattern matching.
The use of getopts was leading to conflicts between this script's short
options and qemu's long options. For example -serial was getting
interpreted as -s -- erial which is not very helpful.
2014-04-11 18:06:18 -07:00
Alex Crawford
c50e68f9d3 Merge pull request #224 from crawford/oems
feat(vm_image_util): Adding support for openstack and brightbox
2014-04-11 17:47:43 -07:00
Alex Crawford
9095908ca1 feat(vm_image_util): Adding support for openstack and brightbox
Added USE flags for specifying the provider (ec2, openstack, or brightbox).
2014-04-11 16:12:50 -07:00
Michael Marineau
331c194003 fix(set_lsb_release): Set bug report url. 2014-04-11 12:35:43 -07:00
Michael Marineau
add4519021 fix(build_image): Only use 'alpha' group in official builds. 2014-04-09 18:46:07 -07:00
Brandon Philips
bd7d4f4aaa fix(build_library): use https://public.update.core-os.net now
We added a new https certificate on the new update service and changed
the hostname to be consistent with all of the other endpoints. Update
the new images to use this.

The old URL http://public.roller.core-os.net will remain working until
all of the old client have been updated.
2014-04-08 10:54:45 -07:00
Michael Marineau
58bac50d91 fix(vm_image_util): Remove fstab from PXE initrd
Using fstab made overriding it with kernel command line options like
root=/some/disk not work properly. A generator handles it now.
2014-04-04 16:58:43 -07:00
Michael Marineau
06e03e912e fix(set_lsb_release): Code name was not epic enough. 2014-04-04 11:32:31 -07:00
Alex Polvi
e3156672ce refactor to use _write_cpio_common 2014-03-31 16:08:29 -07:00
Alex Polvi
0d3cd4b417 feat(iso): add iso image format to image_to_vm 2014-03-31 15:49:57 -07:00
Michael Marineau
e2aaed1619 Merge pull request #209 from marineam/pxe
feat(vm_image_util): Add /usr/.noupdate flag file in PXE images.
2014-03-31 14:01:44 -07:00
Michael Marineau
cd00e6eafe Merge pull request #212 from marineam/gce
fix(vm_image_util): Default to larger vm (8GB) disk layout for GCE
2014-03-29 14:41:14 -07:00
Michael Marineau
17d22228f8 fix(vm_image_util): Default to larger vm (8GB) disk layout for GCE
GCE was using the base 3GB layout which isn't very useful for actual
machines.
2014-03-29 14:22:01 -07:00
Michael Marineau
e0cfea50fb fix(vm_image_util): Require OEM packages to be aware of /usr/share/oem
Installing to a temporary directory and then copying over the final
contents of /usr/share/oem allows more complicated OEM packages such as
python to be configured with --prefix=/usr/share/oem while previously
the atypical use of ROOT=/usr/share/oem would have complicated things.
2014-03-27 22:17:32 -07:00
Michael Marineau
a78c5fb665 fix(vm_image_util): Keep most partitions mounted read-only.
This ensures that the only partition being modified is OEM.
2014-03-27 21:52:40 -07:00
Michael Marineau
a6328f7c2b feat(vm_image_util): Add /usr/.noupdate flag file in PXE images.
This can be used by update_engine as a quick test to determine if it is
running on a system that it can handle. This avoids needing something
like the 'coreos.diskless' kernel command line flag.
2014-03-27 15:41:41 -07:00
Brandon Philips
7b6e547751 Merge pull request #206 from philips/fixup_core_upload_update
feat(core_roller_upload): initial commit
2014-03-26 05:56:20 -07:00
Brandon Philips
42770b6c00 feat(core_roller_upload): initial commit
TODO: get rollerctl releases installed in here too.
2014-03-26 05:55:26 -07:00
Michael Marineau
11aabd7bd0 fix(vm_image_util): Do not generate a machine UUID.
If QEMU is given a uuid systemd will detect that and in turn use it for
the machine-id. This made the bug causing the machine-id to be always
re-generated on boot harder to notice since it didn't happen on QEMU.
2014-03-25 14:23:23 -07:00
Michael Marineau
c489d2f7c8 Merge pull request #196 from marineam/no_kexec
feat(vm_image_util): Add qemu_no_kexec image type
2014-03-24 14:48:55 -07:00
Michael Marineau
dc1b3e32e9 fix(toolchain_util): Correct default binhost ordering.
Later hosts in the list override earlier hosts so the current version
must be listed after the older sdk version.
2014-03-24 11:17:26 -07:00
Michael Marineau
7c0e821953 Merge pull request #202 from marineam/pxe
PXE images
2014-03-23 20:19:41 -07:00
Michael Marineau
0a8f178002 feat(vm_image_util): Support other disk formats with Xen, such as vhd. 2014-03-23 17:15:36 -07:00
Michael Marineau
d4d06cfe57 feat(vm_image_util): Add new Rackspace target with VHD disk images. 2014-03-23 16:31:09 -07:00
Michael Marineau
5ab320d317 fix(vm_image_util): Fix typo in README 2014-03-23 11:43:36 -07:00
Michael Marineau
066bd23df8 feat(vm_image_util): Rework the qemu wrapper script to work for PXE
Now the script can be used with a disk image or a kernel/initrd.
Using a disk with the PXE kernel should work too but haven't tried it.
2014-03-22 22:28:10 -07:00
Michael Marineau
e151a33cee fix(vm_image_util): Fix building squashfs for /usr
Taking a bit of a new approach to booting PXE images here for both
amd64-generic and amd64-usr. Instead of requiring the user to specify
squashfs and tmpfs on the kernel command line we can simply provide
defaults in the initrd's fstab.
2014-03-22 22:23:40 -07:00
Michael Marineau
441a982a39 fix(vm_image_util): Disable installing oem-pxe
It only installed /usr/share/oem/oem-release which we no longer use.
2014-03-22 14:27:48 -07:00
Michael Marineau
81367903bf fix(vm_image_util): Package up /usr for pxe images. 2014-03-22 14:27:48 -07:00
Michael Marineau
26b5865b73 Merge pull request #199 from marineam/syslinux
fix(build_image): Switch to SYSLINUX for our EFI bootloader.
2014-03-19 20:39:35 -07:00
Michael Marineau
e59e366770 Merge pull request #197 from marineam/release-files
cleanup(set_lsb_release): Rework release config setup
2014-03-19 20:39:08 -07:00
Michael Marineau
9d073452ed fix(build_image): Switch to SYSLINUX for our EFI bootloader.
Now with SYSLINUX 6 we can use the same bootloader on EFI and BIOS
systems. This replaces our previous reliance on building default kernel
options into the kernel image itself.
2014-03-19 17:53:00 -07:00
Brian Waldon
899e7ddebe fix(vagrant): pad vagrant mac to six characters 2014-03-19 17:03:24 -07:00
Michael Marineau
8244c7a260 cleanup(set_lsb_release): Rework release config setup
- Remove custom COREOS_* attributes from /etc/lsb-release
- Move dev image logic to dev_image_util
  For extra fun fix detection of local host URL for devserver.
- Remove weirdly verbose "DESCRIPTION" format.
- Add COREOS_RELEASE_BOARD back to /usr/share/coreos/release
  This is mostly just so update_engine and gmerge report the correct
  board name to devserver, informative-only on prod images.
- Remove version info from /etc/gentoo-release
- Switch from 'track' to 'group' terminology.
2014-03-19 15:56:21 -07:00
Michael Marineau
e2536ad76f feat(vm_image_util): Add qemu_no_kexec image type
This makes it easy to test booting without kexec on qemu/kvm similar to
how images are booted on Xen.
2014-03-18 15:07:09 -07:00
Michael Marineau
ee207599af fix(set_lsb_release): Bear Creek Manor 2014-03-14 10:53:59 -07:00
Brandon Philips
87de0fa5df Merge pull request #192 from philips/no-https-on-roller-yet
fix(build_library): use http until we get certs on roller
2014-03-13 14:13:50 -07:00
Brandon Philips
d71aab28df fix(build_library): use http until we get certs on roller 2014-03-13 14:08:37 -07:00
Brandon Philips
98393b7a21 fix(build_library): mkdir /usr/share/coreos in the right order
This is important otherwise things fail to create files because the
directoreis don't exist.
2014-03-13 12:18:33 -07:00
Brandon Philips
6620d7a5a7 fix(build_library): put lsb-release in usr too 2014-03-13 12:08:50 -07:00
Brandon Philips
ed19e9f559 fix(build_library): use ln -sf instead of if
we don't need an if statement when we can force.
2014-03-13 12:05:33 -07:00
Brandon Philips
9ce005cf88 fix(build_library): make the usr link relative
Fix the problem of: "pecified switch root path %s does not seem to be an
OS tree. /etc/os-release is missing" because dracut doesn't have an
/usr/share/coreos/os-release file.
2014-03-13 12:04:10 -07:00
Greg Kroah-Hartman
1d6d1f7539 feat(build_library) move os-release to /usr/share/coreos/ 2014-03-13 03:14:02 +00:00
Greg Kroah-Hartman
9ee59adf6f fix(build_library) fix the build breakage from previous amd64-user change 2014-03-13 03:13:12 +00:00
Brandon Philips
03c152a519 hack(build_library): support amd64-usr
Make special defaults for amd64-usr
2014-03-12 19:28:46 -07:00
Brandon Philips
b8fe368087 fix(build_library): create /usr/share/coreos files
create the basic files in /usr/share/coreos that should exist
2014-03-12 18:45:51 -07:00
Michael Marineau
0c1198c3bb feat(disk_util): Switch from SYSLINUX's gptmbr.bin to mbr.bin
cgpt now supports generating hybrid MBRs and the classic style mbr.bin
from any version of SYSLINUX should work the same with the hybrid MBR.
The other code, gptmbr.bin, changes after SYSLINUX 3. Switching lets me
play with different versions of SYSLINUX without breaking everything.

With this change all images feature a hybrid MBR so the special case for
some VM platforms has been removed.
2014-03-12 15:38:34 -07:00
Michael Marineau
88820b12d3 fix(build_image): The kernel is now in /usr/boot in /usr images 2014-03-12 14:36:07 -07:00
Michael Marineau
c90ea5f504 fix(vm_image_util): Skip kexec when booting on Xen HVM
This is buggy, instead we will need to handle Xen HVM similar to PV
except this requires SYSLINUX config tweaking instead of grub's menu.lst
2014-03-11 11:38:46 -07:00
Michael Marineau
87c0814006 fix(disk_util): Fix undefined variable introduce in 4dbdb391 2014-03-06 12:41:07 -08:00
Michael Marineau
4dbdb391a4 feat(disk_util): Switch to btrfs for root filesystem in /usr images
This is all that is required to swap out ext4 for btrfs.
No btrfs user space tools or auto-resize support yet.
2014-03-05 18:52:23 -08:00
Michael Marineau
2aa3571e45 rename(configure_bootloaders): Remove the legacy use of "legacy" 2014-03-05 16:00:24 -08:00
Michael Marineau
a022642e54 rename(disk_layout): Remove the legacy use of "legacy" 2014-03-05 15:57:22 -08:00
Michael Marineau
695ff028b3 fix(catalyst): Don't disable ebuild-locks
This doesn't make things go faster and I am suspicious that it makes
things worse. For example /etc/xml/catalog winds up empty from time to
time and I wonder if this locking is related to that.
2014-03-04 23:08:37 -08:00
Michael Marineau
ae03aaf368 fix(build_image): Switch STATE/ROOT partitions to coreos-resize type.
This is used by the new resize implementation to identify which
partition to resize during boot.
2014-03-03 13:08:31 -08:00
Michael Marineau
1177d198da fix(release_util): Fix DIGESTS regression from feb59db9f
While attempting to fix the easy to mix up DIGESTS names in feb59db9f I
stumbled across yet another way that the DIGESTS names were a bit
unpredictable: previously a .bz2 got stuck into the file name when
upload_images automatically compressed some file types. The new code
missed this and never added the .bz2. Correct this now, both for
image_to_vm which has a pile of glue to keep the legacy names in place
for now and build_image which I never intended to change.
2014-02-19 17:50:40 -08:00
Michael Marineau
930260ab9e fix(prod_image_util): restore /etc/gentoo-release
Vagrant reads this file to determine that we are CoreOS... so lets not
break that just yet. A PR to switch to os-release has been posted:
https://github.com/mitchellh/vagrant/pull/2985

Some day gentoo-release will be dropped but that day is not today.
2014-02-14 20:28:20 -08:00
Michael Marineau
7dd8d95b45 fix(build_image): Drop long unused overlays/usr/local bind mount
This was used by the old ChromeOS "dev image" scheme and does not get
mounted by default so stop shipping it.
2014-02-14 16:14:39 -08:00
Michael Marineau
438478f0cf fix(base_image_util): Do not auto-generate conflicting tmpfiles entries
Many directories are now handled by the new baselayout instead.
2014-02-14 16:13:31 -08:00
Michael Marineau
821d718a74 fix(vm_image_util): assert qemu wrapper is sh friendly 2014-02-09 18:22:34 -08:00
Michael Marineau
5abb561e19 Merge pull request #170 from marineam/catalyst
fix(catalyst): Recreate portage snapshot with --rebuild
2014-02-09 18:06:58 -08:00
Michael Marineau
a1026792aa fix(catalyst): Recreate portage snapshot with --rebuild 2014-02-09 17:37:53 -08:00
Michael Marineau
30b72754ff fix(setup_board): Remove note about annoying eselect warning
Silenced in eselect 1.4
2014-02-09 14:48:45 -08:00
Michael Marineau
7a43a07fef feat(setup_board): Configure binary package sources on the fly.
Generate list of board binhosts based on the new $COREOS_DOWNLOAD_ROOT
variable and optionally use packages only from a specific version
2014-02-09 14:24:01 -08:00
Michael Marineau
5524a7ce9a fix(common): Define VERSION_ID and BUILD_ID
Scripts can now use COREOS_VERSION_ID to get the base version instead of
having to strip off the BUILD_ID that is appended for unofficial builds.
2014-02-09 13:59:42 -08:00
Michael Marineau
50e54cea85 fix(release_util): Move default upload root to common, add --upload_root
Make it possible for other scripts to share the same value for our
release repository and equally easy to override with a custom value.
Also allow setting the root from the command line in addition to the
environment. Usually --upload_root is better to use than --upload_path.
2014-02-07 10:37:45 -08:00
Jeremiah Orem
84b94c97f7 qemu_template: == is a bashism, change to =. 2014-02-07 00:17:14 -08:00
Michael Marineau
1f84df1388 fix(base_image_util): Prune old reference to platform/dev 2014-01-31 15:46:29 -08:00
Michael Marineau
bf6ee33244 fix(vm_image_util): If DIGESTS wasn't generated don't copy it.
Failed to test my last change with uploads disabled :(

Also, it needs to be return 0, not return.
2014-01-30 13:31:36 -08:00
Michael Marineau
8a15840d6a fix(vm_image_util): Use more consistent names for vm .DIGESTS
Switch from naming DIGESTS based in disk image name to a common prefix.

old: coreos_production_qemu_image.img.DIGESTS ->
new: coreos_production_qemu.DIGESTS

The old behavior wasn't very consistent since plain disk images aren't
used by all types and the code implementing that was easy to brake,
namely by mistake coreos_production_pxe_image.cpio.gz.DIGESTS became
coreos_production_pxe.vmlinuz.DIGESTS a couple releases ago.

The old names will continue to exist as well for the time being to avoid
breaking existing install/download scripts and the original pxe DIGESTS
name is back.
2014-01-29 17:23:10 -08:00
Michael Marineau
feb59db9f5 fix(release_util): Add argument to specify the name to use for .DIGESTS
For multi-file uploads we should explicitly declare what the name of the
.DIGESTS file should be instead of using the first file name. Relying on
the ordering was subtle and easy to break.
2014-01-29 16:30:03 -08:00
Michael Marineau
b3e81f22e4 fix(image_to_vm): Wrap upload_image in vm_upload.
This keeps all references to VM_GENERATED_FILES inside of
build_library/vm_image_util.sh so changes that impact it more obvious.
2014-01-29 14:01:33 -08:00
Alex Polvi
abd1c40b3d usr(locale): delete local and lvm stuff that is not needed 2014-01-23 16:14:14 -08:00
Michael Marineau
b06c7896f9 fix(build_image): Properly configure portage in dev images.
This replaces the hack in the gmerge ebuild of just copying over a
single package.provided file to create a profile that sorta works.
2014-01-23 14:13:21 -08:00
Michael Marineau
13413947ad Merge pull request #150 from marineam/smp
fix(qemu): Enable all available CPU features and SMP by default
2014-01-22 16:09:40 -08:00
Michael Marineau
fdfe2c2e6e fix(tmpfiles): auto-generate tmpfiles based on .keep
To avoid having to sync directory creation and tmpfiles installed by
ebuilds just require ebuilds to do `keepdir /etc/path` and this script
will handle the rest. A possible extension would be to update to handle
symlinks in addition to directories in gen_tmpfiles.py
2014-01-22 12:16:35 -08:00
polvi
20f8ae73a8 Merge pull request #154 from polvi/usr-rm-from-prod
usr(build-artifacts): remove some things that portage automatically crea...
2014-01-21 16:47:36 -08:00
Alex Polvi
3647ecb1cc use rmdir 2014-01-21 16:43:16 -08:00
Michael Marineau
b95f4eb0fc fix(test_image_content): Remove check for localtime symlink
We no longer provide this symlink, it was always broken anyway.
2014-01-21 16:40:01 -08:00
Alex Polvi
98d9fdb925 usr(build-artifacts): remove some things that portage automatically creates 2014-01-21 13:01:09 -08:00
Michael Marineau
b5ebd7e32e Merge pull request #152 from marineam/remount
Some -usr updates
2014-01-20 11:17:11 -08:00
Michael Marineau
453c784779 fix(build_image): Only clear UUID on rootfs/usr filesystems.
The funky UUID and other special settings should only be applied to
coreos-rootfs and coreos-usr partitions which will never be fscked. When
STATE becomes ROOT in -usr images it gets fsked while mounted read-only
and fsck updates the filesystem's UUID if it is blank. Turns out this
causes disagreement between the kernel and the disk leading to bad
things. A related issue was fixed in a newer version of tune2fs but
unless I missed it the same bugfix didn't make it into e2fsck so
updating wouldn't resolve the issue.

http://e2fsprogs.sourceforge.net/e2fsprogs-release.html#1.42.9
2014-01-17 21:41:18 -08:00
Michael Marineau
7e3dd619d1 fix(build_image): Add fstrim commands for -usr images. 2014-01-17 21:09:31 -08:00
Michael Marineau
825dfd63ee fix(build_image): Remount via new stand-alone units.
Replaces the old dev-mode script that sorta took a shotgun "remount and
hope for the best" approach. New units provided by coreos-init.
2014-01-17 21:09:31 -08:00
Michael Marineau
12e0f8dddd fix(qemu): Enable all available CPU features and SMP by default 2014-01-17 00:23:24 -08:00
Michael Marineau
b312044172 fix(build_image): Set read-only hack on correct filesystem.
Check if the disk layout is a /usr layout and if so hack the USR-A
partition, not whatever is mounted to /. Also use the new functionality
in disk_util for this as it can look up partitions by label.
2014-01-16 23:23:41 -08:00
Michael Marineau
8418179ff4 fix(build_library): Add amd64-usr board and disk layouts.
The basic infrastructure to support this is now in place. Add a new
board that uses the experimental coreos/amd64/usr profile /usr based
disk layouts. This is just enough to successfully build images, they
aren't bootable yet.
2014-01-05 18:39:47 -08:00
Michael Marineau
96da63e87e fix(create_legacy_bootloader_templates.sh): Support -usr layouts
The boot kernel parameters change depending on whether the new /usr
scheme is in use. Pass the disk layout to the bootloader config script
and adjust generated configs accordingly.
2014-01-05 18:39:47 -08:00
Michael Marineau
bfe47817e4 fix(build_image): Add support for COREOS_DISK_LAYOUT_SUFFIX
Append COREOS_DISK_LAYOUT_SUFFIX from the portage profile to disk layout
names. Allows switching from "base" to "base-usr" and similar.
2014-01-05 18:39:47 -08:00
Michael Marineau
e84f922ba5 fix(build_library): remove references to chromeos-common.sh
Nothing from chromeos-common.sh is needed for image building now. Also
kill off build_common.sh which was just a weird way of sourcing
common.sh. The two piddly functions it provided fit better in
build_image_util.sh
2014-01-05 18:39:47 -08:00
Michael Marineau
19ecd4572f fix(disk_util): Sort mount order instead of special casing /
Now that /usr is a mount point we need to make sure it gets mounted
before /usr/share/oem. Simply sorting by path length works well enough.
2014-01-05 18:39:47 -08:00
Michael Marineau
ba532952b1 fix(disk_util): Fix layout inheritance in config verification. 2014-01-05 13:55:52 -08:00
Michael Marineau
3546256597 fix(vm_image_util): Unmount STATE before making squashfs 2014-01-04 21:39:31 -08:00
Michael Marineau
15eead682b cleanup(build_library): Remove old disk_layout_util.sh
All of this code can go away now.
2014-01-04 21:17:06 -08:00
Michael Marineau
bfcbb3f57f fix(image_to_vm): Move to disk_util, modify images in-place.
Avoid unpacking/repacking partitions by using disk_util's resize and
mount commands. Also simplify assorted bits along the way.
2014-01-04 21:00:45 -08:00
Michael Marineau
e066f91ca3 feat(disk_util): Add tune command, controlling fs read-only hack.
Now disk_util is aware of the weird ext2 read-only hack, both by
providing a command to manipulate it and support in the mount command to
automatically set the 'ro' mount option for filesystems with it.

Making mount aware of the hack makes it much easier to mount prod
images with a mix read-only and read-write filesystems.
2014-01-04 21:00:45 -08:00
Michael Marineau
89b61ac7b0 fix(disk_util): Rework how code handles existing images.
Read partition size and offset into the normal partition config with the
prefix 'image_' for each key.
2014-01-04 21:00:45 -08:00
Michael Marineau
1ee1840a89 fix(disk_util): Fix mount --read_only option. 2014-01-04 16:55:03 -08:00
Michael Marineau
c992d45dd3 feat(disk_util): Add resize command.
Based on the new gpt update code add the ability to resize filesystems
in existing images. Usually just the last (STATE) partition is resized.
2014-01-03 18:14:12 -08:00
Michael Marineau
ebc83599b3 fix(disk_util): Move loop device setup code to generic function 2014-01-03 17:59:15 -08:00
Michael Marineau
805cc65ffd fix(disk_util): Add option to safely rewrite partition table.
write_gpt --update <img> will read an existing image and make sure all
existing partitions will not get moved or truncated in the new layout.
This is mostly useful for resizing the final partition or just rewriting
metadata like partition types and labels.
2014-01-03 16:40:54 -08:00
Michael Marineau
5afd720956 fix(disk_util): Move existing image reading code to new function.
This will allow the code to be shared, making it possible to safely
resize existing images with disk_util.
2014-01-03 16:40:21 -08:00
Michael Marineau
8e0d630699 fix(image_to_vm): Remove support for alternate state fs image.
We haven't really needed this, remove the option to simplify things.
2013-12-30 16:32:37 -08:00
Michael Marineau
213472652c add(prod_image_util): Rename what remains of cros_make_image_bootable
cros_make_image_bootable now only is relevant for prod images, so move
the remaining code to prod_image_util in a similar scheme that base and
dev images use.
2013-12-30 16:12:44 -08:00
Michael Marineau
306a2f6cbc fix(cros_make_image_bootable): Switch to disk_util mount/umount 2013-12-30 16:12:44 -08:00
Michael Marineau
e2c2271579 fix(create_legacy_bootloader_templates): Setup ESP partition.
Replace "update_bootloaders" script.
2013-12-30 16:12:43 -08:00
Michael Marineau
359505490d fix(disk_util): Install syslinux as part of filesystem formatting.
This means scripts later don't need to deal with the ESP block device
directly, they can just copy the config files into place.
2013-12-30 16:12:43 -08:00
Michael Marineau
d1fee3653e fix(cros_make_image_bootable): Remove dead command line flags.
Lots of things are either unused or meaningless. A particularly creative
one is the fact that there are command line flags for mount point
locations that are then overwritten.
2013-12-30 16:12:43 -08:00
Michael Marineau
52e1dba3ec fix(build_image): Migrate to new disk_util commands 2013-12-30 16:12:43 -08:00
Michael Marineau
9bc36ee344 fix(base_image_util): Remove dead code, leave rootfs writable.
The verification flag was being passed through to the bootloader
template script but no longer had any effect.
Force the base image to always remain writable, its only purpose is to
be modified in a later build step anyway.
2013-12-30 16:12:41 -08:00
Michael Marineau
8ca62121d9 feat(disk_util): Add mount and unmount commands.
This will replace the assorted mix of mount/umount scripts.
2013-12-30 16:12:04 -08:00
Michael Marineau
ba45152b4b feat(disk_util): Add 'format' command to create filesystems in an image.
This will replace the less flexible code in base_image_util.sh
2013-12-30 16:12:04 -08:00
Michael Marineau
ab23353448 fix(disk_util): Rework config parsing.
Merge GetPartitionTable and partition alignment from WritePartitionTable
into LoadPartitionConfig so that all this config manipulation code is in
one place and inheritance from the 'base' layout is more predictable.
2013-12-30 16:12:04 -08:00
Michael Marineau
0f4b52134a fix(disk_util): Convert partition list to an object.
Hey, 'num' is a primary key! Lets use it and avoid pointless looping.
2013-12-30 16:12:04 -08:00
Michael Marineau
576c8996f4 fix(disk_util): Remove support for --adjust_part
This isn't a feature we've been using as far as I know and if someone
needs a custom partition layout it's probably better to just add it to
the json file. Removing this avoids some complexity.
2013-12-30 16:12:02 -08:00
Michael Marineau
cc341f856b fix(disk_util): Merge write_mbr into write_gpt
No need for this to be a different command.
2013-12-30 16:10:46 -08:00
Michael Marineau
de9ff4fc8e fix(disk_util): Rework how argument parsing/passing works.
Move from optparse to argparse. Move layout file and layout type to
global options with reasonable default values so every command doesn't
need to them. Adjust calling scripts to match.

For now layout type is being passed via an environment variable
DISK_LAYOUT_TYPE but this is a temporary situation.
2013-12-30 16:10:46 -08:00
Michael Marineau
fdefbf704c add(disk_util): Rename cgpt.py to disk_util.
Use a more generic name so cgpt.py and disk_layout_util.sh can be merged
into one tool. Wrappers around wrappers around wrappers are tedious.
2013-12-30 16:10:46 -08:00
Michael Marineau
4c0e511348 Merge pull request #145 from marineam/symlink-usr
fix(test_image_content): Improve /usr symlink and conflict tests.
2013-12-30 15:43:18 -08:00
Michael Marineau
3d7bed9aea fix(toolchain_util.sh): Fix BOARD_NAMES list
This has been broken since d91e8d21 :(
2013-12-11 19:38:45 -08:00
Michael Marineau
62ae4d60b1 fix(test_image_content): Improve /usr symlink and conflict tests.
Now uses the package database instead of filesystem so the check works
even if /bin and friends are symlinks to /usr. Also disable the
whitelist and check that the expected symlinks are correct if the
symlink-usr USE flag is enabled.
2013-12-09 19:32:54 -08:00
Michael Marineau
8071aca926 Merge pull request #144 from marineam/cleanup
fix(*): remove lingering broken support for board overlays.
2013-12-08 19:01:53 -08:00
Michael Marineau
6d414d275e fix(*): remove lingering broken support for board overlays.
This is a feature from the chromeos sdk that we haven't used and doesn't
work any more. Clean it up...
2013-12-08 16:02:00 -08:00
Michael Marineau
68221b98e6 fix(build_image): Properly clear the EXIT trap
Now build_image will no longer claim that the build failed, prompting
you to delete the output directory, after a good build.
2013-12-08 15:42:34 -08:00
Michael Marineau
8330920290 fix(toolchain_util.sh): Never force binary packages with crossdev.
When calling update_chroot with --usepkg --nogetbinpkg the default
emerge command line will force binary packages for the toolchain but if
the packages are not available locally building via crossdev is
required. Since the crossdev bootstrap process rebuilds the toolchain a
couple times with different use flags if binary packages are forced the
second stages gets skipped resulting in a broken gcc and glibc install.
2013-12-06 15:19:41 -08:00
Michael Marineau
4ffb21da38 Merge pull request #139 from marineam/gce
GCE support
2013-12-02 22:14:54 -08:00
Michael Marineau
c9c1efd276 fix(build_image): Add --fast to control use of parallel_emerge
This makes it possible to toggle parallel_emerge just as other scripts
do. In other scripts update the help string to be more specific, the
--jobs option can be used to control parallelism.
2013-12-01 16:04:10 -08:00
Michael Marineau
d3a3a88768 fix(base_image_util.sh): Install glibc and gcc libs via emerge. 2013-12-01 16:04:10 -08:00
Michael Marineau
6dd768b810 feat(release_util.sh): Support changing default upload path with env var 2013-11-30 17:36:38 -08:00
Michael Marineau
95388caab1 fix(image_to_vm): Add GCE oem package 2013-11-30 17:33:33 -08:00
Michael Marineau
0cb0cbf71e feat(image_to_vm): Add minimal GCE support.
Simply rolls our disk image into a tarball that can be passed to gcutil.
To actually be useful we need an OEM package to handle SSH keys.
2013-11-30 16:39:31 -08:00
Michael Marineau
175d88e6e4 fix(build_image_util.sh): Move image install mask to portage profile.
Reduce the spaghetti config a bit...
2013-11-29 23:38:06 -08:00
Michael Marineau
a70da914ba fix(toolchain_util.sh): Replace TOOLCHAIN_BINONLY with a function.
The new function supports generating arguments for cross toolchain
packages in addition to native ones.
2013-11-29 17:56:58 -08:00
Michael Marineau
d91e8d21c4 fix(toolchain_util.sh): Fix variable name conflicts.
Although it didn't seem to be causing any bugs the global variables in
toolchain_util conflicted with some names used elsewhere. Clean that up
by adding an S to the array names that didn't already have one.
2013-11-29 17:56:58 -08:00
Michael Marineau
0badc0a576 fix(toolchain_util.sh): Don't build via crossdev if pkgs are up to date.
When calling update_chroot with --nousepkg it is silly to always force a
rebuild of the cross toolchain. Change the test to work regardless of
whether binary packages are enabled by checking if anything needs to be
built from source.
2013-11-29 17:56:58 -08:00
Michael Marineau
21614c5942 fix(toolchain_util): Move toolchain build-dep code from catalyst.
Now this code can be shared with setup_board. Only required if
setup_board is called with --nousepkg which is rare to never but feels
like the correct thing to do. Alternatively setup_board could always
use binary packages (as it basically does now).
2013-11-29 17:56:58 -08:00
Michael Marineau
9179f985d0 Merge pull request #137 from marineam/check-pkgs
Improvements for image validation, add /usr conflict test
2013-11-27 14:58:17 -08:00
Michael Marineau
4e8bef60d7 fix(test_image_content): Clean out some stray tab chars 2013-11-27 14:55:04 -08:00
Michael Marineau
fd7976e7fd fix(test_image_content): Add test for /usr file conflicts. 2013-11-27 14:43:35 -08:00
Michael Marineau
485044f23a Merge pull request #132 from marineam/code-name
fix(set_lsb_release): Time for a new code name
2013-11-27 14:20:07 -08:00
Michael Marineau
241d135126 fix(test_build_root): Switch to using test_image_content
Start using the more complete test_image_content test for the build root
and add the test to the end of build_packages.
2013-11-26 17:14:50 -08:00
Michael Marineau
1e8f44e3fc fix(check_deps): Depend exclusively on ld.so.conf for lib list
The list in ld.so.conf needs to be complete so don't bother with
including other hard-coded paths or the path to ld-linux-x86-64.so.2.
2013-11-26 16:41:42 -08:00
Michael Marineau
f25b84973e Merge pull request #135 from marineam/tarball
SDK tarball library
2013-11-23 23:41:36 -08:00
Michael Marineau
75972cd991 fix(catalyst): Always use the current SDK tarball as seed.
Right now there is some funky logic to either use a previous build as a
seed or the current SDK tarball if it happens to have been downloaded.
This is a bit confusing and doesn't work reliably since it is reasonable
for there to be neither a previous build or the current SDK available if
the SDK chroot was created some time ago. Fix this by using the new SDK
library and always use the latest SDK, downloading it if needed.
2013-11-23 20:32:55 -08:00
Michael Marineau
763b27bb7f fix(common.sh): Move DIGESTS handling code to common functions.
This code would be useful to use when downloading SDK tarballs in
addition to uploading them. :)
2013-11-22 19:15:10 -08:00
Jeremiah Orem
0dd9778b6e Avoid overwriting /usr/{bin,sbin,lib64} symlinks. 2013-11-22 21:49:24 -05:00
Michael Marineau
c5c9ea0b9b fix(common.sh): New variables for .cache and .repo/manfests
A number of places refer to these paths and that number is going to
grow. Since the standard pattern is to use environment variables for
commonly used paths it is time to add ones for these:
REPO_CACHE_DIR
REPO_MANIFESTS_DIR
2013-11-22 16:13:49 -08:00
Michael Marineau
8af32ad6c8 fix(pvgrub): Stick root's copy of the configs in /boot/grub
Previously this was in /boot/grub/grub which was probably by mistake.
2013-11-19 21:40:40 -08:00
Michael Marineau
23b1b01f1a fix(syslinux): Apply sudo_clobber fix to syslinux configs.
Already cleaned up the contrived cat/dd combo for the pvgrub configs, do
the same for the syslinux configs.
2013-11-19 18:41:27 -08:00
Michael Marineau
59c90bfb38 fix(pvgrub): Disable support for gptprio root detection/fallback.
This scheme only works robustly with kexec. Until the happy day that
kexec is supported on Xen (or when Xen is dead, long live Xen!) we
shouldn't bother trying. This allows us to use kernel modules again.
2013-11-14 15:04:04 -08:00
Michael Marineau
fa1ba72176 fix(set_lsb_release): Time for a new code name 2013-11-12 18:03:58 -08:00
Michael Marineau
b5e608c551 fix(toolchain_util.sh): Switch from sudo_clobber to sudo tee
sudo_clobber is provided by common.sh which isn't included in the
catalyst environment so call sudo tee (what sudo_clobber does) directly
instead.
2013-11-07 16:07:17 -08:00
Michael Marineau
84fadc8236 fix(check_deps): Fix support for includes in ld.so.conf
The path passed to _ReadLdSoConf must start with a '/' which wasn't
happening since relpath returns a relative path.
2013-11-07 13:28:13 -08:00
Michael Marineau
41099eef6f fix(board_options.sh): Move CHOST->ARCH mapping code.
Use the complete chost to portage arch mapping list from crossdev and
move the logic to toolchain_util.sh where it can be used by other
scripts.
2013-11-07 13:28:13 -08:00
Michael Marineau
b5816f7a8d fix(disk_layout_util.sh): Fix changing build_image's disk layout.
Previously the code in base_image_util.sh properly handled the disk
layout command line flag but the spaghetti code later on calls a
function from disk_layout_util.sh which only returned 'base' resulting
in a bit of a mess if something other than 'base' is used. Sync up the
two code paths to avoid that...
2013-11-07 13:28:13 -08:00
Michael Marineau
d5a19a0700 fix(toolchain_util.sh): Move cross-toolchain install code to common lib.
This will eventually be used by setup_board instead of the even more
complicated toolchain code provided by chromite.
2013-11-07 13:28:13 -08:00
Michael Marineau
e145b916f2 fix(catalyst.sh): Update catalyst build more aggressively.
Use 2*CPUs for the target load average but add load average throttling
to emerge in addition to make. Also work around how catalyst sets
FEATURES so we can disable extra locking for hopefully faster builds.
2013-11-07 13:28:13 -08:00
Michael Marineau
986548722d fix(toolchain_util.sh): Move native->cross pkg translation to function
Will be useful in other places and seems better to hide the bash magic.
2013-11-07 13:28:13 -08:00
Michael Marineau
0ba3d9ea04 fix(get_board_chost): Accept a list of boards to get_board_* funcs 2013-11-07 13:28:13 -08:00
Michael Marineau
6778eeda83 fix(bootstrap_sdk): Remove toolchain build step, replaced by build_toolchains 2013-11-07 13:28:13 -08:00
Michael Marineau
9187adb7ca fix(catalyst_toolchains.sh): Fix error in doc comment 2013-10-23 12:07:39 -07:00
Michael Marineau
169cc17394 fix(build_toolchains): Fix simple logging typo 2013-10-23 12:02:25 -07:00
Michael Marineau
31d5ced3df fix(build_toolchains): Remove hard-coded portage profile 2013-10-23 11:58:19 -07:00
Michael Marineau
c503b0248b add(build_toolchains): New command to build cross and native target toolchains.
This replaces the cross-toolchain compile step in bootstrap_sdk and adds the
ability to build native toolchains using the cross toolchain. This is just
the first step towards actually providing the native toolchain in a container.
2013-10-23 11:07:01 -07:00
Michael Marineau
f6341fc31d fix(legacy_disk_layout.json): Omit unused partitions.
We don't need to reserve space on disk just to reserve partition
numbers. And now that partitions are aligned these blanks spots grew
from 512 bytes to 1MB which is not much but still silly.
2013-10-16 19:44:49 -07:00
Michael Marineau
03754b2d62 fix(cgpt.py): Add support for aligning partitions
When using anything other than classic spinning disks with 512 sectors
it is generally best to maintain some alignment with the underlying
physical sector or erase block size. The default alignment most
partitioning tools use these days is 1MB (2048 sectors). Also sometimes
qemu-img requires disk sizes to be aligned to 64KB.
2013-10-16 19:32:04 -07:00
Michael Marineau
ecca978053 fix(cgpt.py): Fix GPT reserved space calculations.
The existing code arbitrarily multiplies START_SECTOR by 512 converting
from blocks/sectors to bytes, but blocks was the correct unit to begin
with. Also the secondary GPT area is not considered but that was OK
because the bogus unit conversion oversized our disks by almost 16MB.

Instead of relying on bugs properly reserve 34 sectors at each end of
the disk. (Well, we could get away with only 33 at the end since it
doesn't have a MBR but meh.)
2013-10-16 18:30:46 -07:00
unclejack
655c9de59e fix(build_library): set tz to UTC in vmx template
VMware is using the local time zone by default for the clock.
This changes the vmx template in vm_image_util.sh to set it to UTC
instead.
2013-10-15 23:14:11 +03:00
Alex Polvi
dcfcb00f5e feat(oem-rackspace): add rackspace as valid format option 2013-10-13 19:56:39 -07:00
Michael Marineau
5adbfd8a32 fix(catalyst): Move catalyst scripts from lib to build_library.
Just seems like a better place for them.
2013-10-10 11:47:09 -07:00
Michael Marineau
c96af93ba6 fun(set_lsb_release): New code name for version 100 2013-10-08 18:43:26 -07:00
Michael Marineau
c6f20655db fix(qemu_template): Fix getopts usage in qemu wrapper script.
Previously shifts were added into the getopts loop to work around
differences between different sh implementations but that causes getopts
to end the loop early. Instead use an intermediate variable to work
around inconsistent OPTIND behavior and explicitly check for the --
separator. Tested in bash, dash, and ash.
2013-10-08 13:35:10 -07:00
Brandon Philips
178783f1c8 fix(build_library): fix the pxe image instructions
the args to the kernel have changed to state= and root=squashfs: also
make the boot be 1024Mb of RAM otherwise qemu falls over with initrds.
2013-09-30 17:05:55 -07:00
Michael Marineau
6adc3d1d35 fix(build_image): Always use read-write for developer images. 2013-09-19 21:40:01 -04:00
Michael Marineau
be2926d8a3 fix(build_image): Exclude libc locales and info pages. 2013-09-19 21:32:48 -04:00
Michael Marineau
e15457054a fix(build_image): Replace two lingering pbzip2 references with lbzip2 2013-09-19 20:53:02 -04:00
Michael Marineau
e2b35bbae1 fix(build_image): Install dev packages into root, not /usr/local.
We don't have any particular reason for the weird hackery required to
install packages into /usr/local instead of root. The rootfs image is
already being modified a little might as well modify it a lot. :)
2013-09-19 20:43:59 -04:00
Michael Marineau
207cc2f6a3 cleanup(*): Remove unused/broken test and factory images 2013-09-19 19:04:54 -04:00
Michael Marineau
c86eb16098 fix(build_image): Remove defunct bootcache option.
From ChromeOS, not applicable to our systems.
2013-09-19 18:21:32 -04:00
Michael Marineau
9f98ce2aad Merge pull request #113 from philips/squashfs-init
feat(build_library): generate squashfs in cpio
2013-09-09 18:23:53 -07:00
Brandon Philips
05a4974836 fix(vm_image_util): remove /usr/share/oem prefix
remove this prefix from the PARTIIONED=0 builds
2013-09-09 18:06:40 -07:00
Brandon Philips
2605c6ca95 feat(vm_image_util): use bind mounts for pxe oem
solid cleanup idea from marineam to use bind mounts instead of copying
to generate the desired root layout.
2013-09-09 17:47:10 -07:00
Brandon Philips
f3413b473d feat(build_library): generate squashfs in cpio
squashfs is more efficient and plays well with namespaces. Switch to
generating a cpio with a single squashfs files.
2013-09-09 16:12:44 -07:00
Michael Marineau
1d58a2e611 feat(build_library): Add support for gpg signing DIGESTS
For the sake of consistency with Gentoo the GPG signature is DIGESTS.asc
2013-09-06 17:06:52 -07:00
Brandon Philips
c003b47772 fix(build_library): properly quote fields with spaces
quote COREOS_RELEASE_DESCRIPTION since it has spaces
2013-09-05 17:35:12 -07:00
Michael Marineau
b223b45800 fix(image_to_vm): Fix upload pxe, VM_GENERATED_FILES must be an abspath 2013-09-05 16:14:02 -07:00
Michael Marineau
bbacf2f0bd fix(image_to_vm): Mount source rootfs as ro when creating cpio.
When building with a write-protected root mounting as rw, the default,
fails.
2013-09-05 16:24:45 -04:00
Michael Marineau
c8d986d408 fix(image_to_vm): Cleanup must run as root.
Failures mid-build leave root-owned files behind.
2013-09-05 16:17:14 -04:00
Michael Marineau
b52955ef00 fix(set_lsb_release): New code name suggested by @gregkh 2013-09-04 14:46:45 -07:00
Michael Marineau
2d5a0a29e4 fix(image_to_vm): Use SCSI for VMware disks. 2013-09-01 17:23:59 -07:00
Michael Marineau
1539ff334e Merge pull request #98 from marineam/image-size
Image size
2013-08-28 12:25:56 -07:00
Brandon Philips
043dfeb868 Merge pull request #94 from philips/pxe-initial
Pxe initial
2013-08-28 12:09:41 -07:00
Brandon Philips
ce445512fd fix(build_library): fixup naming for the pxe image
based on @marineam's comments fixup the naming and ensure the output
files get picked up by the build system.
2013-08-28 12:04:55 -07:00
Michael Marineau
dfb7d8d115 fix(build_library): Drop default 'base' layout to 512MB for STATE.
This will further reduce the amount of dd'ing required when using block
devices.
2013-08-28 11:55:25 -07:00
Michael Marineau
8a488f890b fix(image_to_vm): Increase STATE in vagrant images to 16GB
Vagrant users are accustomed to much larger disk sizes so lets give it
to them. I'm leaving the others as-is since it is easier to grow than
shrink disks if anyone has a particular size they need.
2013-08-28 11:52:19 -07:00
Michael Marineau
9734ac017f feat(image_to_vm): Make disk layout configurable by VM type.
Use the smaller base format for 'raw' disk images since these will
usually be dd'd to a block device to create AMIs and what not. For
images using qcow2 and vmdk stick with the larger vm size.
2013-08-28 11:35:06 -07:00
Michael Marineau
c6bbadd6e0 feat(image_to_vm): Add 'vmware_insecure' image type.
This bundles the vagrant ssh key, vmdk, and vmx into a zip file for easy
downloading and login access via ssh.
2013-08-27 21:18:12 -07:00
Brandon Philips
a840ae036c feat(build_library): pxe support
This adds support for creating a PXE image and kernel using build_image
2013-08-27 17:33:44 -07:00
Michael Marineau
8b7cc15bc6 Revert "fix(build_library): Create disk image first instead of last."
This reverts commit b97cfe126f.

The minor device numbers of loop partitions are allocated dynamically
which significantly complicates dunning under Docker which uses a static
/dev. Rolling this back until we can rely on /dev being dynamic.
2013-08-26 00:53:27 +00:00
Michael Marineau
4f18deb87f fix(build_image): Add support for using git in dev images.
If git is installed via coreos-dev in the STATE partition it will need
some help finding its install location since it was built thinking it
would be installed in /usr rather than /usr/local.
2013-08-26 00:53:21 +00:00
Brandon Philips
047e3e0df1 feat(build_library): put all of the partition stuff behind a flag
this lays the groundwork for supporting a cpio img which doesn't have
partitions.
2013-08-22 10:51:11 -07:00
Michael Marineau
b97cfe126f fix(build_library): Create disk image first instead of last.
This avoids the need to dd individual filesystem images into a complete
disk image, just mount the partitions directly from a loop device
covering the whole image. This does add the requirement that mkfs run as
root but that isn't a problem.
2013-08-21 16:54:23 -04:00
Michael Marineau
34cfe6e07e churn(build_library): Change lots of stateful references to state.
For consistency we are using 'state' these days, not 'stateful'. While
I'm mucking around in this code it seems like a good time to switch.
2013-08-20 22:36:53 -04:00
Michael Marineau
ebbd281f0d cleanup(gen_tmpfiles): Move to build_library 2013-08-20 22:19:00 -04:00
Michael Marineau
ad908d0820 fix(gen_tmpfiles): Don't include /var/tmp, systemd defines this one. 2013-08-20 22:16:37 -04:00
Michael Marineau
efac054f54 fix(build_library): Remove usb and factory_layout partition layouts.
These are just cluttering things and adding an element of "how does this
work?" because base_image_util was defaulting to the "usb" layout in
some places and "base" in others.
2013-08-20 21:47:53 -04:00
Michael Marineau
34c324cc3a fix(build_library): Remove GPT writer scripts, call cgpt directly.
This change removes /usr/sbin/write_gpt.sh from images which we have no
use for. This allows us to drop the indirection of writing partition
tables by first writing out a script to call. Now cgpt.py can call cgpt
directly to initialize the partition layout. This opens the way for
further improvements to how disk images are created.
2013-08-20 21:30:22 -04:00
Michael Marineau
1ad0ea2eab fix(cgpt.py): Remove broken 'expand' feature.
This currently does nothing because our state partition is not partition
number 1. Even if it did we don't really needed it since we rely on
expanding on boot instead.
2013-08-20 21:09:06 -04:00
Michael Marineau
325755e923 cleanup(build_image): Remove some unused flags.
Remove --verity_*: Unused, we don't support verity
Remove --usb_disk: Unused, we use PARTUUID now.
Remove --enable_serial: Unused, and serial is enabled for syslinux
2013-08-19 18:09:11 -04:00
Michael Marineau
d8e670a2b3 fix(build_image): Don't over-size root partitions in base images.
Right now the initial (pre image_to_vm) images oversize the root
partitions, creating the expected 1GB filesystem in a 2GB partition.
image_to_vm later shrinks the partition back down to match. Just start
out with 1GB partitions to begin with instead.
2013-08-19 18:09:11 -04:00
Michael Marineau
0f84e3b05f feat(image_to_vm): Add new and improved qemu wrapper script.
This one is more automagical and sets up ssh keys from ssh-agent and the
user's home directory by default. Also adds an option for setting the
ssh port so it can be something other than 2222. Script should be
sufficiently portable, tested in bash, dash, and ash.
2013-08-18 19:43:07 -04:00
Michael Marineau
81afa4f300 fix(boot): Enable serial console when booting via syslinux.
Useful for qemu -nographic or any any other situation where serial is
easier to get at than VGA. It may be possible that in some setups ttyS0
isn't appropriate but we can figure out a way to customize kernel
options if/when that ever comes up.
2013-08-16 15:18:31 -04:00
Michael Marineau
c21b8ee03d cleanup(boot): remove lingering dm-verity bits, cleanup kernel args.
Remove unused dev/dm-0 vs dm-1 logic from verity and the associated
rootwait option it required (meaningless with our initrd). Move old
cros_legacy to common instead of using it in every command line option.
We should remove it entirely soon since it isn't useful for us. Remove
unneeded intel graphics modeset option.
2013-08-16 15:00:29 -04:00
Michael Marineau
b0d2775e0a fix(image_to_vm): Fix backslash in qemu README.
Go me fixing this issue in the script while adding it in the README.
2013-08-11 23:41:05 -04:00
Michael Marineau
bef5728f6e fix(image_to_vm): Cleanup qemu script, document -virtfs 2013-08-11 22:17:20 -04:00
polvi
3a1d4dbe1b Merge pull request #80 from polvi/vagrant-vmware
feat(vagrant): vmware fusion support
2013-08-06 14:01:00 -07:00
Alex Polvi
324f4d86f2 call it --format=vagrant_vmware_fusion 2013-08-06 11:14:03 -07:00
Alex Polvi
55062ec902 feat(vagrant): vmware fusion support 2013-08-06 10:58:18 -07:00
Michael Marineau
a21a545f2e fix(set_lsb_release): Make sure $ROOT/etc exists.
Useful for generating a root filesystem overlay that catalyst can apply.
2013-08-05 22:38:34 -04:00
Michael Marineau
ff6af5ea8f feat(set_lsb_release): Add special "sdk" track without an update server.
I want to start including version info in SDK builds as an alternative
scheme to the existing "chroot_version_hooks" system which always
assumes freshly unpacked SDKs are the latest regardless of what version
they actually were.
2013-08-05 22:35:34 -04:00
Michael Marineau
f8c0033de2 feat(image_to_vm): Add openstack image, uses oem-ami and qcow2 format. 2013-08-02 15:07:12 -04:00
Michael Marineau
c7ba8cd4a4 fix(image_to_vm): Replace qemu's config file with a script.
The recommended command using the config file was triggering a massive
memory leak in qemu because it was adding both the default virtual
hardware nic as well as the virtio nic. This could be worked around by
adding something like -net none or moving all the -net commands from the
file to the command line but eh. Clearly qemu config files are used and
tested by nobody else so lets just use a trusty script instead.
2013-08-02 14:53:08 -04:00
Michael Marineau
99982182b9 feat(image_to_vm): Switch to qcow2 as default qemu disk format.
We only really need raw images for dd'ing to block devices and this
format has been requested for some cases so lets just use it!
2013-08-02 14:53:08 -04:00
Alex Polvi
9ddb254ac1 feat(vagrant) add version requirement to the vagrantfile 2013-08-01 20:29:38 -07:00
Michael Marineau
9c88c24131 fix(image_to_vm): gzip vagrant's .box files 2013-08-01 22:42:37 -04:00
Michael Marineau
ae3202da32 fix(image_to_vm): Add VM MAC address to Vagrantfile, create box image.
Vagrant should now be good to go!
2013-08-01 19:39:12 -04:00
Michael Marineau
a2046afc40 fix(image_to_vm): Use vmdk disks for vagrant and write configs.
Vagrant will need the virtualbox ovf plus its own Vagrantfile config.
After this we will need an optional "package" step to this script to
take these files and bundle them into a .box tarball. This could also be
used to switch from .ovf+vmdk for plain virtualbox images to a bundled
.ova archive which combines the two.
2013-08-01 16:35:28 -04:00
Michael Marineau
ce01e133db fix(image_to_vm): Use vmdk+ovf for virtual box images.
Now we have a config file that can be imported into VirtualBox.
2013-08-01 14:42:04 -04:00
Michael Marineau
5e1337307a feat(image_to_vm): Basic vagrant disk image support
This just generates a vdi that includes the vagrant ssh key.
2013-08-01 00:02:33 -04:00
Michael Marineau
7c48115da6 fix(image_to_vm): Use saved version info instead of parsing directory.
Trying to include version info by adding the directory name to VM image
names didn't work and a better solution is for build_image to write out
a version.txt file. This should also fix an issue where uploading from
image_to_vm.sh didn't always go to the same location as the images
uploaded from build_image did.
2013-07-31 21:22:52 -04:00
Michael Marineau
84348c39af fix(build_library): Re-enable zeroing free-space but in a sane way.
As of Linux 3.2 loopback supports discard by punching holes in the
underlying file. This doesn't actually seem to impact things right now
since we are writing to fresh filesystems but might as well do this to
prevent wasted space from sneaking in later on.
2013-07-27 16:39:52 -04:00
Michael Marineau
a1a1ed830c fix(build_library): Use sparse files for disk images, no useless sudo
Enable sparse files for all dd and cp commands and replace some dd
commands that are really better off being truncate commands.

While in the neighborhood there were a number of useless sudo commands
for things that just happen to be in sbin. Call them directly instead.
2013-07-26 23:45:10 -04:00
Michael Marineau
1ea1e8ba9b cleanup(common): Remove rarely used pv_cat_cmd
Its single use is in build_common and even then having a little progress
bar for copying images isn't that interesting, they just get lost in the
noise of the emerge output. Keep it simple, use cp.
2013-07-26 22:40:59 -04:00
Michael Marineau
42a4536d7d fix(*): Rename dev image to coreos_developer_image.bin
Remove hard-coded references and unused scripts that mentioned it.
2013-07-26 22:12:10 -04:00
Michael Marineau
6697c05d0a Merge pull request #61 from marineam/vm_upload
Vm upload
2013-07-26 15:18:04 -07:00
Michael Marineau
c5cd245603 feat(image_to_vm): Add support for uploading vm images
After this I can make production AMI images available for download! :-D
2013-07-26 16:31:11 -04:00
Brandon Philips
ecb8ea259c Merge pull request #60 from philips/move-stateful-around
Move stateful around
2013-07-26 11:33:59 -07:00
Brandon Philips
3b30f8def3 fix(build_library): symlnks to stateful
add backward compat symlinks to the stateful directory
2013-07-26 10:20:29 -07:00
Brandon Philips
be72d56a50 fix(*): move dev_image to overlays
put the dev_image in overlays/usr/local
2013-07-26 10:20:18 -07:00
Brandon Philips
ca0b25028e Merge pull request #59 from philips/remove-container-stuff
chore(build_library): remove container library
2013-07-26 08:51:53 -07:00
Brandon Philips
cf8be2c320 fix(*): use /media/state and overlays dir
/mnt/stateful_partition was already a little unruly with
/mnt/stateful_partition/home and /mnt/stateful_partition/var_overlay
serving similar functional purposes.

Then we needed to also add /opt and /srv overlays.

I also have wanted to get rid of the ugly and weird
/mnt/stateful_partition name so lets just have one big move.

/mnt/stateful_partition -> /media/state
/mnt/stateful_partition/var_overlay -> /media/overlays/var
/mnt/stateful_partition/home -> /media/overlays/home

From there we add /media/overlays/srv and /media/overlays/opt
2013-07-26 08:44:47 -07:00
Brandon Philips
141d488da6 chore(build_library): remove container library
This is no longer used. It was used to debug early boot problems early
on.
2013-07-26 05:35:20 -07:00
Michael Marineau
2acc703cc8 fix(set_lsb_release): Spelling is for suckers 2013-07-26 00:02:11 -04:00
Michael Marineau
9ed620c277 fix(build_image): Fix baselayout install in final images.
The basic system directory structure including the lib symlinks were
fixed for sysroot in the following commits but the image build uses an
entirely different bit of code to do the exact same set of hacks. Port
those changes to the image building code to hopefully make all happy.

2ae0c30f4e
ac931bd088
2013-07-25 23:22:12 -04:00
Michael Marineau
fcb2a614b6 fix(set_lsb_release): swap BUILD_ID and VERSION_ID
This is what happens when you run off without finishing testing.
2013-07-25 23:18:13 -04:00
Michael Marineau
cc0873bbd8 fix(set_lsb_release): Add option for production updates, misc updates.
Add --production_track argument to set_lsb_release and
cros_make_image_bootable to support using the production update service
on developer builds of the 'prod' image. This replaces the previous hack
of setting COREOS_OFFICIAL=1 in the middle of the build.

Since lsb-release doesn't exist prior to the first call to
set_lsb_release switch to sudo_clobber instead of append. That way if it
is called a second time later the contents aren't duplicated.

Write the info to gentoo-release and os-release as well so everything
gets the same information.
2013-07-25 18:14:51 -04:00
Michael Marineau
b2b23fdaf4 Merge pull request #55 from marineam/vm
feat(image_to_vm): Refactor to make adding/changing vm formats easier.
2013-07-25 11:05:42 -07:00
Michael Marineau
9379ee19f0 fix(vm_image_util): Remove space before # comment in qemu config.
Last minute bug slipped in because of a line I commented out since the
current coreos kernel doesn't support virtio block devices (that change
coming soon). Qemu doesn't tolerate any spaces before # in comments.
2013-07-25 13:54:50 -04:00
Michael Marineau
df886c91e7 fix(vm_image_util): Remove tab characters. 2013-07-25 13:16:04 -04:00
Michael Marineau
033cf224f1 feat(image_to_vm): Refactor to make adding/changing vm formats easier.
The old script was heading towards spaghetti code realm. This breaks up
all the image variations such as hybrid MBR, OEM packages, etc into
configuration options and small functions that actually do the work.

All this is in the new vm_image_util.sh library but the command line
parsing and overall procedure remains in image_to_vm.sh

As part of this we gain support for putting some qemu options in a
config file as well as Xen virtual machines using pygrub and pvgrub.

Lots of generally unused options have been removed to simplify things
and keep output file names consistent.
2013-07-24 23:11:50 -04:00
Brandon Philips
b9568f9dce chore(*): use COREOS lsb-release variables
use the COREOS_ variables in /etc/lsb-release
2013-07-24 15:43:26 -07:00
Brandon Philips
69803d5ad6 feat(create_legacy_bootloader): add hvc0 on Xen
add console=hvc0 for systems that use pygrub/pvgrub by adding it to the
menu.lst files.
2013-07-22 17:37:51 -07:00
Brandon Philips
a923365449 chore(build_library/create_legacy_bootloader): remove old stuff
We don't need all of these args. Remove them.
2013-07-22 17:36:17 -07:00
Brandon Philips
95b2a4b8cd chore(*): use coreos_ everywhere 2013-07-21 23:20:50 -07:00
Brandon Philips
836ffc9327 feat(build_library): reintroduce A/B menu.lst
reintroduce unique A/B menu.lsts to work around the kexec problems that
we have. Essentially instead of always using boot_kernel on pvgrub
systems use the A/B kernels installed at update time to the boot
partition.
2013-07-21 22:30:46 -07:00
Michael Marineau
99089076af fix(build_image): Don't unmount when the rootfs isn't mounted
This function is never called when rootfs is mounted but leaving in a
check for it as a just in case sort of thing.
2013-07-19 02:41:52 -04:00
Michael Marineau
7564371200 hack(build_image): Make check for /usr/share/locale a warning.
Switching the toolchain to upstream Gentoo brought this directory back
and based on the Chromium OS history keeping this directory out of the
builds is a bit tedious. Keeping image sizes down isn't *that* important
right now so just let it be.
2013-07-18 10:38:16 -07:00
Brandon Philips
7ea2b4924f feat(boot_kernel): add support for the boot kernel
This adds the boot_kernel to the build boot partiton and updates the
relevant config files. Mission accomplished.

TODO: Update the installer to not worry about moving files around
anymore
2013-07-17 18:02:27 -07:00
Brandon Philips
ed037ea05c chore(build_library): remove efi image
we don't really care about booting on pure efi systems right now and I don't
think this all works so remove it for now.
2013-07-17 18:02:02 -07:00
Brandon Philips
06444a4ffc chore(build_library): strip out verity logic
remove some unused verity variables.
2013-07-17 18:00:00 -07: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
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
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
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
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
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
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
b4252985f2 feat(build_image): Add upload support for official builds 2013-07-05 23:55:50 -04:00
Michael Marineau
34bbdc1996 fix(build_packages): Move gsutil code from build_packages to a library.
To avoid making the same gsutil changes in more scripts move the code to
a library file where some of the basic parts can be shared.
2013-07-05 23:54:23 -04:00
Brandon Philips
a45c529549 feat(build*): add CoreOS production image building
This will create a CoreOS production image and support it with the tools
like image_to_vm.sh and build_image.
2013-07-05 12:06:40 -07:00
Brandon Philips
195d052495 fix(*): drop FACTORY images
we don't need factory image functionality. Drop it to simplify our
scripts and prepare for our "production" feature and flags.
2013-07-05 09:37:38 -07:00
Michael Marineau
2482291e7d fix(scripts): Cleanup build version handling.
A few things here:
 - Source manifests/version.txt directly instead of coreos-version.sh
 - Remove Chrome branch from target image directory names.
 - Use proper version instead of timestap for catalyst builds.
 - Move lsb_release script from coreos-overlay to build_library.
2013-07-02 16:12:02 -04:00
Michael Marineau
31dbe34f10 feat(build_image): Record directories installed in stateful_partition
During builds var_overlay is always mounted over /var. We want to do the
same at run time but we also want to ensure everything expected to be
there always does. After emerge completes gen_tmpfiles.py will scan /var
for any .keep files that were installed and records their parent
directories' permissions and ownership to /usr/lib/tmpfiles.d. On each
boot systemd will automatically recreate anything that goes missing.

This also means that going forward any ebuild that needs a directory in
/var (or anywhere else the stateful partition is bound) can simply rely
on the 'keepdir' ebuild function instead of adding things to
coreos_startup.
2013-06-06 14:18:52 -04:00
Brandon Philips
4057d5590d feat(disk_layout): follow new CoreOS partition layout
As outlined here we need a new partition layout, this patch makes the
necessary changes:
https://groups.google.com/forum/#!topic/coreos-dev/bA7gwGGoTng

The first big change is making all of the scripts obey partition numbers
based on labels in the disk_layout.json. This makes it much easier to
change later on.

The second big change is in the layout itself. The json file was updated
to reflect the document above.

And finally the grub boot configuration needed for pv-grub and pygrub
were added to the create_legacy_bootloader_templates.sh library utlity.

Everything seems to work and boot now.
2013-05-12 12:31:03 -07:00
Brandon Philips
edf40e1863 fix(build_library/legacy_bootloader): add menu.lst entries
these entries are needed for pvgrub, pygrub. Add them!
2013-05-03 18:17:21 -07:00
Brandon Philips
386ac79bd6 feat(build_library/container): more fixes
this sets up the container to a reasonable level. I stopped using this
container tool after I the dev server got up and running so YMMV.
2013-04-30 18:39:09 -07:00
Brandon Philips
6bb635d51c hack(build_container): add a script to build containers
this is a bit of a hack but I wanted to see if it had any utility during
development before making it all pretty. Essentially this is a copy of
build_image but instead of building up an entire image it simply puts
the files into directories on disk to be ran with systemd-nspawn/lxc/etc
2013-03-11 18:55:27 -07:00
Brandon Philips
7d9acd0de1 Revert "fix(dev_util): restore removed code from dev_util"
so it is a bit complicated but essentially gtest pulls in python which
pulls in pyton-updater which wants portage so portage gets installed in
teh real root not the dev one. Just leave it for now.
2013-03-07 11:32:19 -08:00
Brandon Philips
8a60480ff2 fix(dev_util): restore removed code from dev_util
93ed764 accidently removed some code, restore it.
2013-02-27 18:50:29 -08:00
Brandon Philips
93ed76460b feat(build_library): let python into root image
python allows systemd-analyze to work and gives a full portage stack.
Just let it in.
2013-02-26 08:00:40 -08:00
Brandon Philips
9f544e77a2 fix(build_library): cleanup kernel cmdline
don't be quiet, talk on tty0, and remove unneeded args

Change-Id: I6d49d0b119528ecb8082d38e77066691039092cb
2013-02-20 09:32:07 -08:00
Brandon Philips
f40133ceac hack(build_library/base_image_util.sh): don't zero fs
the math is wrong here as a build will often fail with "disk full". Fix
this.

Change-Id: Ib812991b584816862f0c72aeec79bebf37e214ba
2013-02-16 11:29:40 -08:00
Brandon Philips
a85c3f9167 fix(build_library/test_image_content.sh): Remove Xorg requirement
Remove Xorg and chrome, we don't ship those in coreos

Change-Id: Id3ffadda31c31e0d6afdc18738d2ed46fc41b537
2013-02-15 06:59:58 -08:00
Brandon Philips
78e2afafea fix(build_library/disk_layout_util.sh): unmount rootfs
Sometimes during the buildprocess we get here and the rootfs is still mounted?!

Change-Id: I6dc044d9d1318be606c1645f925421fa84c1f513
2013-02-14 16:26:48 -08:00
Brandon Philips
005de74765 fix(build_library/dev_image_util): use coreos
remove dev-init stuff for now and use coreos

Change-Id: I3f55550d197e3045eb26ea46fb9792d7c35dd5ab
2013-02-14 16:18:57 -08:00
Brandon Philips
9191f32d77 fix(test_build_root): fix tests for coreos
remove chrome and Xorg test

Change-Id: I6fe575954a8110c6bd94cbe7874b2cbea90def45
2013-02-14 16:18:57 -08:00
Brandon Philips
11472e5166 common: make safe_umount retry a few times
on Fedora 18 on Gnome 3.0 something is making the first attempt at
unmounting return busy. Unfortunatly, the return code is 32 everytime
so we have to parse the output of umount :( :( :(

Change-Id: I7f94bf6c2059c7e7cb4fb173d9ffbabd59f2b24f
2013-02-14 16:18:56 -08:00
Denis Glotov
94b00acd95 Revert "Revert "Extend STATEfull partition to 3Gb in 2gb-rootfs-updatable disk layout.""
This reverts commit 285b5338b8

Change-Id: I19f8238cb55f88b358244c09c32841ad9f79dd3f
Reviewed-on: https://gerrit.chromium.org/gerrit/42457
Tested-by: Denis Glotov <glotov@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Denis Glotov <glotov@chromium.org>
2013-02-01 12:00:17 -08:00
Don Garrett
7b69fb2525 Reorder rootfs partitions to be spinning disk friendly.
Change the order of partitions to given better performance for spinning disks.
However, this change affects all devices, not just those with spinning disks.

We will be able to remove the per-board overrides from several devices if/
when this change is accepted.

BUG=chromium-os:38122
TEST=image_to_live, (Will run trybots, and perform a recovery).

Change-Id: Ibe60e384e0392936f9f8ceb326618951367974df
Reviewed-on: https://gerrit.chromium.org/gerrit/41792
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Don Garrett <dgarrett@chromium.org>
2013-02-01 11:39:24 -08:00
Simran Basi
285b5338b8 Revert "Extend STATEfull partition to 3Gb in 2gb-rootfs-updatable disk layout."
Suspecting this CL is killing devices in the lab: crosbug.com/38483

This reverts commit 38fe561a92

Change-Id: I6a6f0c170d5410de79ad0d2b96c7b9c95046cae4
Reviewed-on: https://gerrit.chromium.org/gerrit/42452
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
2013-02-01 09:03:45 -08:00
Denis Glotov
38fe561a92 Extend STATEfull partition to 3Gb in 2gb-rootfs-updatable disk layout.
This is needed for vmtests to have enough space, because default size,
although expandable, is too small in vm images.

BUG=chromium-os:38088
TEST=cbuildbot x86-generic-asan amd-64-generic-asan --remote -g I07d31d8b -gI18fab01e -gI9f55fcd3

Change-Id: I9f55fcd3707859dca8304b8e0c78ebd39afea566
Reviewed-on: https://gerrit.chromium.org/gerrit/42390
Tested-by: Denis Glotov <glotov@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Denis Glotov <glotov@chromium.org>
2013-02-01 02:33:54 -08:00
Denis Glotov
61772d46aa Add 2gb-rootfs-updateble disk layout.
This is to be used with build_image and image_to_vm by cros buildbots
that need more rootfs size.

Unlike 2gb-rootfs, it has both ROOT-A and ROOT-B enlarged to 2gb, so
that image update test (1_update in SimpleTestsUpdateAndVerify) is possible.

BUG=chromium-os:38088
TEST=cbuildbot x86-generic-asan amd-64-generic-asan --remote -g I6f497214 -g I07d31d8b

Change-Id: I6f497214f54f4457cf2b40610beb9272622d1a47
Reviewed-on: https://gerrit.chromium.org/gerrit/41814
Tested-by: Denis Glotov <glotov@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Denis Glotov <glotov@chromium.org>
2013-01-28 08:16:28 -08:00
Mike Frysinger
79ae5b4a06 use new status=none with dd
The latest coreutils introduces a status=none option which suppresses
all information which is more than the current status=noxfer.

BUG=None
TEST=`./build_image` no longer spews any dd info

Change-Id: I3cfefed1d38e7e5ff52342c98e6a306d9a48950a
Reviewed-on: https://gerrit.chromium.org/gerrit/41930
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2013-01-24 13:58:27 -08:00
Paul Taysom
5e39bb6cd1 Configure the serial port for debugging
Enable the serial port from the build_image command line.
Currenly, you have to edit build_kernel_image.sh to enable
the serial port for kernel debugging. Now:

./build_image --board=${BOARD} --enable_serial=ttyS0

Will enable sending printks to the specified serial port.

BUG=chromium-os:38026
TEST=built images with and without serial enabled

Change-Id: I9ef4f2a20f0d451e132371339c4eba1faf4c94de
Reviewed-on: https://gerrit.chromium.org/gerrit/41638
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Paul Taysom <taysom@chromium.org>
Tested-by: Paul Taysom <taysom@chromium.org>
2013-01-23 17:44:43 -08:00
Mike Frysinger
baae8eb628 common.sh: convert to bash
We don't need to support POSIX shell, so convert to bash.

BUG=None
TEST=`cbuildbot {amd64,x86,arm}-generic-full chromiumos-sdk daisy-release` worked

Change-Id: I33ad25d2310c593f3e346d955e3aa27da41091fc
Reviewed-on: https://gerrit.chromium.org/gerrit/41271
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2013-01-16 13:59:21 -08:00
Gilad Arnold
8f861c05b6 common.sh: limit pv progress bar initial width to 80 characters
By default, pv automatically infers and uses the full width of the
terminal. This generally makes sense for a console application, but in
the case of pv it just causes the progress bar to be ridiculously wide
when run on wide terminals, to the point it's hard to read. This CL is
setting it to 80 characters, the widely accepted standard width for
a terminal, in cases where the terminal appears to be larger than
80 columns. Note that:

* Even with -w, pv appears to be resizing the progress bar as the
  terminal width changes midway through the run. This means that if
  a user widens the window, then the progress bar will go wide again and
  there's nothing to be done about it.

* Theoretically, in very rare cases this may lead to a progress bar the
  exceeds the width of the terminal (i.e. set to 80 columns on
  a terminal that has just shrunk to fewer columns). The odds for such
  timing are close to nil and even then the damage is minimal.

* This will work for non-terminal runs, or otherwise runs where stty
  does not produce any output.

* To avoid the initialization overhead for all common.sh inclusion,
  replacing the variable with a function that prints the pv/cat command.

BUG=None
TEST=Ran ./image_to_usb on wide and narrow terminal windows, it works.

Change-Id: I549df1dd29e93909ea646ae9b9e09d9a588ad382
Reviewed-on: https://gerrit.chromium.org/gerrit/40937
Commit-Queue: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
2013-01-12 23:06:31 -08:00
Anush Elangovan
c52c5fbb7c Add support for "skip_kernelblock_install"
CrOS could be used in devices that dont have custom firmware to
interpret the Kernelblock (Part2,4). In such devices skip trying
to make the kernelblock

BUG=none
TEST=./build_image --board=chronos test and verify we dont build the kernel block

Change-Id: I3e9a8dd765ea00db2ebf112553d96c08960e544f
Reviewed-on: https://gerrit.chromium.org/gerrit/40219
Commit-Queue: Anush Elangovan <anush@chromium.org>
Reviewed-by: Anush Elangovan <anush@chromium.org>
Tested-by: Anush Elangovan <anush@chromium.org>
2013-01-02 17:03:40 -08:00
Vic Yang
8e0cd07e03 Build factory install shim by ebuild
Now that we have an ebuild for factory install shim, let's move to that
instead of base image.

BUG=chrome-os-partner:16712
TEST=Test network boot, install shim, RMA shim on Link.
     Test install shim on Snow.
CQ-DEPEND=CL:39952

Change-Id: Ib6a7a598087647b44a4aeca970e293ea72023890
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/39955
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
2012-12-21 18:54:08 -08:00
Kees Cook
9ea1347ed9 update_partition_table: dynamically handle resize
When changing the size of the stateful partition, we must be able to
operate on any image, with any arrangement of partitions. The static
templates cannot be used because we don't know what we're starting with.
As such, this change makes the update function walk the list of
partitions, duplicating all their details, and moves any located after
stateful by the change in size, and copies in the new stateful contents.

BUG=chromium-os:37080
TEST=link build and decryption recovery tested

Change-Id: I1131dd8ee91e5db2556bdf8f7ca12b08f35da32b
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/39424
Reviewed-by: Will Drewry <wad@chromium.org>
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
2012-12-10 13:56:46 -08:00
Josh Triplett
127416ae93 check_deps: Find libraries using RUNPATH too, not just RPATH
check_deps checks for libraries using RPATH, but does not take the
similar RUNPATH into account.  For the purposes of chasing down
library dependencies, finding a library on either path suffices.

BUG=None
TEST=Build an image that includes binaries and associated libraries in a
     non-standard location, with the binaries and libraries setting an
     RUNPATH (and not an RPATH) pointing at that non-standard location.

Change-Id: Ic930bbacbe5c8ddeb367c39960dadea8aaba0cb2
Reviewed-on: https://gerrit.chromium.org/gerrit/39397
Tested-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Josh Triplett <josh@joshtriplett.org>
2012-12-07 15:22:17 -08:00
Darren Krahn
a91800bcc9 Revert "build_image: filter out unused glibc files"
This removes files only used at link time, or when manually debugging,
or by glibc's charset routines (gconv) which are not used by Chromium.

BUG=chromium-os:22939
BUG=chromium-os:23105
TEST=build_image for daisy works
TEST=`cbuildbot {x86,x86_64,arm}-generic-full` worked
TEST=`cbuildbot chromiumos-sdk` worked
TEST=build_image boots & runs fine on an alex

Original-Change-Id: I68d848c2e307c98d53a8faa73924f57571f7887b
Change-Id: I25ffda36d28fd114715053c3a2590cc2248688bf
Reviewed-on: https://gerrit.chromium.org/gerrit/39214
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Darren Krahn <dkrahn@chromium.org>
Tested-by: Darren Krahn <dkrahn@chromium.org>
2012-12-04 17:03:43 -08:00
Paul Taysom
0c2b408347 Fix for factory build of bootcache
BUG=chromium-os:36862
TEST=./build_image factory_install --board=parrot

Change-Id: If1e59d09eec45340e49b2711b4799eb1f83ea007
Reviewed-on: https://gerrit.chromium.org/gerrit/39133
Tested-by: Paul Taysom <taysom@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Paul Taysom <taysom@chromium.org>
2012-12-03 16:13:15 -08:00
Mike Frysinger
5ea15f8a38 build_image: filter out unused glibc files
This removes files only used at link time, or when manually debugging,
or by glibc's charset routines (gconv) which are not used by Chromium.

BUG=chromium-os:22939
BUG=chromium-os:23105
TEST=build_image for daisy works
TEST=`cbuildbot {x86,x86_64,arm}-generic-full` worked
TEST=`cbuildbot chromiumos-sdk` worked
TEST=build_image boots & runs fine on an alex

Change-Id: I68d848c2e307c98d53a8faa73924f57571f7887b
Reviewed-on: https://gerrit.chromium.org/gerrit/37378
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-11-30 15:48:40 -08:00
Paul Taysom
00df6f6e5b Build script changes needed to enable bootcache
Changes to build_image to allow enabling of bootcache.

./build_image --board=$BOARD --enable_bootcache

A board can be configured to use the bootcache by
the following lines in private-overlays/overlay-<board>-private/scripts

if [[ ${FLAGS_bootcache_use_board_default} -eq ${FLAGS_TRUE} ]]; then
  FLAGS_enable_bootcache=${FLAGS_TRUE}
fi

Setting --noenable_bootcache or --enable_bootcache on the comand
line will override the default.

BUG=chromium-os:25441
TEST=built and installed snow, amd-64(latitude), stumpy

Change-Id: Ie081ef94f4799b0071b53e0587d89f1247b4a11f
Reviewed-on: https://gerrit.chromium.org/gerrit/38414
Tested-by: Paul Taysom <taysom@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Paul Taysom <taysom@chromium.org>
2012-11-28 16:19:40 -08:00
Mike Frysinger
ff73cef8a6 build_image: fall back to ro-mount automatically
A rootfs built with verification cannot be mounted rw, so have the
mount script try to mount things ro if the rw mount failed.

BUG=None
TEST=`./build_image && ./mount.sh` work

Change-Id: I291ece366e03e218b3cd9ff8f30bd9a6e9cf879d
Reviewed-on: https://gerrit.chromium.org/gerrit/35065
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-11-15 11:31:29 -08:00
Paul Taysom
782425697f Added space to root partitions for bootcache
Added 200Meg to the root partitions where needed.

BUG=chromium-os:25441
TEST=secuity_test_image for stumpy and daisy. Installed stumpy, parrot, daisy.

Change-Id: Iaa049968f02b4d262ca5997b0844793f8acf999b
Reviewed-on: https://gerrit.chromium.org/gerrit/37905
Tested-by: Paul Taysom <taysom@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Paul Taysom <taysom@chromium.org>
2012-11-13 14:04:01 -08:00
Mike Frysinger
215f906123 build_image: use an array for excludes
This makes a follow up commit easier to document excludes.

BUG=chromium-os:22939
TEST=build_image for daisy installs same set of files

Change-Id: I09a9b3fe6f8c1d1fd9dd4d094f2fb7c81ce24880
Reviewed-on: https://gerrit.chromium.org/gerrit/37377
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-11-05 20:25:08 -08:00
Mike Frysinger
3e759d9e7d build_image: use pbzip2 when decompressing glibc
BUG=None
TEST=build_image for daisy worked

Change-Id: If2343bc1f13a23bc1b6bc0eae9a4ed8938b53eb4
Reviewed-on: https://gerrit.chromium.org/gerrit/37361
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-11-05 13:57:30 -08:00
Liam McLoughlin
12a9a84de9 Add adjust_part flag
BUG=chromium-os:35003
TEST=Build an image specifying above flag, verify image is correct size

Change-Id: I36df212bf1dac41717044da011552d459645d523
Reviewed-on: https://gerrit.chromium.org/gerrit/35105
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
2012-10-30 04:44:53 -07:00
Shawn Nematbakhsh
a84e93a688 Fix factory install shim w/ legacy x86 boot.
Install shim images are broken when booting from legacy x86 BIOS. The
install shim relies upon "cros_factory_install" being passed as a boot
flag. This flag is never passed to create_legacy_bootloader_templates,
so the install shim flow is broken.

This change passes the boot args flags to create_legacy_bootloader... so
the install shim will function normally.

TEST=Create factory_install image, verify correct boot w/ x86 BIOS.
BUG=chrome-os-partner:15661

Change-Id: I46b2be188f48b7626bfd3235d5788410c7488c42
Reviewed-on: https://gerrit.chromium.org/gerrit/36590
Tested-by: Shawn Nematbakhsh <shawnn@google.com>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Commit-Ready: Shawn Nematbakhsh <shawnn@google.com>
2012-10-25 21:53:49 -07:00
David James
18a9c2513a Move board overlay calculation into chromite (part 3 of 5)
This CL adjusts all scripts to use cros_list_overlays from chromite
instead of cros_overlay_list.

BUG=chromium-os:35514
TEST=Trybot runs with all callers adjusted to use
     cros_list_overlays instead of cros_overlay_list.
CQ-DEPEND=CL:36191

Change-Id: I6b147a64744015f6b199b2a00493e6f1e030376b
Reviewed-on: https://gerrit.chromium.org/gerrit/36167
Tested-by: David James <davidjames@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: David James <davidjames@chromium.org>
2012-10-23 08:52:03 -07:00
Don Garrett
de262e86c7 Increase the rootfs to 1G in size.
We are coming close to filling the rootfs size, so just make it bigger.

TEST=build_image, image_to_live, recovery, USB install, trybot
BUG=chromium-os:35086
CQ-DEPEND=CL:*27626
CQ-DEPEND=CL:*27627
CQ-DEPEND=CL:*27628
CQ-DEPEND=CL:*27632

Change-Id: Ida27761dbcf59e5553b10789a068e9cd6c1887ee
Reviewed-on: https://gerrit.chromium.org/gerrit/35477
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Commit-Ready: Don Garrett <dgarrett@chromium.org>
2012-10-17 23:30:38 -07:00
Mike Frysinger
26c4241341 build_image: only dump debug info when failing
If the image happens to be full but didn't run out of space,
then don't dump the filesystem debug output.  Only do it when
we're erroring out.

BUG=chromium-os:35083
TEST=`./build_image --board=x86-alex` still worked

Change-Id: Ia585b43273cc891aaaebe0fe08aedec78c91055e
Reviewed-on: https://gerrit.chromium.org/gerrit/35885
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Peter Mayo <petermayo@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-10-17 22:49:00 -07:00
Liam McLoughlin
61de2dc827 Make ROOT-B 4096 blocks long to workaround recovery image padding
BUG=chrome-os-partner:15036
TEST=Build/run recovery image, verify it runs at expected speed

Change-Id: I8bd701761456a9444845ffc87b9b70f7d3f0c371
Reviewed-on: https://gerrit.chromium.org/gerrit/35226
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
2012-10-11 04:53:33 -07:00
Liam McLoughlin
8ad01c5e9a Add a layout type named "big" to allow for gmerge/chrome development
BUG=none
TEST=build_image --board=stumpy --disk_layout=big

Change-Id: Id48bbdda2b3a570e267ae860acb87415db82a9b9
Reviewed-on: https://gerrit.chromium.org/gerrit/34685
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Reviewed-by: Peter Mayo <petermayo@chromium.org>
2012-10-09 12:42:54 -07:00
Mike Frysinger
1ef08a9fcf cgpt: validate layout files when loading
Add more sanity checks to the input .json file to catch when people
make typos or other random mistakes.

BUG=None
TEST=loaded all .json files we have

Change-Id: Ibc2439684628225da43639c2fac25958b5fa794e
Reviewed-on: https://gerrit.chromium.org/gerrit/34708
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-10-08 13:13:39 -07:00
Mike Frysinger
c17cf6aff0 cgpt: fix up "with open" handling
There is no need to call .close() ourself in a with block.

We can also use a with block in the WritePartitionScript func.

BUG=None
TEST=build_image still works

Change-Id: I53b31ba96c94e885b1d4415889b5d2a9691ccda1
Reviewed-on: https://gerrit.chromium.org/gerrit/34707
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-10-08 13:13:39 -07:00
Mike Frysinger
624071a08b cgpt: touch up style
No functional changes here.

BUG=None
TEST=build_image worked

Change-Id: I4dc7968c7417cefcb6576e9452dcf71847101c56
Reviewed-on: https://gerrit.chromium.org/gerrit/34706
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-10-08 13:13:38 -07:00
Kees Cook
a242b0a7cd build_library: move update_partition_table to common location
The "update_partition_table" routine is used by mod_image_for_recovery.sh
and ~/trunk/src/platform/dev/host/tests/mod_recovery_for_decryption.sh.

This moves the routine into a common location so future changes will not
break things. Additional removes the duplicate okboat/failboat
definitions from mod_image_for_recovery.sh since those are in a common
place already.

This change does not fix the stateful resize logic part of the bug, but
does move the code into a single place so mod_recovery_for_decryption.sh
can use it once it has been fixed.

BUG=chromium-os:35003
TEST=created working recovery image

Change-Id: Ibcd5289389dcadf58ccf0678ecfb29095848b247
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/34678
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
2012-10-04 15:15:49 -07:00
Mike Frysinger
8b82f358ed Revert "Added enable_bootcache option to scripts"
This reverts commit acff376525

This broke the signing process due to changed kernel params.
Please update ensure_secure_kernelparams.config under the
cros-signing/ tree before relanding this.

Change-Id: I3be62e16299eb69bbfef9f1530d92200a2e309d7
Reviewed-on: https://gerrit.chromium.org/gerrit/34320
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2012-09-28 19:16:40 -07:00
Paul Taysom
acff376525 Added enable_bootcache option to scripts
Added a new flag for enabling the boot cache.

BUG=chromium-os:25441
TEST=built and ran amd64 and arm

Change-Id: Ia151d40c4b02f4353981affd321763521d972ee6
Reviewed-on: https://gerrit.chromium.org/gerrit/33617
Tested-by: Paul Taysom <taysom@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Paul Taysom <taysom@chromium.org>
2012-09-28 11:31:13 -07:00
Mike Frysinger
b344800aa6 build_image: clean up emit_gpt_scripts a bit
Looks like the func was copy & pasted, so delete the first one (which
doesn't get used).  Then expand on the existing func to also generate
a mount and an umount script.

BUG=None
TEST=ran build_image, then tested the mount/umount and unpack/pack scripts

Change-Id: I34a372c7b4858b8e9057a29b2eb58c38d547eadd
Reviewed-on: https://gerrit.chromium.org/gerrit/33929
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-09-26 15:35:03 -07:00
Liam McLoughlin
0915c1e100 Fix bug where cros_factory_install didn't end up in the kernel cmdline
BUG=none
TEST=./build_image --board=stumpy factory_install, verify kernel cmdline

Change-Id: Icdf3156ea08e46d0ce5154133d62cb8d98d144f5
Reviewed-on: https://gerrit.chromium.org/gerrit/34102
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
2012-09-26 06:35:49 -07:00
Liam McLoughlin
e61da0dff1 Fixes the ability to AU after running chromeos-install
Make it possible to run chromeos-install without root

BUG=none
TEST=Build image, chromeos-install, verify ROOT-B is full size

Change-Id: Id506f1e5a6f8b8ee03ea1bdd621aaab1239bca2c
Reviewed-on: https://gerrit.chromium.org/gerrit/34081
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Ready: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
2012-09-26 03:01:41 -07:00
Liam McLoughlin
53fbca3fdb Correct partition layout calculation code
The CURR counter wasn't being correctly incremented for the stateful
partition resulting in an invalid layout

BUG=chromium-os:34715
TEST=Build image and verify it can be installed

Change-Id: Ie2f90d2e51e34e2056414363d7b2b42413018322
Reviewed-on: https://gerrit.chromium.org/gerrit/33928
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Tested-by: Olof Johansson <olofj@chromium.org>
2012-09-24 16:25:08 -07:00
Mike Frysinger
e82e99e999 cgpt_shell: avoid bash
This script gets run on the target, so we need to avoid bash.

BUG=chromium-os:34715
TEST=build_image works

Change-Id: Ib64036246149b8b98414e4434ed89a3a40c2f693
Reviewed-on: https://gerrit.chromium.org/gerrit/33911
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-09-24 12:18:42 -07:00
Liam McLoughlin
e81a23207f Updated verity error_behavior and max_ios defaults to match expected values
BUG=chromium-os:34696
TEST=Run ensure_secure_kernelparams.sh on an image built with this change

Change-Id: I16a6f5127bdfae958f9cd0d9ce1b0c55a0f68c67
Reviewed-on: https://gerrit.chromium.org/gerrit/33888
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
2012-09-24 10:56:52 -07:00
Liam McLoughlin
aca5e1edfe Fix up OEM partition during image build
BUG=chrome-os-partner:14340
BUG=chromium-os:34688
TEST=Build an image, verify OEM partition has filesystem

Change-Id: Ie3e51427a36f5e8ea288abb7ac3ceeefb20cdb6f
Reviewed-on: https://gerrit.chromium.org/gerrit/33866
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
2012-09-23 17:00:37 -07:00
Liam McLoughlin
5b37c5443a Simplify and add flexibility to image creation process
This change adds support for building the disk layout from a
configuration file. It also cleans up much of the image creation
code.

install_gpt no longer exists, and has been replaced by cgpt.py's
write action. This spits out a file that has two functions that can
be called to write a partition layout to a disk/file. This gets rid
of the gigantic nest of calculations that built the layout previously.

All instances of partition/filesystem sizes in build scripts should now
be gone in favour of calls to the cgpt.py tool.

create_boot_desc has moved inside the base image creation, in an effort
to simplify build_image.

load_kernel_test is gone since it's apparently not supposed to be called
here anyway (asked wfrichar/rspangler about this one).

Base image creation now uses files rather than loop devices when
building an image. This means we can simply umount them once we're
done and not worry about cleaning up the loop device, since it's
been done for us.

Hash pad calculation has been removed. This is now set manually inside
the partition config file.

Hybrid MBR creation is gone, since it's now possible to do that in a board
specific hook (see overlay-beaglebone/scripts/board_specific_setup.sh).

OEM partition now has a filesystem, which is mounted at /usr/share/oem
during emerge so that packages can stash files here.

root_fs_dir and friends are still globals, but the long-term idea
is to make this not the case.

BUG=chromium-os:33817
TEST=All types of images and their respective flows
  (VM, recovery, test, factory etc)

Change-Id: I8a596728a4d1845c930e837bea627f5b6a11c098
Reviewed-on: https://gerrit.chromium.org/gerrit/29931
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
2012-09-23 10:05:12 -07:00
Chris Sosa
0538571ce1 Deprecate for_test upstart jobs by building and installing test/dev init pkgs.
We also remove some dead mod_for_test scripts.

BUG=chromium-os:9729, chromium-os:14091
TEST=build_packages, build_image dev test
CQ-DEPEND=If58678ab4fe7abd9142a619850be07249d159781

Change-Id: Iff6a143dbf8ce58878dc1b07629c52bbb7f02ded
Reviewed-on: https://gerrit.chromium.org/gerrit/32998
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Chris Sosa <sosa@chromium.org>
2012-09-18 11:10:29 -07:00
Mike Frysinger
15a884825a build_image: dump debug info when target image is full
When we run out of space in the target image, it can be unclear that this
is the actual issue.  Detect this case and issue an appropriate warning,
and dump disk usage to help people triage things.

BUG=chromium-os:34167
TEST=`./build_image --board=amd64-generic` passed normally
TEST=`./build_image --board=amd64-generic factory_install` triggered the out-of-space check

Change-Id: I3052892a8c8bc386c7f08e1df26432eea2285563
Reviewed-on: https://gerrit.chromium.org/gerrit/32250
Reviewed-by: Peter Mayo <petermayo@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-09-05 18:32:27 -07:00
Liam McLoughlin
eb7ccc33b3 Move chromeos-factory into mod_image_for_test
Previously it was a dependency of chromeos-test which isn't correct

BUG=none
TEST=Build base and factory images

Change-Id: I133b937d1b56f96d5ebf3428172f9a4457c6bf5e
Reviewed-on: https://gerrit.chromium.org/gerrit/31156
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
2012-08-28 13:38:19 -07:00
Mike Frysinger
2cf2102f99 test_build_root: convert to arrays
Minor code clean up.

BUG=None
TEST=`build_image` still works + boots

Change-Id: I0e26dd3575f963a52d522c4f7c2da8aa5a7dda5c
Reviewed-on: https://gerrit.chromium.org/gerrit/30262
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-08-14 13:38:33 -07:00
Mike Frysinger
c17a493bcc setup DEFAULT_BOARD by default
Rather than forcing all consumers of DEFAULT_BOARD to remember to call
get_default_board, just do it for them automatically.

BUG=None
TEST=`cbuildbot {arm,amd64,x86}-generic-full` works
TEST=`./build_packages --help` shows correct default

Change-Id: I8d6ccb83babb2764a50692318eb9193c45fb3b39
Reviewed-on: https://gerrit.chromium.org/gerrit/17868
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-08-14 10:17:31 -07:00
Liam McLoughlin
d606ee21b4 Adding board specific image creation stage
BUG=none
TEST=Build a beaglebone image then verify that the beaglebone
bootloader was installed into the ESP

Change-Id: I1037ee6a61d409e8fd2d66ec6746048a54ce8f14
Reviewed-on: https://gerrit.chromium.org/gerrit/26738
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
2012-08-07 19:06:42 -07:00
Mike Frysinger
5885d772f7 build_image: make initial fs setup quieter
No need to dump all these mkfs/dd details early on.

BUG=None
TEST=`./build_image` still works, and doesn't spew as much

Change-Id: Ia8113d2ce2c0e6a8a13535b67b37372f0f146398
Reviewed-on: https://gerrit.chromium.org/gerrit/29366
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-08-07 12:32:22 -07:00
Liam McLoughlin
8afcdcd1a6 Add a flag to build_image that provisions both root partitions
BUG=none
TEST=Run build_image with --full, verify two roots are provisioned

Change-Id: I3a90cd18a7546519733bbf6ba51c9ad03e19e2ca
Reviewed-on: https://gerrit.chromium.org/gerrit/27432
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
2012-07-16 20:52:01 -07:00
Liam McLoughlin
0f21504982 Added hybrid MBR support in image_to_usb.sh
BUG=chromium-os:32150
TEST=Run image_to_usb.sh with --hybrid_mbr flag

Change-Id: I91c5072bd3f5f5f431f0778a66adf162f2dbd75d
CQ-DEPEND=I8cdf6694782357162188020217bc2350116c3a6d
Reviewed-on: https://gerrit.chromium.org/gerrit/26992
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
2012-07-16 17:49:11 -07:00
Don Garrett
d54aa70d57 Fix delta generation to work with updated glibc version.
The new glibc caused a series of problems with Paygen based delta generation.

First, the new glibc is newer than what is used in workstations, or on
the Paygen servers. Since libc wasn't one of the libraries bundled up
by generate_au_zip.py, the executables bundled up (including delta_generator)
would fail because of unstatisfied library requirements at startup.

When the new libc was included by generate_au_zip.py, the delta_generator
executable started causing the dynamic loader to segfault during startup,
presumably because it was linked for a newer version. This means that
the new loader needs to be bundled and explicitly used when invoking
the new executables (thanks David James for figuring this out!).

Next, after including all of the new libraries, bash would crash at startup
with these libraries at the start of LD_LIBRARY_PATH. Since Paygen which
set LD_LIBRARY_PATH before invoking a shell script which invokes the delta
generator, this means delta generation would crash before it started.

If I modified Paygen to not set LD_LIBRARY_PATH, then older au_generator.zip
files could not be properly handled (and we do so regularly).

This change moves the required dynamic libraries into a subdir of the zip
file which will not be in Paygens LD_LIBRARY_PATH which allows bash to
operate correctly.

It also renames each dynamically linked executable from xxx to xxx.wrapped
and creates a shell script named xxx which invokes xxx.wrapped with the
new LD_LIBRARY_PATH and using ld-linux-x86-64.so.2 to do so.

This change also moves a number of constants from inline in various
functions to constants at the top of the script, and introduces a WHITE_LIST
to cause a build failure if ld-linux-x86-64.so.2 isn't present.
(Fixing chromium-os:32550 would help with that)

BUG=chromium-os:32542
TEST=Generated au_generator.zip by hand, extracted files in a test directory,
and generated a delta using Paygen's command line:

LD_LIBRARY_PATH=. PATH=.:$PATH ./cros_generate_update_payload --image ../chromiumos_test_image.bin --output fuzzy --outside_chroot

Change-Id: I90d18a6d17a8f9824b19a6ce480048e388832b56
Reviewed-on: https://gerrit.chromium.org/gerrit/27443
Reviewed-by: Jay Srinivasan <jaysri@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Commit-Ready: Don Garrett <dgarrett@chromium.org>
2012-07-15 16:23:23 -07:00
Don Garrett
c8e3cb091e Generate_au_zip blacklisting was blacklisting * not nothing.
Fix the blacklisting logic, and re-add the magic library linux-vdso.so.

BUG=chromium-os:32542
TEST=Run by hand, .zip contents examined by hand.

Change-Id: I94d99bf62e5eb011ac70428d7cebeaa852519a78
Reviewed-on: https://gerrit.chromium.org/gerrit/27398
Reviewed-by: Jay Srinivasan <jaysri@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Commit-Ready: Don Garrett <dgarrett@chromium.org>
2012-07-13 18:28:27 -07:00
Don Garrett
540284316d Bundle up ALL dependant libraries for the delta generator.
We were blacklisting some dependant libraries for the delta generator when
we bundle them all up together. When glibc in the chroot was update to be
newer than glibc on our workstations, this broke payload generation.

The real fix is to link delta_generator statically so we don't have to do
this goofy library bundling business (chromium-os:32544). In the mean time,
bundle everything up to get us working again.

BUG=chromium-os:32544
TEST=Trybot run, but not fully verified.

Change-Id: I7b7d247f4edd8ecbab772807f6d2c4e7fdfd414a
Reviewed-on: https://gerrit.chromium.org/gerrit/27327
Commit-Ready: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
2012-07-12 16:16:15 -07:00
Kees Cook
224817fda9 Relocate stateful_parition/var to stateful_partition/var_overlay
To avoid needing to migrate fresh dev images's /var contents when
using the encrypted partition, move the /var bits out of the old
stateful_partition/var location into stateful_partition/var_overlay.

The (initially empty) system /var will continue to either live
in stateful_partition/var (in the unencrypted case), or in
stateful_partition/encrypted/var (in the encrypted case).

The contents needed for gmerge will be symlinked into place at runtime
(via CL I6e68b1f334f5d5b3c4d2977008435bd929191ce7). While the installer
already makes sure that /var is not shipped on an image, this change
additionally make sure that the other contents installed by the ebuilds
will not show up in the actual /var either.

BUG=chromium-os:22172
TEST=link build, boot, install, manual testing.

Change-Id: Ie6480a59929818fe5d36a46abf533b648fb78850
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/26355
Reviewed-by: Chris Sosa <sosa@chromium.org>
2012-07-09 09:06:30 -07:00
Mike Frysinger
c51e1f941d build_image: use pbzip2 on glibc debug info
Gives a minor speed up.

BUG=None
TEST=`./build_image --board=x86-alex dev` still works

Change-Id: I2c5251b788c557e9c76d05140aaed255003bb1e3
Reviewed-on: https://gerrit.chromium.org/gerrit/26258
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-06-27 19:17:10 -07:00
Mike Frysinger
e94c0766a3 build_image: fix /usr/lib/debug handling with dev images
gdb only looks in /usr/lib/debug, not anywhere in /usr/local.  So
unpack the C library stuff into the common /usr/local/usr/lib/debug
and symlink /usr/lib/debug to the /usr/local tree.  This way gdb can
find all these things automatically.

BUG=None
TEST=run gdb on board and see it find .debug files automatically

Change-Id: I93bd352ccac52d9d0179537d2eb520da6f684697
Reviewed-on: https://gerrit.chromium.org/gerrit/25270
Reviewed-by: Caroline Tice <cmtice@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-06-26 16:08:44 -07:00
Liam McLoughlin
924dae0521 Correct flag name for hybrid MBR option
BUG=chromium-os:32150
TEST=Build image using --hybrid_mbr flag

Change-Id: Iecd9204ab005ea03b131b86d9bd0019b720f1019
Reviewed-on: https://gerrit.chromium.org/gerrit/26144
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
2012-06-26 15:47:58 -07:00
Liam McLoughlin
07279034a9 Add option to create a hybrid MBR
This allows booting on boards that require their bootloader be on
the first partition of a MBR formatted disk

BUG=chromium-os:32150
TEST=Build an image using the --hybrid_mbr_hack flag, verify that
the ESP is visible on a system with GPT support

Change-Id: I4b137ef672b9ed7327bd42ec0a260d82a8c9d470
Reviewed-on: https://gerrit.chromium.org/gerrit/26071
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
2012-06-26 13:58:51 -07:00
Brian Harring
7f175a59e1 common.sh: output a backtrace and debug information on failure.
Currently, if set -e spots a nonzero exit we basically have
no real debug information- it just stops immediately without stating
where or why.  This forces our scripts to be stupidly verbose so
we can track roughly where they were, thus when they fail we can
use that information to localize the rough exit point.

Instead we should be traping that set -e induced exit and
outputing necessary debug information to run it down.  This includes
outputing the relevant stack trace, or at least what we can get of
it.

The 'die' function is now enhanced to automatically dump the trace
that lead to it.  For most consumers this is desired- however for
commandline parsing induced dies ("--board is missing" for example),
the trace is noise.  For those cases, a 'die_notrace' function was
added that retains the original non-backtrace behaviour.

Example output via instrumenting cros_generate_breakpad_symbols
w/ the failing command '/bin/false' (nonzero exit code).

Before:
./cros_generate_breakpad_symbols  monkeys --board=x86-alex
<no output at all, just exit code 1>

With this CL:
./cros_generate_breakpad_symbols  monkeys --board=x86-alex
ERROR   : script called: ./cros_generate_breakpad_symbols 'monkeys' '--board=x86-alex'
ERROR   : Backtrace:  (most recent call is last)
ERROR   :   file cros_generate_breakpad_symbols, line 207, called: main 'monkeys' '--board=x86-alex'
ERROR   :   file cros_generate_breakpad_symbols, line 163, called: die_err_trap '/bin/false' '1'
ERROR   :
ERROR   : Command failed:
ERROR   :   Command '/bin/false' exited with nonzero code: 1

BUG=chromium-os:30598
TEST=inject a failing command into a script, verify the output.
TEST=inject a 'command not found', verify the output
TEST=cbuildbot x86-generic-full --remote
TEST=cbuildbot arm-tegra2-full --remote
TEST=cbuildbot chromiumos-sdk --remote

Change-Id: I517ffde4d1bb7e2310a74f5a6455b53ba2dea86c
Reviewed-on: https://gerrit.chromium.org/gerrit/17225
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Brian Harring <ferringb@chromium.org>
2012-05-07 17:19:41 -07:00
Chris Sosa
dbc853b2bf Add an advanced option to build_image so that a caller can specify the version.
This change adds the ability for a caller to pass a specific version name
to build_image rather than rely on parsing of chromeos_version.sh + attempt
number.

BUG=chromium-os:29077
TEST=Ran build_image w/ w/out option

Change-Id: I69b76ae4bfc148325686902606476a0aae293e56
Reviewed-on: https://gerrit.chromium.org/gerrit/19861
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Chris Sosa <sosa@chromium.org>
2012-04-10 13:06:46 -07:00
Daniel Erat
b51593405b build: Test /etc/localtime symlink in built images.
This makes us fail if /etc/localtime doesn't point at
/var/lib/timezone/localtime.

BUG=chromium-os:27413
TEST=manual: error from build_image after i patched chromeos-base to not create the symlink

Change-Id: I11ef272c2dcd67a189a5d67c46792490ec6d27a1
Reviewed-on: https://gerrit.chromium.org/gerrit/19335
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Daniel Erat <derat@chromium.org>
2012-03-30 13:01:26 -07:00
Mike Frysinger
51409977a2 dev_image_util: make file work by default
File is compiled with a path to the default magic database, but since we
install it into /usr/local rather than the normal /usr, that default path
does not work.  Add a smaller wrapper script around `file` to specify the
new database location so people don't have to manually do so.

BUG=chromium-os:27725
TEST=`./build_image --board=x86-alex dev` produced an image where `file /bin/bash` worked

Change-Id: I3862cb368437a14bf1e4b6ccf4e2df3e4f774817
Reviewed-on: https://gerrit.chromium.org/gerrit/19137
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-03-28 09:29:12 -07:00
Joseph Hwang
ca63e041e5 Install uinput module in test image only
This CL adds uinput module in INSTALL_MASK so that the module
is not installed to non-test image. A mod_image_for_test script
is implemented to install the module in the test image if the
uinput module exists.

BUG=chromium-os:26707
TEST=Build a base image and a test image. Check the directory
  /lib/modules/<version>/kernel/drivers/input/misc
where current <version> is 3.2.7.
In the base image, there should be no uinput.ko,
while in the test image, there should be uinput.ko.
CQ-DEPEND=Ie96242c4d56403866a2298db2ba3bd6459248c1b

Change-Id: I0ca6599f80b9bb72cdc044fc97cdf990ce550edc
Reviewed-on: https://gerrit.chromium.org/gerrit/19032
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Tested-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
Commit-Ready: Joseph Shyh-In Hwang <josephsih@chromium.org>
2012-03-27 06:46:50 -07:00
Brian Harring
c03f260bb2 Revert "Install uinput module in test image only"
This reverts commit 5bf16bab5abb1cbf4f4acbc0d51d8aefa2c64091

Induced breakage: http://build.chromium.org/p/chromiumos/builders/x86%20generic%20incremental/builds/1259

Change-Id: I72170bc48cbc1cfe8b4913a9de1e5d8087525845
Reviewed-on: https://gerrit.chromium.org/gerrit/19023
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
2012-03-23 22:44:04 -07:00
Joseph Hwang
50420556f8 Install uinput module in test image only
This CL adds uinput module in INSTALL_MASK so that the module
is not installed to non-test image. A mod_image_for_test script
is implemented to install the module in test image.

BUG=chromium-os:26707
TEST=Build a base image and a test image. Check the directory
  /lib/modules/<version>/kernel/drivers/input/misc
where current <version> is 3.2.7.
In the base image, there should be no uinput.ko,
while in the test image, there should be uinput.ko.

Change-Id: I02b557466a56e11c5dcc1649a9275d0c2a896f09
Reviewed-on: https://gerrit.chromium.org/gerrit/17209
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Tested-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
Commit-Ready: Joseph Shyh-In Hwang <josephsih@chromium.org>
2012-03-23 20:35:46 -07:00
Mike Frysinger
00c2370856 test_build_root: drop libcros checks
Nothing in the tree needs libcros anymore, so as a precursor to removing
that package, drop the root check on its version info.

BUG=chromium-os:15922
TEST=`cbuildbot arm-generic-full` works
TEST=`cbuildbot x86-generic-full` works

Change-Id: I03668c6dbb4cb79dbadb0c98e3c05dca01a8045d
Reviewed-on: https://gerrit.chromium.org/gerrit/18247
Reviewed-by: Chris Masone <cmasone@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-03-16 09:04:11 -07:00
David James
dee866c121 Remove --build_root from all scripts except mod_image_for_pyauto.sh.
For all scripts, --build_root defaults to /build and is never used. To
remove option clutter, I've deleted this option.

The only script which still references build_root in src/scripts is
mod_image_for_pyauto.sh, which seems to support it for grabbing pyauto
dependencies from a location other than /build/*. This might conceivably
be useful, so I haven't touched that script.

BUG=chromium-os:27364
TEST=Remote trybot run. git grep for references to build_root.

Change-Id: I502f7df0123a598fc62a4ef4ed847ceb182f65b8
Reviewed-on: https://gerrit.chromium.org/gerrit/18283
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: David James <davidjames@chromium.org>
Commit-Ready: David James <davidjames@chromium.org>
2012-03-15 18:55:26 -07:00
Mike Frysinger
53d3680f54 test_build_root: use helper funcs for output
We've got nifty output helpers.  Use them.

BUG=None
TEST=build_packages+build_image for x86-alex works

Change-Id: I03172a8b1baba770cd425a52a1061e998a9717b6
Reviewed-on: https://gerrit.chromium.org/gerrit/18246
Reviewed-by: Chris Masone <cmasone@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-03-15 13:29:22 -07:00
Vadim Bendebury
093ffc22d3 Increase factory shim EFI partition size
With recent changes (transitioning to 64 bit x86 kernels and the 3.2
kernel) the factory install image EFI partition gets overflown,
resulting in build failures.

This change makes sure that factory shim image gets allocated twice
the room for the EFI partition (32M).

BUG=chromium-os:27639
TEST=manual
  run the following commands while in chroot:
  cd ~/trunk/src/scripts
   ./build_image --board=lumpy
   ./build_image --board=lumpy --replace --symlink=factory_shim --build_attempt=3 factory_install
   cd ~/trunk/src/build/images/lumpy/factory_shim
   ./unpack_partitions.sh factory_install_shim.bin
   ls -l part12
   cd ~/trunk/src/build/images/lumpy/latest
   ./unpack_partitions.sh chromiumos_image.bin
   ls -l part12

 . observe that in factory shim case the part_12 partition size is
   33554432 bytes, and in the regular image case the part_12
   partition size is 16777216

 . try using the factory_shim USB stick in recovery mode, observe the
   system come up (did not have a server set up, so the full install
   process was not verified).

Change-Id: Ibe001ec37c752dca90ec30ae056a67610e39a8fb
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/17907
2012-03-13 11:58:47 -07:00
Hung-Te Lin
2a506ffcce Fix typo in build_image factory_test.
The factory test image name is CHROMEOS_FACTORY_TEST_IMAGE_NAME.
Also fixed the error message when FLAGS_factory is not defined.

BUG=chromium-os:27651
TEST=build_image factory_test;
     # ls /usr/local/autotest/site_tests, seeing test packages.

Change-Id: Id8095e48e47382f07d77c85873bf588e489ba8cf
Reviewed-on: https://gerrit.chromium.org/gerrit/17816
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
2012-03-12 13:23:28 -07:00
Chris Sosa
e9e2d66366 Remove --nofast --nostatefuldev from build_image as they are never used.
BUG=chromium-os:27362
TEST=Built a test image.

Change-Id: I884acd534f06d9070b28d5cd74862e2774822578
Reviewed-on: https://gerrit.chromium.org/gerrit/17759
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Chris Sosa <sosa@chromium.org>
2012-03-12 10:55:51 -07:00
Chris Sosa
c9422fa467 Deprecate --test, --withdev, --factory, --factory_install from build_image.
Using these flags directly was deprecated a while back and is causing confusion
which way is the right way.  This CL removes all these FLAGS from build_image
(though keeps support of them in mod_image_for_test/image_to_usb invocations
in common.sh).  In this change I've also defaulted build_image to build the
developer image (and only the developer image).

BUG=chromium-os:27362
TEST=Been busy testing.  Have built the following combinations and verified them:

build_image base
build_image
build_image base dev test
build_image dev
build_image dev factory_test
build_image factory_install

Change-Id: Ie534c276a9ec571926964320ac176daa91b12a81
Reviewed-on: https://gerrit.chromium.org/gerrit/17386
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Chris Sosa <sosa@chromium.org>
2012-03-09 12:41:50 -08:00
Darin Petkov
a973d2bdb4 Add checks for blacklisted directories to test_image_content.
Also, blacklist /usr/share/locale. Most recently this unused directory crept
back into the image after some "sudo" package changes/upgrades.

BUG=chromium-os:11820
TEST=build_image dev for x86-alex, tegra2, amd64-generic

Change-Id: I0a209a5030a3da3674d3a38faf2367032c6e3423
Reviewed-on: https://gerrit.chromium.org/gerrit/16352
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
2012-02-23 02:18:20 -08:00
Stéphane Marchesin
27ef3ab406 Remove chromeos-wm from the files that we test for.
With Aura, we won't have a need for the WM any more.

TEST=built an image without chromeos-wm, verified that the build system didn't complain.

Change-Id: Id6e5006770f72ea45f440dbe56ff7f53262864c1
Reviewed-on: https://gerrit.chromium.org/gerrit/15212
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>
2012-02-03 10:17:08 -08:00
Mike Frysinger
84f66f5864 use helper info/die funcs rather than raw echo
We have helper funcs already for displaying messages, so convert
some raw `echo` calls to them.

BUG=None
TEST=build_image still works and boots

Change-Id: Ie66cc59d0362ef6aa19011fa6cb0bc64a6a4fce8
Reviewed-on: https://gerrit.chromium.org/gerrit/14478
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-01-24 21:57:30 -08:00
Don Garrett
48df416640 Include libstdc++ in the libraries bundled with delta generator.
We have updated the toolchain in the chroot to use a newer version of
libstdc++ than what is installed on our workstations. This means
this additional library is required to generate deltas outside of the
chroot.

BUG=chromium-os:25277
TEST=Generated zip file, and ran contents outside of chroot on my workstation.

Change-Id: I5a90ee355aabd4849a9186a9a66e3dc9b1c51d52
Reviewed-on: https://gerrit.chromium.org/gerrit/14597
Reviewed-by: Eric M. Blake <eblake@google.com>
Reviewed-by: Eric Blake <eblake@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Commit-Ready: Don Garrett <dgarrett@chromium.org>
2012-01-20 20:05:28 -08:00
Hung-Te Lin
d32c59fe47 crosutils: build factory test image by emerge commands
The factory test image was created by using rsync from build artifacts
in chroot, which has some concerns:
 - Runtime dependencies of autotest-factory won't be picked into image.
 - If a developer skips build_package and builds image by using only pre-built
   binary packages, he will get nothing in factory test image.
 - It's hard for developers to figure out how and when his changes will be
   merged to next build_image (cros_workon does not really work).
 - Output image will be definitely different for every developers, also the
   official build bots.
 - If developers never wipes his chroot (setup_board), the factory test image
   will grow until out of space. (For example, my environment outputs a 825M
   image while the official buildbot generates only 563M for same ToT source).

This CL changes image build command to using portage emerge, so that output
image can be prepared faster and smaller, and easier for maintenance.

BUG=chromium-os:3335
TEST=./build_packages; ./build_image --factory  # Image starts factory UI successfully
     # Also tried tests in test_list.all, seems fine.

     time ./mod_image_for_test.sh --factory --force_copy --no_inplace
     # time: 3m2s => 1m55s, factory test image data: 825/563M => 378M

     ./build_image --factory_install # factory install shim is also fine

Change-Id: I82b4505c74cd31e718aaff4a319d50b69b2c852c
Reviewed-on: https://gerrit.chromium.org/gerrit/14473
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
2012-01-20 17:54:11 -08:00
Chris Sosa
93e7b78eea Fix bug with building on the base image with build_image base.
This comes from not correctly negating all FLAGS and also the weird
way we set PRISTINE_IMAGE_NAME.  Addressed in both cases and
simplified FLAGS_* logic in build_image_util.sh

BUG=chromium-os:24627
TEST=build_image base so far.

Change-Id: I92e8550db3ea713cda1f997b702777035145d8d5
Reviewed-on: https://gerrit.chromium.org/gerrit/13636
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Commit-Ready: Chris Sosa <sosa@chromium.org>
2012-01-05 11:55:43 -08:00
Paul Taysom
7af7cb595b Use ext4 format for stateful partition
This is final step in ext4 conversion. We have been running with
the ext4 file system but ext3 format for several weeks. This changes
uses the ext4 format for the stateful partition.

Removed make_developer_script_runner.sh as per review.

BUG=chromium-os:20012
TEST=Ran ext4 on all platforms

Change-Id: I8e1564bfa576e9a0ad810879c18223a6c68b18e1
Reviewed-on: https://gerrit.chromium.org/gerrit/11220
Commit-Ready: Paul Taysom <taysom@google.com>
Reviewed-by: Paul Taysom <taysom@google.com>
Tested-by: Paul Taysom <taysom@google.com>
2011-12-01 11:21:57 -08:00
Anush Elangovan
2d7d6fd17b Enhance build_image to support new grub2 1.99+
BUG=chromium-os:21244
TEST=./build_image works with both old and new grub

Change-Id: Idca80f777b7da72da1690bc374a156f910d487b0
Reviewed-on: https://gerrit.chromium.org/gerrit/11876
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Anush Elangovan <anush@chromium.org>
Commit-Ready: Anush Elangovan <anush@chromium.org>
2011-11-18 16:21:35 -08:00
Jonathan Kliegman
23301afb5f Modify zero-free_space to sync the file and remove within it
There appear to be race conditions in some environments around mounting
and unmounting a file system quickly failing due to a device in use error.

This change removes the extra umount/mount/rm/umount sequence around
rootfs/filler which was done to ensure the file was being synced to disk.

Instead the dd command has added conv=fdatasync which causes it to sync
the file to disk on completion.

This also fixes a possible loopback device leak where the unmount would fail
and then build output directory deletion would fail because the rootfs was
still mounted, leaking both disk space and loopback devices.

BUG=chromium-os:22308
TEST=Ran filefrag on filler, validated that rootfs.image has blocks of 0 bytes
  in each position
  Compressed chromiumos_base_image.bin, compared size to previous build_image
  Booted image on tegra2 device, confirmed it still boots

Change-Id: I097440b7abefd4a0d25f743e968f33a1531a7a21
Reviewed-on: https://gerrit.chromium.org/gerrit/11487
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: Jon Kliegman <kliegs@chromium.org>
Reviewed-by: Paul Taysom <taysom@google.com>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Jon Kliegman <kliegs@chromium.org>
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
2011-11-11 07:57:44 -08:00
Chris Sosa
4299eb9d52 Fix bug where we may modify FLAGS_factory_install after we source base_image_util.sh
This also simplifies the factory_install logic to all be in the same place :).

BUG=chromium-os:22371
TEST=Ran trybot with this CL + tegra2 build that used make_netboot.sh that uses
the factory install which failed on the buildbot previously.

Change-Id: Id0847b85c061cf230d0e6cc5bb40de2eba0992b9
Reviewed-on: https://gerrit.chromium.org/gerrit/10986
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Chris Sosa <sosa@chromium.org>
2011-11-02 13:45:50 -07:00
Chris Sosa
131eaf5667 Fix message funcs to use $@ and fix callers to use it correctly.
Fixed all callers in my big CL to no longer have to wrap poorly using
\ and start from the beginning of the next line but rather pass in
an array of args i.e.

info "tacos" " are" " delicious".

BUG=None
TEST=Ran to see the errors in parse_build_image and manual eyeing.

Change-Id: I5eac8a5ae7a8d314dbc4e821ee33cf88213711d0
Reviewed-on: https://gerrit.chromium.org/gerrit/10823
Commit-Ready: Chris Sosa <sosa@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
2011-10-28 11:08:58 -07:00
Chris Sosa
b0f5732449 Add ability to pass in specific images you want built rather than use flags.
This CL does two things.

First it introduces an argument interface that works with all the following
combinations:

factory_install | [base|dev[test|factory_test]] rather than use --test etc.

This does not build extra images.  If you just want a test image you can
run build_image --board=<board> test and all that's in your latest_dir is
chromiumos_test_image.bin.

Second, we only build what we ask and only finalize what we ask so on
an invocation of build_image test we only actually run cros_make_image_bootable
once saving 2 minutes on my machine (from 6:50->4:50 on multiple iterations).

BUG=chromium-os:22048
TEST=build_image test, all possible combinations of args through to start of
build.  Built factory_install using new and old methods and dev test with both
methods.  Also verified mod_image_for_test still works as advertises stand-alone.

Change-Id: I9fe2feb50a941c007214decd9ba1627012c050af
Reviewed-on: https://gerrit.chromium.org/gerrit/10621
Commit-Ready: Chris Sosa <sosa@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
2011-10-27 16:33:07 -07:00
Hung-Te Lin
23fe17a20e crosutils: fix factory install shim when booting with legacy EFI firmware
Verified boot is not supported yet for USB+EFI boot, which is the case
of factory install shim.  We need to select normal boot in legacy boot
loaders when building factory install shim.

BUG=chrome-os-partner:6358
TEST=build_image --factory_install
     # boots successfully under ZGB H2O firmware

Change-Id: Ic4645a1766514bf7e0c31f8a4df21452bf195705
Reviewed-on: http://gerrit.chromium.org/gerrit/10013
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
2011-10-18 19:46:54 -07:00
Sonny Rao
3163cf0605 Change script style for ARCH comparisons to double-bracket bash style
BUG=none
TEST=test setup_board, build_packages, build_image, image_to_vm,
on x86-generic and amd64-generic

Change-Id: I43d9d8e6e0e48cbce4d0086b78721ed86b120d4a
Reviewed-on: http://gerrit.chromium.org/gerrit/10209
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
2011-10-17 17:53:48 -07:00
Sonny Rao
3494498738 Add amd64 recognition create_legacy_bootloader_templates.sh
This causes the script to treat amd64 the same as x86.

BUG=chromium-os:21284
TEST=./build_image for amd64-generic shouldn't generate an invalid
    architecture error

Change-Id: I37284def3cb2f0b16ece20a74d65bdb8e0116cff
Reviewed-on: http://gerrit.chromium.org/gerrit/9962
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
2011-10-12 15:14:00 -07:00
Sonny Rao
0c80dfb97d build_gpt.sh: accept amd64 as a valid architecture
This change causes build_gpt to treat x86 and amd64 as the same.

BUG=chromium-os:21284
TEST=./build_image for amd64-generic shouldn't generate an invalid
architecture error

Change-Id: I60424515e162a257b9c8d99885cac18f6bb013cd
Reviewed-on: http://gerrit.chromium.org/gerrit/9705
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
2011-10-06 23:31:04 -07:00
Mike Frysinger
4ad673ecfc check_deps: dynamically insert native multilib path
Rather than hardcoding every possible multilib path that we might come
across, look up the native multilib path that the target system is using
by finding the native ELF interpreter.  We use /bin/sh as a known good
file since you can't really have a system without this.

BUG=chromium-os:20636
TEST=`./check_deps /build/amd64-generic /bin/bash` now finds libs without explicit ld.so.conf
TEST=`./build_image --board=x86-alex` still works

Change-Id: Ib80824312a5e5a0f9e17e8ae18a2d42248771eb7
Reviewed-on: http://gerrit.chromium.org/gerrit/8564
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2011-10-03 07:42:29 -07:00
Mike Frysinger
564dcfbde6 check_deps: handle "include" directives in ld.so.conf
The ld.so.conf file supports an "include" directive where it'll include
all the files matched by the following glob.  Since Gentoo has started
using this, we need to support parsing of it too.  So move the parsing
code into a dedicated function and recursively call ourselves when we
hit an include directive.

BUG=chromium-os:20636
TEST=`./check_deps /build/amd64-generic /bin/bash` now finds libs
TEST=`./build_image --board=x86-alex` still works

Change-Id: I8894ca42358d91d8f2ee6e95b47faf9334ccdd26
Reviewed-on: http://gerrit.chromium.org/gerrit/8494
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2011-09-30 22:29:41 -07:00
Elly Jones
9ca3e4c0fe mod_image_for_recovery: reuse salt.
This will prevent the recovery kernel from having a different salt from the
rootfs it corresponds to.

BUG=chromium-os:20766
TESTED_ON=kaen
TEST=Adhoc
Build a recovery image and do recovery from it.

Change-Id: I96f735e527d807247e09e17aac1ed5b51367f0ef
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/8288
2011-09-28 10:50:10 -07:00
Scott Zawalski
53eb7a03b8 Modify build_image_util to preface CHROME_BRANCH with an R 2011-09-28 08:29:19 -07:00
Chris Sosa
905f6164a1 Prefix build folder name with CHROME_BRANCH from chromeos_version.sh.
BUG=chromium-os:15703
TEST=Ran build_image saw right folder.

Change-Id: I646dc7f67dac126436e75299e150ee053d25e810
Reviewed-on: http://gerrit.chromium.org/gerrit/8397
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Scott Zawalski <scottz@chromium.org>
2011-09-27 19:05:14 -07:00
David Rochberg
503e8f6dca Remove v flag for untarring of libc. Reduces volume of log output
BUG=none
TEST=./build_image  --board=x86-alex

Change-Id: I0112165e499fe0aa2dd3ff65c7f1d14406b3534b
Reviewed-on: http://gerrit.chromium.org/gerrit/7648
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David Rochberg <rochberg@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
2011-09-14 10:28:02 -07:00
Hung-Te Lin
920482f7f4 crosutils: add HWID folder when building factory test image
To always have HWID bundles in build output, this CL copies the HWID bundle
files from board temporary space into build output folder.

The HWID folder in make_netboot is also removed.

BUG=chrome-os-partner:5796
TEST=./build_image --factory
     # see "hwid" folder in build output

Change-Id: I8c2cd32c257b117261fba3654b52929c71310c82
Reviewed-on: http://gerrit.chromium.org/gerrit/7331
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2011-09-07 21:11:41 -07:00
Raymes Khoury
d37eb67163 Print friendly error message if the libc tarball is missing.
Advises the user to try running setup_board.

BUG=chromium-os:18934
TEST=Ran with missing tarball and checked message.

Change-Id: Ice444139188756932734f5f89ef22de4cd12ab41
Reviewed-on: http://gerrit.chromium.org/gerrit/6709
Tested-by: Raymes Khoury <raymes@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
2011-09-07 18:19:30 -07:00
David James
d1679ab864 Don't hardcode output directories in boot.desc.
Right now, output directories are hardcoded in boot.desc. This means that
cros_make_image_bootable will still write to the directories mentioned in
build_image, even if it's working on a different directory. This can
mess with the buildbot, because it can cause cros_make_image_bootable
to mess with the files created for existing images.

This change fixes flaky failures where the buildbot fails with warnings
stating that vmlinuz_hd.vblock does not exist. See bug 19956.

BUG=chromium-os:19956
TEST=Run full canary trybot run and verify cros_make_image_bootable uses
     files from the right directory now.

Change-Id: Ib390aa84570b077cbc8b69b757998056acc091ea
Reviewed-on: http://gerrit.chromium.org/gerrit/7282
Reviewed-by: Will Drewry <wad@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2011-09-06 13:50:40 -07:00
J. Richard Barnette
8e48095cb3 Delete some unused options from build_image and mod_image_for_recovery.sh
BUG=None
TEST=run both scripts, boot the images

Change-Id: I7209421d3b438d6daf37f210d5e73c0b9f91eb1d
Reviewed-on: http://gerrit.chromium.org/gerrit/6941
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
2011-09-01 09:18:26 -07:00
J. Richard Barnette
a308b39eae Share commonality between build_image and mod_image_for_test.sh
BUG=None
TEST=run the commands in various combinations.

Change-Id: I94fb167d8312a90818910085adebfb1d0396cdbe
Reviewed-on: http://gerrit.chromium.org/gerrit/6866
Reviewed-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
2011-08-30 15:40:51 -07:00
J. Richard Barnette
5f9dbe46a6 Create a function library for mounting/unmounting images.
The functions are shared between build_image and mod_image_for_test.sh.

BUG=None
TEST=build_image

Change-Id: Ib6d860a6818abee380dde97460f57943cc0a070c
Reviewed-on: http://gerrit.chromium.org/gerrit/6444
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
2011-08-23 13:39:03 -07:00
J. Richard Barnette
aaef76166f Convert build_library/test_image to a shell library.
Renamed the fuction from "test_image" to "test_image_content";
renamed the source file to match.

BUG=None
TEST=build both x86 and arm images

Change-Id: I158f2c5bc0f2fc260d48bd125a1899e6a21d7b79
Reviewed-on: http://gerrit.chromium.org/gerrit/5821
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
2011-08-15 14:23:10 -07:00
J. Richard Barnette
e4e3decfc0 Extract some common code for sharing with build_image, et al.
BUG=None
TEST=build regular, test, and recovery images

Change-Id: I2d7d073c27d14fb88be6a63953dcc77fc76a0807
Reviewed-on: http://gerrit.chromium.org/gerrit/5512
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
2011-08-11 09:51:31 -07:00
J. Richard Barnette
9fb286ea02 Skip filling in kernel partition until cros_make_image_bootable
When first creating an image, vmlinuz was extracted from /boot, and
installed in its place in the kernel partition.  However, none of
that was necessary, because cros_make_image_bootable walks over the
same ground later in the build process.

BUG=chromium-os:17390
TEST=build_image, boot base and dev images on ZGB and legacy device
TEST=inspect build output directory, to confirm no stray artifacts

Change-Id: Iaf332b6603e0bcb17585adbc95a7b65bb8bfe790
Reviewed-on: http://gerrit.chromium.org/gerrit/5107
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
2011-08-01 16:09:00 -07:00
Richard Barnette
c6818be0da Revert "Skip filling in kernel partition until cros_make_image_bootable"
This reverts commit a966c2bad686f787268f01a7529851a1a2a6ad9b

Change-Id: I0990252c34853f7e1884da19b2649ed32e52e078
Reviewed-on: http://gerrit.chromium.org/gerrit/5091
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
2011-08-01 13:53:34 -07:00
J. Richard Barnette
77ec32a128 Skip filling in kernel partition until cros_make_image_bootable
When first creating an image, vmlinuz was extracted from /boot, and
installed in its place in the kernel partition.  However, none of
that was necessary, because cros_make_image_bootable walks over the
same ground later in the build process.

BUG=chromium-os:17390
TEST=build_image, boot base and dev images on ZGB and legacy device
TEST=inspect build output directory, to confirm no stray artifacts

Change-Id: Icd4902f5a823241f24eb64f68f80c8e5e5198341
Reviewed-on: http://gerrit.chromium.org/gerrit/4928
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
2011-08-01 11:41:17 -07:00
J. Richard Barnette
0fad3d7171 Make build_gpt.sh into a shell function library.
Converted build_library/build_gpt.sh from a shell script to a shell
library defining a function to replace the script.

Converted build_library/emit_gpt_scripts.sh into a shell function
that is defined in build_library/build_gpt.sh.

BUG=chromium-os:17390
TEST=build_image
TEST=inspect and run pack_ and unpack_partitions.sh on new image

Change-Id: Ifdcb58f492f871e120cbec9c67bdeab94d1a4d3f
Reviewed-on: http://gerrit.chromium.org/gerrit/4866
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
2011-07-28 08:11:28 -07:00
J. Richard Barnette
f2206118f3 Isolate scripts and files that are used only in build_image
A modest number of different scripts and files have a usage
restricted to build_image.  Move those files to build_library,
to prevent them accumulating unwanted clients.

BUG=chromium-os:17390
TEST=build_image
TEST=grep relevant sources for references to all the files

Change-Id: I3e9f6447ec34c09ea2d61f29ac343386a1e122b9
Reviewed-on: http://gerrit.chromium.org/gerrit/4762
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
2011-07-27 08:46:01 -07:00
J. Richard Barnette
8447777820 Simplify standard boilerplate for selected scripts
This shortens the standard boilerplate for finding and sourcing
shell function libraries for build_image, mod_image_for_test.sh and
mod_image_for_recovery.sh.

As a side effect of the change, both mod_image_for_test.sh and
mod_image_for_recovery.sh will now restart inside the chroot if
invoked from outside; this is consistent with the pre-existing
behavior of build_image.

BUG=None
TEST=run the three scripts, from both inside and outside the chroot

Change-Id: Idd91cbee323346a871b49deea31a76875f5ee3c4
Reviewed-on: http://gerrit.chromium.org/gerrit/4675
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
2011-07-26 14:05:43 -07:00