aboutsummaryrefslogtreecommitdiffstats
path: root/packages/linux/unslung-kernel_2.4.22.l2.3r63.bb
blob: 2a61d61307ec063783e1a0599f3e7bf94cf31f30 (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
SECTION = "kernel"
DESCRIPTION = "Unslung kernel for the Linksys NSLU2 device"
LICENSE = "GPL"
MAINTAINER = "NSLU2 Linux <www.nlsu2-linux.org>"
PR = "r1"

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

KERNEL_IMAGETYPE = "zImage"
KERNEL_SUFFIX = "unslung"

DEPENDS += "nslu2-linksys-firmware"

python () {
	# Don't build unslung kernel unless we're targeting an nslu2
	mach = bb.data.getVar("MACHINE", d, 1)
	if mach != 'nslu2':
		raise bb.parse.SkipPackage("Unslung only builds for the Linksys NSLU2")
}

do_deploy() {
	cp ${STAGING_LIBDIR}/nslu2-binaries/vmlinuz vmlinuz
	dd if=vmlinuz bs=1 count=11732 > vmlinuh
	dd if=vmlinuz bs=1 skip=11732 count=975109 | gzip -dc > vmlinux
	dd if=vmlinuz bs=1 skip=986841 > vmlinut
	cat vmlinux | sed \
		-e 's/ram0/slug/' \
		-e 's/\x01\x31\x2c\xff/\x00\x1e\x84\x7f/' \
			| gzip -9 -c > vmlinux.gz
#		-e 's/flash_sda\x00/hdd_sda\x00\x00\x00/' \
# 		-e 's/flash_\x00/hdd_\x00\x00\x00/' \
#		-e 's/flash_sd%c\x00/hdd_sd%c\x00\x00\x00/' \
	cat vmlinuh vmlinux.gz vmlinut > vmlinuz
#	dd if=/dev/zero of=padding bs=1 count=9
#	cat vmlinuh vmlinux.gz padding vmlinut > vmlinuz
        install -d ${DEPLOY_DIR}/images
        install -m 0644 vmlinuz ${DEPLOY_DIR}/images/${KERNEL_IMAGETYPE}-${KERNEL_SUFFIX}
}

do_deploy[dirs] = "${S}"

addtask deploy before do_build after do_compile