Commit Graph

1158 Commits

Author SHA1 Message Date
Michael Marineau
4d97d2752d grub_install: use GRUB installed to the board root instead of SDK
Follow up to https://github.com/coreos/coreos-overlay/pull/1950
2016-05-10 12:02:56 -07:00
Michael Marineau
d5cb907947 grub_install: drop old/unused esp_dir flag 2016-05-10 10:56:21 -07:00
Michael Marineau
632d578b56 *: drop obsolete gentoo repo reference
Instead of patching portage to support the `disabled` flag now we just
patch it to leave the `[gentoo]` section out of the default repos.conf.

Follow up to 585275b268
2016-05-08 19:31:02 -07:00
Michael Marineau
20541226bf prod_image_util: do not check update keys on arm64
arm64-usr doesn't have update_engine yet so this isn't valid.
2016-05-05 17:33:11 -07:00
Geoff Levand
c053521e37 build_image: Fix image type conditional
PROD_IMAGE is a flag that indicates a production image should be
built, and will be set for dev builds if the user specifies that
both dev and prod images should be built.  build_image was
incorrectly using the PROD_IMAGE variable to conditionaly do some
setup depending on the image type.

Add a new variable IMAGE_BUILD_TYPE that can be tested for the type
of image currently being built and replace the PROD_IMAGE usage.

Signed-off-by: Geoff Levand <geoff@infradead.org>
2016-05-03 14:06:14 -07:00
Michael Marineau
582361b30c catalyst: allow GENTOO_MIRRORS to be passed in through the environment 2016-05-02 20:12:27 -07:00
Nick Owens
bbf737f9e6 Merge pull request #525 from mischief/grub-copy
build_library: copy grub.efi in pxe/cpio generation
2016-05-02 12:11:52 -07:00
Nick Owens
8c76ea6ea4 build_library: core_promote is gone, do not copy it 2016-04-28 16:46:22 -07:00
Nick Owens
a03cef558e build_library: copy grub.efi in pxe/cpio generation 2016-04-27 15:54:59 -07:00
Matthew Garrett
253590ab99 Merge pull request #526 from mjg59/increase_devsize
Increase the size of /usr on devel images
2016-04-27 13:53:48 -07:00
Matthew Garrett
9ae9ce8332 Increase the size of /usr on devel images
devel images contain significantly more code and we're overflowing the
filesystem. Increase this, but only for devel images.
2016-04-27 13:40:36 -07:00
Nick Owens
e0524264b9 build_library: generate pflash files for qemu_uefi from edk2-armvirt 2016-04-21 10:45:15 -07:00
Nick Owens
4ec33c5495 Merge pull request #519 from mischief/lib-path
build_library: use lib for tmpfiles rather than lib64
2016-04-14 15:47:44 -07:00
Nick Owens
12a9d94922 build_library: enable extra modules for arm64-efi 2016-04-14 14:46:01 -07:00
Nick Owens
704a480379 build_library: use lib for tmpfiles rather than lib64
in arm64-usr, lib is not yet a symlink to arm64, so trying to access
tmpfiles.d in lib64 will not work.
2016-04-14 13:26:02 -07:00
Matthew Garrett
0bd89d3381 Move PAM configuration to /usr at build time
A bunch of packages install PAM configuration fragments in /etc. Rather than
modify them all to install into /usr/lib, just move the entire directory at
image build time.
2016-04-11 11:34:57 -07:00
Matthew Garrett
56aa7e5a17 Add support for generating PCR configuration at image build time
We need to ship some PCR measurements alongside images in order to make it
easier for admins to provide an appropriate policy. Add some tooling to
generate the appropriate hashes during build, pack those into a zip file
and upload it.
2016-04-04 14:47:06 -07:00
Alex Crawford
c75583f2b8 Merge pull request #512 from crawford/name
set_lsb_release: a new name
2016-03-26 20:45:51 -07:00
Alex Crawford
d4103b08a6 set_lsb_release: a new name 2016-03-25 19:39:05 -07:00
Michael Marineau
9c529bb6fc check_root: add test for missing interpreters 2016-03-16 11:43:20 -07:00
Yann Hodique
2828c365da ovf: define variables accepted by coreos-cloudinit
OVF environment variables for VMware deployments, including cloud config
and network configuration
2016-03-05 15:15:45 -08:00
Michael Marineau
10fa4b5a0c prod_image_util: move profile.env to /usr
profile is already set up to source /usr/share/baselayout/profile.env
but it never has because I forgot to add this line during the migration
to amd64-usr images. Sure took us a while to notice that one... :(
2016-02-29 18:54:12 -08:00
Michael Marineau
66ea5974ce image_to_vm: add --getbinpkg option
Now image_to_vm can be used without first running build_packages.
2016-02-23 13:06:49 -08:00
Michael Marineau
744faa2df4 vm_image_util: oems are always from ebuild, others always from binary
This resolves two issues:
 - Large dependencies are *never* built during image_to_vm,
   build_packages must now handle that.
 - Since build_packages can't resonably do the oem-* packages (they all
   conflict with eachother) we do want to build them from the ebuild.
   This is now enforced so a old binpkg is never used. This resolves
   confusing issues people have always had while when editing oem
   ebuilds but getting a stale build instead.
2016-02-23 12:50:52 -08:00
Michael Marineau
65864a3a2d build_library: add a little script for checking oem packages 2016-02-23 12:23:40 -08:00
Michael Marineau
743d4bce37 build_image: Add support for --getbinpkg
Allows build_image to be used without first running build_packages.

Note: setup_board --force is required before build_packages will work
properly after doing this since baselayout won't be installed otherwise.
2016-02-20 14:26:50 -08:00
Michael Marineau
bc5de30442 board_options: new portageq wrappers
- May be sourced early, so explicitly die if source fails.
 - Add a function for getting the latest version of a package.
 - Read PROVIDES metadata using portageq, enabling data to be read from
   binary packages in addition to installed packages. The performance
   issue is not an issue here and needed to support empty build roots.
