Commit Graph

85 Commits

Author SHA1 Message Date
Thilo Fromm
15778e54e9
build_packages: fix default torcx output root
In 9fba5789f9 we introduced 
--torcx_output_root as an optional command line parameter
and had it default to "${DEFAULT_BUILD_ROOT}", inadvertently 
diverging from the previous default, which was
"${DEFAULT_BUILD_ROOT}/torcx".

This change sets the correct default root "${DEFAULT_BUILD_ROOT}/torcx" to bring
build_packages back into alignment with build_image.
2022-01-05 13:28:49 +01:00
Thilo Fromm
9fba5789f9 ci-automation: simplified CI automation unsing containers
ci-automation builds on the SDK container and simplifies CI automation
build tasks (SDK bootstrap, SDK container, packages, image, VMs).

See ci-automation/README.md for a brief introduction.

Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
2021-11-26 17:54:43 +01:00
Krzesimir Nowak
8e8cedcbf7 build_packages: Add another cycle to break
With the update of the sys-apps/util-linux package, another cycle has
reared its ugly head. Looks like the package got an optional
dependency on sys-fs/cryptsetup, so break it.
2021-10-12 14:39:07 +02:00
Krzesimir Nowak
cea18c41c3 *: Use the internal copy of cros_workon
The scripts that invoked `cros_workon` without specifying a path to
the script were not calling the internal `cros_workon` directly, but
rather a copy installed in `/usr/bin/cros_workon`.
`/usr/bin/cros_workon` comes from the `coreos-base/cros-devutil` and
is a wrapper script that sources `common.sh` file to figure the
location of the `scripts` and finally invokes the internal
`cros_workon`. Curious thing is that the sourced `common.sh` comes
from the `/usr/lib/crosutils` directory and contents of the directory
come from the `dev-util/crosutils` package. And that `common.sh` is
different from the one in the scripts directory, but fortunately the
part that detects the path to the `scripts` directory is the same. I'm
not sure where where exactly the copy of `common.sh` in
`/usr/lib/crosutils` comes from - likely from somewhere in
`https://chromium.googlesource.com/chromiumos/platform/crosutils`.

Just cut the middle layers and call the internal copy of `cros_workon`
directly.
2021-08-19 12:58:42 +02:00
Krzesimir Nowak
6ed7cd66d5 *: Drop jobs parameter
The `--jobs` parameter that some scripts defined was not used anywhere
in jenkins or mantle. So the value of the parameter always ended up
being equal to `${NUM_JOBS}` set by `common.sh`. Also, even if the
`--jobs` parameter was used for some script, that script usually
didn't forward the jobs value to other scripts, so the other scripts
ended up using `${NUM_JOBS}` again. Also, the `${FLAGS_jobs}` variable
was used by some functions in the build library, and those functions
were sometimes invoked by scripts that didn't define the
`${FLAGS_jobs}` variable. It is tedious to track which script should
actually define the parameter, and where it should be forwarded.

Just get rid of this half-working pretense. If you want to affect how
many jobs `emerge` uses, export the `NUM_JOBS` environment variable
before calling any script.

For `EMERGE_FLAGS` and `REBUILD_FLAGS` we unconditionally specify the
`--jobs` flag's value to `${NUM_JOBS}` because they are passed to
`emerge`. On the other hand we drop the `--jobs` parameter from the
`UPDATE_ARGS` variable, because this variable passed to `setup_board`
or `update_chroot`, which don't have this flag any more.
2021-02-17 13:26:36 +01:00
Krzesimir Nowak
7f2a437f0a build_packages: Build all packages in the broken cycle
Previously we broke the cycle caused by sys-apps/util-linux only,
while disabling cryptsetup USE flag in systemd to avoid another
cycle. That worked before, because the follow-up merge of the rest of
packages built sys-fs/cryptsetup before sys-apps/systemd. After an
update, the new portage is ordering the builds in different way and
sys-apps/systemd ended up being built before sys-fs/cryptsetup and
that failed during the configure phase because of unmet dependencies.

Better build all the packages taking part in the loop (not counting
the virtual packages), so we become less reliant on the package build
ordering. It is going to take slightly more time as we build a couple
of packages more.
2021-02-09 07:44:22 +01:00
Krzesimir Nowak
d575ef441a build_packages: Build multiple packages in one go when breaking loops
Instead of rebuilding just one package and maybe rebuilding others as
a fallout, force rebuilding all the mentioned packages. This makes the
build process a bit more robust against package build ordering
changes.

