aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/linux/linux-mtx-3_2.6.15.4.bb
blob: 25ed27ed33787b30de182d648f880c089592f27f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
DESCRIPTION = "Linux kernel for MTX-3 (Surfbox3)"
HOMEPAGE = "http://meshcube.org/meshwiki/"
LICENSE = "GPLv2"
KV = "${PV}"
PR = "r12"

inherit kernel
# therefore
# PROVIDES = "virtual/kernel"

DEPENDS = "u-boot"
RDEPENDS_${PN} = "mtd-utils"

SRC_URI += "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-${KV}.tar.bz2;name=kernel \
	file://00-mtx-3.diff \
	file://01-verbose-and-fatal-mkuboot.diff \
	file://defconfig-mtx-3"

FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/linux-mtx-3-${KV}"

S = "${WORKDIR}/linux-${KV}"


COMPATIBLE_HOST = "arm.*-linux"
COMPATIBLE_MACHINE = "mtx-3"

# overriding default target 'zImage' with U-Boot-Image
# (note: uImage depends on zImage)
# U-Boot's "mkimage" is required for this to work
KERNEL_IMAGETYPE = "uImage"

# overriding default 'boot'
KERNEL_IMAGEDEST = "tmp"

XIP_PHYS_ADDR = "0x00080000"

MTX_KERNEL_NON_PCI_OHCI = "no"

PACKAGE_ARCH = "mtx-3"

do_configure_prepend() {
        install -m 0644 ${WORKDIR}/defconfig-mtx-3 ${S}/.config
	if [ "x${MTX_KERNEL_NON_PCI_OHCI}" == "xyes" ]; then
		echo "CONFIG_USB_NON_PCI_OHCI=y" >> ${S}/.config
	fi
}

do_compile() {

	kernel_do_compile

	# set CONFIG_XIP_KERNEL=y and CONFIG_XIP_PHYS_ADDR=xxxx if commented out, else append it
#        sed -i -e "s/^[#        ]*CONFIG_XIP_KERNEL.*/CONFIG_XIP_KERNEL=y/" \
#                -e "s/^[#       ]*CONFIG_XIP_PHYS_ADDR.*/CONFIG_XIP_PHYS_ADDR=${XIP_PHYS_ADDR}/" .config
#	grep -q "^CONFIG_XIP_PHYS_ADDR=" .config || echo "CONFIG_XIP_PHYS_ADDR=${XIP_PHYS_ADDR}" >>.config

#        oe_runmake xipImage CC="arm-linux-gcc " LD="arm-linux-ld " ARCH="arm"
}

#
# FIXME: we need to find out the proper names and kernel image formats
# used / needed here and then fix the following ...
#

pkg_postinst_kernel() {
if test "x$D" != "x"; then
	exit 1
else
	if test -e /tmp/zImage.flash-${KV}; then
		echo "*** flashing kernel ***"
		flashcp -v /tmp/zImage.flash-${KV} /dev/mtd/2
		echo "*** done. please reboot ***"
	fi
fi
}

FILES_kernel += " /tmp"

do_deploy() {
        install -d ${DEPLOY_DIR_IMAGE}

# uncompressed Image
	install -m 0644 arch/arm/boot/Image ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_NAME}

# xip is probably not very useful for us - text segment reading may be slow on flash and we have enough ram
#	install -m 0644 arch/arm/boot/xipImage ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_NAME}.xip

# old mtx-2 mips
        #install -m 0644 arch/mips/boot/mtx-3.flash.srec ${DEPLOY_DIR}/images/${KERNEL_IMAGE_NAME}.flash.srec
	#install -m 0644 arch/mips/boot/mtx-3.srec ${DEPLOY_DIR}/images/${KERNEL_IMAGE_NAME}.ram.srec
}

SRC_URI[kernel.md5sum] = "cee7c554cec949926cf524ee1def88c9"
SRC_URI[kernel.sha256sum] = "8430e13b08bbfce7963a138658d2192077abce097f210490767f34c8e9cbaa9f"