2016-02-20 14:17:45 -08:00
Michael Marineau
707c6c6f12 vm_image_util: add a small openstack image for wedging into tiny places
Most vm images have an expanded root partiton to make them practical to
use as-is. Some deployments may not want such a large root, putting most
storage on other volumes.
2016-02-16 11:22:59 -08:00
Michael Marineau
06d5ac79b1 set_lsb_release: a little cleanup, a new name
❤️
2016-02-15 14:17:37 -08:00
Michael Marineau
5ba4c7181d *: drop usage of COREOS_VERSION_STRING
This variable was semi-deprecated ages ago so `version.txt` could follow
a similar variable naming pattern to `os-release`. Finally drop usage of
it here in favor of `$COREOS_VERSION`.
2016-02-15 13:55:55 -08:00
Michael Marineau
9332cb697e release_util: use BOTO_PATH instead of searching for .boto
This simplifies the code a little and allows BOTO_PATH or BOTO_CONFIG to
be set in the environment. Now configs may be in arbitrary locations.
2016-01-28 13:10:01 -08:00
Michael Marineau
95d0bdaf72 *: Fix PIPESTATUS checks for bash 4.3
The one-liner `[[ -z ${PIPESTATUS[*]#0} ]]` no longer works because the
expansion still includes spaces even if all the values are zero. Somehow
that didn't matter in bash 4.2 but it does mater in 4.3 to be consistent
with the general behavior of variables in [[ tests.
2016-01-25 18:25:53 -08:00
Matthew Garrett
5fa4196501 Verify netboot config fragments if there's an available gpg key
If there's a gpg public key available in a system firmware variable, trust
it and use it to verify netboot configuration fragments.
2016-01-11 11:54:04 -08:00
Matthew Garrett
b6792a5609 Fix platform testing for suffix configuration
Grub doesn't seem happy with && tests in if statements, so replace it with
a two stage check.
2016-01-08 14:45:50 -08:00
Matthew Garrett
1f7c749b2d Add UEFI netboot support
If grub's been netbooted, pull the uuid and serial number out of smbios and
hit the API server to get the appropriate configuration.
2016-01-08 14:45:45 -08:00
Vito Caputo
0b9c8e5855 grub: disable console blanking
The console often contains very useful information in the event of a
hard crash, in such situations there's no ability to unblank the console
via keypress because the kernel won't handle the interrupt.

Since CoreOS is a server/cluster operating system, there won't generally
be monitors connected benefitting from a blanked console.  Disabling the
blanking altogether allows the frame buffer contents to always be
visible, even when the kernel can't handle keypresses.
2015-11-11 15:22:12 -08:00
Michael Marineau
b0c14f99b1 kernel_menuconfig: new script to simplify kernel config changes 2015-11-10 18:06:49 -08:00
Vito Caputo
f67fa9ce6c grub: supply disk guid to randomize in coreos.randomize_disk_guid 2015-11-06 14:58:00 -08:00
Vito Caputo
68f1b407c6 grub: add and set coreos.randomize_disk_guid kernel param
coreos.first_boot=1 will no longer trigger disk-guid randomization, so
manual ignition triggers in diskless/pxe scenarios may succeed.  Instead
we explicitly request the randomization when first_boot=1 was added by
grub finding the 00000000-0000-0000-0000-000000000001 disk-guid.
2015-11-05 21:04:31 -08:00
Alex Crawford
f7bcd4f547 grub: add oem_id variable to kernel parameters 2015-10-21 16:47:58 -07:00
Michael Marineau
01ae17dcc9 grub: move standard kernel options to grub
In order to boot properly we need `rootflags=rw mount.usrflags=ro` on
the command line. These have been build into the kernel directly but for
arm64 builds the built in options seem to be ignored.
2015-09-21 15:31:41 -07:00
Andrej Rosano
8ba400eca7 Add arm64 qemu image support
Allows image_to_vm.sh to build also arm64 qemu images.

Signed-off-by: Andrej Rosano <andrej@inversepath.com>
2015-09-17 14:16:18 +02:00
Andrej Rosano
16feac5ef6 Add arm64 grub installation support
Add the necessary variables in grub.cfg and populate the EFI
partition with arm64 efi executable and modules.

Signed-off-by: Andrej Rosano <andrej@inversepath.com>
2015-09-16 15:13:08 +02:00
Alex Crawford
32277dd006 build_library: fix comment 2015-09-08 16:15:50 -07:00
Michael Marineau
0ef030051c catalyst: re-enable ccache
Now that ccache is turned on by default in the profile portage complains
a lot if ccache isn't actually installed, sleeping 5 seconds for each
error message. Since pkgcache is in use ccache isn't going to make that
much of a difference but getting rid of those 5 second sleeps will. :)
2015-09-06 21:26:15 +00:00
Dong Xie
c04e2cb227 init commit of interoute oem build 2015-09-05 00:32:50 +01:00
Alex Crawford
9fb9442576 grub: add coreos.first_boot kernel param 2015-09-01 14:35:43 -07:00
Alex Crawford
b475cb2ea3 grub: run Ignition on first boot 2015-08-31 23:02:25 -07:00
Matthew Garrett
673f166013 Ensure that selinux policy is installed in correct location
Failing to explicitly set the selinux policy store to operate on may
result in semodule installing the policy in an incorrect location. Pass
it on the command line in order to avoid this.
2015-08-24 16:27:18 -07:00
Geoff Levand
3f3b2f2e8c build_image: Run ldconfig in qemu
ldconfig does not work for non-native arches.  Create a new
build_image routine run_ldconfig that uses qemu user emulation
to run the board ldconfig on the board rootfs when the board and
SDK arches are different.

See: http://code.google.com/p/chromium/issues/detail?id=378377

Prior to calling run_ldconfig the board rootfs must have ldconfig
installed.  To arrange this move the call of run_ldconfig to after
the base package install.

Fixes build_image errors like these when building for arm64:

  /sbin/ldconfig: /lib64/libXXX is for unknown machine 183.

Signed-off-by: Geoff Levand <geoff@infradead.org>
2015-08-05 14:47:58 -07:00
Michael Marineau
cf26510ea7 check_root: update ignore list for arm64, make error non-fatal 2015-07-29 19:22:55 -07:00
Michael Marineau
0fbb1891e0 Merge pull request #435 from marineam/check
Improved/faster package checks
2015-07-22 20:46:50 -07:00
Michael Marineau
806d9ca313 grub_install: stash an exact copy of the MBR boot code.
Useful for repairing the MBR without needing GRUB's tools.
2015-07-16 18:06:35 -07:00
Michael Marineau
d27bc5aeb3 Revert "build_library: set osType to otherlinux-64"
This reverts commit 39bb800f16.

This change disabled a number of features so it isn't suitable for the
generic VMware templates. We need to re-trace our steps to list exactly
what tools/systems weren't accepting the linux26 type.
2015-07-16 12:34:33 -07:00
Alex Crawford
0b0aa88be3 Merge pull request #427 from crawford/disk_util
disk_util: use the dummy disk UUID
2015-07-15 00:03:12 -07:00
Michael Marineau
5985b1e3d6 build_library: replace package checking script
The new python script check_root uses data that portage already
maintains on what shared libraries packages need or provide instead of
re-scanning whatever ELF files that can be found. This is much more
comprehensive but there is a bit of a transition issue for folks with
long-lived SDKs: packages built with portage older than 2.2.18 do not
include this data. As such for now the check is non-fatal and provides a
command you can use to refresh locally installed packages.

The code checking for conflicts between top level directories and /usr
has also been rewritten. Both tests now are considerably faster.
2015-07-12 15:50:58 -07:00
Alex Crawford
93e5faebd1 Merge pull request #423 from stresler/patch-1
Adding packet to the list of img and oem types.
2015-07-10 08:39:45 -07:00
Michael Marineau
fcd55e0171 generate_au_zip: improve error reporting of missing files 2015-07-02 13:51:39 -07:00
Michael Marineau
9db6ac5ef7 build_image: make building selinux policy optional 2015-07-01 23:11:09 -07:00
George Tankersley
283452e883 verity: add verity plumbing and hash injection to build scripts 2015-07-01 17:34:11 -07:00
George Tankersley
aa879ddcce grub_install: add support for verity and non-verity grub.cfg 2015-07-01 17:32:37 -07:00
mjg59
28da405b75 Merge pull request #425 from mjg59/master
Build selinux policy
2015-07-01 11:37:11 -07:00
Alex Crawford
7232e74bcc disk_util: use the dummy disk UUID
This dummy UUID (00000000-0000-0000-0000-000000000001) is used to
signify to Ignition that the disk is uninitialized.
2015-06-30 20:04:41 -07:00
Alex Crawford
cf4b282482 disk_util: convert some tabs to spaces 2015-06-30 19:58:10 -07:00
Matthew Garrett
14163c3c0a Build selinux policy
Create an selinux policy at image build time - despite the -i flag, this
won't attempt to install it into the running kernel.
2015-06-30 14:46:51 -07:00
Sam Tresler
01176c2d96 adding packet to the available OEMs 2015-06-29 16:52:36 -04:00
Michael Marineau
5789c6bbbf bootstrap_sdk: add support for directly GPG signing SDK tarballs
SDK tarballs have a .DIGESTS file but it is created by catalyst instead
of the upload_image function. In order to support plain GPG signing but
not avoid re-generating .DIGESTS we need to move that code out of
upload_image to a new function. upload_files shouldn't do it itself
because it is also used for portage binary packages which shouldn't be
signed (there is no point, nothing would verify the signatures).
2015-06-28 17:02:23 -07:00
George Tankersley
abb99b560d Merge pull request #412 from gtank/verity
disk_util: dm-verity hash output
2015-06-12 16:14:39 -07:00
George Tankersley
93f033c59e verity: add support for root hash output to disk_util 2015-06-11 18:37:51 -07:00
Alex Crawford
8cd6d7f8da image_to_vm: fix OVF filename 2015-06-09 18:56:49 -07:00
Alex Crawford
ebb1ad586f build_library: add support for VMware OVF
This moves the functionality of mkova.sh (within the SDK) directly into
the build library.
2015-06-01 16:45:42 -07:00
Alex Crawford
39bb800f16 build_library: set osType to otherlinux-64 2015-05-26 18:35:27 -07:00
Matthew Garrett
9fe7952578 Don't read OEM config data if Secure Boot is enabled
We don't want untrusted configuration to be read if we're in Secure Boot
mode, so skip the OEM config when Secure Boot is enabled and in User Mode.
2015-05-11 15:39:03 -07:00
Michael Marineau
fed42e2d12 Merge pull request #382 from Cygnus-Labs/adding-base-dev-pkg-flag
Enhanced dev_image_util with equivalent to --base_pkg
2015-04-30 17:00:16 -07:00
mjg59
0ce635c1d1 Merge pull request #397 from mjg59/master
Add support for signed kernels
2015-04-23 16:10:25 -07:00
Matthew Garrett
9579f4d68a Update grub configuration to handle ESP kernels, build it into grub
The grub configuration needs some updates to handle dealing with booting
the kernel from the ESP rather than from inside the image. We also want to
be able to avoid dealing with signing the config file, so build it into the
binary. Finally, rather than having to cope with signing grub modules, build
the ones we need to boot into the grub image.
2015-04-22 11:37:15 -07:00
Michael Marineau
12c53080a4 vm_image_util: add support for VMDK images for EC2 AMIs
Lets us avoid larger data transfers when importing images.
2015-04-21 16:27:37 -07:00
Matthew Garrett
07e5220f60 Add the kernels to the ESP
Once we're signing the root filesystem, we're not going to be able to boot
the kernel from there. Copy the kernel out to the EFI System Partition and
sign it.
2015-04-16 15:55:02 -07:00
Matthew Garrett
4b8a64b70c Build shim into the image
grub requires that shim be available in order to call out to verify the
kernel. Sign it and stick it in the image alongside grub.
2015-04-15 11:24:17 -07:00
Matthew Garrett
707803ed43 Add support for Secure Boot images and sign unofficial builds with test keys
Add qemu_uefi_secure target for building Secure Boot images. These are
identical to qemu_uefi images with the exception that the test keys have
been installed into the flash image, enabling Secure Boot by default. In
addition, sign the grub binary with the test keys during build when
producing unofficial images.
2015-04-15 11:11:24 -07:00
Michael Marineau
dc88c752e9 Merge pull request #392 from glevand/for-merge
Add basic support for arm64
2015-04-08 13:42:29 -07:00
Geoff Levand
ec53361620 toolchain_util: Add arm64-usr support
Adds CROSS_PROFILES, BOARD_CHOSTS, and BOARD_PROFILES definitions to support a
generic arm64-usr board.

get_portage_arch() is updated to convert aarch64 correctly.

Signed-off-by: Geoff Levand <geoff@infradead.org>
2015-04-08 13:30:38 -07:00
Michael Marineau
6e6a0a4967 toolchain_util: include repos.conf in bootstrap build environments
This is required for the eventual removal of `$PORTDIR` and
`$PORTDIR_OVERLAY` and ensures toolchain rebuilds/updates with
`./build_packages --nousepkg` don't erroniously try to use ebuilds from
`/usr/portage` inside of the SDK.

In order to fix up the build_toolchains script the crossdev overlay
needs to be setup properly, previously only setup_board did it.

Overall silences a lot of warnings and fixes an issue with crossdev:

    /usr/bin/emerge-wrapper: line 48: /eclass/toolchain-funcs.eclass: No such file or directory
    /usr/bin/emerge-wrapper: line 49: tc-arch: command not found
2015-04-01 16:30:37 -07:00
Geoff Levand
ea6cf50b8d toolchain_util.sh: Fix _configure_sysroot CBUILD
The portage CBUILD and HOSTCC variables need to be set to the SDK host to get
a proper cross build when building target binaries.

Change _configure_sysroot to use the CBUILD environment variable to set the
CBUILD and HOSTCC variables of ${ROOT}/etc/portage/make.conf.  Also, fix up all
calls to _configure_sysroot to set the CBUILD environment variable.

Fixes setup_board failure when the host and target architectures differ.

Signed-off-by: Geoff Levand <geoff@infradead.org>

[marineam: fixed a copy/paste error]
2015-04-01 15:54:43 -07:00
Michael Marineau
798d9087fb Merge pull request #386 from marineam/fsck
disk_util: include fsck output during resize operation
2015-03-25 14:31:29 -07:00
Michael Marineau
07fc135a12 disk_util: include fsck output during resize operation
Previously fsck output was suppressed to reduce the amount of noise in
build logs on the assumption that fsck really shouldn't have a reason to
fail. The filesystem is freshly created after all. However some users
have reported that fsck is failing but without error messages we don't
know why.
2015-03-25 14:16:15 -07:00
Michael Marineau
3b8cf7d1fb build_image_util: generate package license list for each image
There isn't a sane way for users to know the licenses of individual
packages in CoreOS images in built images. The information is hidden
away back in the original ebuilds. This extends our existing package
list with a new file that also includes licenses:

```
app-admin/flannel-0.3.0-r3::coreos Apache-2.0
app-admin/fleet-0.9.1::coreos Apache-2.0
app-admin/locksmith-0.2.3::coreos Apache-2.0
app-admin/sdnotify-proxy-0.1.0::coreos Apache-2.0
app-admin/sudo-1.8.10_p2::portage-stable ISC BSD
app-admin/toolbox-0.0.0-r4::coreos Apache-2.0
app-arch/bzip2-1.0.6-r6::portage-stable BZIP2
app-arch/gzip-1.5::portage-stable GPL-3
app-arch/tar-1.27.1-r2::portage-stable GPL-3+
...
```
2015-03-24 18:10:45 -07:00
mischief
7d2ee0e33c vm_image_util.sh: use correct group name in production images with no writeable /etc 2015-03-02 17:13:24 -08:00
techdragon
79ce0a3304 Enhanced dev_image_util with equivalent to --base_pkg
- "./build_image prod" already has the ability to specify which package will specify all the packages that should be pulled in and built into an image by specifying a package name using the --base_pkg command line flag. This creates an equivalent option for "./build_image dev" creating a --base_dev_pkg flag that passes a package name into the create_dev_img() function in dev_image_util.sh the same way that --base_pkg is passed into create_prod_image() inside prod_image_util.sh.
2015-03-02 13:21:56 +08:00
Alex Crawford
6013d8acc0 vm_image_util: add cloudsigma 2015-02-13 23:50:05 -08:00
Michael Marineau
d09aeb368c disk_util: allocate the maximum number of usable inodes
This change changes the default 'bytes-per-inode' ration from 16K to 4K,
the block size. To prevent this from wasting too much space change the
inode size from the default 256 to the minimum size, 128. Larger inodes
are used to store extended attributes more efficiently but since we do
not use SELinux the majority of files do not have security attributes.

These defaults may be modified via the new `bytes_per_inode` and
`inode_size` options.
2015-02-11 17:12:18 -08:00
Michael Marineau
d0da252d49 toolchain_util: fix parsing emerge --pretend output
Fix parsing the following output:

    [ebuild  N    ] dev-libs/gmp-5.1.3-r1 to /usr/x86_64-cros-linux-gnu/
    [ebuild     UD] sys-libs/timezone-data-2013d [2014i-r1] to /usr/x86_64-cros-linux-gnu/

The previous regex did not account for upgrades and got confused by the
`[2014i-r1]` listing and goobbled up too much of the string. I am not
sure *why* portage is reporting an upgrade when --emptytree is also used
but there it is. Match all not-] characters instead.
2015-01-28 16:37:52 -08:00
Alex Crawford
db1f826632 build_library: add extract_docs() 2015-01-16 13:12:21 -08:00
Michael Marineau
645181d044 Merge pull request #372 from marineam/ext4
disk_layout: switch to ext4 as the default root filesystem.
2015-01-12 14:12:46 -08:00
Michael Marineau
5c7a101bfe catalyst: disable ccache and autoresume
Disable ccache as it is causing issues in other builds so disable it
everywhere to be safe. Disable the autoresume feature because our build
process doesn't actually make use of it.
2015-01-08 16:17:26 -08:00
Michael Marineau
6b23aabcda disk_layout: switch to ext4 as the default root filesystem.
A brief summary: https://lwn.net/Articles/627232/ ;-)
2015-01-08 12:54:54 -08:00
Alex Polvi
1854bc2028 build_image: add ability to pick different base package 2015-01-02 15:07:52 -05:00
Yuya Kusakabe
95f7c37a9d vm_image_util: changed niftycloud format to ovf 2014-12-18 17:22:51 +09:00
Michael Marineau
9ae2e1397f Merge pull request #364 from vmware/open-vmdk
add vmware_ova to image formats
2014-12-17 14:58:37 -08:00
Oliver Kurth
bf90db1301 remove autogenerated comment 2014-12-17 14:52:04 -08:00
Michael Marineau
3b40989d52 catalyst: make sure the 'portage' user can write to distfiles and ccache
Adding the update step appears to break permissions on the distfiles
directory. Ensure the portage user is correct and set the permissions on
directories it needs to write to in advance.
2014-12-17 12:46:18 -08:00
Michael Marineau
4debbfc257 catalyst: update GCC dependencies before building stage1
When bootstrapping a SDK we need to update GCC dependencies to ensure
the GCC built for stage1 is linked against the same library versions as
those that are included in the stage1. Without this updating the mpc
library just results in a broken stage1.
2014-12-17 12:44:10 -08:00
Michael Marineau
ebf77d4fdd grub: search for OEM by partition label instead of filesystem label
Probing all filesystem types on all block devices appears to hang
booting Amazon EC2 HVM instances. The console output is unreliably
buffered so there is no information on what the failure actually is. On
the up side we can work around it easily by only searching the GPT which
appears to be safe.
2014-12-15 02:22:42 +00:00
Yuya Kusakabe
44adc99dc6 vm_image_util: add niftycloud 2014-12-13 12:14:19 +09:00
Michael Marineau
a45ba5dc5e grub: use new mount.usr kernel command line args 2014-12-08 18:14:10 -08:00
Michael Marineau
ac169700a9 vm_image_util: remove kexec/boot_kernel configuration
No longer applicable with the new bootloader setup.
2014-12-05 16:52:21 -08:00
Michael Marineau
fe9db4157b vm_image_util: add qemu_xen image type for testing
To aid testing things under Xen it helps to have a machine locally that
actually runs Xen! This isn't a particularly great setup but it works
well enough to simplify my own testing. Must be used with a developer
image and packages built with `USE=vm-testing` set to include the Xen
userspace tools.
2014-12-05 16:51:11 -08:00
Michael Marineau
d443daa168 grub: the one bootloader to rule them all
This uses our new GRUB2 features to handle GPT priority partition
selection, terminal selection, OEM tweaks, etc. The old SYSLINUX and
PV-GRUB configs are now unused except for maintaining compatibility
with older installs. Of the old configs only the ones that
coreos-postinst copies are needed. The new setup supports using GRUB2
under Xen, giving us automatic fallback support on all of our platforms
for the very first time!

