Commit Graph

146 Commits

Author SHA1 Message Date
Krzesimir Nowak
a76292c7d5 *: Drop the use of deprecated PORTDIR and PORTDIR_OVERLAY env vars
These were mostly replaced by relevant config in repos.conf directory.
2023-02-20 17:10:26 +01:00
Krzesimir Nowak
fa48f70a37 *: Make catalyst and emerge verbose by default
That way we can see a report of what emerge is going to do and the
status of the use flags for the installed packages. The downside is
that we are going to have reports about using deprecated and
unsupported profile in even more places.
2023-02-16 13:57:05 +01:00
Krzesimir Nowak
520b92ad7e *: Expand short emerge flags and use bash arrays
Emerge flags are cryptic in general, but short flags even more so, so
expand them. While at it, I noticed some places where bash arrays
could be used, so convert those places too.
2023-02-16 13:57:05 +01:00
Krzesimir Nowak
409b47a932 *: Fix user-patches setup
Normally `ln -sf path/to/target at/name` will create a symlink at
`at/name` that points to `path/to/target`. But if `at/name` already
exists and is a directory or a symlink to some other directory, then
this command will create a symlink at `at/name/target` pointing to
`path/to/target`. There is an ambiguity between 1st and 3rd form of
`ln` (please refer to `man ln` for the available invocation forms). It
can be disambiguated by using the `-T` flag to force the 1st form.

In our case, if `/etc/portage/patches` symlink already existed and was
pointing to `<coreos-overlay>/coreos/user-patches`, we ended up with a
useless symlink at `<coreos-overlay>/coreos/user-patches/user-patches`
pointing to `<coreos-overlay>/coreos/user-patches`.
2023-01-31 12:00:22 +01:00
Krzesimir Nowak
f63ee98d00 *: Allow applying user patches
When setting up portage configuration, we set up a symlink in
${ROOT}/etc/portage/patches that points to the coreos/user-patches
directory inside the coreos-overlay. That way, we can add our custom
patches to coreos-overlay without the need for moving the packages
from portage-stable to coreos-overlay only to apply an extra patch.
2022-12-14 13:52:48 +01:00
Jeremi Piotrowski
7c87bb611f enable GENERATE_SLSA_PROVENANCE for board ROOT
This needs to be done in setup_board for ROOT=/build/$BOARD, but also in
toolchain_util because basic toolchains packages are built through
catalyst.
2022-07-27 12:59:49 +02:00
Jeremi Piotrowski
95c5d94837 setup_board: fix building binpkgs for toolchain dependencies
install_cross_libs installs TOOLCHAIN_PKGS deps into /usr/$BOARD_CHOST,
so that TOOLCHAIN_PKGS binpkgs can be built. We also need binpkgs for
the TOOLCHAIN_PKGS deps so that we can install them into /build/$BOARD
later together with TOOLCHAIN_PKGS. This is where the flow is currently
broken. Due to a change in semantics, --emptyroot tries to rebuild host
packages as well, and dropping it leaves --onlydeps which results in no
binpkgs being built because they are already installed.

We can solve resolve this by reusing the dependency list generated by
install_cross_libs, and explicitly building those binpkgs. It is worth
remarking that this flow of building the toolchain binpkgs through
setup_board is not in use in Flatcar, because we normally build
toolchains with catalyst. We are interested in reviving it because we
want to build everything with SLSA provenance information.
2022-07-27 12:59:49 +02:00
Thilo Fromm
b567344234 sdk-container: add scripts for containerised SDK
This change introduces a containerised SDK as a replacement for cork SDK
operations. It also simplifies versioning by removing the need for
manifest repos as well as usage of the "repo" tool by use of git
submodules for coreos-overlay and portage-stable.

The following feature scripts are added:
- run_sdk_container: Run a command in an SDK container, using the
        current scripts repo + ebuild submodules.
        current scripts repo + ebuild submodules.
- bootstrap_sdk_container / build_sdk_container_image: Bootstrap a new
        SDK and create an SDK container from the resulting SDK tarball.

