cleanup tree
This commit is contained in:
@@ -1,102 +0,0 @@
|
||||
# Copyright 2004-2011 Sabayon
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $
|
||||
|
||||
SUPPORTED_AVAHI_MODULES="base gtk gtk3 mono qt"
|
||||
|
||||
# @ECLASS-VARIABLE: AVAHI_MODULE
|
||||
# @DESCRIPTION:
|
||||
# Set this variable to the avahi module ebuild name, by default it's used
|
||||
# the second part of PN, for example: for avahi-glib, it is "glib".
|
||||
# Supported avahi modules:
|
||||
# base gtk gtk3 mono qt
|
||||
AVAHI_MODULE="${AVAHI_MODULE:-${PN/avahi-}}"
|
||||
|
||||
# @ECLASS-VARIABLE: AVAHI_PATCHES
|
||||
# @DEFAULT-UNSET
|
||||
# @DESCRIPTION:
|
||||
# List of patches to apply
|
||||
if [ -z "${AVAHI_PATCHES}" ]; then
|
||||
AVAHI_PATCHES=()
|
||||
fi
|
||||
|
||||
# @ECLASS-VARIABLE: AVAHI_MODULE_DEPEND
|
||||
# @DESCRIPTION:
|
||||
# Avahi module built time dependencies list
|
||||
AVAHI_MODULE_DEPEND="${AVAHI_MODULE_DEPEND:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: AVAHI_MODULE_RDEPEND
|
||||
# @DESCRIPTION:
|
||||
# Avahi module run time dependencies list
|
||||
AVAHI_MODULE_RDEPEND="${AVAHI_MODULE_RDEPEND:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: AVAHI_MODULE_PDEPEND
|
||||
# @DESCRIPTION:
|
||||
# Avahi module post dependencies list
|
||||
AVAHI_MODULE_PDEPEND="${AVAHI_MODULE_PDEPEND:-}"
|
||||
|
||||
_supported="0"
|
||||
for mod in ${SUPPORTED_AVAHI_MODULES} ; do
|
||||
if [ "${mod}" = "${AVAHI_MODULE}" ]; then
|
||||
_supported="1"
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ "${_supported}" = "0" ]; then
|
||||
die "Unsupported avahi module: ${AVAHI_MODULE}"
|
||||
fi
|
||||
|
||||
MY_P=${P/-${AVAHI_MODULE}}
|
||||
|
||||
inherit autotools eutils flag-o-matic
|
||||
|
||||
DESCRIPTION="avahi ${AVAHI_MODULE} module"
|
||||
HOMEPAGE="http://avahi.org/"
|
||||
SRC_URI="http://avahi.org/download/${MY_P}.tar.gz"
|
||||
S="${WORKDIR}/${MY_P}"
|
||||
|
||||
LICENSE="LGPL-2.1"
|
||||
SLOT="0"
|
||||
KEYWORDS="~arm ~amd64 ~x86"
|
||||
|
||||
AVAHI_COMMON_DEPEND=">=dev-util/intltool-0.40.5
|
||||
>=dev-util/pkgconfig-0.9.0"
|
||||
DEPEND="${AVAHI_MODULE_DEPEND} ${AVAHI_COMMON_DEPEND}"
|
||||
RDEPEND="${AVAHI_MODULE_RDEPEND}"
|
||||
PDEPEND="${AVAHI_MODULE_PDEPEND}"
|
||||
|
||||
avahi_src_prepare() {
|
||||
sed -i\
|
||||
-e "s:\\.\\./\\.\\./\\.\\./doc/avahi-docs/html/:../../../doc/${PF}/html/:" \
|
||||
doxygen_to_devhelp.xsl || die
|
||||
|
||||
for i in ${!AVAHI_PATCHES[@]}; do
|
||||
epatch "${AVAHI_PATCHES[i]}"
|
||||
done
|
||||
|
||||
eautoreconf
|
||||
}
|
||||
|
||||
avahi_src_configure() {
|
||||
use sh && replace-flags -O? -O0
|
||||
# We need to unset DISPLAY, else the configure script might have problems detecting the pygtk module
|
||||
unset DISPLAY
|
||||
local myconf="
|
||||
--disable-static
|
||||
--localstatedir=/var
|
||||
--with-distro=gentoo
|
||||
--disable-xmltoman
|
||||
--disable-monodoc
|
||||
--enable-glib
|
||||
--enable-gobject
|
||||
--disable-qt3
|
||||
$@"
|
||||
econf ${myconf}
|
||||
}
|
||||
|
||||
avahi_src_install-cleanup() {
|
||||
# Remove .la files
|
||||
find "${D}" -name '*.la' -exec rm -f {} + || die
|
||||
}
|
||||
|
||||
EXPORT_FUNCTIONS src_prepare src_configure
|
||||
@@ -1,863 +0,0 @@
|
||||
# Copyright 2004-2010 Sabayon Project
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $
|
||||
|
||||
# @ECLASS-VARIABLE: K_NASPATCHES_VER
|
||||
# @DESCRIPTION:
|
||||
# The version of the sablink patches tarball(s) to apply.
|
||||
# A value of "5" would apply 2.6.12-5 to my-sources-2.6.12.ebuild
|
||||
|
||||
# @ECLASS-VARIABLE: K_NASKERNEL_NAME
|
||||
# @DESCRIPTION:
|
||||
# The kernel name used by the ebuild, it should be the ending ${PN} part
|
||||
# for example, of linux-sablink it is "${PN/${PN/-*}-}" (sablink)
|
||||
K_NASKERNEL_NAME="${K_NASKERNEL_NAME:-${PN/${PN/-*}-}}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_NASKERNEL_URI_CONFIG
|
||||
# @DESCRIPTION:
|
||||
# Set this either to "no" or "yes" depending on the location of the
|
||||
# kernel config files. If they are inside FILESDIR (old location)
|
||||
# leave this option set to "no", otherwise set this to "yes"
|
||||
K_NASKERNEL_URI_CONFIG="${K_NASKERNEL_URI_CONFIG:-no}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_NASKERNEL_SELF_TARBALL_NAME
|
||||
# @DESCRIPTION:
|
||||
# If the main kernel sources tarball is generated in-house and available
|
||||
# on the "sablink" mirror, set this variable to the extension name (see example
|
||||
# below). This will disable ALL the extra/local patches (since they have to
|
||||
# be applied inside the tarball). Moreover, K_NASKERNEL_URI_CONFIG,
|
||||
# K_NASPATCHES_VER, K_NASKERNEL_NAME, K_KERNEL_PATCH_VER will be ignored.
|
||||
# Example:
|
||||
# K_NASKERNEL_SELF_TARBALL_NAME="sablink"
|
||||
# This would generate:
|
||||
# SRC_URI="mirror://sablink/sys-kernel/linux-${PV}+sablink.tar.bz2"
|
||||
K_NASKERNEL_SELF_TARBALL_NAME="${K_NASKERNEL_SELF_TARBALL_NAME:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_NASKERNEL_FORCE_SUBLEVEL
|
||||
# @DESCRIPTION:
|
||||
# Force the rewrite of SUBLEVEL in kernel sources Makefile
|
||||
K_NASKERNEL_FORCE_SUBLEVEL="${K_NASKERNEL_FORCE_SUBLEVEL:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_NASKERNEL_RESET_EXTRAVERSION
|
||||
# @DESCRIPTION:
|
||||
# Force the rewrite of EXTRAVERSION in kernel sources Makefile (setting it to "")
|
||||
K_NASKERNEL_RESET_EXTRAVERSION="${K_NASKERNEL_RESET_EXTRAVERSION:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_NASKERNEL_LONGTERM
|
||||
# @DESCRIPTION:
|
||||
# Consider Kernel stable patchset as longterm (changing URL)
|
||||
K_NASKERNEL_LONGTERM="${K_NASKERNEL_LONGTERM:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_KERNEL_SOURCES_PKG
|
||||
# @DESCRIPTION:
|
||||
# The kernel sources package used to build this kernel binary
|
||||
K_KERNEL_SOURCES_PKG="${K_KERNEL_SOURCES_PKG:-${CATEGORY}/${PN/*-}-sources-${PVR}}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_KERNEL_PATCH_VER
|
||||
# @DESCRIPTION:
|
||||
# If set to "3" for example, it applies the upstream kernel
|
||||
# patch corresponding to patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}.3.bz2
|
||||
# @TODO: deprecate and remove once 2.6.x kernels are retired
|
||||
K_KERNEL_PATCH_VER="${K_KERNEL_PATCH_VER:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_KERNEL_PATCH_HOTFIXES
|
||||
# @DESCRIPTION:
|
||||
# If there is the need to quickly apply patches to the kernel
|
||||
# without bumping the kernel patch tarball (for eg. in case
|
||||
# of just released security fixes), set this variable in your ebuild
|
||||
# pointing to space separated list of patch paths.
|
||||
K_KERNEL_PATCH_HOTFIXES="${K_KERNEL_PATCH_HOTFIXES:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_KERNEL_DISABLE_PR_EXTRAVERSION
|
||||
# @DESCRIPTION:
|
||||
# Set this to "1" if you want to tell kernel-2 eclass to
|
||||
# not use ${PR} in kernel EXTRAVERSION (K_NOUSEPR). Otherwise, set
|
||||
# this to "0" to not set K_NOUSEPR at all.
|
||||
K_KERNEL_DISABLE_PR_EXTRAVERSION="${K_KERNEL_DISABLE_PR_EXTRAVERSION:-1}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_KERNEL_SLOT_USEPVR
|
||||
# @DESCRIPTION:
|
||||
# Set this to "1" if you want to use ${PVR} in SLOT variable, instead of ${PV}
|
||||
# sys-kernel/linux-vserver (vserver-sources) require this. This won't work for
|
||||
# firmware pkgs.
|
||||
K_KERNEL_SLOT_USEPVR="${K_KERNEL_SLOT_USEPVR:-0}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_NASKERNEL_FIRMWARE
|
||||
# @DESCRIPTION:
|
||||
# Set this to "1" if your ebuild is a kernel firmware package
|
||||
K_FIRMWARE_PACKAGE="${K_FIRMWARE_PACKAGE:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_ONLY_SOURCES
|
||||
# @DESCRIPTION:
|
||||
# For every kernel binary package, there is a kernel source package associated
|
||||
# if your ebuild is one of them, set this to "1"
|
||||
K_ONLY_SOURCES="${K_ONLY_SOURCES:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_REQUIRED_LINUX_FIRMWARE_VER
|
||||
# @DESCRIPTION:
|
||||
# Minimum required version of sys-kernel/linux-formware package, if any
|
||||
K_REQUIRED_LINUX_FIRMWARE_VER="${K_REQUIRED_LINUX_FIRMWARE_VER:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_WORKAROUND_SOURCES_COLLISION
|
||||
# @DESCRIPTION:
|
||||
# For kernel binary packages, Workaround file collisions with kernel
|
||||
# sources already providing certain files (like Makefile). Used
|
||||
# by linux-openvz and linux-vserver
|
||||
K_WORKAROUND_SOURCES_COLLISION="${K_WORKAROUND_SOURCES_COLLISION:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_WORKAROUND_USE_REAL_EXTRAVERSION
|
||||
# @DESCRIPTION:
|
||||
# Some kernel sources are shipped with their own EXTRAVERSION and
|
||||
# we're kindly asked to not touch it, if this is your case, set
|
||||
# this variable and depmod will work correctly.
|
||||
K_WORKAROUND_USE_REAL_EXTRAVERSION="${K_WORKAROUND_USE_REAL_EXTRAVERSION:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_GENKERNEL_ARGS
|
||||
# @DESCRIPTION:
|
||||
# Provide extra genkernel arguments using K_GENKERNEL_ARGS
|
||||
K_GENKERNEL_ARGS="${K_GENKERNEL_ARGS:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_MKIMAGE_RAMDISK_ADDRESS
|
||||
# @DESCRIPTION:
|
||||
# [ARM ONLY] Provide the ramdisk load address to be used with mkimage
|
||||
K_MKIMAGE_RAMDISK_ADDRESS="${K_MKIMAGE_RAMDISK_ADDRESS:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_MKIMAGE_RAMDISK_ENTRYPOINT
|
||||
# @DESCRIPTION:
|
||||
# [ARM ONLY] Provide the ramdisk entry point address to be used with mkimage
|
||||
K_MKIMAGE_RAMDISK_ENTRYPOINT="${K_MKIMAGE_RAMDISK_ENTRYPOINT:-}"
|
||||
|
||||
KERN_INITRAMFS_SEARCH_NAME="${KERN_INITRAMFS_SEARCH_NAME:-initramfs-genkernel*${K_NASKERNEL_NAME}}"
|
||||
|
||||
# Disable deblobbing feature
|
||||
K_DEBLOB_AVAILABLE=0
|
||||
ETYPE="sources"
|
||||
|
||||
inherit eutils kernel-2 mount-boot linux-info
|
||||
|
||||
# from kernel-2 eclass
|
||||
detect_version
|
||||
detect_arch
|
||||
|
||||
DESCRIPTION="Sablink Linux kernel functions and phases"
|
||||
|
||||
|
||||
K_LONGTERM_URL_STR=""
|
||||
if [ -n "${K_NASKERNEL_LONGTERM}" ]; then
|
||||
K_LONGTERM_URL_STR="/longterm/v${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}"
|
||||
fi
|
||||
|
||||
## kernel-2 eclass settings
|
||||
if [ -n "${K_NASKERNEL_SELF_TARBALL_NAME}" ]; then
|
||||
SRC_URI="mirror://sablink/${CATEGORY}/linux-${PVR}+${K_NASKERNEL_SELF_TARBALL_NAME}.tar.bz2"
|
||||
elif [ -n "${K_NASPATCHES_VER}" ]; then
|
||||
UNIPATCH_STRICTORDER="yes"
|
||||
K_NASPATCHES_PKG="nas-patches-${PV}-${K_NASPATCHES_VER}.tar.bz2"
|
||||
UNIPATCH_LIST="${DISTFILES}/${K_NASPATCHES_PKG}"
|
||||
SRC_URI="${KERNEL_URI}
|
||||
mirror://sablink/${CATEGORY}/linux-nas-patches/${K_NASPATCHES_PKG}"
|
||||
else
|
||||
SRC_URI="${KERNEL_URI}"
|
||||
fi
|
||||
|
||||
if [ -z "${K_NASKERNEL_SELF_TARBALL_NAME}" ]; then
|
||||
if [ -n "${K_KERNEL_PATCH_VER}" ]; then
|
||||
K_PATCH_NAME="patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}.${K_KERNEL_PATCH_VER}.bz2"
|
||||
SRC_URI="${SRC_URI}
|
||||
mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}${K_LONGTERM_URL_STR}/${K_PATCH_NAME}"
|
||||
UNIPATCH_LIST="${DISTDIR}/${K_PATCH_NAME}
|
||||
${UNIPATCH_LIST}"
|
||||
fi
|
||||
fi
|
||||
if [ -n "${K_KERNEL_PATCH_HOTFIXES}" ]; then
|
||||
UNIPATCH_LIST="${K_KERNEL_PATCH_HOTFIXES} ${UNIPATCH_LIST}"
|
||||
fi
|
||||
|
||||
_get_real_kv_full() {
|
||||
if [[ "${KV_MAJOR}${KV_MINOR}" -eq 26 ]]; then
|
||||
echo "${ORIGINAL_KV_FULL}"
|
||||
elif [[ "${OKV/.*}" = "3" ]]; then
|
||||
# Linux 3.x support, KV_FULL is set to: 3.0-sablink
|
||||
# need to add another final .0 to the version part
|
||||
#echo "${ORIGINAL_KV_FULL/-/.0-}"
|
||||
echo "${ORIGINAL_KV_FULL}"
|
||||
else
|
||||
echo "${ORIGINAL_KV_FULL}"
|
||||
fi
|
||||
}
|
||||
|
||||
# replace "linux" with K_NASKERNEL_NAME, usually replaces
|
||||
# "linux" with "sablink" or "server" or "openvz"
|
||||
KV_FULL="${KV_FULL/${PN/-*}/${K_NASKERNEL_NAME}}"
|
||||
EXTRAVERSION="${EXTRAVERSION/${PN/-*}/${K_NASKERNEL_NAME}}"
|
||||
# drop -rX if exists
|
||||
if [[ -n "${PR//r0}" ]] && [[ "${K_KERNEL_DISABLE_PR_EXTRAVERSION}" = "1" ]] \
|
||||
&& [[ -z "${K_NOSETEXTRAVERSION}" ]]; then
|
||||
EXTRAVERSION="${EXTRAVERSION%-r*}"
|
||||
KV_FULL="${KV_FULL%-r*}"
|
||||
KV="${KV%-r*}"
|
||||
fi
|
||||
# rewrite it
|
||||
ORIGINAL_KV_FULL="${KV_FULL}"
|
||||
KV_FULL="$(_get_real_kv_full)"
|
||||
|
||||
# Starting from linux-3.0, we still have to install
|
||||
# sources stuff into /usr/src/linux-3.0.0-sablink (example)
|
||||
# where the last part must always match uname -r
|
||||
# otherwise kernel-switcher (and RELEASE_LEVEL file)
|
||||
# will complain badly
|
||||
KV_OUT_DIR="/usr/src/linux-${KV_FULL}"
|
||||
S="${WORKDIR}/linux-${KV_FULL}"
|
||||
|
||||
|
||||
if [ -n "${K_FIRMWARE_PACKAGE}" ]; then
|
||||
SLOT="0"
|
||||
elif [ "${K_KERNEL_SLOT_USEPVR}" = "1" ]; then
|
||||
SLOT="${PVR}"
|
||||
else
|
||||
SLOT="${PV}"
|
||||
fi
|
||||
|
||||
_is_kernel_binary() {
|
||||
if [ -z "${K_ONLY_SOURCES}" ] && [ -z "${K_FIRMWARE_PACKAGE}" ]; then
|
||||
# yes it is
|
||||
return 0
|
||||
else
|
||||
# no it isn't
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# provide extra virtual pkg
|
||||
if _is_kernel_binary; then
|
||||
PROVIDE="${PROVIDE} virtual/linux-binary"
|
||||
fi
|
||||
|
||||
if [ -n "${K_NASKERNEL_SELF_TARBALL_NAME}" ]; then
|
||||
HOMEPAGE="http://gitweb.sablink.org/?p=linux/kernel/sablink.git;a=summary"
|
||||
else
|
||||
HOMEPAGE="http://www.sablink.org"
|
||||
fi
|
||||
|
||||
|
||||
# Setup kernel configuration file name
|
||||
if [ -z "${K_NASKERNEL_SELF_TARBALL_NAME}" ]; then
|
||||
if [ "${K_NASKERNEL_URI_CONFIG}" = "yes" ]; then
|
||||
tmp_K_NASKERNEL_CONFIG_FILE="${K_NASKERNEL_CONFIG_FILE:-${K_NASKERNEL_NAME}-${PVR}-__ARCH__.config}"
|
||||
tmp_K_NASKERNEL_FW_CONFIG_FILE="${K_NASKERNEL_FW_CONFIG_FILE:-${K_NASKERNEL_NAME}-fw_env-__ARCH__.config}"
|
||||
SRC_URI="${SRC_URI}
|
||||
arm? ( mirror://sablink/${CATEGORY}/linux-nas-patches/config/${tmp_K_NASKERNEL_CONFIG_FILE/__ARCH__/arm}
|
||||
mirror://sablink/${CATEGORY}/linux-nas-patches/config/${tmp_K_NASKERNEL_FW_CONFIG_FILE/__ARCH__/arm} )"
|
||||
# K_SABKERNEL_CONFIG_FILE will be set in _set_config_file_vars
|
||||
unset tmp_K_SABKERNEL_CONFIG_FILE
|
||||
|
||||
|
||||
|
||||
# Returns success if _set_config_file_vars was called.
|
||||
_is_config_file_set() {
|
||||
[[ ${_config_file_set} = 1 ]]
|
||||
}
|
||||
|
||||
_set_config_file_vars() {
|
||||
# Setup kernel configuration file name
|
||||
if [ -z "${K_SABKERNEL_SELF_TARBALL_NAME}" ]; then
|
||||
if [ "${K_SABKERNEL_URI_CONFIG}" = "yes" ]; then
|
||||
K_NASKERNEL_CONFIG_FILE="${K_NASKERNEL_CONFIG_FILE:-${K_NASKERNEL_NAME}-${PVR}-__ARCH__.config}"
|
||||
K_NASKERNEL_FW_CONFIG_FILE="${K_NASKERNEL_FW_CONFIG_FILE:-${K_NASKERNEL_NAME}-fw_env-__ARCH__.config}"
|
||||
use arm && K_NASKERNEL_CONFIG_FILE=${K_NASKERNEL_CONFIG_FILE/__ARCH__/arm}
|
||||
use arm && K_NASKERNEL_FW_CONFIG_FILE=${K_NASKERNEL_FW_CONFIG_FILE/__ARCH__/arm}
|
||||
# ARM not supported, if put in SRC_URI it tries to fetch it
|
||||
else
|
||||
use arm && K_NASKERNEL_CONFIG_FILE="${K_NASKERNEL_CONFIG_FILE:-${K_NASKERNEL_NAME}-${PVR}-arm.config}"
|
||||
use arm && K_NASKERNEL_FW_CONFIG_FILE="${K_NASKERNEL_FW_CONFIG_FILE:-${K_NASKERNEL_NAME}-fw_env-arm.config}"
|
||||
fi
|
||||
else
|
||||
K_NASKERNEL_CONFIG_FILE="${K_NASKERNEL_CONFIG_FILE:-${K_NASKERNEL_NAME}-${PVR}-__ARCH__.config}"
|
||||
K_NASKERNEL_ALT_CONFIG_FILE="${K_NASKERNEL_ALT_CONFIG_FILE:-${K_NASKERNEL_NAME}-${PV}-__ARCH__.config}"
|
||||
K_NASKERNEL_FW_CONFIG_FILE="${K_NASKERNEL_FW_CONFIG_FILE:-${K_NASKERNEL_NAME}-fw_env-__ARCH__.config}"
|
||||
if use arm; then
|
||||
K_NASKERNEL_CONFIG_FILE=${K_NASKERNEL_CONFIG_FILE/__ARCH__/arm}
|
||||
K_NASKERNEL_ALT_CONFIG_FILE=${K_NASKERNEL_ALT_CONFIG_FILE/__ARCH__/arm}
|
||||
K_NASKERNEL_FW_CONFIG_FILE=${K_NASKERNEL_FW_CONFIG_FILE/__ARCH__/arm}
|
||||
fi
|
||||
_config_file_set=1
|
||||
fi
|
||||
|
||||
|
||||
if [ -n "${K_ONLY_SOURCES}" ] || [ -n "${K_FIRMWARE_PACKAGE}" ]; then
|
||||
IUSE="${IUSE}"
|
||||
DEPEND="sys-apps/sed"
|
||||
RDEPEND="${RDEPEND}"
|
||||
else
|
||||
IUSE="dmraid dracut iscsi lvm mdadm ccache"
|
||||
DEPEND="app-arch/xz-utils
|
||||
sys-apps/sed
|
||||
sys-devel/make
|
||||
>=sys-kernel/genkernel-3.4.16-r1
|
||||
dracut? ( sys-kernel/dracut )
|
||||
ccache? ( dev-util/ccache )
|
||||
sys-block/devio
|
||||
dev-embedded/u-boot-tools
|
||||
sys-fs/dosfstools"
|
||||
|
||||
RDEPEND="sys-apps/sed
|
||||
sys-kernel/linux-firmware"
|
||||
if [ -n "${K_REQUIRED_LINUX_FIRMWARE_VER}" ]; then
|
||||
RDEPEND+=" >=sys-kernel/linux-firmware-${K_REQUIRED_LINUX_FIRMWARE_VER}"
|
||||
fi
|
||||
fi
|
||||
|
||||
# internal function
|
||||
#
|
||||
# FUNCTION: _update_depmod
|
||||
# @USAGE: _update_depmod <-r depmod>
|
||||
# DESCRIPTION:
|
||||
# It updates the modules.dep file for the current kernel.
|
||||
# This is more or less the same of linux-mod update_depmod, with the
|
||||
# exception of accepting parameter which is passed to depmod -r switch
|
||||
_update_depmod() {
|
||||
|
||||
# if we haven't determined the version yet, we need too.
|
||||
get_version;
|
||||
|
||||
ebegin "Updating module dependencies for ${KV_FULL}"
|
||||
if [ -r "${KV_OUT_DIR}"/System.map ]; then
|
||||
depmod -ae -F "${KV_OUT_DIR}"/System.map -b "${ROOT}" -r "${1}"
|
||||
eend $?
|
||||
else
|
||||
ewarn
|
||||
ewarn "${KV_OUT_DIR}/System.map not found."
|
||||
ewarn "You must manually update the kernel module dependencies using depmod."
|
||||
eend 1
|
||||
ewarn
|
||||
fi
|
||||
}
|
||||
|
||||
nas-kernel_pkg_setup() {
|
||||
if [ -n "${K_FIRMWARE_PACKAGE}" ]; then
|
||||
einfo "Preparing kernel firmwares"
|
||||
else
|
||||
einfo "Preparing kernel and its modules"
|
||||
fi
|
||||
}
|
||||
|
||||
nas-kernel_src_unpack() {
|
||||
local okv="${OKV}"
|
||||
if [ -n "${K_NASKERNEL_SELF_TARBALL_NAME}" ]; then
|
||||
OKV="${PVR}+${K_NASKERNEL_SELF_TARBALL_NAME}"
|
||||
fi
|
||||
kernel-2_src_unpack
|
||||
if [ -n "${K_NASKERNEL_FORCE_SUBLEVEL}" ]; then
|
||||
# patch out Makefile with proper sublevel
|
||||
sed -i "s:^SUBLEVEL = .*:SUBLEVEL = ${K_NASKERNEL_FORCE_SUBLEVEL}:" \
|
||||
"${S}/Makefile" || die
|
||||
fi
|
||||
if [ -n "${K_NASKERNEL_RESET_EXTRAVERSION}" ]; then
|
||||
sed -i "s:^EXTRAVERSION =.*:EXTRAVERSION = :" "${S}/Makefile" || die
|
||||
# some sources could have multiple append-based EXTRAVERSIONs
|
||||
sed -i "s/^EXTRAVERSION :=.*//" "${S}/Makefile" || die
|
||||
fi
|
||||
OKV="${okv}"
|
||||
|
||||
# Let's handle EAPIs 0 and 1...
|
||||
case ${EAPI:-0} in
|
||||
0|1) nas-kernel_src_prepare ;;
|
||||
esac
|
||||
}
|
||||
|
||||
nas-kernel_src_prepare() {
|
||||
_set_config_file_vars
|
||||
}
|
||||
|
||||
nas-kernel_src_compile() {
|
||||
if [ -n "${K_FIRMWARE_PACKAGE}" ]; then
|
||||
_firmwares_src_compile
|
||||
elif [ -n "${K_ONLY_SOURCES}" ]; then
|
||||
kernel-2_src_compile
|
||||
else
|
||||
_kernel_src_compile
|
||||
fi
|
||||
}
|
||||
|
||||
_firmwares_src_compile() {
|
||||
einfo "Starting to compile firmwares..."
|
||||
_kernel_copy_config "${S}/.config"
|
||||
cd "${S}" || die "cannot find source dir"
|
||||
|
||||
export LDFLAGS=""
|
||||
OLDARCH="${ARCH}"
|
||||
unset ARCH
|
||||
emake firmware || die "cannot compile firmwares"
|
||||
ARCH="${OLDARCH}"
|
||||
}
|
||||
|
||||
_kernel_copy_config() {
|
||||
_is_config_file_set \
|
||||
|| die "Kernel configuration file not set. Was nas-kernel_src_prepare() called?"
|
||||
|
||||
if [ -n "${K_NASKERNEL_SELF_TARBALL_NAME}" ]; then
|
||||
local base_path="${S}/sablink/config"
|
||||
if [ -f "${base_path}/${K_NASKERNEL_ALT_CONFIG_FILE}" ]; then
|
||||
# new path, without revision
|
||||
cp "${base_path}/${K_NASKERNEL_ALT_CONFIG_FILE}" "${1}" || die "cannot copy kernel config"
|
||||
else
|
||||
# PVR path (old)
|
||||
cp "${base_path}/${K_NASKERNEL_CONFIG_FILE}" "${1}" || die "cannot copy kernel config"
|
||||
fi
|
||||
else
|
||||
if [ "${K_NASKERNEL_URI_CONFIG}" = "no" ]; then
|
||||
cp "${FILESDIR}/${PF/-r0/}-${ARCH}.config" "${1}" || die "cannot copy kernel config"
|
||||
else
|
||||
cp "${DISTDIR}/${K_NASKERNEL_CONFIG_FILE}" "${1}" || die "cannot copy kernel config"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
_kernel_src_compile() {
|
||||
# disable sandbox
|
||||
export SANDBOX_ON=0
|
||||
|
||||
# needed anyway, even if grub use flag is not used here
|
||||
if use arm ; then
|
||||
mkdir -p "${WORKDIR}"/boot/dtb
|
||||
else
|
||||
mkdir -p "${WORKDIR}"/boot
|
||||
fi
|
||||
|
||||
einfo "Starting to compile kernel..."
|
||||
_kernel_copy_config "${WORKDIR}"/config
|
||||
|
||||
# do some cleanup
|
||||
rm -rf "${WORKDIR}"/lib
|
||||
rm -rf "${WORKDIR}"/cache
|
||||
rm -rf "${S}"/temp
|
||||
|
||||
# creating workdirs
|
||||
# some kernels fail with make 3.82 if firmware dir is not created
|
||||
mkdir "${WORKDIR}"/lib/lib/firmware -p
|
||||
mkdir "${WORKDIR}"/cache
|
||||
mkdir "${S}"/temp
|
||||
|
||||
cd "${S}" || die
|
||||
GKARGS="--no-save-config --disklabel"
|
||||
use dracut && GKARGS="${GKARGS} --dracut"
|
||||
use dmraid && GKARGS="${GKARGS} --dmraid"
|
||||
use iscsi && GKARGS="${GKARGS} --iscsi"
|
||||
use mdadm && GKARGS="${GKARGS} --mdadm"
|
||||
use lvm && GKARGS="${GKARGS} --lvm"
|
||||
|
||||
export DEFAULT_KERNEL_SOURCE="${S}"
|
||||
export CMD_KERNEL_DIR="${S}"
|
||||
for opt in ${MAKEOPTS}; do
|
||||
if [ "${opt:0:2}" = "-j" ]; then
|
||||
mkopts="${opt}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
[ -z "${mkopts}" ] && mkopts="-j3"
|
||||
|
||||
OLDARCH="${ARCH}"
|
||||
env_setup_xmakeopts
|
||||
[ -n "${xmakeopts}" ] && eval "${xmakeopts}"
|
||||
if [ -n "${CROSS_COMPILE}" ] && [ "${CBUILD:-${CHOST}}" != "${CTARGET}" ]; then
|
||||
einfo "Enabling cross-emerge for ${CROSS_COMPILE}, arch: ${KARCH}"
|
||||
GKARGS="${GKARGS} --arch-override=${KARCH}"
|
||||
GKARGS="${GKARGS} --kernel-cross-compile=${CROSS_COMPILE}"
|
||||
GKARGS="${GKARGS} --utils-cross-compile=${CROSS_COMPILE}"
|
||||
# ARCH= must be forced to KARCH
|
||||
ARCH="${KARCH}"
|
||||
else
|
||||
einfo "Cross-emerge is disabled"
|
||||
unset CROSS_COMPILE
|
||||
unset ARCH
|
||||
use ccache && GKARGS="${GKARGS} --kernel-cc=/usr/lib/ccache/bin/gcc"
|
||||
fi
|
||||
|
||||
# If ARM, build the uImage directly
|
||||
#if use arm; then
|
||||
# K_GENKERNEL_ARGS+=" --kernel-target=uImage --kernel-binary=arch/arm/boot/uImage"
|
||||
#fi
|
||||
|
||||
# Workaround bug in splash_geninitramfs corrupting the initramfs
|
||||
# if xz compression is used (newer genkernel >3.4.24)
|
||||
local support_comp=$(genkernel --help | grep compress-initramfs-type)
|
||||
if [ -n "${support_comp}" ]; then
|
||||
GKARGS+=" --compress-initramfs-type=gzip"
|
||||
fi
|
||||
|
||||
K_NASKERNEL_DTB="none"
|
||||
# Buffalo anounced a new box named Pro Live (video transcode streaming)
|
||||
# so the old ls_pro_live has to be split to ls_pro ls_live
|
||||
# for now let it stay but a move schould be done to ls_pro
|
||||
if [ "${K_NASKERNEL_NAME}" = "buffalo_ls_chl" ]; then
|
||||
devio > foo 'wl 0xe3a01c0B,4' 'wl 0xe3811061,4' # Linkstation Live V3 (2.6.34)
|
||||
K_NASKERNEL_TYPE="buffalo"
|
||||
K_NASKERNEL_DEVICE="Buffalo Linkstation LiveV3 (LS-CHL)"
|
||||
fi
|
||||
if [ "${K_NASKERNEL_NAME}" = "buffalo_ls_chl2" ]; then
|
||||
#devio > foo 'wl 0xe3a01c0a,4' 'wl 0xe3811067,4' # Linkstation XHL/CHLv2 (2.6.30)
|
||||
# new Device tree no need for devio
|
||||
K_NASKERNEL_DTB="kirkwood-lschlv2.dtb"
|
||||
K_NASKERNEL_TYPE="buffalo"
|
||||
K_NASKERNEL_DEVICE="Buffalo LS-XHL Series"
|
||||
fi
|
||||
if [ "${K_NASKERNEL_NAME}" = "buffalo_ls_hgl" ]; then
|
||||
devio > foo 'wl 0xe3a01c07,4' 'wl 0xe38110d5,4' # Linkstation HGL (2.6.31)
|
||||
K_NASKERNEL_TYPE="buffalo"
|
||||
K_NASKERNEL_DEVICE="Buffalo Linkstation LS-HGL"
|
||||
fi
|
||||
if [ "${K_NASKERNEL_NAME}" = "buffalo_ls_live" ]; then
|
||||
devio > foo 'wl 0xe3a01c06,4' 'wl 0xe3811031,4' # Linkstation Pro/Live (2.6.26)
|
||||
K_NASKERNEL_TYPE="buffalo"
|
||||
K_NASKERNEL_DEVICE="Buffalo Linkstation Pro/Live"
|
||||
fi
|
||||
if [ "${K_NASKERNEL_NAME}" = "buffalo_ls_mini" ]; then
|
||||
devio > foo 'wl 0xe3a01c07,4' 'wl 0xe3811042,4' # Linkstation mini (2.6.29)
|
||||
K_NASKERNEL_TYPE="buffalo"
|
||||
K_NASKERNEL_DEVICE="Buffalo Linkstation Mini"
|
||||
fi
|
||||
if [ "${K_NASKERNEL_NAME}" = "buffalo_ls_pro" ]; then
|
||||
devio > foo 'wl 0xe3a01c06,4' 'wl 0xe3811031,4' # Linkstation Pro/Live (2.6.26)
|
||||
K_NASKERNEL_TYPE="buffalo"
|
||||
K_NASKERNEL_DEVICE="Buffalo Linkstation Pro/Live"
|
||||
fi
|
||||
if [ "${K_NASKERNEL_NAME}" = "buffalo_ls_pro_duo_rev1" ]; then
|
||||
devio > foo 'wl 0xe3a01c07,4' 'wl 0xe3811027,4' # Linkstation Pro Duo (2.6.30)
|
||||
K_NASKERNEL_TYPE="buffalo"
|
||||
K_NASKERNEL_DEVICE="Buffalo Linkstation Pro Duo - Revision 1"
|
||||
fi
|
||||
if [ "${K_NASKERNEL_NAME}" = "buffalo_ls_pro_duo_rev2" ]; then
|
||||
devio > foo 'wl 0xe3a01c07,4' 'wl 0xe3811027,4' # Linkstation Pro Duo (2.6.30)
|
||||
K_NASKERNEL_TYPE="buffalo"
|
||||
K_NASKERNEL_DEVICE="Buffalo Linkstation Pro Duo - Revision 2"
|
||||
fi
|
||||
if [ "${K_NASKERNEL_NAME}" = "buffalo_ls_vl" ]; then
|
||||
devio > foo 'wl 0xe3a01c0d,4' 'wl 0xe381100a,4' # Linkstation vl (2.6.35)
|
||||
K_NASKERNEL_TYPE="buffalo"
|
||||
K_NASKERNEL_DEVICE="Buffalo LS-VL Series"
|
||||
fi
|
||||
if [ "${K_NASKERNEL_NAME}" = "buffalo_ls_wxl" ]; then
|
||||
devio > foo 'wl 0xe3a01c0b,4' 'wl 0xe38110c4,4' # Linkstation WXL (2.6.35)
|
||||
K_NASKERNEL_TYPE="buffalo"
|
||||
# Broken hardware name needs to be correct in u-boot firmware
|
||||
K_NASKERNEL_DEVICE="Buffalo Linkstation Pro/Live"
|
||||
fi
|
||||
if [ "${K_NASKERNEL_NAME}" = "buffalo_ls_xhl" ]; then
|
||||
#devio > foo 'wl 0xe3a01c0a,4' 'wl 0xe3811067,4' # Linkstation XHL/CHLv2 (2.6.30)
|
||||
# new Device tree no need for devio
|
||||
K_NASKERNEL_DTB="kirkwood-lsxhl.dtb"
|
||||
K_NASKERNEL_TYPE="buffalo"
|
||||
K_NASKERNEL_DEVICE="Buffalo LS-XHL Series"
|
||||
fi
|
||||
|
||||
# Freescale
|
||||
if [ "${K_NASKERNEL_NAME}" = "freescale_mx53_loco" ]; then
|
||||
K_NASKERNEL_TYPE="default"
|
||||
K_NASKERNEL_DEVICE="Freescale MX53 LOCO Board"
|
||||
K_GENKERNEL_ARGS+=" --kernel-target=uImage --kernel-binary=arch/arm/boot/uImage"
|
||||
fi
|
||||
|
||||
unset LDFLAGS
|
||||
DEFAULT_KERNEL_SOURCE="${S}" CMD_KERNEL_DIR="${S}" genkernel ${GKARGS} ${K_GENKERNEL_ARGS} \
|
||||
--kerneldir="${S}" \
|
||||
--kernel-config="${WORKDIR}"/config \
|
||||
--cachedir="${WORKDIR}"/cache \
|
||||
--makeopts="${mkopts}" \
|
||||
--tempdir="${S}"/temp \
|
||||
--logfile="${WORKDIR}"/genkernel.log \
|
||||
--bootdir="${WORKDIR}"/boot \
|
||||
--mountboot \
|
||||
--module-prefix="${WORKDIR}"/lib \
|
||||
all || die "genkernel failed"
|
||||
ARCH=${OLDARCH}
|
||||
|
||||
# Buffalo Boxes have a special naming and start address
|
||||
if [ "${K_NASKERNEL_TYPE}" = "buffalo" ]; then
|
||||
if [ "${K_NASKERNEL_DTB}" = "none" ]; then
|
||||
einfo "Prepend the correct Device ID to the Kenel Image"
|
||||
cat foo "${WORKDIR}"/boot/kernel-genkernel-${ARCH}-${KV_FULL} > zImage.new
|
||||
else
|
||||
einfo "Append the device-tree-blob to the Kenel Image"
|
||||
cat "${WORKDIR}"/boot/kernel-genkernel-${ARCH}-${KV_FULL} "${S}"/arch/arm/boot/${K_NASKERNEL_DTB} > zImage.new
|
||||
fi
|
||||
einfo "Create uImage of the resulting Image"
|
||||
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n uImage-${KV_FULL} \
|
||||
-d zImage.new "${WORKDIR}"/boot/uImage-genkernel-${ARCH}-${KV_FULL}.buffalo
|
||||
einfo "Create uInitrd with correct start address"
|
||||
mkimage -A arm -O linux -T ramdisk -C none -a 0x00000000 -e 0x00000000 -n initrd-${KV_FULL} \
|
||||
-d "${WORKDIR}"/boot/initramfs-genkernel-${ARCH}-${KV_FULL} "${WORKDIR}"/boot/initrd-genkernel-${ARCH}-${KV_FULL}.buffalo
|
||||
fi
|
||||
|
||||
# # Default uImage and uInit handling
|
||||
# if [ "${K_NASKERNEL_TYPE}" = "default" ]; then
|
||||
# cp "${WORKDIR}"/boot/kernel-genkernel-${ARCH}-${KV_FULL} "${WORKDIR}"/boot/uImage-genkernel-${ARCH}-${KV_FULL}
|
||||
# mkimage -A arm -O linux -T ramdisk -C none -a 0x00000000 -e 0x00000000 -n initrd-${KV_FULL} \
|
||||
# -d "${WORKDIR}"/boot/initramfs-genkernel-${ARCH}-${KV_FULL} "${WORKDIR}"/boot/uInitrd-genkernel-${ARCH}-${KV_FULL}
|
||||
# fi
|
||||
|
||||
# cleanup
|
||||
rm foo zImage.new
|
||||
rm "${WORKDIR}"/boot/kernel-genkernel-${ARCH}-${KV_FULL} "${WORKDIR}"/boot/initramfs-genkernel-${ARCH}-${KV_FULL}
|
||||
}
|
||||
|
||||
_setup_mkimage_ramdisk() {
|
||||
local initramfs=$(ls "${WORKDIR}"/boot/${KERN_INITRAMFS_SEARCH_NAME}* 2> /dev/null)
|
||||
if [ ! -e "${initramfs}" ] || [ ! -f "${initramfs}" ]; then
|
||||
ewarn "No initramfs at ${initramfs}, cannot run mkimage on it!"
|
||||
else
|
||||
einfo "Setting up u-boot initramfs for: ${initramfs}"
|
||||
/usr/bin/mkimage -A arm -O linux -T ramdisk -C none -a "${K_MKIMAGE_RAMDISK_ADDRESS}" \
|
||||
-e "${K_MKIMAGE_RAMDISK_ENTRYPOINT}" -d "${initramfs}" \
|
||||
"${initramfs}.u-boot" || return 1
|
||||
mv "${initramfs}.u-boot" "${initramfs}" || return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
nas-kernel_src_install() {
|
||||
if [ -n "${K_FIRMWARE_PACKAGE}" ]; then
|
||||
_firmwares_src_install
|
||||
elif [ -n "${K_ONLY_SOURCES}" ]; then
|
||||
_kernel_sources_src_install
|
||||
else
|
||||
_kernel_src_install
|
||||
fi
|
||||
}
|
||||
|
||||
_firmwares_src_install() {
|
||||
dodir /lib/firmware
|
||||
keepdir /lib/firmware
|
||||
cd "${S}" || die
|
||||
emake INSTALL_FW_PATH="${D}/lib/firmware" firmware_install || die "cannot install firmwares"
|
||||
}
|
||||
|
||||
_kernel_sources_src_install() {
|
||||
local version_h_name="${KV_OUT_DIR/\//}/include/linux"
|
||||
local version_h="${ROOT}${version_h_name}"
|
||||
if [ -f "${version_h}" ]; then
|
||||
einfo "Discarding previously installed version.h to avoid collisions"
|
||||
addwrite "/${version_h_name}"
|
||||
rm -f "${version_h}"
|
||||
fi
|
||||
|
||||
_kernel_copy_config ".config"
|
||||
kernel-2_src_install
|
||||
cd "${D}${KV_OUT_DIR}" || die
|
||||
local oldarch="${ARCH}"
|
||||
unset ARCH
|
||||
if ! use sources_standalone; then
|
||||
make modules_prepare || die "failed to run modules_prepare"
|
||||
rm .config || die "cannot remove .config"
|
||||
rm Makefile || die "cannot remove Makefile"
|
||||
rm include/linux/version.h || die "cannot remove include/linux/version.h"
|
||||
fi
|
||||
ARCH="${oldarch}"
|
||||
}
|
||||
|
||||
_kernel_src_install() {
|
||||
use arm && { _setup_mkimage_ramdisk || die "cannot setup mkimage"; }
|
||||
|
||||
dodir "${KV_OUT_DIR}"
|
||||
insinto "${KV_OUT_DIR}"
|
||||
|
||||
_kernel_copy_config ".config"
|
||||
doins ".config" || die "cannot copy kernel config"
|
||||
doins Makefile || die "cannot copy Makefile"
|
||||
doins Module.symvers || die "cannot copy Module.symvers"
|
||||
doins System.map || die "cannot copy System.map"
|
||||
|
||||
# NOTE: this is a workaround caused by linux-info.eclass not
|
||||
# being ported to EAPI=2 yet
|
||||
local version_h_name="${KV_OUT_DIR/\//}/include/linux"
|
||||
local version_h="${ROOT}${version_h_name}/version.h"
|
||||
if [ -f "${version_h}" ]; then
|
||||
einfo "Discarding previously installed version.h to avoid collisions"
|
||||
addwrite "${version_h}"
|
||||
rm -f "${version_h}"
|
||||
fi
|
||||
|
||||
# Include include/linux/version.h to make Portage happy
|
||||
dodir "${KV_OUT_DIR}/include/linux"
|
||||
insinto "${KV_OUT_DIR}/include/linux"
|
||||
doins "${S}/include/linux/version.h" || die "cannot copy version.h"
|
||||
|
||||
insinto "/boot"
|
||||
doins "${WORKDIR}"/boot/* || die "cannot copy /boot over"
|
||||
cp -Rp "${WORKDIR}"/lib/* "${D}/" || die "cannot copy /lib over"
|
||||
|
||||
# This doesn't always work because KV_FULL (when K_NOSETEXTRAVERSION=1) doesn't
|
||||
# reflect the real value used in Makefile
|
||||
#dosym "../../..${KV_OUT_DIR}" "/lib/modules/${KV_FULL}/source" || die "cannot install source symlink"
|
||||
#dosym "../../..${KV_OUT_DIR}" "/lib/modules/${KV_FULL}/build" || die "cannot install build symlink"
|
||||
cd "${D}"/lib/modules/* || die "cannot enter /lib/modules directory, more than one element?"
|
||||
# cleanup previous
|
||||
rm -f build source || die
|
||||
# create sane symlinks
|
||||
ln -sf "../../..${KV_OUT_DIR}" source || die "cannot create source symlink"
|
||||
ln -sf "../../..${KV_OUT_DIR}" build || die "cannot create build symlink"
|
||||
cd "${S}" || die
|
||||
|
||||
# drop ${D}/lib/firmware, virtual/linux-firmwares provides it
|
||||
rm -rf "${D}/lib/firmware"
|
||||
|
||||
if [ -n "${K_WORKAROUND_SOURCES_COLLISION}" ]; then
|
||||
# Fixing up Makefile collision if already installed by
|
||||
# openvz-sources
|
||||
einfo "Workarounding source package collisions"
|
||||
make_file="${KV_OUT_DIR/\//}/Makefile"
|
||||
einfo "Makefile: ${make_file}"
|
||||
if [ -f "${ROOT}/${make_file}" ]; then
|
||||
elog "Removing ${D}/${make_file}"
|
||||
rm -f "${D}/${make_file}"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Install kernel configuration information
|
||||
# useful for Entropy kernel-switcher
|
||||
if _is_kernel_binary; then
|
||||
# release level is enough for now
|
||||
base_dir="/etc/kernels/${P}"
|
||||
dodir "${base_dir}"
|
||||
insinto "${base_dir}"
|
||||
echo "${KV_FULL}" > "RELEASE_LEVEL"
|
||||
doins "RELEASE_LEVEL"
|
||||
einfo "Installing ${base_dir}/RELEASE_LEVEL file: ${KV_FULL}"
|
||||
fi
|
||||
|
||||
# copy firmware config file to propper location
|
||||
if [ -n "${K_NASKERNEL_SELF_TARBALL_NAME}" ]; then
|
||||
local base_path="${S}/sablink/config"
|
||||
cp "${base_path}/${K_NASKERNEL_FW_CONFIG_FILE}" "${D}/etc/fw_env.config.${K_NASKERNEL_NAME}" || die "cannot copy firmware config"
|
||||
else
|
||||
if [ "${K_NASKERNEL_URI_CONFIG}" = "no" ]; then
|
||||
cp "${FILESDIR}/${PF/-r0/}-${ARCH}.config" "${D}/etc/fw_env.config.${K_NASKERNEL_NAME}" || die "cannot copy firmware config"
|
||||
else
|
||||
cp "${DISTDIR}/${K_NASKERNEL_FW_CONFIG_FILE}" "${D}/etc/fw_env.config.${K_NASKERNEL_NAME}" || die "cannot copy firmware config"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
nas-kernel_pkg_preinst() {
|
||||
if _is_kernel_binary; then
|
||||
mount-boot_pkg_preinst
|
||||
fi
|
||||
}
|
||||
|
||||
_get_real_extraversion() {
|
||||
make_file="${ROOT}${KV_OUT_DIR}/Makefile"
|
||||
local extraver=$(grep -r "^EXTRAVERSION =" "${make_file}" | cut -d "=" -f 2 | head -n 1)
|
||||
local trimmed=${extraver%% }
|
||||
echo ${trimmed## }
|
||||
}
|
||||
|
||||
_get_release_level() {
|
||||
if [[ -n "${K_WORKAROUND_USE_REAL_EXTRAVERSION}" ]]; then
|
||||
echo "${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}$(_get_real_extraversion)"
|
||||
elif [[ "${KV_MAJOR}${KV_MINOR}" -eq 26 ]]; then
|
||||
echo "${KV_FULL}"
|
||||
elif [[ "${OKV/.*}" = "3" ]] && [[ "${KV_PATCH}" = "0" ]]; then
|
||||
# Linux 3.x support, KV_FULL is set to: 3.0-sablink
|
||||
# need to add another final .0 to the version part
|
||||
echo "${KV_FULL/-/.0-}"
|
||||
else
|
||||
echo "${KV_FULL}"
|
||||
fi
|
||||
}
|
||||
|
||||
nas-kernel_uimage_config() {
|
||||
# Two cases here:
|
||||
# 1. /boot/uImage symlink is broken (pkg_postrm)
|
||||
# 2. /boot/uImage symlink doesn't exist (pkg_postinst)
|
||||
|
||||
if ! has_version app-admin/eselect-uimage; then
|
||||
ewarn "app-admin/eselect-uimage not installed"
|
||||
ewarn "If you are using this tool, please install it"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local uimage_file=$(eselect uimage show --quiet 2> /dev/null)
|
||||
if [ -z "${uimage_file}" ]; then
|
||||
# pick the first listed, sorry!
|
||||
local eselect_list=$(eselect uimage list --quiet 2> /dev/null)
|
||||
if [ -n "${eselect_list}" ]; then
|
||||
eselect uimage set 1
|
||||
else
|
||||
echo
|
||||
ewarn "No more kernels available, you won't be able to boot"
|
||||
echo
|
||||
fi
|
||||
else
|
||||
echo
|
||||
elog "You are currently booting with kernel:"
|
||||
elog "${uimage_file}"
|
||||
elog
|
||||
elog "Use 'eselect uimage' in order to switch between the available ones"
|
||||
echo
|
||||
fi
|
||||
}
|
||||
|
||||
nas-kernel_pkg_postinst() {
|
||||
if _is_kernel_binary; then
|
||||
fstab_file="${ROOT}etc/fstab"
|
||||
einfo "Removing extents option for ext4 drives from ${fstab_file}"
|
||||
# Remove "extents" from /etc/fstab
|
||||
if [ -f "${fstab_file}" ]; then
|
||||
sed -i '/ext4/ s/extents//g' "${fstab_file}"
|
||||
fi
|
||||
|
||||
# Setup newly installed kernel on ARM
|
||||
if use arm; then
|
||||
nas-kernel_uimage_config
|
||||
fi
|
||||
|
||||
kernel-2_pkg_postinst
|
||||
local depmod_r=$(_get_release_level)
|
||||
_update_depmod "${depmod_r}"
|
||||
|
||||
elog "Please report kernel bugs at:"
|
||||
elog "http://bugs.sablink.org"
|
||||
|
||||
elog "The source code of this kernel is located at"
|
||||
elog "=${K_KERNEL_SOURCES_PKG}."
|
||||
elog "Sablink Linux recommends that portage users install"
|
||||
elog "${K_KERNEL_SOURCES_PKG} if you want"
|
||||
elog "to build any packages that install kernel modules"
|
||||
elog "(such as sim-buffalo, etc...)."
|
||||
|
||||
# copy the firmware config for the actual hardware to the right place
|
||||
device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | head -n1 | sed "s/^[^:]*: //")
|
||||
if [ "${K_NASKERNEL_DEVICE}" = "$device" ]; then
|
||||
cp ${ROOT}/etc/fw_env.config.${K_NASKERNEL_NAME} ${ROOT}/etc/fw_env.config
|
||||
fi
|
||||
|
||||
else
|
||||
kernel-2_pkg_postinst
|
||||
fi
|
||||
}
|
||||
|
||||
nas-kernel_pkg_prerm() {
|
||||
if _is_kernel_binary; then
|
||||
mount-boot_pkg_prerm
|
||||
fi
|
||||
}
|
||||
|
||||
nas-kernel_pkg_postrm() {
|
||||
if _is_kernel_binary; then
|
||||
# Setup newly installed kernel on ARM
|
||||
if use arm; then
|
||||
nas-kernel_uimage_config
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# export all the available functions here
|
||||
case ${EAPI:-0} in
|
||||
0|1) extra_export_funcs= ;;
|
||||
*) extra_export_funcs=src_prepare ;;
|
||||
esac
|
||||
|
||||
EXPORT_FUNCTIONS pkg_setup src_unpack ${extra_export_funcs} src_compile src_install pkg_preinst pkg_postinst pkg_prerm pkg_postrm
|
||||
#EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_compile src_install pkg_preinst pkg_postinst pkg_prerm pkg_postrm
|
||||
|
||||
|
||||
|
||||
@@ -1,851 +0,0 @@
|
||||
# Copyright 2004-2010 Sabayon Project
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $
|
||||
|
||||
# @ECLASS-VARIABLE: K_NASPATCHES_VER
|
||||
# @DESCRIPTION:
|
||||
# The version of the sablink patches tarball(s) to apply.
|
||||
# A value of "5" would apply 2.6.12-5 to my-sources-2.6.12.ebuild
|
||||
|
||||
# @ECLASS-VARIABLE: K_NASKERNEL_NAME
|
||||
# @DESCRIPTION:
|
||||
# The kernel name used by the ebuild, it should be the ending ${PN} part
|
||||
# for example, of linux-sablink it is "${PN/${PN/-*}-}" (sablink)
|
||||
K_NASKERNEL_NAME="${K_NASKERNEL_NAME:-${PN/${PN/-*}-}}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_NASKERNEL_URI_CONFIG
|
||||
# @DESCRIPTION:
|
||||
# Set this either to "no" or "yes" depending on the location of the
|
||||
# kernel config files. If they are inside FILESDIR (old location)
|
||||
# leave this option set to "no", otherwise set this to "yes"
|
||||
K_NASKERNEL_URI_CONFIG="${K_NASKERNEL_URI_CONFIG:-no}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_NASKERNEL_SELF_TARBALL_NAME
|
||||
# @DESCRIPTION:
|
||||
# If the main kernel sources tarball is generated in-house and available
|
||||
# on the "sablink" mirror, set this variable to the extension name (see example
|
||||
# below). This will disable ALL the extra/local patches (since they have to
|
||||
# be applied inside the tarball). Moreover, K_NASKERNEL_URI_CONFIG,
|
||||
# K_NASPATCHES_VER, K_NASKERNEL_NAME, K_KERNEL_PATCH_VER will be ignored.
|
||||
# Example:
|
||||
# K_NASKERNEL_SELF_TARBALL_NAME="sablink"
|
||||
# This would generate:
|
||||
# SRC_URI="mirror://sablink/sys-kernel/linux-${PV}+sablink.tar.bz2"
|
||||
K_NASKERNEL_SELF_TARBALL_NAME="${K_NASKERNEL_SELF_TARBALL_NAME:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_NASKERNEL_FORCE_SUBLEVEL
|
||||
# @DESCRIPTION:
|
||||
# Force the rewrite of SUBLEVEL in kernel sources Makefile
|
||||
K_NASKERNEL_FORCE_SUBLEVEL="${K_NASKERNEL_FORCE_SUBLEVEL:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_NASKERNEL_RESET_EXTRAVERSION
|
||||
# @DESCRIPTION:
|
||||
# Force the rewrite of EXTRAVERSION in kernel sources Makefile (setting it to "")
|
||||
K_NASKERNEL_RESET_EXTRAVERSION="${K_NASKERNEL_RESET_EXTRAVERSION:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_NASKERNEL_LONGTERM
|
||||
# @DESCRIPTION:
|
||||
# Consider Kernel stable patchset as longterm (changing URL)
|
||||
K_NASKERNEL_LONGTERM="${K_NASKERNEL_LONGTERM:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_KERNEL_SOURCES_PKG
|
||||
# @DESCRIPTION:
|
||||
# The kernel sources package used to build this kernel binary
|
||||
K_KERNEL_SOURCES_PKG="${K_KERNEL_SOURCES_PKG:-${CATEGORY}/${PN/*-}-sources-${PVR}}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_KERNEL_PATCH_VER
|
||||
# @DESCRIPTION:
|
||||
# If set to "3" for example, it applies the upstream kernel
|
||||
# patch corresponding to patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}.3.bz2
|
||||
# @TODO: deprecate and remove once 2.6.x kernels are retired
|
||||
K_KERNEL_PATCH_VER="${K_KERNEL_PATCH_VER:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_KERNEL_PATCH_HOTFIXES
|
||||
# @DESCRIPTION:
|
||||
# If there is the need to quickly apply patches to the kernel
|
||||
# without bumping the kernel patch tarball (for eg. in case
|
||||
# of just released security fixes), set this variable in your ebuild
|
||||
# pointing to space separated list of patch paths.
|
||||
K_KERNEL_PATCH_HOTFIXES="${K_KERNEL_PATCH_HOTFIXES:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_KERNEL_DINASLE_PR_EXTRAVERSION
|
||||
# @DESCRIPTION:
|
||||
# Set this to "1" if you want to tell kernel-2 eclass to
|
||||
# not use ${PR} in kernel EXTRAVERSION (K_NOUSEPR). Otherwise, set
|
||||
# this to "0" to not set K_NOUSEPR at all.
|
||||
K_KERNEL_DINASLE_PR_EXTRAVERSION="${K_KERNEL_DINASLE_PR_EXTRAVERSION:-1}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_KERNEL_SLOT_USEPVR
|
||||
# @DESCRIPTION:
|
||||
# Set this to "1" if you want to use ${PVR} in SLOT variable, instead of ${PV}
|
||||
# sys-kernel/linux-vserver (vserver-sources) require this. This won't work for
|
||||
# firmware pkgs.
|
||||
K_KERNEL_SLOT_USEPVR="${K_KERNEL_SLOT_USEPVR:-0}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_NASKERNEL_FIRMWARE
|
||||
# @DESCRIPTION:
|
||||
# Set this to "1" if your ebuild is a kernel firmware package
|
||||
K_FIRMWARE_PACKAGE="${K_FIRMWARE_PACKAGE:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_ONLY_SOURCES
|
||||
# @DESCRIPTION:
|
||||
# For every kernel binary package, there is a kernel source package associated
|
||||
# if your ebuild is one of them, set this to "1"
|
||||
K_ONLY_SOURCES="${K_ONLY_SOURCES:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_REQUIRED_LINUX_FIRMWARE_VER
|
||||
# @DESCRIPTION:
|
||||
# Minimum required version of sys-kernel/linux-formware package, if any
|
||||
K_REQUIRED_LINUX_FIRMWARE_VER="${K_REQUIRED_LINUX_FIRMWARE_VER:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_WORKAROUND_SOURCES_COLLISION
|
||||
# @DESCRIPTION:
|
||||
# For kernel binary packages, Workaround file collisions with kernel
|
||||
# sources already providing certain files (like Makefile). Used
|
||||
# by linux-openvz and linux-vserver
|
||||
K_WORKAROUND_SOURCES_COLLISION="${K_WORKAROUND_SOURCES_COLLISION:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_WORKAROUND_USE_REAL_EXTRAVERSION
|
||||
# @DESCRIPTION:
|
||||
# Some kernel sources are shipped with their own EXTRAVERSION and
|
||||
# we're kindly asked to not touch it, if this is your case, set
|
||||
# this variable and depmod will work correctly.
|
||||
K_WORKAROUND_USE_REAL_EXTRAVERSION="${K_WORKAROUND_USE_REAL_EXTRAVERSION:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_GENKERNEL_ARGS
|
||||
# @DESCRIPTION:
|
||||
# Provide extra genkernel arguments using K_GENKERNEL_ARGS
|
||||
K_GENKERNEL_ARGS="${K_GENKERNEL_ARGS-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_NASKERNEL_XLOADER_VER
|
||||
# @DESCRIPTION:
|
||||
# If set to "1.5.1" for example, it downloads the selected version
|
||||
K_NASKERNEL_XLOADER_VER="${K_NASKERNEL_XLOADER_VER:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_NASKERNEL_XLOADER_PATCHES_VER
|
||||
# @DESCRIPTION:
|
||||
# If set to "3" for example, it applies the
|
||||
# patchs corresponding to x-loader-${K_NASKERNEL_XLOADER_VER}
|
||||
K_NASKERNEL_XLOADER_PATCHES_VER="${K_NASKERNEL_XLOADER_PATCHES_VER:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_NASKERNEL_XLOADER_TARGET
|
||||
# @DESCRIPTION:
|
||||
# If set to "omap4430panda_config" for example, it is build for that arch
|
||||
K_NASKERNEL_XLOADER_TARGET="${K_NASKERNEL_XLOADER_TARGET:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_KERNEL_UBOOT_VER
|
||||
# @DESCRIPTION:
|
||||
# If set to "2011.12" for example, it downloads the selected version
|
||||
K_NASKERNEL_UBOOT_VER="${K_NASKERNEL_UBOOT_VER:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_KERNEL_UBOOT_PATCHES_VER
|
||||
# @DESCRIPTION:
|
||||
# If set to "3" for example, it applies the
|
||||
# patchs corresponding to u-boot-${K_NASKERNEL_UBOOT_VER}
|
||||
K_NASKERNEL_UBOOT_PATCHES_VER="${K_NASKERNEL_UBOOT_PATCHES_VER:-}"
|
||||
|
||||
# @ECLASS-VARIABLE: K_NASKERNEL_UBOOT_TARGET
|
||||
# @DESCRIPTION:
|
||||
# If set to "omap4_panda_config" for example, it is build for that arch
|
||||
K_NASKERNEL_UBOOT_TARGET="${K_NASKERNEL_UBOOT_TARGET:-}"
|
||||
|
||||
KERN_INITRAMFS_SEARCH_NAME="${KERN_INITRAMFS_SEARCH_NAME:-initramfs-genkernel*${K_NASKERNEL_NAME}}"
|
||||
|
||||
# Disable deblobbing feature
|
||||
K_DEBLOB_AVAILABLE=0
|
||||
|
||||
inherit eutils kernel-2 mount-boot linux-info
|
||||
|
||||
# from kernel-2 eclass
|
||||
detect_version
|
||||
detect_arch
|
||||
|
||||
DESCRIPTION="Sabayon Linux kernel functions and phases"
|
||||
|
||||
|
||||
K_LONGTERM_URL_STR=""
|
||||
if [ -n "${K_NASKERNEL_LONGTERM}" ]; then
|
||||
K_LONGTERM_URL_STR="/longterm/v${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}"
|
||||
fi
|
||||
|
||||
## kernel-2 eclass settings
|
||||
if [ -n "${K_NASKERNEL_SELF_TARBALL_NAME}" ]; then
|
||||
SRC_URI="mirror://sablink/${CATEGORY}/linux-${PVR}+${K_NASKERNEL_SELF_TARBALL_NAME}.tar.bz2"
|
||||
elif [ -n "${K_NASPATCHES_VER}" ]; then
|
||||
UNIPATCH_STRICTORDER="yes"
|
||||
K_NASPATCHES_PKG="nas-patches-${PV}-${K_NASPATCHES_VER}.tar.bz2"
|
||||
UNIPATCH_LIST="${DISTFILES}/${K_NASPATCHES_PKG}"
|
||||
SRC_URI="${KERNEL_URI}
|
||||
mirror://sablink/${CATEGORY}/linux-nas-patches/${K_NASPATCHES_PKG}"
|
||||
else
|
||||
SRC_URI="${KERNEL_URI}"
|
||||
fi
|
||||
|
||||
if [ -z "${K_NASKERNEL_SELF_TARBALL_NAME}" ]; then
|
||||
if [ -n "${K_KERNEL_PATCH_VER}" ]; then
|
||||
K_PATCH_NAME="patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}.${K_KERNEL_PATCH_VER}.bz2"
|
||||
SRC_URI="${SRC_URI}
|
||||
mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}${K_LONGTERM_URL_STR}/${K_PATCH_NAME}"
|
||||
UNIPATCH_LIST="${DISTDIR}/${K_PATCH_NAME}
|
||||
${UNIPATCH_LIST}"
|
||||
fi
|
||||
fi
|
||||
if [ -n "${K_KERNEL_PATCH_HOTFIXES}" ]; then
|
||||
UNIPATCH_LIST="${K_KERNEL_PATCH_HOTFIXES} ${UNIPATCH_LIST}"
|
||||
fi
|
||||
|
||||
# download x-loader if required (ubuntu is mainly supporterted by TI)
|
||||
if [ -n "${K_NASKERNEL_XLOADER_VER}" ]; then
|
||||
SRC_URI="${SRC_URI}
|
||||
mirror://sablink/${CATEGORY}/linux-nas-patches/x-loader_${K_NASKERNEL_XLOADER_VER}.orig.tar.gz
|
||||
https://launchpad.net/ubuntu/+archive/primary/+files/x-loader_${K_NASKERNEL_XLOADER_VER}.orig.tar.gz"
|
||||
if [ -n "${K_NASKERNEL_XLOADER_PATCHES_VER}" ]; then
|
||||
SRC_URI="${SRC_URI}
|
||||
mirror://sablink/${CATEGORY}/linux-nas-patches/x-loader-patches-${K_NASKERNEL_XLOADER_VER}-${K_NASKERNEL_XLOADER_PATCHES_VER}.tar.bz2"
|
||||
fi
|
||||
fi
|
||||
|
||||
# download u-boot if required
|
||||
if [ -n "${K_NASKERNEL_UBOOT_VER}" ]; then
|
||||
SRC_URI="${SRC_URI}
|
||||
mirror://sablink/${CATEGORY}/linux-nas-patches/u-boot-${K_NASKERNEL_UBOOT_VER}.tar.bz2
|
||||
ftp://ftp.denx.de/pub/u-boot/u-boot-${K_NASKERNEL_UBOOT_VER}.tar.bz2"
|
||||
if [ -n "${K_NASKERNEL_UBOOT_PATCHES_VER}" ]; then
|
||||
SRC_URI="${SRC_URI}
|
||||
mirror://sablink/${CATEGORY}/linux-nas-patches/u-boot-patches-${K_NASKERNEL_UBOOT_VER}-${K_NASKERNEL_UBOOT_PATCHES_VER}.tar.bz2"
|
||||
fi
|
||||
fi
|
||||
|
||||
_get_real_kv_full() {
|
||||
if [[ "${KV_MAJOR}${KV_MINOR}" -eq 26 ]]; then
|
||||
echo "${ORIGINAL_KV_FULL}"
|
||||
elif [[ "${OKV/.*}" = "3" ]]; then
|
||||
# Linux 3.x support, KV_FULL is set to: 3.0-sablink
|
||||
# need to add another final .0 to the version part
|
||||
echo "${ORIGINAL_KV_FULL}"
|
||||
else
|
||||
echo "${ORIGINAL_KV_FULL}"
|
||||
fi
|
||||
}
|
||||
|
||||
# replace "linux" with K_NASKERNEL_NAME, usually replaces
|
||||
# "linux" with "sablink" or "server" or "openvz"
|
||||
KV_FULL="${KV_FULL/${PN/-*}/${K_NASKERNEL_NAME}}"
|
||||
EXTRAVERSION="${EXTRAVERSION/${PN/-*}/${K_NASKERNEL_NAME}}"
|
||||
# drop -rX if exists
|
||||
if [[ -n "${PR//r0}" ]] && [[ "${K_KERNEL_DINASLE_PR_EXTRAVERSION}" = "1" ]] \
|
||||
&& [[ -z "${K_NOSETEXTRAVERSION}" ]]; then
|
||||
EXTRAVERSION="${EXTRAVERSION%-r*}"
|
||||
KV_FULL="${KV_FULL%-r*}"
|
||||
KV="${KV%-r*}"
|
||||
fi
|
||||
# rewrite it
|
||||
ORIGINAL_KV_FULL="${KV_FULL}"
|
||||
KV_FULL="$(_get_real_kv_full)"
|
||||
|
||||
# Starting from linux-3.0, we still have to install
|
||||
# sources stuff into /usr/src/linux-3.0.0-sablink (example)
|
||||
# where the last part must always match uname -r
|
||||
# otherwise kernel-switcher (and RELEASE_LEVEL file)
|
||||
# will complain badly
|
||||
KV_OUT_DIR="/usr/src/linux-${KV_FULL}"
|
||||
S="${WORKDIR}/linux-${KV_FULL}"
|
||||
|
||||
|
||||
if [ -n "${K_FIRMWARE_PACKAGE}" ]; then
|
||||
SLOT="0"
|
||||
elif [ "${K_KERNEL_SLOT_USEPVR}" = "1" ]; then
|
||||
SLOT="${PVR}"
|
||||
else
|
||||
SLOT="${PV}"
|
||||
fi
|
||||
|
||||
_is_kernel_binary() {
|
||||
if [ -z "${K_ONLY_SOURCES}" ] && [ -z "${K_FIRMWARE_PACKAGE}" ]; then
|
||||
# yes it is
|
||||
return 0
|
||||
else
|
||||
# no it isn't
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# provide extra virtual pkg
|
||||
if _is_kernel_binary; then
|
||||
PROVIDE="${PROVIDE} virtual/linux-binary"
|
||||
fi
|
||||
|
||||
if [ -n "${K_NASKERNEL_SELF_TARBALL_NAME}" ]; then
|
||||
HOMEPAGE="http://gitweb.sablink.org/?p=linux/kernel/sablink.git;a=summary"
|
||||
else
|
||||
HOMEPAGE="http://www.sablink.org"
|
||||
fi
|
||||
|
||||
|
||||
# Setup kernel configuration file name
|
||||
if [ -z "${K_NASKERNEL_SELF_TARBALL_NAME}" ]; then
|
||||
if [ "${K_NASKERNEL_URI_CONFIG}" = "yes" ]; then
|
||||
K_NASKERNEL_CONFIG_FILE="${K_NASKERNEL_CONFIG_FILE:-${K_NASKERNEL_NAME}-${PVR}-__ARCH__.config}"
|
||||
K_NASKERNEL_FW_CONFIG_FILE="${K_NASKERNEL_FW_CONFIG_FILE:-${K_NASKERNEL_NAME}-fw_env-__ARCH__.config}"
|
||||
SRC_URI="${SRC_URI}
|
||||
arm? ( mirror://sablink/${CATEGORY}/linux-nas-patches/config/${K_NASKERNEL_CONFIG_FILE/__ARCH__/arm}
|
||||
mirror://sablink/${CATEGORY}/linux-nas-patches/config/${K_NASKERNEL_FW_CONFIG_FILE/__ARCH__/arm} )"
|
||||
use arm && K_NASKERNEL_CONFIG_FILE=${K_NASKERNEL_CONFIG_FILE/__ARCH__/arm}
|
||||
use arm && K_NASKERNEL_FW_CONFIG_FILE=${K_NASKERNEL_FW_CONFIG_FILE/__ARCH__/arm}
|
||||
else
|
||||
use arm && K_NASKERNEL_CONFIG_FILE="${K_NASKERNEL_CONFIG_FILE:-${K_NASKERNEL_NAME}-${PVR}-arm.config}"
|
||||
use arm && K_NASKERNEL_FW_CONFIG_FILE="${K_NASKERNEL_FW_CONFIG_FILE:-${K_NASKERNEL_NAME}-fw_env-arm.config}"
|
||||
fi
|
||||
else
|
||||
K_NASKERNEL_CONFIG_FILE="${K_NASKERNEL_CONFIG_FILE:-${K_NASKERNEL_NAME}-${PVR}-__ARCH__.config}"
|
||||
K_NASKERNEL_ALT_CONFIG_FILE="${K_NASKERNEL_ALT_CONFIG_FILE:-${K_NASKERNEL_NAME}-${PV}-__ARCH__.config}"
|
||||
K_NASKERNEL_FW_CONFIG_FILE="${K_NASKERNEL_FW_CONFIG_FILE:-${K_NASKERNEL_NAME}-fw_env-__ARCH__.config}"
|
||||
if use arm; then
|
||||
K_NASKERNEL_CONFIG_FILE=${K_NASKERNEL_CONFIG_FILE/__ARCH__/arm}
|
||||
K_NASKERNEL_ALT_CONFIG_FILE=${K_NASKERNEL_ALT_CONFIG_FILE/__ARCH__/arm}
|
||||
K_NASKERNEL_FW_CONFIG_FILE=${K_NASKERNEL_FW_CONFIG_FILE/__ARCH__/arm}
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "${K_ONLY_SOURCES}" ] || [ -n "${K_FIRMWARE_PACKAGE}" ]; then
|
||||
IUSE="${IUSE}"
|
||||
DEPEND="sys-apps/sed"
|
||||
RDEPEND="${RDEPEND}"
|
||||
else
|
||||
IUSE="dmraid dracut ccache"
|
||||
DEPEND="app-arch/xz-utils
|
||||
sys-apps/sed
|
||||
sys-devel/make
|
||||
>=sys-kernel/genkernel-3.4.16-r1
|
||||
dracut? ( sys-kernel/dracut )
|
||||
ccache? ( dev-util/ccache )
|
||||
sys-block/devio
|
||||
dev-embedded/u-boot-tools
|
||||
sys-fs/dosfstools"
|
||||
RDEPEND="sys-apps/sed
|
||||
sys-kernel/linux-firmware"
|
||||
if [ -n "${K_REQUIRED_LINUX_FIRMWARE_VER}" ]; then
|
||||
RDEPEND+=" >=sys-kernel/linux-firmware-${K_REQUIRED_LINUX_FIRMWARE_VER}"
|
||||
fi
|
||||
fi
|
||||
|
||||
# internal function
|
||||
#
|
||||
# FUNCTION: _update_depmod
|
||||
# @USAGE: _update_depmod <-r depmod>
|
||||
# DESCRIPTION:
|
||||
# It updates the modules.dep file for the current kernel.
|
||||
# This is more or less the same of linux-mod update_depmod, with the
|
||||
# exception of accepting parameter which is passed to depmod -r switch
|
||||
_update_depmod() {
|
||||
|
||||
# if we haven't determined the version yet, we need too.
|
||||
get_version;
|
||||
|
||||
ebegin "Updating module dependencies for ${KV_FULL}"
|
||||
if [ -r "${KV_OUT_DIR}"/System.map ]; then
|
||||
depmod -ae -F "${KV_OUT_DIR}"/System.map -b "${ROOT}" -r "${1}"
|
||||
eend $?
|
||||
else
|
||||
ewarn
|
||||
ewarn "${KV_OUT_DIR}/System.map not found."
|
||||
ewarn "You must manually update the kernel module dependencies using depmod."
|
||||
eend 1
|
||||
ewarn
|
||||
fi
|
||||
}
|
||||
|
||||
nas-kernel_pkg_setup() {
|
||||
if [ -n "${K_FIRMWARE_PACKAGE}" ]; then
|
||||
einfo "Preparing kernel firmwares"
|
||||
else
|
||||
einfo "Preparing kernel and its modules"
|
||||
fi
|
||||
}
|
||||
|
||||
nas-kernel_src_unpack() {
|
||||
local okv="${OKV}"
|
||||
if [ -n "${K_NASKERNEL_SELF_TARBALL_NAME}" ]; then
|
||||
OKV="${PVR}+${K_NASKERNEL_SELF_TARBALL_NAME}"
|
||||
fi
|
||||
kernel-2_src_unpack
|
||||
if [ -n "${K_NASKERNEL_FORCE_SUBLEVEL}" ]; then
|
||||
# patch out Makefile with proper sublevel
|
||||
sed -i "s:^SUBLEVEL = .*:SUBLEVEL = ${K_NASKERNEL_FORCE_SUBLEVEL}:" \
|
||||
"${S}/Makefile" || die
|
||||
fi
|
||||
if [ -n "${K_NASKERNEL_RESET_EXTRAVERSION}" ]; then
|
||||
sed -i "s:^EXTRAVERSION =.*:EXTRAVERSION = :" "${S}/Makefile" || die
|
||||
# some sources could have multiple append-based EXTRAVERSIONs
|
||||
sed -i "s/^EXTRAVERSION :=.*//" "${S}/Makefile" || die
|
||||
fi
|
||||
sed -i "s:\$(CKVERSION)::" "${S}/Makefile" || die
|
||||
OKV="${okv}"
|
||||
|
||||
# unpack x-loader if required
|
||||
if [ -n "${K_NASKERNEL_XLOADER_VER}" ]; then
|
||||
pushd ${WORKDIR}
|
||||
unpack x-loader-${K_NASKERNEL_XLOADER_VER}.orig.tar.gz
|
||||
if [ -n "${K_NASKERNEL_XLOADER_PATCHES_VER}" ]; then
|
||||
unpack x-loader-patches-${K_NASKERNEL_XLOADER_VER}-${K_NASKERNEL_XLOADER_PATCHES_VER}.tar.bz2
|
||||
fi
|
||||
popd
|
||||
fi
|
||||
|
||||
# unpack u-boot if required
|
||||
if [ -n "${K_NASKERNEL_UBOOT_VER}" ]; then
|
||||
pushd ${WORKDIR}
|
||||
unpack u-boot-${K_NASKERNEL_UBOOT_VER}.tar.bz2
|
||||
if [ -n "${K_NASKERNEL_UBOOT_PATCHES_VER}" ]; then
|
||||
unpack u-boot-patches-${K_NASKERNEL_UBOOT_VER}-${K_NASKERNEL_UBOOT_PATCHES_VER}.tar.bz2
|
||||
fi
|
||||
popd
|
||||
fi
|
||||
}
|
||||
|
||||
nas-kernel_src_compile() {
|
||||
if [ -n "${K_FIRMWARE_PACKAGE}" ]; then
|
||||
_firmwares_src_compile
|
||||
elif [ -n "${K_ONLY_SOURCES}" ]; then
|
||||
kernel-2_src_compile
|
||||
else
|
||||
_kernel_src_compile
|
||||
fi
|
||||
}
|
||||
|
||||
_firmwares_src_compile() {
|
||||
einfo "Starting to compile firmwares..."
|
||||
_kernel_copy_config "${S}/.config"
|
||||
cd "${S}" || die "cannot find source dir"
|
||||
|
||||
export LDFLAGS=""
|
||||
OLDARCH="${ARCH}"
|
||||
unset ARCH
|
||||
emake firmware || die "cannot compile firmwares"
|
||||
ARCH="${OLDARCH}"
|
||||
}
|
||||
|
||||
_kernel_copy_config() {
|
||||
if [ -n "${K_NASKERNEL_SELF_TARBALL_NAME}" ]; then
|
||||
local base_path="${S}/sablink/config"
|
||||
if [ -f "${base_path}/${K_NASKERNEL_ALT_CONFIG_FILE}" ]; then
|
||||
# new path, without revision
|
||||
cp "${base_path}/${K_NASKERNEL_ALT_CONFIG_FILE}" "${1}" || die "cannot copy kernel config"
|
||||
else
|
||||
# PVR path (old)
|
||||
cp "${base_path}/${K_NASKERNEL_CONFIG_FILE}" "${1}" || die "cannot copy kernel config"
|
||||
fi
|
||||
else
|
||||
if [ "${K_NASKERNEL_URI_CONFIG}" = "no" ]; then
|
||||
cp "${FILESDIR}/${PF/-r0/}-${ARCH}.config" "${1}" || die "cannot copy kernel config"
|
||||
else
|
||||
cp "${DISTDIR}/${K_NASKERNEL_CONFIG_FILE}" "${1}" || die "cannot copy kernel config"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
_kernel_src_compile() {
|
||||
# disable sandbox
|
||||
export SANDBOX_ON=0
|
||||
|
||||
# creating workdirs
|
||||
# some kernels fail with make 3.82 if firmware dir is not created
|
||||
mkdir "${WORKDIR}"/lib/lib/firmware -p
|
||||
mkdir "${WORKDIR}"/cache
|
||||
mkdir "${S}"/temp
|
||||
|
||||
# needed anyway, even if grub use flag is not used here
|
||||
mkdir -p "${WORKDIR}"/boot
|
||||
|
||||
# compile x-loader if required
|
||||
if [ -n "${K_NASKERNEL_XLOADER_VER}" ]; then
|
||||
einfo "Starting to compile X Loader..."
|
||||
pushd "${WORKDIR}/x-loader-${K_NASKERNEL_XLOADER_VER}"
|
||||
if [ -n "${K_NASKERNEL_XLOADER_PATCHES_VER}" ]; then
|
||||
EPATCH_SOURCE="${WORKDIR}/x-loader-patches" EPATCH_SUFFIX="patch" \
|
||||
EPATCH_FORCE="yes" epatch
|
||||
fi
|
||||
if [ -n "${CROSS_COMPILE}" ] && [ "${CBUILD:-${CHOST}}" != "${CTARGET}" ]; then
|
||||
einfo "Enabling cross-compile for ${CROSS_COMPILE}, arch: ${KARCH}"
|
||||
emake ARCH=${KARCH} CROSS_COMPILE=${CROSS_COMPILE}- ${K_NASKERNEL_XLOADER_TARGET}
|
||||
emake ARCH=${KARCH} CROSS_COMPILE=${CROSS_COMPILE}-
|
||||
else
|
||||
einfo "Cross-compile is disabled"
|
||||
emake CROSS_COMPILE=${CTARGET}- ${K_NASKERNEL_XLOADER_TARGET}
|
||||
emake CROSS_COMPILE=${CTARGET}-
|
||||
fi
|
||||
popd
|
||||
fi
|
||||
|
||||
# compile u-boot if required
|
||||
if [ -n "${K_NASKERNEL_UBOOT_VER}" ]; then
|
||||
einfo "Starting to compile U Boot..."
|
||||
pushd "${WORKDIR}/u-boot-${K_NASKERNEL_UBOOT_VER}"
|
||||
if [ -n "${K_KERNEL_UBOOT_PATCHES_VER}" ]; then
|
||||
EPATCH_SOURCE="${WORKDIR}/u-boot-patches" EPATCH_SUFFIX="patch" \
|
||||
EPATCH_FORCE="yes" epatch
|
||||
fi
|
||||
if [ -n "${CROSS_COMPILE}" ] && [ "${CBUILD:-${CHOST}}" != "${CTARGET}" ]; then
|
||||
einfo "Enabling cross-compile for ${CROSS_COMPILE}, arch: ${KARCH}"
|
||||
emake ARCH=${KARCH} CROSS_COMPILE=${CROSS_COMPILE}- ${K_NASKERNEL_UBOOT_TARGET}
|
||||
emake ARCH=${KARCH} CROSS_COMPILE=${CROSS_COMPILE}-
|
||||
else
|
||||
einfo "Cross-compile is disabled"
|
||||
emake CROSS_COMPILE=${CTARGET}- ${K_NASKERNEL_UBOOT_TARGET}
|
||||
emake CROSS_COMPILE=${CTARGET}-
|
||||
fi
|
||||
popd
|
||||
fi
|
||||
|
||||
einfo "Starting to compile kernel..."
|
||||
_kernel_copy_config "${WORKDIR}"/config
|
||||
|
||||
# do some cleanup
|
||||
rm -rf "${WORKDIR}"/lib
|
||||
rm -rf "${WORKDIR}"/cache
|
||||
rm -rf "${S}"/temp
|
||||
|
||||
|
||||
cd "${S}" || die
|
||||
GKARGS="--no-save-config --disklabel"
|
||||
use dracut && GKARGS="${GKARGS} --dracut"
|
||||
use dmraid && GKARGS="${GKARGS} --dmraid"
|
||||
export DEFAULT_KERNEL_SOURCE="${S}"
|
||||
export CMD_KERNEL_DIR="${S}"
|
||||
for opt in ${MAKEOPTS}; do
|
||||
if [ "${opt:0:2}" = "-j" ]; then
|
||||
mkopts="${opt}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
[ -z "${mkopts}" ] && mkopts="-j3"
|
||||
|
||||
OLDARCH="${ARCH}"
|
||||
env_setup_xmakeopts
|
||||
[ -n "${xmakeopts}" ] && eval "${xmakeopts}"
|
||||
if [ -n "${CROSS_COMPILE}" ] && [ "${CBUILD:-${CHOST}}" != "${CTARGET}" ]; then
|
||||
einfo "Enabling cross-compile for ${CROSS_COMPILE}, arch: ${KARCH}"
|
||||
GKARGS="${GKARGS} --arch-override=${KARCH}"
|
||||
GKARGS="${GKARGS} --kernel-cross-compile=${CROSS_COMPILE}"
|
||||
GKARGS="${GKARGS} --utils-cross-compile=${CROSS_COMPILE}"
|
||||
# ARCH= must be forced to KARCH
|
||||
ARCH="${KARCH}"
|
||||
else
|
||||
einfo "Cross-compile is disabled"
|
||||
unset CROSS_COMPILE
|
||||
unset ARCH
|
||||
use ccache && GKARGS="${GKARGS} --kernel-cc=/usr/lib/ccache/bin/gcc"
|
||||
fi
|
||||
|
||||
# Buffalo anounced a new box named Pro Live (video transcode streaming)
|
||||
# so the old ls_pro_live has to be split to ls_pro ls_live
|
||||
# for now let it stay but a move schould be done to ls_pro
|
||||
if [ "${K_NASKERNEL_NAME}" = "buffalo_ls_chl" ]; then
|
||||
devio > foo 'wl 0xe3a01c0B,4' 'wl 0xe3811061,4' # Linkstation Live V3 (2.6.34)
|
||||
K_NASKERNEL_TYPE="buffalo"
|
||||
K_NASKERNEL_DEVICE="Buffalo Linkstation LiveV3 (LS-CHL)"
|
||||
fi
|
||||
if [ "${K_NASKERNEL_NAME}" = "buffalo_ls_chl2" ]; then
|
||||
devio > foo 'wl 0xe3a01c0a,4' 'wl 0xe3811067,4' # Linkstation XHL/CHLv2 (2.6.30)
|
||||
K_NASKERNEL_TYPE="buffalo"
|
||||
K_NASKERNEL_DEVICE="Buffalo LS-XHL Series"
|
||||
fi
|
||||
if [ "${K_NASKERNEL_NAME}" = "buffalo_ls_hgl" ]; then
|
||||
devio > foo 'wl 0xe3a01c07,4' 'wl 0xe38110d5,4' # Linkstation HGL (2.6.31)
|
||||
K_NASKERNEL_TYPE="buffalo"
|
||||
K_NASKERNEL_DEVICE="Buffalo Linkstation LS-HGL"
|
||||
fi
|
||||
if [ "${K_NASKERNEL_NAME}" = "buffalo_ls_live" ]; then
|
||||
devio > foo 'wl 0xe3a01c06,4' 'wl 0xe3811031,4' # Linkstation Pro/Live (2.6.26)
|
||||
K_NASKERNEL_TYPE="buffalo"
|
||||
K_NASKERNEL_DEVICE="Buffalo Linkstation Pro/Live"
|
||||
fi
|
||||
if [ "${K_NASKERNEL_NAME}" = "buffalo_ls_mini" ]; then
|
||||
devio > foo 'wl 0xe3a01c07,4' 'wl 0xe3811042,4' # Linkstation mini (2.6.29)
|
||||
K_NASKERNEL_TYPE="buffalo"
|
||||
K_NASKERNEL_DEVICE="Buffalo Linkstation Mini"
|
||||
fi
|
||||
if [ "${K_NASKERNEL_NAME}" = "buffalo_ls_pro" ]; then
|
||||
devio > foo 'wl 0xe3a01c06,4' 'wl 0xe3811031,4' # Linkstation Pro/Live (2.6.26)
|
||||
K_NASKERNEL_TYPE="buffalo"
|
||||
K_NASKERNEL_DEVICE="Buffalo Linkstation Pro/Live"
|
||||
fi
|
||||
if [ "${K_NASKERNEL_NAME}" = "buffalo_ls_pro_duo_rev1" ]; then
|
||||
devio > foo 'wl 0xe3a01c07,4' 'wl 0xe3811027,4' # Linkstation Pro Duo (2.6.30)
|
||||
K_NASKERNEL_TYPE="buffalo"
|
||||
K_NASKERNEL_DEVICE="Buffalo Linkstation Pro Duo - Revision 1"
|
||||
fi
|
||||
if [ "${K_NASKERNEL_NAME}" = "buffalo_ls_pro_duo_rev2" ]; then
|
||||
devio > foo 'wl 0xe3a01c07,4' 'wl 0xe3811027,4' # Linkstation Pro Duo (2.6.30)
|
||||
K_NASKERNEL_TYPE="buffalo"
|
||||
K_NASKERNEL_DEVICE="Buffalo Linkstation Pro Duo - Revision 2"
|
||||
fi
|
||||
if [ "${K_NASKERNEL_NAME}" = "buffalo_ls_vl" ]; then
|
||||
devio > foo 'wl 0xe3a01c0d,4' 'wl 0xe381100a,4' # Linkstation vl (2.6.35)
|
||||
K_NASKERNEL_TYPE="buffalo"
|
||||
K_NASKERNEL_DEVICE="Buffalo LS-VL Series"
|
||||
fi
|
||||
if [ "${K_NASKERNEL_NAME}" = "buffalo_ls_wxl" ]; then
|
||||
devio > foo 'wl 0xe3a01c0b,4' 'wl 0xe38110c4,4' # Linkstation WXL (2.6.35)
|
||||
K_NASKERNEL_TYPE="buffalo"
|
||||
# Broken hardware name needs to be correct in u-boot firmware
|
||||
K_NASKERNEL_DEVICE="Buffalo Linkstation Pro/Live"
|
||||
fi
|
||||
if [ "${K_NASKERNEL_NAME}" = "buffalo_ls_xhl" ]; then
|
||||
devio > foo 'wl 0xe3a01c0a,4' 'wl 0xe3811067,4' # Linkstation XHL/CHLv2 (2.6.30)
|
||||
K_NASKERNEL_TYPE="buffalo"
|
||||
K_NASKERNEL_DEVICE="Buffalo LS-XHL Series"
|
||||
fi
|
||||
|
||||
# Freescale
|
||||
if [ "${K_NASKERNEL_NAME}" = "freescale_mx53_loco" ]; then
|
||||
K_NASKERNEL_TYPE="default"
|
||||
K_NASKERNEL_DEVICE="Freescale MX53 LOCO Board"
|
||||
K_GENKERNEL_ARGS+=" --kernel-target=uImage --kernel-binary=arch/arm/boot/uImage"
|
||||
fi
|
||||
|
||||
unset LDFLAGS
|
||||
DEFAULT_KERNEL_SOURCE="${S}" CMD_KERNEL_DIR="${S}" genkernel ${GKARGS} ${K_GENKERNEL_ARGS} \
|
||||
--kerneldir="${S}" \
|
||||
--kernel-config="${WORKDIR}"/config \
|
||||
--cachedir="${WORKDIR}"/cache \
|
||||
--makeopts="${mkopts}" \
|
||||
--tempdir="${S}"/temp \
|
||||
--logfile="${WORKDIR}"/genkernel.log \
|
||||
--bootdir="${WORKDIR}"/boot \
|
||||
--mountboot \
|
||||
--lvm \
|
||||
--luks \
|
||||
--iscsi \
|
||||
--mdadm \
|
||||
--module-prefix="${WORKDIR}"/lib \
|
||||
all || die "genkernel failed"
|
||||
ARCH=${OLDARCH}
|
||||
|
||||
# Buffalo Boxes have a special naming and start address
|
||||
if [ "${K_NASKERNEL_TYPE}" = "buffalo" ]; then
|
||||
cat foo "${WORKDIR}"/boot/kernel-genkernel-${ARCH}-${KV_FULL} > zImage.new
|
||||
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n uImage-${KV_FULL} \
|
||||
-d zImage.new "${WORKDIR}"/boot/uImage-genkernel-${ARCH}-${KV_FULL}.buffalo
|
||||
mkimage -A arm -O linux -T ramdisk -C none -a 0x00000000 -e 0x00000000 -n initrd-${KV_FULL} \
|
||||
-d "${WORKDIR}"/boot/initramfs-genkernel-${ARCH}-${KV_FULL} "${WORKDIR}"/boot/initrd-genkernel-${ARCH}-${KV_FULL}.buffalo
|
||||
# install u-boot if required
|
||||
if [ -n "${K_NASKERNEL_UBOOT_VER}" ]; then
|
||||
cp "${WORKDIR}"/u-boot-${K_NASKERNEL_UBOOT_VER}/u-boot.bin "${WORKDIR}"/boot/u-boot-${ARCH}-${K_NASKERNEL_UBOOT_VER}.${K_NASKERNEL_NAME}
|
||||
fi
|
||||
fi
|
||||
|
||||
# Default uImage and uInit handling
|
||||
if [ "${K_NASKERNEL_TYPE}" = "default" ]; then
|
||||
cp "${WORKDIR}"/boot/kernel-genkernel-${ARCH}-${KV_FULL} "${WORKDIR}"/boot/uImage-genkernel-${ARCH}-${KV_FULL}
|
||||
mkimage -A arm -O linux -T ramdisk -C none -a 0x00000000 -e 0x00000000 -n initrd-${KV_FULL} \
|
||||
-d "${WORKDIR}"/boot/initramfs-genkernel-${ARCH}-${KV_FULL} "${WORKDIR}"/boot/uInitrd-genkernel-${ARCH}-${KV_FULL}
|
||||
# install u-boot if required
|
||||
if [ -n "${K_NASKERNEL_UBOOT_VER}" ]; then
|
||||
cp "${WORKDIR}"/u-boot-${K_NASKERNEL_UBOOT_VER}/u-boot.bin "${WORKDIR}"/boot/u-boot-${ARCH}-${K_NASKERNEL_UBOOT_VER}.${K_NASKERNEL_NAME}
|
||||
fi
|
||||
fi
|
||||
|
||||
# cleanup
|
||||
rm foo zImage.new
|
||||
rm "${WORKDIR}"/boot/kernel-genkernel-${ARCH}-${KV_FULL} "${WORKDIR}"/boot/initramfs-genkernel-${ARCH}-${KV_FULL}
|
||||
|
||||
}
|
||||
|
||||
nas-kernel_src_install() {
|
||||
if [ -n "${K_FIRMWARE_PACKAGE}" ]; then
|
||||
_firmwares_src_install
|
||||
elif [ -n "${K_ONLY_SOURCES}" ]; then
|
||||
_kernel_sources_src_install
|
||||
else
|
||||
_kernel_src_install
|
||||
fi
|
||||
}
|
||||
|
||||
_firmwares_src_install() {
|
||||
dodir /lib/firmware
|
||||
keepdir /lib/firmware
|
||||
cd "${S}" || die
|
||||
emake INSTALL_FW_PATH="${D}/lib/firmware" firmware_install || die "cannot install firmwares"
|
||||
}
|
||||
|
||||
_kernel_sources_src_install() {
|
||||
local version_h_name="${KV_OUT_DIR/\//}/include/linux"
|
||||
local version_h="${ROOT}${version_h_name}"
|
||||
if [ -f "${version_h}" ]; then
|
||||
einfo "Discarding previously installed version.h to avoid collisions"
|
||||
addwrite "/${version_h_name}"
|
||||
rm -f "${version_h}"
|
||||
fi
|
||||
|
||||
_kernel_copy_config ".config"
|
||||
kernel-2_src_install
|
||||
cd "${D}${KV_OUT_DIR}" || die
|
||||
local oldarch="${ARCH}"
|
||||
unset ARCH
|
||||
if ! use sources_standalone; then
|
||||
make modules_prepare || die "failed to run modules_prepare"
|
||||
rm .config || die "cannot remove .config"
|
||||
rm Makefile || die "cannot remove Makefile"
|
||||
rm include/linux/version.h || die "cannot remove include/linux/version.h"
|
||||
fi
|
||||
ARCH="${oldarch}"
|
||||
}
|
||||
|
||||
_kernel_src_install() {
|
||||
dodir "${KV_OUT_DIR}"
|
||||
insinto "${KV_OUT_DIR}"
|
||||
|
||||
_kernel_copy_config ".config"
|
||||
doins ".config" || die "cannot copy kernel config"
|
||||
doins Makefile || die "cannot copy Makefile"
|
||||
doins Module.symvers || die "cannot copy Module.symvers"
|
||||
doins System.map || die "cannot copy System.map"
|
||||
|
||||
# NOTE: this is a workaround caused by linux-info.eclass not
|
||||
# being ported to EAPI=2 yet
|
||||
local version_h_name="${KV_OUT_DIR/\//}/include/linux"
|
||||
local version_h="${ROOT}${version_h_name}/version.h"
|
||||
if [ -f "${version_h}" ]; then
|
||||
einfo "Discarding previously installed version.h to avoid collisions"
|
||||
addwrite "${version_h}"
|
||||
rm -f "${version_h}"
|
||||
fi
|
||||
|
||||
# Include include/linux/version.h to make Portage happy
|
||||
dodir "${KV_OUT_DIR}/include/linux"
|
||||
insinto "${KV_OUT_DIR}/include/linux"
|
||||
doins "${S}/include/linux/version.h" || die "cannot copy version.h"
|
||||
|
||||
insinto "/boot"
|
||||
doins "${WORKDIR}"/boot/*
|
||||
cp -Rp "${WORKDIR}"/lib/* "${D}/"
|
||||
|
||||
# This doesn't always work because KV_FULL (when K_NOSETEXTRAVERSION=1) doesn't
|
||||
# reflect the real value used in Makefile
|
||||
#dosym "../../..${KV_OUT_DIR}" "/lib/modules/${KV_FULL}/source" || die "cannot install source symlink"
|
||||
#dosym "../../..${KV_OUT_DIR}" "/lib/modules/${KV_FULL}/build" || die "cannot install build symlink"
|
||||
cd "${D}"/lib/modules/* || die "cannot enter /lib/modules directory, more than one element?"
|
||||
# cleanup previous
|
||||
rm -f build source || die
|
||||
# create sane symlinks
|
||||
ln -sf "../../..${KV_OUT_DIR}" source || die "cannot create source symlink"
|
||||
ln -sf "../../..${KV_OUT_DIR}" build || die "cannot create build symlink"
|
||||
cd "${S}" || die
|
||||
|
||||
# drop ${D}/lib/firmware, virtual/linux-firmwares provides it
|
||||
rm -rf "${D}/lib/firmware"
|
||||
|
||||
if [ -n "${K_WORKAROUND_SOURCES_COLLISION}" ]; then
|
||||
# Fixing up Makefile collision if already installed by
|
||||
# openvz-sources
|
||||
einfo "Workarounding source package collisions"
|
||||
make_file="${KV_OUT_DIR/\//}/Makefile"
|
||||
einfo "Makefile: ${make_file}"
|
||||
if [ -f "${ROOT}/${make_file}" ]; then
|
||||
elog "Removing ${D}/${make_file}"
|
||||
rm -f "${D}/${make_file}"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Install kernel configuration information
|
||||
# useful for Entropy kernel-switcher
|
||||
if _is_kernel_binary; then
|
||||
# release level is enough for now
|
||||
base_dir="/etc/kernels/${P}"
|
||||
dodir "${base_dir}"
|
||||
insinto "${base_dir}"
|
||||
echo "${KV_FULL}" > "RELEASE_LEVEL"
|
||||
doins "RELEASE_LEVEL"
|
||||
einfo "Installing ${base_dir}/RELEASE_LEVEL file: ${KV_FULL}"
|
||||
fi
|
||||
|
||||
|
||||
# copy firmware config file to propper location
|
||||
if [ -n "${K_NASKERNEL_SELF_TARBALL_NAME}" ]; then
|
||||
local base_path="${S}/sablink/config"
|
||||
cp "${base_path}/${K_NASKERNEL_FW_CONFIG_FILE}" "${D}/etc/fw_env.config.${K_NASKERNEL_NAME}" || die "cannot copy firmware config"
|
||||
else
|
||||
if [ "${K_NASKERNEL_URI_CONFIG}" = "no" ]; then
|
||||
cp "${FILESDIR}/${PF/-r0/}-${ARCH}.config" "${D}/etc/fw_env.config.${K_NASKERNEL_NAME}" || die "cannot copy firmware config"
|
||||
else
|
||||
cp "${DISTDIR}/${K_NASKERNEL_FW_CONFIG_FILE}" "${D}/etc/fw_env.config.${K_NASKERNEL_NAME}" || die "cannot copy firmware config"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
nas-kernel_pkg_preinst() {
|
||||
if _is_kernel_binary; then
|
||||
mount-boot_pkg_preinst
|
||||
fi
|
||||
}
|
||||
|
||||
_get_real_extraversion() {
|
||||
make_file="${ROOT}${KV_OUT_DIR}/Makefile"
|
||||
local extraver=$(grep -r "^EXTRAVERSION =" "${make_file}" | cut -d "=" -f 2 | head -n 1)
|
||||
local trimmed=${extraver%% }
|
||||
echo ${trimmed## }
|
||||
}
|
||||
|
||||
_get_release_level() {
|
||||
if [[ -n "${K_WORKAROUND_USE_REAL_EXTRAVERSION}" ]]; then
|
||||
echo "${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}$(_get_real_extraversion)"
|
||||
elif [[ "${KV_MAJOR}${KV_MINOR}" -eq 26 ]]; then
|
||||
echo "${KV_FULL}"
|
||||
elif [[ "${OKV/.*}" = "3" ]] && [[ "${KV_PATCH}" = "0" ]]; then
|
||||
# Linux 3.x support, KV_FULL is set to: 3.0-sablink
|
||||
# need to add another final .0 to the version part
|
||||
echo "${KV_FULL/-/.0-}"
|
||||
else
|
||||
echo "${KV_FULL}"
|
||||
fi
|
||||
}
|
||||
|
||||
nas-kernel_pkg_postinst() {
|
||||
if _is_kernel_binary; then
|
||||
fstab_file="${ROOT}etc/fstab"
|
||||
einfo "Removing extents option for ext4 drives from ${fstab_file}"
|
||||
# Remove "extents" from /etc/fstab
|
||||
if [ -f "${fstab_file}" ]; then
|
||||
sed -i '/ext4/ s/extents//g' "${fstab_file}"
|
||||
fi
|
||||
|
||||
kernel-2_pkg_postinst
|
||||
local depmod_r=$(_get_release_level)
|
||||
_update_depmod "${depmod_r}"
|
||||
|
||||
elog "Please report kernel bugs at:"
|
||||
elog "http://bugs.sablink.org"
|
||||
|
||||
elog "The source code of this kernel is located at"
|
||||
elog "=${K_KERNEL_SOURCES_PKG}."
|
||||
elog "Sabayon Linux recommends that portage users install"
|
||||
elog "${K_KERNEL_SOURCES_PKG} if you want"
|
||||
elog "to build any packages that install kernel modules"
|
||||
elog "(such as ati-drivers, nvidia-drivers, virtualbox, etc...)."
|
||||
|
||||
# copy the firmware config for the actual hardware to the right place
|
||||
device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | head -n1 | sed "s/^[^:]*: //")
|
||||
if [ "${K_NASKERNEL_DEVICE}" = "$device" ]; then
|
||||
cp ${ROOT}/etc/fw_env.config.${K_NASKERNEL_NAME} ${ROOT}/etc/fw_env.config
|
||||
fi
|
||||
else
|
||||
kernel-2_pkg_postinst
|
||||
fi
|
||||
}
|
||||
|
||||
nas-kernel_pkg_prerm() {
|
||||
if _is_kernel_binary; then
|
||||
mount-boot_pkg_prerm
|
||||
fi
|
||||
}
|
||||
|
||||
nas-kernel_pkg_postrm() {
|
||||
if _is_kernel_binary; then
|
||||
mount-boot_pkg_postrm
|
||||
fi
|
||||
}
|
||||
|
||||
# export all the available functions here
|
||||
EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_prerm pkg_postrm
|
||||
|
||||
@@ -1,226 +0,0 @@
|
||||
# Copyright 1999-2009 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: lucianm Exp $
|
||||
#
|
||||
# Author:
|
||||
# Lucian Muresan <lucianm AT users DOT sourceforge DOT net>
|
||||
# based upon code from the vdr-plugin.eclass by
|
||||
# Matthias Schwarzott <zzam@gentoo.org>
|
||||
# Joerg Bornkessel <hd_brummy@gentoo.org>
|
||||
|
||||
# orion5x-kernel.eclass
|
||||
#
|
||||
|
||||
inherit kernel-2
|
||||
|
||||
IUSE_ORION_NAS_DEVICES="linkstation_pro_duo linkstation_pro_live linkstation_mini kurobox_pro qnap_ts_109_209 qnap_ts_409 dlink_dns_323 hp_mv2120 ts_78xx_sbc wrt350_v2 terastation_pro_v2 netronix_nh233 maxtor_shared_storage_2"
|
||||
|
||||
DEPEND="${DEPEND}
|
||||
sys-block/devio
|
||||
dev-embedded/u-boot-tools"
|
||||
|
||||
PROVIDE="virtual/linux-sources"
|
||||
|
||||
MY_MACHINE_TYPE=""
|
||||
nasdevice_count=0
|
||||
|
||||
for nasdevice in ${IUSE_ORION_NAS_DEVICES}; do
|
||||
IUSE="${IUSE} orion_nas_devices_${nasdevice}"
|
||||
done
|
||||
|
||||
orion5x-kernel_add_nasdevice() {
|
||||
#: ${nasdevice_count:=0}
|
||||
: $(( nasdevice_count++ ))
|
||||
|
||||
if [[ ${nasdevice_count} -eq 2 ]]; then
|
||||
ewarn
|
||||
ewarn "Only one machine type can be patched after building the zImage!"
|
||||
ewarn "Please select just one of '${IUSE_ORION_NAS_DEVICES}'!"
|
||||
die "Multiple machine types selected"
|
||||
fi
|
||||
|
||||
local dev="${1}"
|
||||
local desc="device ${dev}"
|
||||
if [[ -n "${2}" ]]; then
|
||||
desc="${2}"
|
||||
fi
|
||||
|
||||
einfo "Will patch the zImage for ${desc}"
|
||||
MY_MACHINE_TYPE="${MY_MACHINE_TYPE} ${dev}"
|
||||
}
|
||||
|
||||
orion5x-kernel_patch_help() {
|
||||
einfo ""
|
||||
einfo ""
|
||||
einfo ""
|
||||
einfo "You may add your own patches like this:"
|
||||
einfo ""
|
||||
einfo " - Add the following variable to your /etc/make.conf:"
|
||||
einfo " ORION5X_KERNEL_PATCHES_DIR=\"/path/to/my/patches\""
|
||||
einfo ""
|
||||
einfo " - Create the following subdirectories inside your local patch directory:"
|
||||
einfo " ${PN}/${PV}"
|
||||
einfo ""
|
||||
einfo " - Place your patches ending on *.diff or *.patch in the created"
|
||||
einfo " \"${PV}\" directory, together with a file called \"0_list\" in which you"
|
||||
einfo " list them in the order you want them applied."
|
||||
einfo ""
|
||||
}
|
||||
|
||||
orion5x-kernel_pkg_setup() {
|
||||
kernel-2_pkg_setup
|
||||
|
||||
local nasdevice
|
||||
|
||||
for nasdevice in ${IUSE_ORION_NAS_DEVICES}; do
|
||||
if use orion_nas_devices_${nasdevice}; then
|
||||
orion5x-kernel_add_nasdevice ${nasdevice}
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ ${nasdevice_count} -eq 0 ]]; then
|
||||
ewarn
|
||||
ewarn "You did not select a machine type to be patched after building the zImage!"
|
||||
ewarn "Please set 'ORION_NAS_DEVICES' to just one of '${IUSE_ORION_NAS_DEVICES}'!"
|
||||
die "No Orion machine type selected"
|
||||
fi
|
||||
|
||||
if [ -z "${ORION5X_KERNEL_PATCHES_DIR}" ] ; then
|
||||
orion5x-kernel_patch_help
|
||||
else
|
||||
if ! [ -d "${ORION5X_KERNEL_PATCHES_DIR}/${PN}/${PV}" ] ; then
|
||||
orion5x-kernel_patch_help
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
orion5x-kernel_apply_local_patches() {
|
||||
cd ${S}
|
||||
if test -d "${ORION5X_KERNEL_PATCHES_DIR}/${PN}"; then
|
||||
echo
|
||||
local PATCH_LIST=$(cat ${ORION5X_KERNEL_PATCHES_DIR}/${PN}/${PV}/0_list)
|
||||
einfo "Applying local patches found in"
|
||||
einfo "${ORION5X_KERNEL_PATCHES_DIR}:"
|
||||
# for LOCALPATCH in ${ORION5X_KERNEL_PATCHES_DIR}/${PN}/${PV}/*.{diff,patch}; do
|
||||
# test -f "${LOCALPATCH}" && epatch "${LOCALPATCH}"
|
||||
# done
|
||||
for LOCALPATCH in ${PATCH_LIST}; do
|
||||
cd ${S}
|
||||
test -f "${ORION5X_KERNEL_PATCHES_DIR}/${PN}/${PV}/${LOCALPATCH}" && patch -p 1 < "${ORION5X_KERNEL_PATCHES_DIR}/${PN}/${PV}/${LOCALPATCH}"
|
||||
#test -f "${ORION5X_KERNEL_PATCHES_DIR}/${PN}/${PV}/${LOCALPATCH}" && epatch "${ORION5X_KERNEL_PATCHES_DIR}/${PN}/${PV}/${LOCALPATCH}"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
orion5x-kernel_generate_mach-type_patch(){
|
||||
echo "diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
|
||||
index 25f1230..789190e 100644
|
||||
--- a/arch/arm/boot/Makefile
|
||||
+++ b/arch/arm/boot/Makefile
|
||||
@@ -55,6 +55,10 @@ \$(obj)/compressed/vmlinux: \$(obj)/Image FORCE
|
||||
|
||||
\$(obj)/zImage: \$(obj)/compressed/vmlinux FORCE
|
||||
\$(call if_changed,objcopy)
|
||||
+ devio > foo 'wl 0xe3a01c05,4' 'wl 0xe38110e5,4'
|
||||
+ cat foo \$(obj)/zImage > zImage.new
|
||||
+ mv zImage.new \$(obj)/zImage
|
||||
+ rm foo
|
||||
@echo ' Kernel: \$@ is ready'
|
||||
|
||||
endif" > ${WORKDIR}/force_mach-type.patch
|
||||
}
|
||||
|
||||
orion5x-kernel_src_unpack(){
|
||||
|
||||
kernel-2_src_unpack
|
||||
orion5x-kernel_apply_local_patches
|
||||
|
||||
# create mach-type patch in the working dir, to modify it according to the
|
||||
# set orion nas device
|
||||
orion5x-kernel_generate_mach-type_patch
|
||||
|
||||
if use orion_nas_devices_linkstation_pro_live; then
|
||||
#devio > foo 'wl 0xe3a01c06,4' 'wl 0xe3811031,4' # Linkstation Pro/Live
|
||||
sed -i -e "s:0xe3a01c05,4:0xe3a01c06,4:" ${WORKDIR}/force_mach-type.patch
|
||||
sed -i -e "s:0xe38110e5,4:0xe3811031,4:" ${WORKDIR}/force_mach-type.patch
|
||||
fi
|
||||
|
||||
#if use orion_nas_devices_kurobox_pro; then
|
||||
#nothing to replace for the Kurobox Pro
|
||||
#fi
|
||||
|
||||
if use orion_nas_devices_qnap_ts_109_209; then
|
||||
#devio > foo 'wl 0xe3a01c06,4' 'wl 0xe381101d,4' # QNAP TS-109/TS-209
|
||||
sed -i -e "s:0xe3a01c05,4:0xe3a01c06,4:" ${WORKDIR}/force_mach-type.patch
|
||||
sed -i -e "s:0xe38110e5,4:0xe381101d,4:" ${WORKDIR}/force_mach-type.patch
|
||||
fi
|
||||
|
||||
if use orion_nas_devices_qnap_ts_409; then
|
||||
#devio > foo 'wl 0xe3a01c06,4' 'wl 0xe3811041,4' # QNAP TS-409
|
||||
sed -i -e "s:0xe3a01c05,4:0xe3a01c06,4:" ${WORKDIR}/force_mach-type.patch
|
||||
sed -i -e "s:0xe38110e5,4:0xe3811041,4:" ${WORKDIR}/force_mach-type.patch
|
||||
fi
|
||||
|
||||
if use orion_nas_devices_dlink_dns_323; then
|
||||
#devio > foo 'wl 0xe3a01c06,4' 'wl 0xe3811006,4' # D-Link DNS-323
|
||||
sed -i -e "s:0xe3a01c05,4:0xe3a01c06,4:" ${WORKDIR}/force_mach-type.patch
|
||||
sed -i -e "s:0xe38110e5,4:0xe3811006,4:" ${WORKDIR}/force_mach-type.patch
|
||||
fi
|
||||
|
||||
if use orion_nas_devices_hp_mv2120; then
|
||||
#devio > foo 'wl 0xe3a01c06,4' 'wl 0xe381109d,4' # HP Media Vault MV2120
|
||||
sed -i -e "s:0xe3a01c05,4:0xe3a01c06,4:" ${WORKDIR}/force_mach-type.patch
|
||||
sed -i -e "s:0xe38110e5,4:0xe381109d,4:" ${WORKDIR}/force_mach-type.patch
|
||||
fi
|
||||
|
||||
if use orion_nas_devices_ts_78xx_sbc; then
|
||||
#devio > foo 'wl 0xe3a01c06,4' 'wl 0xe3811074,4' # Technologic Systems TS-78xx SBC
|
||||
sed -i -e "s:0xe3a01c05,4:0xe3a01c06,4:" ${WORKDIR}/force_mach-type.patch
|
||||
sed -i -e "s:0xe38110e5,4:0xe3811074,4:" ${WORKDIR}/force_mach-type.patch
|
||||
fi
|
||||
|
||||
if use orion_nas_devices_maxtor_shared_storage_2; then
|
||||
#devio > foo 'wl 0xe3a01c06,4' 'wl 0xe38110e6,4' # Maxtor Shared Storage II (2.6.27)
|
||||
sed -i -e "s:0xe3a01c05,4:0xe3a01c06,4:" ${WORKDIR}/force_mach-type.patch
|
||||
sed -i -e "s:0xe38110e5,4:0xe38110e6,4:" ${WORKDIR}/force_mach-type.patch
|
||||
fi
|
||||
|
||||
if use orion_nas_devices_wrt350_v2; then
|
||||
#devio > foo 'wl 0xe3a01c06,4' 'wl 0xe3811061,4' # Linksys WRT350N v2
|
||||
sed -i -e "s:0xe3a01c05,4:0xe3a01c06,4:" ${WORKDIR}/force_mach-type.patch
|
||||
sed -i -e "s:0xe38110e5,4:0xe3811061,4:" ${WORKDIR}/force_mach-type.patch
|
||||
fi
|
||||
|
||||
if use orion_nas_devices_linkstation_pro_duo; then
|
||||
#devio > foo 'wl 0xe3a01c07,4' 'wl 0xe3811027,4' # Buffalo Linkstation Pro Duo (Is this right?)
|
||||
sed -i -e "s:0xe3a01c05,4:0xe3a01c07,4:" ${WORKDIR}/force_mach-type.patch
|
||||
sed -i -e "s:0xe38110e5,4:0xe3811027,4:" ${WORKDIR}/force_mach-type.patch
|
||||
fi
|
||||
|
||||
if use orion_nas_devices_linkstation_mini; then
|
||||
#devio > foo 'wl 0xe3a01c07,4' 'wl 0xe3811042,4' # Buffalo Linkstation Mini (Is this right?)
|
||||
sed -i -e "s:0xe3a01c05,4:0xe3a01c07,4:" ${WORKDIR}/force_mach-type.patch
|
||||
sed -i -e "s:0xe38110e5,4:0xe3811042,4:" ${WORKDIR}/force_mach-type.patch
|
||||
fi
|
||||
|
||||
if use orion_nas_devices_terastation_pro_v2; then
|
||||
#devio > foo 'wl 0xe3a01c06,4' 'wl 0xe3811030,4' # Buffalo TS Pro V2 (not yet supported in Vanilla 2.6.26 as of Aug. 10th, 2008)
|
||||
sed -i -e "s:0xe3a01c05,4:0xe3a01c06,4:" ${WORKDIR}/force_mach-type.patch
|
||||
sed -i -e "s:0xe38110e5,4:0xe3811030,4:" ${WORKDIR}/force_mach-type.patch
|
||||
fi
|
||||
|
||||
if use orion_nas_devices_netronix_nh233; then
|
||||
#devio > foo 'wl 0xe3a01c07,4' 'wl 0xe3811065,4' # Netronix NH-233
|
||||
sed -i -e "s:0xe3a01c05,4:0xe3a01c07,4:" ${WORKDIR}/force_mach-type.patch
|
||||
sed -i -e "s:0xe38110e5,4:0xe3811065,4:" ${WORKDIR}/force_mach-type.patch
|
||||
fi
|
||||
|
||||
# finally patch with the correct orion nas device
|
||||
epatch ${WORKDIR}/force_mach-type.patch
|
||||
}
|
||||
|
||||
orion5x-kernel_pkg_postinst(){
|
||||
postinst_sources
|
||||
}
|
||||
|
||||
EXPORT_FUNCTIONS pkg_setup src_unpack pkg_postinst
|
||||
Reference in New Issue
Block a user