dreambox-secondstage: update to 11r1
[opendreambox.git] / meta-dreambox / recipes-bsp / dreambox-secondstage / dreambox-secondstage-base.inc
1 SUMMARY = "Dreambox second stage bootloader"
2 SECTION = "base"
3 LICENSE = "CLOSED"
4 PROVIDES = "virtual/bootloader"
5 PRIORITY = "required"
6
7 PRECOMPILED_ARCH ?= "${MACHINE_ARCH}"
8
9 do_install() {
10         install -d ${D}${datadir}/${PN}
11         install -m 0644 secondstage-${PRECOMPILED_ARCH}-${PRECOMPILED_VERSION}.bin ${D}${datadir}/${PN}/secondstage-${PRECOMPILED_ARCH}.bin
12 }
13
14 PACKAGES = "${PN} ${PN}-bin"
15
16 PACKAGE_ARCH := "${MACHINE_ARCH}"
17
18 RDEPENDS_${PN} = "mtd-utils-nandwrite mtd-utils-mtd-debug dreambox-buildimage"
19
20 FILES_${PN} = "${datadir}/${PN}/secondstage-${PRECOMPILED_ARCH}.bin"
21
22 pkg_postinst_${PN}() {
23 if [ -z "$D" ] && grep -q '\<${PRECOMPILED_ARCH}\>' /proc/stb/info/model; then
24         buildimage --arch=${PRECOMPILED_ARCH} --raw ${EXTRA_BUILDCMD} \
25                 --erase-block-size=`mtd_debug info /dev/mtd1 | grep '^mtd\.erasesize' | awk '{print $3}'` \
26                 --sector-size=`mtd_debug info /dev/mtd1 | grep '^mtd\.writesize' | awk '{print $3}'` \
27                 --boot-partition=${DREAMBOX_PART0_SIZE}:${datadir}/${PN}/secondstage-${PRECOMPILED_ARCH}.bin \
28                 > /var/tmp/secondstage.nand
29         mtd_debug erase /dev/mtd1 0 `mtd_debug info /dev/mtd1 | grep '^mtd\.size' | awk '{print $3}'`
30         nandwrite -m -n -o /dev/mtd1 /var/tmp/secondstage.nand
31         sync
32 fi
33 }