Commit Graph

216 Commits

Author SHA1 Message Date
Krzesimir Nowak
cc60a22da8 common: Print debugging info along the backtrace
Recently we had some problems with read-only filesystems, that pop up
in different places. It may be easier to catch if the debugging info
is printed in an error case instead of just one specific location.
2023-11-29 13:15:13 +01:00
Krzesimir Nowak
ec723be9d9 *: Drop unused pkgdb stuff 2023-07-05 08:43:25 +02:00
Krzesimir Nowak
a99d99ed6e common.sh: Add a standard name for sysext base image 2023-07-05 08:40:15 +02:00
Krzesimir Nowak
46b98ba0d2 image_to_vm: Require pkgdb tarball and handle sysext building 2023-06-06 13:01:09 +02:00
Krzesimir Nowak
e1e9975f53
Merge pull request #608 from flatcar/krnowak/bincache-for-dev-builds
common: Split binpkg and SDK tarball URLs
2023-01-25 16:12:29 +01:00
Krzesimir Nowak
375ffa6579 common.sh: Drop the unnecessary hack
We have a user patch in coreos-overlay fixing this issue directly in
gcc-config.
2023-01-12 08:37:57 +01:00
Krzesimir Nowak
e7f02d2fec common: Split binpkg and SDK tarball URLs
Use FLATCAR_DEV_BUILDS only for setting up binpkg URLs, ceding the SDK
tarball URL role to the new FLATCAR_SDK_SERVERS variable. That way we
can still set up binpkg URLs the way we used to do so far and set up
SDK tarball URLs differently.

For two-phase SDK build, we would like to use intermediate SDK as a
seed. This SDK is only available on bincache, but previously only
nightly builds could use bincache as the source of SDK tarballs. Now,
with the URL split, we can set up the builds to use both bincache and
the release server, where release builds will prioritize release
server over bincache, and developer builds - bincache over release
server.
2023-01-11 08:34:20 +01:00
Krzesimir Nowak
97bf185815 common: Extend liblto link fixup function
We need to fix another symlink created by gcc-config, so extend the
function that was doing it for some other links and rename it - it's
not about only liblto any more.
2022-11-09 10:13:24 +01:00
Dongsu Park
a900d579c4 *: blacklist/whitelist to denylist/allowlist
Replace blacklist with denylist, and whitelist with allowlist.
Use proper vocabulary in all over the code.
2022-02-17 10:44:25 +01:00
flatcar-ci
7d76cfedf7 ci-automation + setup_board: publish and use binpkgs
This change adds a job for publishing binary packages to the build cache
server to the ci automation.

Also, setup_board is updated to use the buildcache package cache if a
nightly build version is detected.

Signed-off-by: flatcar-ci <infra+ci@flatcar-linux.org>
2022-01-07 17:16:44 +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
caa74dfaf8 common: Do not warn on listing the nonexistent files
The subshell was printing the error backtrace, but apparently it was
of no consequences. Just assume that listing may fail, so we don't get
any confusing backtraces.
2021-09-28 16:35:21 +02:00
Krzesimir Nowak
df63498a91 common: Replace the use of python2 with python3
We want to move to python3 eventually so update the script snippet. We
can be sure that python3 is installed, because portage already
requires it.
2021-08-18 18:56:35 +02:00
Krzesimir Nowak
a6a6e0be2c common: Make sure that NUM_JOBS is a positive integer 2021-02-18 08:25:21 +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
Kai Lüke
9952f2f84c
common: Support reading the package URL env vars from version.txt
The environment variables FLATCAR_DEV_BUILDS and FLATCAR_DEV_BUILDS_SDK
define where the base URL for the binary package store of the board
packages and the SDK packages. To set it, they were either exported in
the chroot or passed each time as parameter but this was only available
for the SDK packages in the tricky order
"update_chroot --dev_builds_sdk URL" (or --binhost) and then
"./build_packages --skip_chroot_upgrade".
The defining information for binary package URL comes from version.txt
but it lacks the base URL for a convenient use. Add the base URLs for
SDK and board packages there to be able to get binary packages without
manual tricks and errors. Any changes to
~/trunk/.repo/manifests/version.txt will directly be picked up
from ./build_packages and friends to set the correct URLs in
/etc/portage/make.conf and /build/BOARD/etc/portage/make.conf
so that even a manual "emerge(-BOARD) --usepkg --getbinpkg" uses them.
A helper script "./set_version" is provided to ease modifying
~/trunk/.repo/manifests/version.txt by resolving the latest nightly
version.
Later this functionality can also be used to simplify the Jenkins code
which currently sets these variables (but the special case of the
Release Base download being different from the upload holds).
2020-07-14 21:51:49 +02:00
Marga Manterola
e04156a0f1
bootstrap_sdk: build and upload SDK toolchain pkgs
Before, we were relying on the toolchains job to build and upload
packages that were part of the SDK. With this change, all packages that
should be part of the SDK are built and uploaded by the SDK job. The
toolchains job only builds toolchain packages specific for the release.

This change includes several adjustments done to both the SDK and the
toolchains jobs to make this work:
 * Make the SDK job build all cross toolchains, including Rust
 * Stop building Rust in the toolchains job and use the one in the SDK
   instead.
 * In toolchain_util.sh: detect when the symlink folder for crossdev
   packages is missing and run crossdev to create it during
   update_chroot setup.
 * Make it possible to build the SDK starting from stage 4 instead of
   stage 1, to make the SDK building faster for PR branches / nightlies
   (full build should still be done for releases / weeklies).