Since grub.cfg is copied into place instead of generated, build_image's
--boot_args option is no longer supported. It could be re-added later
with some sed goo but for now it is easy enough to just edit grub.cfg.
2014-12-05 16:51:11 -08:00
Oliver Kurth
735e811a31 add vmware_ova to image formats 2014-12-04 16:19:23 -08:00
Alex Crawford
4d6a8aaf08 vm_image_util: use only ttyS0 for the console on Azure instances 2014-12-01 14:54:57 -08:00
Michael Marineau
3587784bc4 disk_util: Add support for computing verity hashes 2014-11-15 18:58:10 -08:00
Michael Marineau
931610d5bb disk_util: Set priority and successful attributes in new images
Mark the initial copy of CoreOS as 'successful' and with a non-zero
priority. Required to boot with a stricter interpretation of the
partition selection scheme which ignores partitions that have a priority
of zero. The new grub implementation follows this rule and is what the
original ChromeOS spec used too.

For the sake of completeness if multiple partitions are configured in
the json file with this feature they will be prioritized in disk-order.
2014-11-15 16:01:25 -08:00
Michael Marineau
96d11eb03b Merge pull request #351 from marineam/secure
A pile of goo to support a minimal secure boot demo
2014-11-07 17:43:06 -08:00
Matt Boersma
1d34b98dff virtualbox_ovf.sh: use virtio network interfaces 2014-11-07 16:16:03 -07:00
Michael Marineau
0c6adece3d A pile of goo to support a minimal secure boot demo 2014-11-07 13:53:46 -08:00
Michael Marineau
810ba021b7 vm_image_util: add qemu_uefi image type for easier testing 2014-11-05 15:53:17 -08:00
Michael Marineau
95c45cbc1e Merge pull request #343 from vmware/vmx-devices
use devices vmxnet3 and pvscsi
2014-11-03 15:42:39 -08:00
Michael Marineau
d2da1b9081 Merge pull request #346 from marineam/qcow2
vm_image_util: generate qcow2 images compatible with QEMU < 1.1
2014-11-03 14:23:59 -08:00
Michael Marineau
7ba6381f38 disk_layout: align partitions and disk sizes to 2MB
The VHD format actually uses 2MB blocks internally so the 1MB alignment
used in e77e4e54 wasn't sufficent to prevent other tools from further
adjusting the image size to align it. Additionally a 1MB alignment may
be triggering a bug in OpenStack or XenServer disk resizing that renders
that partial block at the end of the old image size unmapped/unavailabe.
2014-11-03 13:19:58 -08:00
Michael Marineau
2f081e91c8 disk_util: ensure partitions are layed out on disk in order
So far the default iteration order of python dicts has mostly matched
the order that we want the partitions on disk but this is not always the
case. I caught the BIOS-BOOT partition being ordered on disk after the
USR-A partition. Nothing bad came of this but consistancy is good.
2014-11-03 13:07:29 -08:00
Michael Marineau
ea898ea3f6 vm_image_util: generate qcow2 images compatible with QEMU < 1.1 2014-11-03 11:12:09 -08:00
Oliver Kurth
67ad41fd22 use vmxnet3 device 2014-10-23 13:52:56 -07:00
Oliver Kurth
431a0b4ec0 use pvscsi device 2014-10-23 13:50:05 -07:00
Oliver Kurth
39eb776b8d add pcie configuration to vmware vmx file 2014-10-23 13:49:50 -07:00
Alex Crawford
f0618ab541 build_library: use jq to parse JSON 2014-10-22 15:19:27 -07:00
Alex Crawford
a204e434c6 grub_install: use sudo when reprobing 2014-10-22 15:19:04 -07:00
Alex Crawford
c226ac1c12 azure: finalize azure image
Increase the root partition to ~28 GiB.
2014-10-13 12:19:41 -07:00
Alex Crawford
44520881c7 build_image, image_to_vm: add disk-size assertions
Assert that the image is a multiple of 1 MiB
2014-10-08 21:09:54 -07:00
Michael Marineau
0d3a849e2b disk_layout: adjust ROOT partition sizes to fill new alignment
The new disk size alignment left too much extra space at the end of the
disk which would lead to pointless resizing on first boot. Fill in the
extra space so that no more than 1MB is left unused.
2014-10-08 20:40:54 -07:00
Michael Marineau
e77e4e5499 disk_layout: Align disk sizes to both 1MB and cylinder boundaries.
The VHD disk format internally includes CHS addressing and qemu-img
respectfully aligns disk images to the common 16 heads 63 sectors
geometry when possible. This is unfortunate since images uploaded to
Azure must also be aligned to 1MB we normally do.