May be useful when breaking multiple dep loops that have some common
packages, so we build them all once.
2021-02-09 07:44:22 +01:00
Thilo Fromm
22b08b0ae4 build_packages, build_image_util.sh: fix up liblto symlink
Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
2020-11-16 19:06:59 +01:00
Vincent Batts
f104a53aeb
build_packages: export build host information
Signed-off-by: Vincent Batts <vbatts@kinvolk.io>
2020-08-28 13:51:22 -04:00
Kai Lüke
066deb9d09
build_packages: Add flag to ignore some binary packages
When the ebuild file changed but not its version nor its cross-workon
commit, the binary package would be used. Also some dependencies are not
encoded to trigger a rebuild of depending packages.
Allow to exclude some binary packages so that we can be sure that they
are rebuilt.
2020-05-11 16:26:35 +02:00
Marga Manterola
0eea902ddf Fix typo 2020-05-11 12:28:50 +02:00
Andrew Jeddeloh
a27b02bcb6 *: use cros_workon not cros_list_modified_pkgs
This removes a dependency on chromite
2018-05-30 13:07:58 -07:00
Andrew Jeddeloh
935466b68d *: remove restart_in_chroot_if_needed
Replace calls to restart_in_chroot_if_needed with assert_inside_chroot.
This removes a dependency on chromite.
2018-05-30 13:07:58 -07:00
David Michael
f91198ca0e build_packages: also build all torcx images by default
The idea is that once the installed board packages have changed,
the sysroot that was used to build any existing torcx packages may
no longer be compatible.  It will therefore run build_torcx_store,
passing relevant options to it, to build a new torcx store of
images with the current sysroot.

This adds --skip_torcx_store to use the previous behavior.
2017-06-02 14:22:53 -07:00
Michael Marineau
aed5e0d526 build_packages: fix @preserved-rebuild
When the --usepkgonly flag was added in d327840ce this step got wrapped
in an inverted test. It should normally be enabled.
2016-07-13 22:55:19 -07:00
Michael Marineau
9ab853a668 build_image: remove eclean, run in build_packages instead
Allows the binary package cache to be preserved when using build_image
without a fully populated board root.
2016-02-20 14:11:41 -08:00
Michael Marineau
9b00ea5495 *: disable reinstalling rebuilt binaries with --usepkgonly
When --usepkgonly is mixed with the right update flags it will
re-install any binary packages that have a newer build. Since the full
set of SDK and board packages are rebuilt quite often this leads to
excessive reinstalling.
2016-02-04 11:50:36 -08:00
Michael Marineau
d327840ce8 *: add --usepkgonly flag to avoid building from source 2016-02-03 18:29:16 -08:00
Michael Marineau
81ee5389c0 build_packages: accept package names as an argument 2016-02-03 18:29:16 -08:00
Michael Marineau
a42ffcddbb build_packages: include all flags in usage message 2016-02-03 17:37:38 -08:00
Michael Marineau
bf104d415e build_packages: remove old --reuse_pkgs_from_local_boards flag
Removed from setup_board in ancient times e6b3c608.
2016-02-03 17:30:10 -08:00
Michael Marineau
10a7864ff0 build_packages: flip weird inverted boolean flag
Use `--workon` and `--noworkon` instead of `--nonoworkon` and `--noworkon`
2016-02-03 17:26:24 -08:00
Michael Marineau
602412fd2a build_packages: remove unused --accept_licenses
This flag was dropped from setup_board way back in commit 7d6619df8.
2016-02-03 17:23:20 -08:00
Geoff Levand
57c129acfd setup_board: Call setup_qemu_static
setup_qemu_static only needs to be called once, and can
be done early so that it is available.  Move the call
of setup_qemu_static from build_packages to setup_board.

Signed-off-by: Geoff Levand <geoff@infradead.org>
2015-11-19 15:08:00 -08:00
Andrej Rosano
acea447ccd build_packages: Fix ramdisk creation for non-native arches
Chrooting in the target non-native arch rootfs is required
for update-bootengine to be run correctly.