2020-06-29 15:18:55 +05:30
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
David Michael
2467923d56 Remove arm64 from supported board operations 2018-10-25 16:00:09 +00:00
David Michael
8e8d07f9a0 common.sh: Use amd64-usr as the default default board
We only support amd64-usr at this point, so this removes a required
step when setting up a new SDK.  If the default board is specified
normally or through the environment, it will override this value.
2018-10-25 14:11:42 +00:00
Andrew Jeddeloh
1718adb22a *: remove dev image
The dev image has been broken for some time. Some bits are left because
the dev container (not broken) still uses them. They should be renamed.
2018-07-25 13:11:17 -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
Andrew Jeddeloh
60d6b80053 common.sh: remove dead choose function 2018-05-30 13:07:58 -07:00
Benjamin Gilbert
97b09dc943 common: Drop functions to disable/enable ext[234] read-only hack
The last user of this code switched to disk_util in
b312044172.
2017-04-21 13:59:31 -07:00
Benjamin Gilbert
3e27bdcc45 common: Don't export COREOS_BUILD_ID
5a76e4e5e9 started exporting COREOS_BUILD_ID
whenever it was found in version.txt, even if its value was blank. Because
COREOS_BUILD_ID is in ENVIRONMENT_WHITELIST, this caused generated build IDs
to be propagated into the SDK chroot environment and reused for every build
in a "cork enter" session. Stop exporting COREOS_BUILD_ID when we set it
ourselves.

See also 8e754f9c2b.
2017-04-06 12:23:51 -07:00
Geoff Levand
5a76e4e5e9 load_environment_var: Pickup COREOS_BUILD_ID
Change the setting of COREOS_BUILD_ID so that its value, in order of
preference, is set to

  A value set in the environment.
  A value provided in manifest's version.txt.
  A fall back value of the current time-date.

Signed-off-by: Geoff Levand <geoff@infradead.org>
2017-03-20 15:36:03 -07:00
Geoff Levand
aa259bf685 load_environment_var: Strip double quotes
To allow double quoted values to be processed correctly.

Signed-off-by: Geoff Levand <geoff@infradead.org>
2017-03-20 15:36:03 -07: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
Michael Marineau
f6064d52e8 build_image: fix generation of version.txt
The generation of version.txt was the only thing depending on sourcing
the deprecated BUILD, BRANCH, and PATCH values from version.txt which
common.sh no longer does since 0b6acf86. Derive them instead.
2015-12-02 12:32:34 -08:00
Michael Marineau
14646f7900 common: set properly COREOS_SDK_VERSION
Broken in 0b6acf86 when we started selectively reading version.txt
2015-12-01 12:46:01 -08:00
Michael Marineau
0b6acf8605 common: add support for using COREOS_BUILD_ID from the environment
This allows build systems to export COREOS_BUILD_ID, making it practical
to map built images to the job that created them.
2015-11-30 09:29:24 -08:00
Michael Marineau
39a3a48a18 enter_chroot: add support for passing through GNUPGHOME
When running under jenkins the $GNUPGHOME may be located under the
current build directory instead of $HOME to avoid conflicting with other
jobs on the same build host.
2015-11-29 14:05:08 -08:00
Michael Marineau
6b1a7e7b3b common: don't get env list from chromite
This call to a python script is merely used to get a static list of
environment variables that happens to be defined in that repo.
2015-11-18 16:09:27 -08:00
Andrej Rosano
21925e99d4 common.sh: add arm64 chroot utility functions
By copying and removing the relevant qemu static executable the
functions enable and disable the chroot environment for arm64 rootfs.

Signed-off-by: Andrej Rosano <andrej@inversepath.com>
2015-09-16 12:41:12 +02:00
Michael Marineau
729f9da872 common: make sure /etc/mtab is correct before mounting anything
If mtab ever gets replaced by a regular file all sorts of things break.
2014-12-03 16:30:19 -08:00
Michael Marineau
81ce75300f cleanup: remove source location migration code
This code is not applicable to us, it predates CoreOS and is a weird
thing for common.sh to be doing as well. Instead always define
CHROOT_TRUNK_DIR to /mnt/host/source, create ~/trunk in make_chroot.
2014-09-14 15:32:10 -07:00
Michael Marineau
6df3bbbe2e sdk: assert host system is running Linux 3.7 or later
Currently building images on older kernels will fail because mkfs.btrfs
enables an incompatible feature 'extref' by default. We never really
made this requirement explicit and the SDK in general has continued to
maintain compatibility with older kernels. Make the requirement explicit
so users will get errors quicker and there is a clear line for what
kernel features can be used in the SDK.
2014-09-02 15:55:52 -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
47daca491c fix(sdk_lib): Remove depot_tools mount
We now include repo in the SDK which was the only thing from depot_tools
that we depended on.
2014-05-27 16:39:49 -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
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
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
10d98e7b32 fix(common): Switch to os-release style names in version.txt
The existing version.txt is kinda annoying. The common case of referring
to the current version requires joining three values and the names of
those values only make sense in ChromeOS. Instead just use version as a
string, using VERSION, VERSION_ID, and BUILD_ID just as they appear in
os-release. It is up to the few scripts that need the individual parts
to break the version apart.

The old values remain for the sake of compatibility.
2014-04-29 01:44:47 -04:00
Michael Marineau
10025571d9 fix(common): Disable parallel_emerge by default for most commands.
I would like to phase out parallel_emerge so disable it for all commands
other than build_image which is the only one that shows a noticeable
benefit from it (~2 min with --fast, ~3 min with --nofast).
2014-02-17 12:42:22 -08:00
Michael Marineau
e6739a22a8 fix(common): Fix dumb typo in bash alternate-value expansion
Missing a :
Perhaps I'm getting to clever with my shell for my own good.
2014-02-10 21:56:59 -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
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
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