dreambox-bootlogo: remove legacy recipes
[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 PRECOMPILED_VERSION ?= "${PV}"
9
10 do_install() {
11         install -d ${D}${datadir}/${PN}
12         install -m 0644 secondstage-${PRECOMPILED_ARCH}-${PRECOMPILED_VERSION}.bin ${D}${datadir}/${PN}/secondstage.bin
13 }
14
15 PACKAGES = "${PN} ${PN}-bin"
16
17 PACKAGE_ARCH := "${MACHINE_ARCH}"
18
19 RDEPENDS_${PN} = "mtd-utils-nandwrite mtd-utils-mtd-debug dreambox-buildimage"
20
21 FILES_${PN} = "${datadir}/${PN}/secondstage.bin"
22
23 pkg_postinst_${PN}() {
24 if [ -z "$D" ] && grep -q '\<${PRECOMPILED_ARCH}\>' /proc/stb/info/model; then
25         buildimage --arch=${PRECOMPILED_ARCH} --raw ${EXTRA_BUILDCMD} \
26                 --erase-block-size=`mtd_debug info /dev/mtd1 | grep '^mtd\.erasesize' | awk '{print $3}'` \
27                 --sector-size=`mtd_debug info /dev/mtd1 | grep '^mtd\.writesize' | awk '{print $3}'` \
28                 --boot-partition=${DREAMBOX_PART0_SIZE}:${datadir}/${PN}/secondstage.bin \
29                 > /var/tmp/secondstage.nand
30         mtd_debug erase /dev/mtd1 0 `mtd_debug info /dev/mtd1 | grep '^mtd\.size' | awk '{print $3}'`
31         nandwrite -m -n -o /dev/mtd1 /var/tmp/secondstage.nand
32         sync
33 fi
34 }