Merge pull request #291 from marineam/firmware

Moar Firmware!
This commit is contained in:
Michael Marineau 2014-01-03 13:35:08 -08:00
commit af94b1d6e0
12 changed files with 140 additions and 3368 deletions

View File

@ -126,6 +126,8 @@ RDEPEND="${RDEPEND}
sys-apps/util-linux sys-apps/util-linux
sys-fs/e2fsprogs sys-fs/e2fsprogs
sys-fs/aufs-util sys-fs/aufs-util
sys-kernel/coreos-firmware
sys-kernel/coreos-kernel
sys-libs/timezone-data sys-libs/timezone-data
sys-process/lsof sys-process/lsof
sys-process/procps sys-process/procps

View File

@ -1,13 +1,13 @@
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved. # Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
[[ ${EAPI} != "4" ]] && die "Only EAPI=4 is supported" [[ ${EAPI} != "5" ]] && die "Only EAPI=5 is supported"
inherit cros-workon toolchain-funcs inherit cros-workon toolchain-funcs
HOMEPAGE="http://www.chromium.org/" HOMEPAGE="http://www.chromium.org/"
LICENSE="GPL-2" LICENSE="GPL-2"
SLOT="0" SLOT="0/${PVR}"
DEPEND="sys-apps/debianutils DEPEND="sys-apps/debianutils
sys-devel/bc sys-devel/bc
@ -195,7 +195,9 @@ cros-kernel2_src_compile() {
cros-kernel2_src_install() { cros-kernel2_src_install() {
dodir /boot dodir /boot
kmake INSTALL_PATH="${D}/boot" install kmake INSTALL_PATH="${D}/boot" install
kmake INSTALL_MOD_PATH="${D}" modules_install # Install firmware to a temporary (bogus) location.
# The linux-firmware package will be used instead.
kmake INSTALL_MOD_PATH="${D}" INSTALL_FW_PATH="${T}/fw" modules_install
local version=$(kernelversion) local version=$(kernelversion)
if [ ! -e "${D}/boot/vmlinuz" ]; then if [ ! -e "${D}/boot/vmlinuz" ]; then

View File

@ -455,9 +455,11 @@ cros-workon_src_unpack() {
cros-workon_get_build_dir() { cros-workon_get_build_dir() {
local dir local dir
# strip subslot, for EAPI=5
local slot="${SLOT%/*}"
if [[ ${CROS_WORKON_INCREMENTAL_BUILD} == "1" ]]; then if [[ ${CROS_WORKON_INCREMENTAL_BUILD} == "1" ]]; then
dir="${SYSROOT}/var/cache/portage/${CATEGORY}/${PN}" dir="${SYSROOT}/var/cache/portage/${CATEGORY}/${PN}"
[[ ${SLOT:-0} != "0" ]] && dir+=":${SLOT}" [[ ${slot:-0} != "0" ]] && dir+=":${slot}"
else else
dir="${WORKDIR}/build" dir="${WORKDIR}/build"
fi fi
@ -570,7 +572,9 @@ cros-workon_src_install() {
fi fi
if [[ -d "${LCOV_DIR}" ]] ; then if [[ -d "${LCOV_DIR}" ]] ; then
local dir="${PN}" local dir="${PN}"
[[ ${SLOT} != "0" ]] && dir+=":${SLOT}" # strip subslot, for EAPI=5
local slot="${SLOT%/*}"
[[ ${slot} != "0" ]] && dir+=":${slot}"
insinto "/usr/share/profiling/${dir}/lcov" insinto "/usr/share/profiling/${dir}/lcov"
doins -r "${LCOV_DIR}"/* doins -r "${LCOV_DIR}"/*
fi fi

View File

@ -0,0 +1 @@
coreos-firmware-99999999.ebuild

View File

@ -0,0 +1,124 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild,v 1.30 2013/09/05 05:46:37 vapier Exp $
EAPI=5
if [[ ${PV} == 99999999* ]]; then
inherit git-2
SRC_URI=""
EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git"
KEYWORDS=""
else
SRC_URI="mirror://gentoo/linux-firmware-${PV}.tar.xz"
KEYWORDS="amd64"
fi
DESCRIPTION="Linux firmware files"
HOMEPAGE="http://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git"
LICENSE="GPL-1 GPL-2 GPL-3 BSD freedist"
SLOT="0"
IUSE=""
DEPEND="sys-kernel/coreos-kernel:="
RDEPEND="${DEPEND}
!=sys-kernel/coreos-kernel-3.12.6
!<=sys-kernel/coreos-kernel-3.11.7-r5
!sys-kernel/linux-firmware
!sys-firmware/alsa-firmware[alsa_cards_ca0132]
!sys-firmware/alsa-firmware[alsa_cards_korg1212]
!sys-firmware/alsa-firmware[alsa_cards_maestro3]
!sys-firmware/alsa-firmware[alsa_cards_sb16]
!sys-firmware/alsa-firmware[alsa_cards_ymfpci]
!media-tv/cx18-firmware
!<sys-firmware/ivtv-firmware-20080701-r1
!media-tv/linuxtv-dvb-firmware[dvb_cards_cx231xx]
!media-tv/linuxtv-dvb-firmware[dvb_cards_cx23885]
!media-tv/linuxtv-dvb-firmware[dvb_cards_usb-dib0700]
!net-dialup/ueagle-atm
!net-dialup/ueagle4-atm
!net-wireless/ar9271-firmware
!net-wireless/i2400m-fw
!net-wireless/libertas-firmware
!sys-firmware/rt61-firmware
!net-wireless/rt73-firmware
!net-wireless/rt2860-firmware
!net-wireless/rt2870-firmware
!sys-block/qla-fc-firmware
!sys-firmware/amd-ucode
!sys-firmware/iwl1000-ucode
!sys-firmware/iwl2000-ucode
!sys-firmware/iwl2030-ucode
!sys-firmware/iwl3945-ucode
!sys-firmware/iwl4965-ucode
!sys-firmware/iwl5000-ucode
!sys-firmware/iwl5150-ucode
!sys-firmware/iwl6000-ucode
!sys-firmware/iwl6005-ucode
!sys-firmware/iwl6030-ucode
!sys-firmware/iwl6050-ucode
!x11-drivers/radeon-ucode
"
#add anything else that collides to this
# source name is linux-firmware, not coreos-firmware
S="${WORKDIR}/linux-firmware-${PV}"
src_unpack() {
if [[ ${PV} == 99999999* ]]; then
git-2_src_unpack
else
default
# rename directory from git snapshot tarball
mv linux-firmware-*/ linux-firmware-${PV} || die
fi
}
src_prepare() {
# FIXME(marineam): The linux-info eclass would normally be able to
# provide version info but since we don't install kernel source code the
# way it expects it doesn't work correctly. Will fix this eventually...
local kernel_pkg=$(best_version sys-kernel/coreos-kernel)
local kernel_ver="${kernel_pkg#sys-kernel/coreos-kernel-}"
kernel_ver="${kernel_ver%_*}"
kernel_ver="${kernel_ver%-*}"
local kernel_mods="${ROOT}/lib/modules/${kernel_ver}"
# the actually version may have a + or other extraversion suffix
local kernel_mods=$(ls -d1 "${kernel_mods}"* | tail -n1)
# If any firmware is missing warn but don't raise a fuss. Missing
# files either means linux-firmware probably out-of-date but since
# this is new and hacky I'm not going to worry too much just yet.
einfo "Scanning for files required by ${kernel_pkg}"
echo -n > "${T}/firmware-scan"
local kofile fwfile
for kofile in $(find "${kernel_mods}" -name '*.ko'); do
for fwfile in $(modinfo --field firmware "${kofile}"); do
if [[ ! -e "${fwfile}" ]]; then
ewarn "Missing firmware: ${fwfile} (${kofile##*/})"
elif [[ -L "${fwfile}" ]]; then
echo "${fwfile}" >> "${T}/firmware-scan"
realpath --relative-to=. "${fwfile}" >> "${T}/firmware-scan"
else
echo "${fwfile}" >> "${T}/firmware-scan"
fi
done
done
einfo "Pruning all unneeded firmware files..."
sort -u "${T}/firmware-scan" > "${T}/firmware"
find * -not -type d \
| sort "${T}/firmware" "${T}/firmware" - \
| uniq -u | xargs -r rm
assert
# Prune empty directories
find -type d -empty -delete || die
}
src_install() {
insinto /lib/firmware/
doins -r *
}

View File

@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2 # 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 $ # $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 EAPI=5
CROS_WORKON_COMMIT="0507eb5ef5a83ab746677b7f19d6e3a19906c995" CROS_WORKON_COMMIT="0507eb5ef5a83ab746677b7f19d6e3a19906c995"
CROS_WORKON_REPO="git://github.com" CROS_WORKON_REPO="git://github.com"
CROS_WORKON_PROJECT="coreos/linux" CROS_WORKON_PROJECT="coreos/linux"

View File

@ -1,22 +0,0 @@
# 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="0507eb5ef5a83ab746677b7f19d6e3a19906c995"
CROS_WORKON_REPO="git://github.com"
CROS_WORKON_PROJECT="coreos/linux"
CROS_WORKON_LOCALNAME="linux"
CROS_WORKON_OUTOFTREE_BUILD=0
inherit cros-workon cros-kernel2
DESCRIPTION="CoreOS kernel"
HOMEPAGE="http://www.kernel.org"
SRC_URI="${KERNEL_URI}"
KEYWORDS="amd64 x86"
IUSE=""
src_prepare() {
epatch "${FILESDIR}"/no_firmware.patch
}

View File

@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2 # 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 $ # $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 EAPI=5
CROS_WORKON_COMMIT="2e8b6ebe08210cda2967c63320fc0052de903efa" CROS_WORKON_COMMIT="2e8b6ebe08210cda2967c63320fc0052de903efa"
CROS_WORKON_REPO="git://github.com" CROS_WORKON_REPO="git://github.com"
CROS_WORKON_PROJECT="coreos/linux" CROS_WORKON_PROJECT="coreos/linux"

View File

@ -1,37 +0,0 @@
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)