Commit Graph

42 Commits

Author SHA1 Message Date
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
Mike Frysinger
c51e1f941d build_image: use pbzip2 on glibc debug info
Gives a minor speed up.

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

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

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

Change-Id: I93bd352ccac52d9d0179537d2eb520da6f684697
Reviewed-on: https://gerrit.chromium.org/gerrit/25270
Reviewed-by: Caroline Tice <cmtice@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-06-26 16:08:44 -07:00
Mike Frysinger
51409977a2 dev_image_util: make file work by default
File is compiled with a path to the default magic database, but since we
install it into /usr/local rather than the normal /usr, that default path
does not work.  Add a smaller wrapper script around `file` to specify the
new database location so people don't have to manually do so.

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

Change-Id: I3862cb368437a14bf1e4b6ccf4e2df3e4f774817
Reviewed-on: https://gerrit.chromium.org/gerrit/19137
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-03-28 09:29:12 -07:00
Chris Sosa
e9e2d66366 Remove --nofast --nostatefuldev from build_image as they are never used.
BUG=chromium-os:27362
TEST=Built a test image.

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

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

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

Change-Id: Ie534c276a9ec571926964320ac176daa91b12a81
Reviewed-on: https://gerrit.chromium.org/gerrit/17386
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Chris Sosa <sosa@chromium.org>
2012-03-09 12:41:50 -08:00
Mike Frysinger
84f66f5864 use helper info/die funcs rather than raw echo
We have helper funcs already for displaying messages, so convert
some raw `echo` calls to them.

BUG=None
TEST=build_image still works and boots

Change-Id: Ie66cc59d0362ef6aa19011fa6cb0bc64a6a4fce8
Reviewed-on: https://gerrit.chromium.org/gerrit/14478
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-01-24 21:57:30 -08:00
Chris Sosa
b0f5732449 Add ability to pass in specific images you want built rather than use flags.
This CL does two things.

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

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

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

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

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

Change-Id: I9fe2feb50a941c007214decd9ba1627012c050af
Reviewed-on: https://gerrit.chromium.org/gerrit/10621
Commit-Ready: Chris Sosa <sosa@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
2011-10-27 16:33:07 -07:00
J. Richard Barnette
a308b39eae Share commonality between build_image and mod_image_for_test.sh
BUG=None
TEST=run the commands in various combinations.

Change-Id: I94fb167d8312a90818910085adebfb1d0396cdbe
Reviewed-on: http://gerrit.chromium.org/gerrit/6866
Reviewed-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
2011-08-30 15:40:51 -07:00