Since qemu-img doesn't have a way to handle this well right now adjust
our existing alignment logic to create disk images aligned to both.
2014-10-08 20:40:45 -07:00
Michael Marineau
e361e9170e vm_image_util: Enable new VMware OEM package. 2014-10-08 20:40:45 -07:00
Michael Marineau
bb1c2559fb grub_install: work around intermittent missing loopback partitions
I am unsure exactly what situation is causing the loopback partition
device node to not exist when it is being mounted but this should help
work around the situation and log loudly about it so we can hopefully
figure out where to dig further.
2014-10-08 12:24:01 -07:00
Camilo Aguilar
7729258fda Upgrades virtual hardware version
Version 4 is too low. Some VMware products even crash trying to
upgrade it to a greater version (VMware Fusion 6 Pro). Having at
least 7 will allow us to use some modern features in most VMware
products, such as enabling vmxnet3 virtual network adapters or adding
much more memory and cpu cores to virtual machines.
2014-09-29 16:00:03 -05:00
Michael Marineau
da86c34d75 prod_image_util: clean up /etc cleanup code
Pruning files via INSTALL_MASK in the profile is a bit more apropriate
since it allows us to keep most of that info in one place. The only
parts that need to be deleted or adjusted here are inputs and outputs of
`env-update` which has to be run after everything is installed.

