add u-boot and x-loader build

This commit is contained in:
Mario Fetka 2011-12-26 18:39:59 +01:00
parent 0533c6d7ea
commit 31419a012d

View File

@ -117,6 +117,38 @@ K_WORKAROUND_USE_REAL_EXTRAVERSION="${K_WORKAROUND_USE_REAL_EXTRAVERSION:-}"
# 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
@ -162,6 +194,28 @@ 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_KERNEL_XLOADER_PATCHES_VER}" ]; then
SRC_URI="${SRC_URI}
mirror://sablink/${CATEGORY}/linux-nas-patches/x-loader-patches-${K_NASKERNEL_XLOADER_VER}-${K_KERNEL_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_KERNEL_UBOOT_PATCHES_VER}" ]; then
SRC_URI="${SRC_URI}
mirror://sablink/${CATEGORY}/linux-nas-patches/u-boot-patches-${K_NASKERNEL_UBOOT_VER}-${K_KERNEL_UBOOT_PATCHES_VER}.tar.bz2"
fi
fi
_get_real_kv_full() {
if [[ "${KV_MAJOR}${KV_MINOR}" -eq 26 ]]; then
echo "${ORIGINAL_KV_FULL}"
@ -265,7 +319,8 @@ else
>=sys-kernel/genkernel-3.4.16-r1
dracut? ( sys-kernel/dracut )
sys-block/devio
dev-embedded/u-boot-tools"
dev-embedded/u-boot-tools
sys-fs/dosfstools"
RDEPEND="sys-apps/sed
sys-kernel/linux-firmware"
if [ -n "${K_REQUIRED_LINUX_FIRMWARE_VER}" ]; then
@ -388,6 +443,44 @@ _kernel_src_compile() {
rm -rf "${WORKDIR}"/cache
rm -rf "${S}"/temp
# compile x-loader if required
if [ -n "${K_NASKERNEL_XLOADER_VER}" ]; then
pushd "${WORKDIR}/x-loader-${K_NASKERNEL_XLOADER_VER}"
if [ -n "${K_KERNEL_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 ${K_NASKERNEL_XLOADER_TARGET}
emake
fi
popd
fi
# compile u-boot if required
if [ -n "${K_NASKERNEL_UBOOT_VER}" ]; then
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 ${K_NASKERNEL_UBOOT_TARGET}
emake
fi
popd
fi
cd "${S}" || die
GKARGS="--no-save-config --disklabel"
use dracut && GKARGS="${GKARGS} --dracut"
@ -500,6 +593,10 @@ _kernel_src_compile() {
-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
# cleanup