Commit Graph

58 Commits

Author SHA1 Message Date
Michael Marineau
9ed9ff7b45 build_image: generate C.UTF-8 locale 2016-09-30 15:24:32 -07:00
Michael Marineau
ed3c8637f6 build_image: dev images/containers no longer have pcr data
Broken by 1092afd which missed that dev images and containers were also
uploading pcr data despite it not really being applicable to those.
2016-09-21 21:18:15 -07:00
Michael Marineau
8eceddd54f Revert "*: drop obsolete gentoo repo reference" 2016-05-24 14:20:43 -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
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
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
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
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
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
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
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
19a4ae59d0 build_library: enable remount-usr later in the boot process. 2014-07-14 15:55:03 -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
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
a93cb921d8 refactor(build_library): Add a function for enabling systemd units. 2014-05-17 16:23:16 -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
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
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
add4519021 fix(build_image): Only use 'alpha' group in official builds. 2014-04-09 18:46:07 -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
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
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
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
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
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
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
d3a3a88768 fix(base_image_util.sh): Install glibc and gcc libs via emerge. 2013-12-01 16:04:10 -08:00
Michael Marineau
6adc3d1d35 fix(build_image): Always use read-write for developer images. 2013-09-19 21:40:01 -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
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
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
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
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
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
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
Anush Elangovan
c52c5fbb7c Add support for "skip_kernelblock_install"
CrOS could be used in devices that dont have custom firmware to
interpret the Kernelblock (Part2,4). In such devices skip trying
to make the kernelblock

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

Change-Id: I3e9a8dd765ea00db2ebf112553d96c08960e544f
Reviewed-on: https://gerrit.chromium.org/gerrit/40219
Commit-Queue: Anush Elangovan <anush@chromium.org>
Reviewed-by: Anush Elangovan <anush@chromium.org>
Tested-by: Anush Elangovan <anush@chromium.org>
2013-01-02 17:03:40 -08:00
Darren Krahn
a91800bcc9 Revert "build_image: filter out unused glibc files"
This removes files only used at link time, or when manually debugging,
or by glibc's charset routines (gconv) which are not used by Chromium.

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

Original-Change-Id: I68d848c2e307c98d53a8faa73924f57571f7887b
Change-Id: I25ffda36d28fd114715053c3a2590cc2248688bf
Reviewed-on: https://gerrit.chromium.org/gerrit/39214
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Darren Krahn <dkrahn@chromium.org>
Tested-by: Darren Krahn <dkrahn@chromium.org>
2012-12-04 17:03:43 -08:00
Mike Frysinger
5ea15f8a38 build_image: filter out unused glibc files
This removes files only used at link time, or when manually debugging,
or by glibc's charset routines (gconv) which are not used by Chromium.

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

Change-Id: I68d848c2e307c98d53a8faa73924f57571f7887b
Reviewed-on: https://gerrit.chromium.org/gerrit/37378
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-11-30 15:48:40 -08:00
Liam McLoughlin
5b37c5443a Simplify and add flexibility to image creation process
This change adds support for building the disk layout from a
configuration file. It also cleans up much of the image creation
code.

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

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

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

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

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

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

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

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

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

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

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

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

Change-Id: Iff6a143dbf8ce58878dc1b07629c52bbb7f02ded
Reviewed-on: https://gerrit.chromium.org/gerrit/32998
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Chris Sosa <sosa@chromium.org>
2012-09-18 11:10:29 -07:00