Previously we didn't actually clean up `env.d` at all which lead at
least one user to think they should edit those files and run
`env-update` themselves but we don't ship that tool on prod images.
2014-09-25 16:13:29 -07:00
Vito Caputo
454e4c1ad4 Added --oem_pkg oem override option to image_to_vm.sh
This sets the IMG_FORCE_OEM_PACKAGE variable to the supplied string.  If a
':' is present, what follows it gets put in the IMG_FORCE_OEM_USE variable
and what precedes in the former.

_get_vm_opt() has been modified to generally support forced overrides such
as this one, simply set variables named IMG_FORCE_$opt.

Now you can do things like:

for fmt in cloudstack \
		digitalocean \
		ec2-compat:ec2 \
		ec2-compat:openstack \
		ec2-compat:brightbox \
		exoscale \
		gce \
		hyperv \
		rackspace \
		rackspace-onmetal; do
	./image_to_vm.sh --format=qemu --oem_pkg=$fmt
	../build/images/amd64-usr/latest/coreos_developer_qemu.sh -curses
done

rather than having to modify build_library/vm_image_util.sh to test oem
builds in qemu.
2014-09-24 14:28:56 -04:00
Michael Marineau
a1a86ac731 vm_image_util: use new azure and hyperv oem packages 2014-09-22 15:21:20 -07:00
Stephen A. Zarkos
3b2c54fe5e Hyper-V & Azure build support
Add Hyper-V and Azure as build targets for development images.
2014-09-18 14:27:31 -07:00
Michael Marineau
09e720e821 cleanup: remove a couple references to chrome-bot 2014-09-14 14:54:35 -07:00
Michael Marineau
81fb3e12a0 Merge pull request #330 from exoscale/build-exoscale
exoscale builder
2014-09-08 19:23:35 -07:00
Antoine Coetsier
b9dc44da2e remove boot_kernel option for KVM in exoscale 2014-09-08 23:23:13 +02:00
Michael Marineau
1a8b197659 qemu: adjust the meaning of the -s (simple) flag
My primary use case for this flag is to fix booting with UEFI firmware
which can have problems when mixed with KVM, adding kexec into the mix
doesn't help matters either. The current version of OVMF can boot from
virtio drives just fine so that is now enabled and KVM is disabled.