Signed-off-by: Andrej Rosano <andrej@inversepath.com>
2015-09-16 12:41:23 +02:00
Michael Marineau
f5970d877c build_packages: reduce the noise that --depclean generates 2015-08-04 14:46:09 -07:00
Michael Marineau
e881b270db update_chroot/build_packages: remove obsolete packages
Before attempting to do @preserved-rebuild to fix linked against old
libraries remove any packages that no longer have corresponding ebuilds,
making them impossible to rebuild. This uses `--depclean`'s secondary
meaning: `--unmerge` but only remove packages without dependencies.
2015-07-24 14:38:09 -07:00
Michael Marineau
9d4d888429 update_chroot/build_packages: trigger @preserved-rebuild
Rebuilds packages that are linked against old libraries that have been
upgraded or removed from the system. Skipping this can lead to shared
library checks looking ok in the build root but then built images have
broken library dependencies.
2015-07-12 15:48:21 -07:00
Michael Marineau
28c3c3def3 build_packages: be less aggressive about rebuilding packages
The --rebuild-if-unbuilt emerge option will recompile packages if any
build-time dependencies changed. This can be a useful safety to make
sure applications get re-linked and so forth. However recent versions of
portage have grown better defaults for choosing when to rebuild so lets
turn the build_packages flag around and leave emerge to do its default
behavior and see if that is sufficiently safe.
2015-07-08 13:45:18 -07:00
Michael Marineau
9db6ac5ef7 build_image: make building selinux policy optional 2015-07-01 23:11:09 -07:00
Michael Marineau
22e3c116cc build_packages: always rebuild when breaking dependency cycles
Previously we attempted to speed up the first build of a board by
pulling in binary packages regardless of their use flags, assuming that
if the package was already built the loop would not be an issue. Usually
this was true but not always. Now things like util-linux will always get
compiled when setting up a board for the first time but at least it
won't be as likely to fail.
2015-06-25 14:15:35 -07:00
Geoff Levand
dcc9a2b97d build_packages: Update help for CoreOS
Signed-off-by: Geoff Levand <geoff@infradead.org>
2015-04-09 09:42:26 -07:00
Michael Marineau
03411ad4d8 build_packages: add support breaking loops with multiple use flags
Sorry, this is just getting bad. We need to switch to initializing the
board root stage3 style, similar to how the SDK or most any
semi-complicated Gentoo install starts. Breaking loops while merging
into a clean root is just too complicated.

On what this does: util-linux now has a udev *and* a systemd use flag.
Since we use systemd they both are effectively the same and pull in the
systemd package. This adds support for disabling both flags during the
loop breaking procedure.
2015-03-18 11:59:25 -07:00
Michael Marineau
a518dc8df1 build_package: fix loop between two loop breaking steps
If util-linux has a binary package it will be used, but if that binary
package has +udev it will pull in systemd. systemd has a loop that needs
to be broken too so if the util-linux loop breaker doesn't also handle
the systemd one it all falls apart.

In short the comment above the loop breaker code noting that we can try
this until it gets wonky. Well, it is wonky and we need to re-do how
build_packages works as a result. This is just a temporary workaround
until we figure out a larger restructuring.
2014-07-22 14:49:52 -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
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
097196a6af build_packages: break dependency loop between util-linux and systemd.
This is required to enable the udev use flag.
2014-07-19 15:07:00 -07:00
Michael Marineau
55896af9c1 build_packages: break dependency loop when cryptsetup is enabled 2014-07-01 16:59:54 -07:00
Michael Marineau
691c588c75 fix(build_packages): Simplify emerge command, use board-packages ebuild.
The extra "dependency check" doesn't appear to be all that useful, so
don't waste time on it. Remove some unused command line options for
selecting which packages to build. Use new board-packages ebuild which
currently just includes 'coreos' and 'coreos-dev' but later can include
extra things like 'python-oem' which doesn't land in the base image.
2014-03-27 22:37:28 -07: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
6452857e82 fix(*): Change default for --jobs to $NUM_JOBS
This makes parallelism behavior between parallel_emerge and emerge
consistent. NUM_JOBS is defined as the number of CPUs by common.sh
2013-12-01 16:04:10 -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
37267cfce4 fix(setup_board): Install board build root toolchains via emerge! 2013-11-29 18:19:15 -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
078ec6cf0d fix(build_packages): Don't redirect emerge output.
The stats upload has been removed so there is no longer a need to
capture the emerge output to parse the logged output. Remove a bit of
dead chromeos logic too.
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
8ee5f00137 fix(common.sh): Stop collecting stats and uploading them to Google.
Just... no.. in so many ways. Kinda dumb it took me this long to delete
this little chunk of rather annoying code.
2013-10-23 11:39:08 -07:00
Michael Marineau
207cc2f6a3 cleanup(*): Remove unused/broken test and factory images 2013-09-19 19:04:54 -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
Michael Marineau
4bcee421ad fix(build_packages): Fix check for .boto, argument name was wrong. 2013-07-05 17:49:38 -04:00