Copy of upstream 2.7.5-r4 + cross compile tweaks/fixes from our -r2
Dropped some sed hackery related to ChromiumOS's /usr/local weirdness.
I am hoping that issue18851.patch fixes some intermittent build issues.
Although it'd be nice to re-use packages for experimental boards that
may only have a few differences from amd64-generic there is a bug in
some ebuilds and portage that break sharing binary packages between
different values of $ROOT. This prevents that from happening by
accident.
https://bugs.gentoo.org/show_bug.cgi?id=490014
This profile enables the symlink-usr USE flag and target profiles have a
new variable COREOS_DISK_LAYOUT_SUFFIX that allows the profile to switch
to a different set of disk layouts. By default no suffix is used but the
usr profile uses layouts with the suffix "-usr" such as "base-usr".
This provides firmware from linux-firmware but excludes everything not
explicitly required by coreos-kernel. Note that firmware installed by
this will only be available on the root filesystem, the initrd still
uses the smaller set of firmware the linux repo provides.
The current 3.12 kernel wants a few files missing in the July snapshot:
* Missing firmware: ct2fw-3.2.1.1.bin (bna.ko)
* Missing firmware: ctfw-3.2.1.1.bin (bna.ko)
* Missing firmware: cxgb4/t5fw.bin (cxgb4.ko)
These files have been added to the linux-firmware repo so a newer
snapshot will be required but for now I'm sticking with what is already
in Gentoo so I don't have to generate my own tarball or whatever.
In preparation for moving to using firmware provided by the
linux-firmware repository instead of linux the kernel ebuild needs to
stop installing the files to avoid conflicts. Also to better ensure that
the firmware package gets rebuilt every time the kernel does bump to
EAPI=5 and set the subslot to the ebuild version/revision. The firmware
package can then depend on the kernel w/ a special slot operator to make
sure it gets rebuilt when the kernel version changes. The firmware
package can then scan the installed modules and only install the
firmware that is required.
(Portage automatic rebuild behavior often makes this sort of rebuild
happen anyway but using subslots makes it a strict requirement.)
This appears to be part of a scheme to set an alternative login password
in ChromeOS that we have not been using. Our solution will be to make
/etc read-write so this can just go away.
Existing behavior remains unchanged if symlink-usr is unset, otherwise
leave terminfo alone (if minimal is also unset) or prune terminfo down
to the set that would have been installed to /etc if minimal is set.
On CoreOS we use systemd to manage docker containers. Having docker
automatically start containers on reboot makes everything confused. Stop
doing this.
This makes double sure that the symlink is never removed by INSTALL_MASK
or PKG_INSTALL_MASK. This symlink is so strictly required by random
tools we cannot allow it to ever go missing by mistake.
A case of binary packages masking breakage, didn't notice this broke
because I didn't happen to trigger a build of gmerge during my testing.
This package.provided file contained the hackily installed toolchain
which is now handled via a normal emerge instead.
The INSTALL_MASK is altered all over the place, clean it up by moving
all of it to profiles. Add /usr/share/{i18n,locales} to exclude those
installed by glibc since it doesn't have a nls use flag to disable them.
Change the install location based on symlink-usr instead of the target
and use absolute symlinks. We need to move towards never installing to
/{bin,sbin,lib...} and the use of absolute links avoids needlessly
breaking if the symlink-usr flag and the current state of /bin don't
agree (i.e. between flipping the flag and migrating the current files).
As much as I like not seeing the i8042 error in the kernel log on
platforms without it I foresee someone being really ticked off with me
for making this a module when dracut fails without loading the PS/2 and
keyboard modules making the rescue shell kinda hard to use unless a
serial console is also available.
Yeah, well, fair enough future me. You win.
The kernel is much more particular about how it handles the cpio format
than GNU's cpio tool. Two things:
- Don't use the -depth option to find, cpio documentation recommends
using it (the directory comes after the contents so set the
permissions on the dir last in case it is overly restrictive) but the
kernel thinks the other direction and doesn't put things into a
directory that does not (yet) exist.
- Don't add anything under /lib which is a symlink in the original
file. Adding /lib as a directory later replaces the earlier /lib
symlink. Again the user space tool thinks in the other direction and
will happily dereference the symlink while extracting, preserving it.
CPIO CPIO CPIO!
Lots of changes here, some things of note:
- Switch from built-in to modules for much of the kernel.
- Enable more features, mostly in power management and networking.
- Remove no_firmware.patch, this was added back when we had two
different kernels which would conflict if both installed firmware.
- Stop disabling OUTOFTREE_BUILD now that we don't patch the source.
So far this is just compile tested so it is marked ~amd64 for now.
STRIP_MASK wasn't updated to the new vmlinux location earlier.
RESTRICT=binchecks disables checks that only make sense for user space
binaries. This silences a bogus scanelf error.
If OUTOFTREE_BUILD=1 (currently disabled but that will change) the
kernel will use the existing checkout as the source tree rather than
cloning another tree. If someone built anything in that tree and .config
exists the build will fail complaining that the source isn't clean.
Instead of failing just disable OUTOFTREE and emit a warning.
OUTOFTREE combined with INCREMENTAL makes successive kernel builds
pretty much no-ops (just re-linking modules and bzImage).
Build only bzImage instead of the default 'all' which also will re-link
all of the modules which is pointless and just causes the initramfs and
rootfs to become out of sync.
Since we need to both bundle modules into the initramfs as well as
bundle the initramfs into the kernel image we need to update a pre-built
image with the user space tools as part of the kernel build process.
This seemed the best scheme, the alternatives were:
- Unpack bootengine.cpio to a temporary directory, build and install
kernel modules into that temporary directory, pass that directory
plus a config file listing what device nodes to the kernel build.
- Build kernel modules and generate a fresh bootengine.cpio using the
update-bootengine tool. This would require calling sudo (and breaking
out of the sandbox in the process) in the middle of the ebuild.
The use flag kernel_sources conflicts with the special meaning of the
use flag prefix kernel_ which is reserved for defining the host kernel,
for example kernel_linux. Also a couple other ebuilds in Gentoo have a
source use flag so let's just follow that pattern instead.
We do not currently support or care about things like arm, device trees,
smatch, and other things that massively complicate this eclass. Remove
them so making further changes is simple. Features can always be added
back later.
This makes it possible to have multiple kernel ebuilds in the tree at
once since the defconfig can be versioned along side the ebuilds instead
of being global.
Not sure how this managed to work in the past, perhaps the test for
using Google's common.mk used to always fail but now works properly?
In any case, we don't use clang any more.
Move all obviously safe features into the coreos profiles to further
reduce the magic in make.conf, leave the more fast-and-loose options in
make.conf to keep them kinda "special".