So the -s option can also mean sloooooooow but boots!
2014-09-07 09:58:51 -07:00
Michael Marineau
5bfa0c8d20 build: switch from SYSLINUX to GRUB2
The new grub install script must be called after the image is unmounted
and the old bootloaders script doesn't need to touch grub at all. For
now we will continue to use the existing syslinux configs but
interpreted by grub. Beyond the grub menu flashing by during boot
everything should still be functionally equivalent.
2014-09-07 09:58:51 -07:00
Michael Marineau
12a9900e02 grub_install: new install script for grub, add UEFI bootloader
This script replaces the standard grub-install tool to give us some more
control over what is going and ensure grub-install's auto-detection
magic doesn't make any incorrect choices. Also this script sets up a
loopback device and mounts the EFI partition in just the right way for
grub-bios-setup's auto-detection magic to work correctly.

I've chosen not to adapt disk_util to use partitioned loop devices to
make grub happy because ensuring loop devices get cleaned up properly
for the general case gets tricky and less robust.
2014-09-07 09:57:39 -07:00
retrack
ddccb5072b exoscale builder 2014-09-05 09:56:48 +02:00
Michael Marineau
9580ea4086 build_image_util: fix generation of packages.txt
The passing ROOT= as an environment variable to board wrapper scripts
doesn't work, the script unconditionally overrides it. This means so far
our packages.txt files have listed the contents of /build/amd64-usr
instead of the image. Fix this by calling equery directly instead.
2014-09-04 15:12:20 -07:00
Alex Crawford
b2b70c8624 Merge pull request #325 from crawford/digitalocean
digitalocean: Add image format for digitalocean
2014-09-02 13:52:30 -07:00
Michael Marineau
3de1613a99 Merge pull request #324 from marineam/grub
Grub2 preview
2014-09-02 10:22:27 -07:00
Michael Marineau
680730cc1a configure_bootloaders: add grub install stub code
Not currently used, this configuration which sets up grub to re-use the
syslinux configuration only works with recent git versions, not any
releases. Compatibility is also limited because the serial configuration
in syslinux must be duplicated in the grub config.
2014-08-30 17:46:38 -07:00
Michael Marineau
0cc06c9c5c build_image_util: pass the disk image through to configure_bootloaders
Required so that configure_bootloaders can now handle installing the
bootloaders as well.
2014-08-30 16:39:05 -07:00
Michael Marineau
25b20b420c disk_util: support exposing a hybrid partition without syslinux
We don't need to do anything like manually install the MBR boot code
for grub but we do need to continue to expose the ESP partition as a
hybrid partition to support pvgrub.
2014-08-30 16:26:26 -07:00
Michael Marineau
fd8618336d disk_util: do not zero MBR and GPT when resizing disk
Calling cgpt create when resizing zeros the MBR boot code. This worked
with the syslinux setup because the boot code was re-written. When not
using syslinux it is easier to just preserve the existing MBR instead.
2014-08-30 16:00:07 -07:00
Michael Marineau
cb97931478 disk_layout: replace unused "BOOT-B" with Grub's BIOS Boot Partition
Unlike SYSLINUX, GRUB2 does not recommend embedding itself in a FAT
filesystem. Instead GRUB2 prefers embedding in the space between the MBR
and first partition or using a dedicated partition that is safe from
tampering by fs utilities. In our case the space after the MBR is where
the GPT lives so we need to use the extra partition scheme instead.

The 64MB "BOOT-B" partition has never been used so we can replace it
with a 2MB partition which is more than enough for GRUB.
2014-08-29 14:05:22 -07:00
Michael Marineau
4228c591a8 disk_layout: mount ESP to /boot instead of /boot/efi
We have long since stopped installing anything to the /boot directory of
the root filesystem. Mount the ESP partition to /boot for consistancy
with the discoverable partition spec.
2014-08-29 13:57:42 -07:00
Michael Marineau
70051bf6ef prod_image_util: install GCC libraries to /usr/lib
Normally GCC is installed in a way that allows installing multiple
versions and switching between them. Our production images do not need
this and additionally the only things from the GCC package that are
needed are the shared libraries. To ensure these libraries are *always*
locatable regardless of the presence of /etc/ld.so.conf and
/etc/ld.so.cache we can install those libraries to plain old /usr/lib.
The GCC packages don't have a built in way to do this but we can get
away with extracting the libraries directly from the binary package.

This is actually similar to what ChromeOS did with a few exceptions:
 - We use a native GCC build instead of the cross toolchain
 - The archive is properly extracted from the package instead of feeding
   the package directly to tar and ignoring the resulting warnings.