The following additions have been made to SDK scripts:
- setup_board: add --pkgdir parameter to use a custom binary packge
  directory.

Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
2021-11-26 17:54:43 +01:00
Thilo Fromm
51aac23dc8 setup_board, update_chroot, dev container: use new bincache mirror
This updates the default settings in build scripts to use
https://mirror.release.flatcar-linux.net/
instead of the google storage bucket if no binhost or FLATCAR_DEV_BUILDS
is specified.

Defaults are updated for
* update_chroot (runs at SDK initialisation time)
* setup_board (creates /boards/[ARCH]/) chroots
* the development container
* set_version
2021-10-05 15:03:00 +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
fe07e45b65 setup_board: Copy repos.conf earlier
eselect calls "portage get_repo_path /build/amd64-usr coreos" at some
point. Before updating portage, portageq seemed to take all the
information not from /build/amd64-usr (which at the time contained no
repo information at all), but rather from /. The newer version of
portageq seems to respect the passed root now, so it actually tries to
consult the nonexistent repos configuration in /build/amd64-usr and
fails. To avoid the failure, perform the copying of the configuration
files earlier.
2021-01-25 16:12:31 +01:00
Flatcar Buildbot
c7bbb2b1e2 2345.0.0 2019-12-04 14:59:11 +01:00
Flatcar Buildbot
1dad511f69 2317.0.1 2019-11-07 19:40:01 +01:00
Andrew Jeddeloh
02ac9cb5b8 Revert "setup_board: add workaround for binutils issue"
This reverts commit 3d60305f24.
2019-08-24 00:48:45 +00:00
Andrew Jeddeloh
3d60305f24 setup_board: add workaround for binutils issue
Add a workaround to be sure we're using the correct binutils when SDK
sharing.
2019-08-23 21:52:30 +00:00
David Michael
2467923d56 Remove arm64 from supported board operations 2018-10-25 16:00:09 +00:00
David Michael
ce2e7e8a17 setup_board: Drop needless SYSROOT when installing binpkgs
For the less common case where binpkgs are not used, restructure
this so that it builds binpkgs in /usr/${CHOST} without installing
them, use those binpkgs to initialize /build/${BOARD}.
2018-08-29 21:40:21 +00: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
Benjamin Gilbert
1ef4609ef2 scripts: Drop unused BOARD_USE assignments 2017-06-16 19:22:51 -07:00
Matthew Garrett
9e64bef513 setup_board: create a glsa-check wrapper
We want to be able to verify that we don't have any vulnerabilities in the
build root, so install a wrapper for glsa-check
2016-05-17 16:39:40 -07:00
Michael Marineau
6c7c063474 setup_board: fix running build_image with an empty board root 2016-05-04 17:13:29 -07:00
Michael Marineau
da27e7e51b setup_board: remove bad pkg-config wrapper
See https://github.com/coreos/coreos-overlay/pull/1883

Builds should be usring /usr/bin/$CHOST-pkg-config instead.
2016-04-11 12:07:27 -07:00
Michael Marineau
61672f7f75 setup_board: always create tmp directories 2016-02-20 14:05:50 -08:00
Michael Marineau
a714804ca6 setup_board: check regen flags before calling update_chroot
Abort early if applicable, skip update_chroot if regen only is enabled.
2016-02-19 13:24:44 -08:00
Michael Marineau
7979650cde setup_board: move arm64 grub recompile to update_chroot 2016-02-19 13:21:16 -08:00
Michael Marineau
89e31f1e57 setup_board: add --regen_configs_only flag 2016-02-19 13:08:57 -08:00
Michael Marineau
3216a22078 Merge pull request #493 from glevand/for-merge-grub
setup_board: Build grub platform modules
2016-02-16 10:56:27 -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
5411bf574e setup_board: fix passing --usepkgonly state through to update_chroot 2016-02-04 11:42:07 -08:00
Michael Marineau
d327840ce8 *: add --usepkgonly flag to avoid building from source 2016-02-03 18:29:16 -08:00
Michael Marineau
5a42bd8565 setup_board: cleanup flags section
Move most flags into the usage message and use a more consistent style.
2016-02-03 17:22:15 -08:00
Geoff Levand
d82ef18ed0 setup_board: Build grub platform modules
Run the emerge of the SDK sys-boot/grub again to pick up any config
changes that were made in setup_board.  This late emerge is needed
to build grub modules for architectures that are different from the
host.

