summaryrefslogtreecommitdiff
path: root/packages/linux/linux.inc
diff options
context:
space:
mode:
Diffstat (limited to 'packages/linux/linux.inc')
-rw-r--r--packages/linux/linux.inc106
1 files changed, 82 insertions, 24 deletions
diff --git a/packages/linux/linux.inc b/packages/linux/linux.inc
index 3ded7ec467..41b0c13179 100644
--- a/packages/linux/linux.inc
+++ b/packages/linux/linux.inc
@@ -2,25 +2,23 @@ DESCRIPTION = "Linux Kernel"
SECTION = "kernel"
LICENSE = "GPL"
-# These devices need mkimage to generate a kernel image
-DEPENDS_kb9202 = "u-boot-mkimage-openmoko-native"
-DEPENDS_at32stk1000 = "u-boot-mkimage-openmoko-native"
-DEPENDS_atngw100 = "u-boot-mkimage-openmoko-native"
-DEPENDS_at91sam9263ek = "u-boot-mkimage-openmoko-native"
-DEPENDS_sarge-at91 = "u-boot-mkimage-openmoko-native"
-
inherit kernel
-KERNEL_IMAGETYPE_alix = "bzImage"
-KERNEL_IMAGETYPE_progear = "bzImage"
-KERNEL_IMAGETYPE_simpad = "zImage"
-KERNEL_IMAGETYPE_kb9202 = "uImage"
-KERNEL_IMAGETYPE_atngw100 = "uImage"
-KERNEL_IMAGETYPE_at32stk1000 = "uImage"
-KERNEL_IMAGETYPE_at91sam9263ek = "uImage"
-KERNEL_IMAGETYPE_sarge-at91 = "uImage"
+# These devices need mkimage to generate a kernel image
+DEPENDS_append_kb9202 = " u-boot-mkimage-openmoko-native "
+DEPENDS_append_at32stk1000 = " u-boot-mkimage-openmoko-native "
+DEPENDS_append_atngw100 = " u-boot-mkimage-openmoko-native "
+DEPENDS_append_at91sam9263ek = " u-boot-mkimage-openmoko-native "
+DEPENDS_append_at91sam9261ek = " u-boot-mkimage-openmoko-native "
+DEPENDS_append_at91sam9260ek = " u-boot-mkimage-openmoko-native "
+DEPENDS_append_sarge-at91 = " u-boot-mkimage-openmoko-native "
+DEPENDS_append_gumstix-connex = " u-boot-mkimage-openmoko-native "
+DEPENDS_append_gumstix-verdex = " u-boot-mkimage-openmoko-native "
+DEPENDS_append_fic-gta01 = " u-boot-mkimage-openmoko-native "
+DEPENDS_append_fic-gta02 = " u-boot-mkimage-openmoko-native "
+
-# Specify the commandline for you device here:
+# Specify the commandline for your device
#boot from mmc
CMDLINE_at91sam9263ek = "mem=64M console=ttyS0,115200 root=/dev/mmcblk0p1 rootfstype=ext2 rootdelay=5"
@@ -30,7 +28,19 @@ CMDLINE_at91sam9263ek = "mem=64M console=ttyS0,115200 root=/dev/mmcblk0p1 rootfs
do_configure_prepend() {
echo "" > ${S}/.config
- if [ "${TARGET_OS}" == "linux-gnueabi" -o "${TARGET_OS}" == "linux-uclibcgnueabi" ]; then
+ #
+ # logo support, if you supply logo_linux_clut224.ppm in SRC_URI, then it's going to be used
+ #
+ if [ -e ${WORKDIR}/logo_linux_clut224.ppm ]; then
+ install -m 0644 ${WORKDIR}/logo_linux_clut224.ppm drivers/video/logo/logo_linux_clut224.ppm
+ echo "CONFIG_LOGO=y" >> ${S}/.config
+ echo "CONFIG_LOGO_LINUX_CLUT224=y" >> ${S}/.config
+ fi
+
+ #
+ # oabi / eabi support
+ #
+ if [ "${TARGET_OS}" = "linux-gnueabi" -o "${TARGET_OS}" = "linux-uclibcgnueabi" ]; then
echo "CONFIG_AEABI=y" >> ${S}/.config
echo "CONFIG_OABI_COMPAT=y" >> ${S}/.config
else
@@ -43,11 +53,49 @@ do_configure_prepend() {
sed -e '/CONFIG_AEABI/d' \
-e '/CONFIG_OABI_COMPAT=/d' \
-e '/CONFIG_CMDLINE=/d' \
+ -e '/CONFIG_LOGO=/d' \
+ -e '/CONFIG_LOGO_LINUX_CLUT224=/d' \
< '${WORKDIR}/defconfig' >>'${S}/.config'
+ #
+ # root-over-nfs-over-usb-eth support. Limited, but should cover some cases.
+ # Enable this by setting a proper CMDLINE_NFSROOT_USB.
+ #
+ if [ ! -z "${CMDLINE_NFSROOT_USB}" ]; then
+ oenote "Configuring the kernel for root-over-nfs-over-usb-eth with CMDLINE ${CMDLINE_NFSROOT_USB}"
+ sed -e '/CONFIG_INET/d' \
+ -e '/CONFIG_IP_PNP=/d' \
+ -e '/CONFIG_USB_GADGET=/d' \
+ -e '/CONFIG_USB_GADGET_SELECTED=/d' \
+ -e '/CONFIG_USB_ETH=/d' \
+ -e '/CONFIG_NFS_FS=/d' \
+ -e '/CONFIG_ROOT_NFS=/d' \
+ -e '/CONFIG_CMDLINE=/d' \
+ -i ${S}/.config
+ echo "CONFIG_INET=y" >> ${S}/.config
+ echo "CONFIG_IP_PNP=y" >> ${S}/.config
+ echo "CONFIG_USB_GADGET=y" >> ${S}/.config
+ echo "CONFIG_USB_GADGET_SELECTED=y" >> ${S}/.config
+ echo "CONFIG_USB_ETH=y" >> ${S}/.config
+ echo "CONFIG_NFS_FS=y" >> ${S}/.config
+ echo "CONFIG_ROOT_NFS=y" >> ${S}/.config
+ echo "CONFIG_CMDLINE=\"${CMDLINE_NFSROOT_USB}\"" >> ${S}/.config
+ fi
yes '' | oe_runmake oldconfig
}
+# Support checking the kernel size since some kernels need to reside in partitions
+# with a fixed length or there is a limit in transferring the kernel to memory
+do_sizecheck() {
+ if [ ! -z "${KERNEL_IMAGE_MAXSIZE}" ]; then
+ size=`ls -l arch/${ARCH}/boot/${KERNEL_IMAGETYPE} | awk '{ print $5}'`
+ if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then
+ rm arch/${ARCH}/boot/${KERNEL_IMAGETYPE}
+ die "This kernel (size=$size) is too big for your device. Please reduce the size of the kernel by making more of it modular."
+ fi
+ fi
+}
+
do_install_prepend() {
if test -e arch/${ARCH}/boot/Image ; then
ln -f arch/${ARCH}/boot/Image arch/${ARCH}/boot/uImage
@@ -58,22 +106,32 @@ do_install_prepend() {
fi
}
+UBOOT_ENTRYPOINT ?= "20008000"
+
+KERNEL_IMAGE_BASE_NAME = ${KERNEL_IMAGETYPE}-${PV}-${PR}-${MACHINE}-${DATETIME}
+
do_deploy() {
install -d ${DEPLOY_DIR_IMAGE}
- install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${PV}-${PR}-${MACHINE}-${DATETIME}.bin
+ install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.bin
tar -cvzf ${DEPLOY_DIR_IMAGE}/modules-${KERNEL_RELEASE}-${PR}-${MACHINE}.tgz -C ${D} lib
if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then
- ${OBJCOPY} -O binary -R .note -R .comment -S vmlinux linux.bin
- rm -f linux.bin.gz
- gzip -9 linux.bin
- uboot-mkimage -A ${ARCH} -O linux -T kernel -C gzip -a 20008000 -e 20008000 -n "${DISTRO_NAME} Kernel for ${MACHINE}" -d linux.bin.gz ${DEPLOY_DIR_IMAGE}/uImage-${PV}-${PR}-${MACHINE}-${DATETIME}.bin
- rm -f linux.bin.gz
+ if test -e arch/${ARCH}/boot/compressed/vmlinux ; then
+ ${OBJCOPY} -O binary -R .note -R .comment -S arch/${ARCH}/boot/compressed/vmlinux linux.bin
+ uboot-mkimage -A ${ARCH} -O linux -T kernel -C none -a ${UBOOT_ENTRYPOINT} -e ${UBOOT_ENTRYPOINT} -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin ${DEPLOY_DIR_IMAGE}/uImage-${PV}-${PR}-${MACHINE}-${DATETIME}.bin
+ rm -f linux.bin
+ else
+ ${OBJCOPY} -O binary -R .note -R .comment -S vmlinux linux.bin
+ rm -f linux.bin.gz
+ gzip -9 linux.bin
+ uboot-mkimage -A ${ARCH} -O linux -T kernel -C gzip -a ${UBOOT_ENTRYPOINT} -e ${UBOOT_ENTRYPOINT} -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin.gz ${DEPLOY_DIR_IMAGE}/uImage-${PV}-${PR}-${MACHINE}-${DATETIME}.bin
+ rm -f linux.bin.gz
+ fi
fi
}
do_deploy[dirs] = "${S}"
-addtask prepatch before do_patch after do_unpack
+addtask sizecheck before do_install after do_compile
addtask deploy before do_package after do_install