As an added benefit switching from a blacklist to a whitelist ensures
that extra cruft does not slip through the cracks, saving 5-10MB.
2014-08-27 20:23:39 -07:00
Michael Marineau
8a3a5e1c51 build_image_util: do not symlink etc/portage/profile
Create profile as a real directory instead of a symlink to the board
root's configuration. Normally the board root does not modify this but
it is useful for build_image to use it to modify package.provided.
2014-08-27 19:55:27 -07:00
Michael Marineau
5377e7870d prod_image_util: update /etc/ld.so.conf on every boot
Early images created this as a file instead of a symlink, these systems
will not be able to find the new GCC libraries using the older config.
2014-08-26 18:28:07 -07:00
Alex Crawford
f835e1e0fd digitalocean: Add image format for digitalocean 2014-08-26 17:30:00 -07:00
Michael Marineau
1de8eb3b11 toolchain: always switch to latest GCC version
Normally Gentoo expects moving between major GCC releases to be a manual
step. In our case we want this to always be automatic, otherwise the GCC
version won't be switched at all.
2014-08-26 16:31:46 -07:00
Michael Marineau
d97f6e7332 Merge pull request #318 from marineam/gce
vm_image_util: use only ttyS0 for the console on GCE instances
2014-08-24 16:55:58 -07:00
Michael Marineau
f6bc2908d4 rename references to updatectl, it is now updateservicectl 2014-08-20 16:27:44 -07:00
Michael Marineau
5c590f2a6d vm_image_util: use only ttyS0 for the console on GCE instances 2014-08-18 16:09:24 -07:00
Michael Marineau
b3ecb2c550 toolchain_util: fix bash syntax when running as root
Apparently expanding an empty string before a variable assignment forces
that assignment to be interpreted as a command instead. Instead of an
empty string use env as our sudo alternative when running as root.
2014-08-18 14:41:53 -07:00
Michael Marineau
319879609e toolchain_util: build stable cross gdb, misc cleanups 2014-08-15 16:17:04 -07:00
Alex Crawford
5d13999fbb onmetal: Up the TOTALTIMEOUT setting
Bump TOTALTIMEOUT to 5 minutes
2014-08-06 19:22:15 -07:00
Alex Crawford
3740cc0504 onmetal: Up the TIMEOUT and TOTALTIMEOUT settings
Bump TIMEOUT to 15 seconds and TOTALTIMEOUT to 2 minutes
2014-08-06 18:45:05 -07:00
Petr Hosek
95e5912b14 feat(vm_image_util): CloudStack support
Provide initial support for CloudStack.
2014-07-24 17:47:57 -07:00
Michael Marineau
3ee48fac14 onmetal: Replace boot_kernel's args
The console should be on ttyS4 and just in case blacklist mei.
2014-07-24 11:57:57 -07:00
Michael Marineau
4ca4b65dba Merge pull request #303 from marineam/fixes
Toolchain build fixes
2014-07-22 12:44:41 -07:00
Alex Crawford
abf24663a2 Merge pull request #305 from crawford/fillings
Pull teeth. Replace with onmetal.
2014-07-21 20:44:36 -05:00
Alex Crawford
712c1a3d9b Pull teeth. Replace with onmetal. 2014-07-21 18:40:36 -07:00
Michael Marineau
2a004f0081 qemu: set DHCP hostname based on image name and version
Provides an easy way to test this setting hostname from DHCP, most other
systems rely on it.
2014-07-21 16:43:48 -07:00
Michael Marineau
859cea0306 build_library: fix compatibility with latest crossdev version 2014-07-20 21:32:53 -07:00
Michael Marineau
f9e03a8e6f build_image: add repos.conf and binpkgs url to dev images
Needed for portage 2.2. Sync URIs are included but not very useful yet
because portage only can do `git pull` but not `git clone`. An extra
helper script will be required to do the initial clone it seems.

Binary packages may be useful for re-installing a package with a
different INSTALL_MASK. Can be used to install debug symbols.
2014-07-19 19:20:51 -07:00
Michael Marineau
07cb281d6a build_image: install the complete system package set in dev images
dev images, now with fancy tools like `make`!
2014-07-19 17:29:05 -07:00
Michael Marineau
a28a8966e4 build_image: use dev and prod profile variants
Instead of gluing in a special PROD_INSTALL_MASK for all images use
profiles to configure the differences between the base build root,
production images, and developer images. This offers much more
flexibility and is needed for providing a full dev environment in
developer images.
2014-07-19 17:17:28 -07:00
Michael Marineau
4d3c198161 tools: remove support for parallel_emerge
Using parallel_emerge has been disabled by default for all commands
except build_image for quite a while now, build_image kept it just
because it was still a bit faster than normal emerge. Keeping
parallel_emerge complicates future changes to build_image so it needs to
drop it entirely. Since that means nothing uses it by default we might
as well just rip out support for it entirely.
2014-07-19 16:38:17 -07:00
Michael Marineau
1016bb323b bootstrap_sdk: setup /usr/lib correctly before calling set_lsb_release
os-release is now written to /usr/lib but that is likely a symlink to
/usr/lib64 so a little extra logic is required to avoid clobbering the
symlink.
2014-07-14 17:41:18 -07:00
Michael Marineau
19a4ae59d0 build_library: enable remount-usr later in the boot process. 2014-07-14 15:55:03 -07:00
Michael Marineau
0326b5f57f build_library: move os-release to new location for systemd 215 2014-07-14 15:55:00 -07:00
Michael Marineau
eeec7e1c65 vm_image: switch xen disk format back to raw
VHD was just for testing, raw is more useful for published images.
coreos-install will now be able to install working xen instances:

    coreos-install -d /dev/xvda -o xen -c cloud-config.yml
2014-07-10 17:23:20 -07:00
Michael Marineau
eebe8d5fe9 build_library: long overdue for a code name change 2014-06-30 15:42:16 -07:00
Michael Marineau
27e00285d5 updates: include updatectl in update tools zip 2014-06-30 15:40:42 -07:00
Michael Marineau
048ee51e6f build_image: when generating update payload don't generate metadata
This feature was removed from delta_generator.
2014-06-25 12:37:36 -07:00
Michael Marineau
51c78a4685 build_image: generate update tools zip by default
Missed this in 7231b95a, the update zip should still be built when the
usr partition is extracted for generating updates but build_image itself
is not generating and signing the update.
2014-06-24 14:01:09 -07:00
Michael Marineau
82e2461ddf build_image: refresh scripts bundled into the update zip. 2014-06-24 13:34:54 -07:00
Michael Marineau
7231b95af1 updates: extract usr partition when building images
The current generate_update function is now less useful, the important
part that we need is just the partition image now. Also by defaulting to
extracting the partition the old cors_generate_update which is still in
use by devserver can be removed entirely, devserver will just expect the
extracted partition image instead.
2014-06-23 12:26:17 -07:00
Michael Marineau
eb605751cd build_image: check that set_official wasn't forgotten in official builds 2014-06-20 18:45:20 -07:00
Alex Crawford
ef14f6449e configure_bootloaders: only add a single serial console boot arg
Only one console of each type (virtual, serial, etc.) is supported
in the boot args. Only add ttyS0 if no other serial consoles have
been provided.
2014-06-19 13:56:24 -07:00
Michael Marineau
919ba5a3b9 fix(disk_util): Install syslinux with extlinux
Attempting to work around an apparent race in mtools, the command
'extlinux' these days is just the install tool for mounted partitions
while 'syslinux' is for unmounted devices.
2014-06-18 14:20:29 -07:00
Michael Marineau
0b052bc756 Merge pull request #276 from marineam/conf
make.conf cleanup
2014-06-16 13:57:50 -07:00
Michael Marineau
9d2774af3b fix(build_image): Use developer_data as a system config.
Evaluating this as a user config causes it to block on
coreos-environment-setup.service which will wait on networking. This
makes it hard to add extra tricks for testing/debugging situations where
networking is failing. For example, to trigger dhcpcd if networkd dies:

    #cloud-config

    write_files:
      - path: /etc/systemd/system/systemd-networkd.service.d/dhcpcd.conf
        content: |
          [Unit]
          OnFailure=dhcpcd.service

          [Service]
          Restart=no
