feat(coreos-bootkernel) add coreos-bootkernel ebuild

This is a separate kernel package, and configuration, for the "boot"
kernel.  It reuses the same eclass for kernel builds, but does two
things differently for boot kernels:
  - no boot/vmlinuz symlink
  - picks the boot version of the kernel configuration.
This commit is contained in:
Greg Kroah-Hartman 2013-06-12 17:27:46 -07:00
parent 6c2393fcc5
commit 9bd4fb24b0
5 changed files with 2832 additions and 2 deletions

File diff suppressed because it is too large Load Diff

View File

@ -85,6 +85,14 @@ get_build_cfg() {
echo "$(cros-workon_get_build_dir)/.config" echo "$(cros-workon_get_build_dir)/.config"
} }
get_boot_kernel() {
if [[ "${PN}" =~ boot ]] ; then
echo "true"
else
echo "false"
fi
}
get_build_arch() { get_build_arch() {
if [ "${ARCH}" = "arm" ] ; then if [ "${ARCH}" = "arm" ] ; then
case "${CHROMEOS_KERNEL_SPLITCONFIG}" in case "${CHROMEOS_KERNEL_SPLITCONFIG}" in
@ -232,6 +240,12 @@ cros-kernel2_src_configure() {
local config local config
local cfgarch="$(get_build_arch)" local cfgarch="$(get_build_arch)"
if [ "$(get_boot_kernel)" = "true" ] ; then
boot="_boot"
else
boot=""
fi
if [ -n "${CHROMEOS_KERNEL_CONFIG}" ]; then if [ -n "${CHROMEOS_KERNEL_CONFIG}" ]; then
config="${S}/${CHROMEOS_KERNEL_CONFIG}" config="${S}/${CHROMEOS_KERNEL_CONFIG}"
else else
@ -257,7 +271,7 @@ cros-kernel2_src_configure() {
chromeos/scripts/prepareconfig ${config} \ chromeos/scripts/prepareconfig ${config} \
"$(get_build_cfg)" || die "$(get_build_cfg)" || die
else else
config="$(defconfig_dir)/${cfgarch}_defconfig" config="$(defconfig_dir)/${cfgarch}_defconfig${boot}"
ewarn "Can't prepareconfig, falling back to default " \ ewarn "Can't prepareconfig, falling back to default " \
"${config}" "${config}"
cp "${config}" "$(get_build_cfg)" || die cp "${config}" "$(get_build_cfg)" || die
@ -442,8 +456,10 @@ cros-kernel2_src_install() {
ln -sf $(basename "${zimage_bin}") zImage || die ln -sf $(basename "${zimage_bin}") zImage || die
fi fi
if [ ! -e "${D}/boot/vmlinuz" ]; then if [ ! -e "${D}/boot/vmlinuz" ]; then
if [ "$(get_boot_kernel)" = "false" ]; then
ln -sf "vmlinuz-${version}" "${D}/boot/vmlinuz" || die ln -sf "vmlinuz-${version}" "${D}/boot/vmlinuz" || die
fi fi
fi
# Check the size of kernel image and issue warning when image size is near # Check the size of kernel image and issue warning when image size is near
# the limit. For factory install initramfs, we don't care about kernel # the limit. For factory install initramfs, we don't care about kernel

View File

@ -0,0 +1,3 @@
Go read the README in coreos-kernel for more information on how to setup the
git tree, this one is identical to that (for the kernel source), but it uses a
different kernel configuration.

View File

@ -0,0 +1,26 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-kernel/vanilla-sources/vanilla-sources-3.7.5.ebuild,v 1.1 2013/01/28 13:18:54 ago Exp $
EAPI=4
CROS_WORKON_COMMIT="da3093ad9f44ba53c3f254b4392f3c742dee41d3"
CROS_WORKON_TREE="0ff44b050e7f57e7d3743a44af2c9211da30bdb4"
CROS_WORKON_REPO="git://github.com"
CROS_WORKON_PROJECT="coreos/linux"
#inherit cros-workon cros-bootkernel
inherit cros-workon cros-kernel2
DEPEND="
sys-devel/bc
"
DESCRIPTION="CoreOS kernel"
HOMEPAGE="http://www.kernel.org"
SRC_URI="${KERNEL_URI}"
KEYWORDS="amd64 arm x86"
IUSE="deblob"
src_prepare() {
epatch "${FILESDIR}"/no_firmware.patch
}

View File

@ -0,0 +1,37 @@
From: Greg Kroah-Hartman <greg@kroah.com>
Subject: [PATCH] firmware: disable the firmware path entirely
We really don't want to build firmware images into the kernel package at
all, so rip out all references to the firmware directory that we can
fine.
diff --git a/Makefile b/Makefile
index 8818c95..0beba841 100644
--- a/Makefile
+++ b/Makefile
@@ -519,7 +519,7 @@ scripts: scripts_basic include/config/auto.conf include/config/tristate.conf \
# Objects we will link into vmlinux / subdirs we need to visit
init-y := init/
-drivers-y := drivers/ sound/ firmware/
+drivers-y := drivers/ sound/
net-y := net/
libs-y := lib/
core-y := usr/
@@ -944,7 +944,6 @@ modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
$(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
@$(kecho) ' Building modules, stage 2.';
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
- $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild
modules.builtin: $(vmlinux-dirs:%=%/modules.builtin)
$(Q)$(AWK) '!x[$$0]++' $^ > $(objtree)/modules.builtin
@@ -980,7 +979,6 @@ _modinst_:
# boot script depmod is the master version.
PHONY += _modinst_post
_modinst_post: _modinst_
- $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modinst
$(call cmd,depmod)
ifeq ($(CONFIG_MODULE_SIG), y)