Signed-off-by: Geoff Levand <geoff@infradead.org>
2016-01-20 09:49:15 -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
Geoff Levand
63679ebbe1 setup_board: Set grub use flags to build arm64
Set the host grub use flags to build arm64 grub support when BOARD is
equal to arm64-usr.

From: Andrej Rosano <andrej@inversepath.com>
[Move to case statement]
Signed-off-by: Geoff Levand <geoff@infradead.org>
2015-11-19 15:08:00 -08:00
Michael Marineau
d30fa4054a setup_board: remove old kernel vars
These are properly detected now.
2015-08-04 18:06:03 -07:00
Michael Marineau
2eec99130b setup_board: simplify PORTAGE_USERNAME handling 2015-07-05 18:01:50 -07:00
Michael Marineau
174a847e36 update_chroot: remove dependence on /usr/local/portage/* symlinks
A step in reducing the amount of initialization code required: drop
needless symlinks under /usr/local/portage to the portage trees. Just
configure portage to point directly at the source instead. Only crossdev
remains in that location because it is a locally managed overlay.
2015-07-05 16:57:05 -07:00
Michael Marineau
d1ec00c932 setup_board: explicitly perform all package moves
For some reason package moves are not handled automatically in the board
build roots. Add explicit calls to emaint to update cached binary
packages, installed packages, and the world file.
2015-04-17 13:40:20 -07:00
Geoff Levand
de00a676a8 setup_board: Remove unused option
setup_board's --latest_toolchain option seems to be a left over from a
removed feature.  It's not used, so remove it.

Signed-off-by: Geoff Levand <geoff@infradead.org>
2015-04-09 09:42:26 -07:00
Geoff Levand
46f5478991 setup_board: Fix hard coded symbol path
commit 03e8d451bf (setup_board: setup
gdb wrapper and debug symbol path) added hard coded paths for the
symbol path.  Change those to use the BOARD_ROOT variable.

Signed-off-by: Geoff Levand <geoff@infradead.org>
2015-04-01 10:58:57 -07:00
Michael Marineau
690da86333 setup_board: export paths to kernel source and build directories
The linux-info eclass may trigger a fatal error if it is unable to check
a package's required kernel options. Even when the error isn't fatal the
warnings add a lot of clutter to our build output.
2014-12-15 17:08:45 -08:00
Michael Marineau
03e8d451bf setup_board: setup gdb wrapper and debug symbol path 2014-08-15 16:36:35 -07:00
Michael Marineau
e19de29cda setup_board: fix fetching binary toolchain packages
Fix 98684560 which in turn tried to fix 0d29e735. This time the option
to download binary packages was lost so building from scratch worked but
not the normal usage of using binary packages. *sigh*
2014-07-22 14:11:18 -07:00
Michael Marineau
986845608a setup_board: fix compiling toolchains from scratch
Commit 0d29e735 broke this by not properly initializing the toolchain
ebuild flags when binary packages were disabled.
2014-07-20 21:32:53 -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
3d8948d91f setup_board: copy portage's repos.conf files from the chroot 2014-07-19 16:10:34 -07:00
Michael Marineau
dea299312e setup_board: remove extra pkg-config wrapper script
crossdev provides cross-pkg-config which respects $SYSROOT so we do not
need to do anything extra ourselves.
2014-07-19 11:37:03 -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
bb3b7d4fcd fix(setup_board): Got lost in my own if statements :( 2014-06-10 16:00:32 -07:00