2014-06-15 15:41:53 -07:00
Michael Marineau
99ed29d218 fix(board_setup): Remove old make.conf symlinks
Just use the single auto-generated make.conf, it covers everything now.
2014-06-12 16:53:27 -07:00
Michael Marineau
0d29e73534 fix(*): Use binary package for baselayout
It is no longer necessary to use the build USE flag or avoid binary
packages when installing baselayout for the first time.
2014-06-10 14:45:56 -04:00
Michael Marineau
93b0ec304a fix(build_library): Remove reference to old SDK profile
The SDK's profile changed to coreos:coreos/amd64/sdk quite a long time
ago. Remove this last reference to it so the alias can be forgotten.
2014-06-10 14:45:56 -04:00
Michael Marineau
9a4ec472ce fix(build_library): Update amd64-usr's portage profile
The usr profile is just an alias to generic now so drop the old name.
2014-06-10 14:45:56 -04:00
Michael Marineau
5b476734a1 Merge pull request #267 from marineam/containers
fix(disk_util): don't run blkid on empty partitions
2014-06-09 11:38:06 -07:00
Michael Marineau
bb3d751e6f feat(build_image): Generate lists of image contents
Index contents by file and package.
2014-06-08 16:38:54 -04:00
Michael Marineau
388220cfad fix(build_image): move upload calls to build_library
This will let the image building code upload extra data without the
wrapper script having to know about it.
2014-06-08 16:37:48 -04:00
Michael Marineau
02bd7351dd fix(disk_util): don't run blkid on empty partitions 2014-06-06 16:12:37 -07:00
Michael Marineau
57ebeef297 fix(release_util): Generate correct download path for official releases
This fixes the vagrant metadata json files that we create.
2014-06-02 12:38:01 -07:00
Alex Crawford
17835eeb79 Merge pull request #263 from crawford/teeth
feat(teeth): Add new OEM and disk layout for teeth
2014-05-29 17:06:37 -07:00
Alex Crawford
d9afc85b0e feat(teeth): Add new OEM and disk layout for teeth 2014-05-29 16:46:27 -07:00
Alex Crawford
ed50f5fe0b feat(disk_util): Replace Resize() with Update()
The new Update() performs the same tasks as the old Resize()
in addition to formatting previously-unformatted partitions. This
allows children disk-layouts to repartition the base layout in
addition to resizing.
2014-05-29 16:46:27 -07:00
Michael Marineau
d408e3c1f5 fix(build_library): Finish conversion to new bucket layout.
I started to move board files under a boards/ directory similar to how
the SDK is under sdk/ but didn't do so everywhere. This should finish
the job so everything is consistent now.

Note: This prefix is only used in developer and buildbot uploads. When
final releases are copied to $channel.release.core-os.net it doesn't use
the prefix since a) I already published urls without the prefix and b)
no sdk files are ever posted to the public release locations.
2014-05-28 14:47:30 -07:00
Michael Marineau
d11815a68d fix(disk_layout): Bump up default ROOT volume sizes for btrfs.
btrfs isn't designed for small volumes and can run out of space sooner
than one would expect in our current setup, particularly with docker.
To try to improve the situation always create the filesystem initially
as 2GB instead of 512MB using the default settings: metadata is
duplicated, data is single, not mixed. The mixed setting may have been
partly why our performance can be so poor. For the default vm layout
use 6GB instead of 3GB, about what we use for EC2.
2014-05-23 18:22:02 -07:00
Michael Marineau
0ec871b203 fix(build_image_util): Reorder when set_lsb_release is called
dev_image_util needs to be able to append to update.conf so move
set_lsb_release to start_image instead of finish_image.
2014-05-22 22:41:54 -07:00
Michael Marineau
ff2d216142 fix(release_util): Add options to configure download path.
Since the new bucket scheme uploads images to a private staging area
first we need to configure the final location to generate vagrant json
metadata correctly.
2014-05-21 13:39:56 -07:00
Michael Marineau
2e9911b978 fix(*): Migrate image storage to new buckets
- Automated builds drop SDK and binary packages into
  gs://builds.developer.core-os.net/ and the new download URL is
  http://builds.developer.core-os.net/ (COREOS_DEV_BUILDS)
- Change default upload path to gs://users.developer.core-os.net/ for
  misc developer builds. Official builds go elsewhere and will just be
  configured in buildbot/jenkins so some COREOS_OFFICIAL stuff is gone.
- Automated builds of images go to a private bucket,
  gs://builds.release.core-os.net which later gets copied to
  gs://alpha.release.core-os.net and friends by core_promote.
2014-05-21 13:21:07 -07:00
Michael Marineau
7372f9f6e6 Merge pull request #254 from marineam/dev-config
Build-time dev cloud configs
2014-05-18 20:46:07 -07:00
Michael Marineau
822644fc54 feat(build_image): Add support for injecting a cloud config
The new --developer_data option can be used to specify a path to a cloud
config to bundle into the image. If none is provided but a shared user
password (for core) is set then generate a config to set that password.
This lets us use the same mechanism for setting the default password for
both disk and PXE images.
2014-05-17 16:23:18 -07:00
Michael Marineau
a93cb921d8 refactor(build_library): Add a function for enabling systemd units. 2014-05-17 16:23:16 -07:00
Michael Marineau
b24df04465 feat(build_image): Add 'container' image type.
This image type is the same as the developer image except that it is a
single root filesystem and is bootable via systemd-nspawn. This may
become obsolete eventually when it becomes possible to boot the normal
disk images under nspawn but it is useful for testing until then.

The partition type is defined by the Discoverable Partitions Spec.
http://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/
2014-05-16 21:11:01 -07:00
Michael Marineau
54f774d931 fix(build_library): Skip modifying non-existent partitions.
To make it possible to plop a CoreOS install into a simple
single-filesystem image for use as a container some things like
configuring bootloaders need to be skipped.
2014-05-16 20:52:21 -07:00
Michael Marineau
ee6b9ee1f9 fix(disk_util): Set btrfs default subvolume
This avoids needing to always pass the subvol=root mount option.
2014-05-16 19:09:23 -07:00
Michael Marineau
acb9800259 fix(disk_util): Don't try to format blank partitions. 2014-05-16 17:40:35 -07:00
Michael Marineau
68a8a67081 fix(update_chroot): Consolidate more portage configuration
To behave more like setup_board/build_packages update_chroot should
fully configure portage to make sure everything is accurate.

Now binhosts are defined in make.conf.host_setup so the static config in
coreos-overlays doesn't need to refer to version.txt. setup_board
already made this change in 7a43a07f.

Define path locations to reduce dependency between static configs in
coreos-overlays and the behavior of the scripts repo. Spreading
configuration across two repos makes everything harder to understand.
Eventually everything should either be defined in profiles in
coreos-overlays or minimal auto-generated config files here in scripts.
2014-05-14 19:15:30 -07:00
Michael Marineau
57992324ba Merge pull request #250 from marineam/refactor
Refactor image building
2014-05-13 17:38:52 -07:00
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