update dm800se secondstage loader
[openembedded.git] / recipes / dreambox / dreambox-secondstage.bb
1 DESCRIPTION = "Dreambox second stage bootloader"
2 SECTION = "base"
3 PRIORITY = "required"
4 MAINTAINER = "Felix Domke <tmbinc@elitedvb.net>"
5 PV_dm7020 = "35"
6 PV_dm7025 = "76"
7 PV_dm600pvr = "66"
8 PV_dm500plus = "66"
9 PV_dm8000 = "76"
10 PV_dm800 = "76"
11 PV_dm500hd = "80"
12 PV_dm800se = "80"
13 PV_dm7020hd = "80"
14 PR = "r1"
15 PR_dm8000 = "r2"
16
17 RDEPENDS_dm8000 = "dreambox-bootlogo (>=5.1-r3)"
18
19 SRC_URI = "http://sources.dreamboxupdate.com/download/7020/secondstage-${MACHINE}-${PV}.bin"
20
21 SECONDSTAGE_UPDATE_SRC = "http://sources.dreamboxupdate.com/download/7020/secondstage-${MACHINE}-${PV}.nfi \
22         http://sources.dreamboxupdate.com/download/7020/writenfi-mipsel-2.6.18-r1"
23
24 SRC_URI_append_dm8000 = " ${SECONDSTAGE_UPDATE_SRC}"
25 SRC_URI_append_dm800 = " ${SECONDSTAGE_UPDATE_SRC}"
26 SRC_URI_append_dm500hd = " ${SECONDSTAGE_UPDATE_SRC}"
27 SRC_URI_append_dm800se = " ${SECONDSTAGE_UPDATE_SRC}"
28 SRC_URI_append_dm7020hd = " ${SECONDSTAGE_UPDATE_SRC}"
29
30 S = "${WORKDIR}"
31
32 do_stage() {
33         install -d ${STAGING_LIBDIR}/dreambox-secondstage
34         gzip -c ${S}/secondstage-${MACHINE}-${PV}.bin > ${STAGING_LIBDIR}/dreambox-secondstage/main.bin.gz
35 }
36
37 # the dm{800,8000,500hd,800se,7020hd} secondstage is already compressed (and encrypted)
38
39 do_stage_dm800() {
40         install -d ${STAGING_LIBDIR}/dreambox-secondstage
41         cp ${S}/secondstage-${MACHINE}-${PV}.bin ${STAGING_LIBDIR}/dreambox-secondstage/main.bin.gz
42 }
43
44 do_install_dm800() {
45         install -d ${D}/tmp
46         install ${WORKDIR}/secondstage-${MACHINE}-${PV}.nfi ${D}/tmp/secondstage.nfi
47         install -m 0755 ${WORKDIR}/writenfi-mipsel-2.6.18-r1 ${D}/tmp/writenfi
48 }
49
50 do_stage_dm8000() {
51         do_stage_dm800
52 }
53
54 do_install_dm8000() {
55         do_install_dm800
56 }
57
58 do_stage_dm500hd() {
59         do_stage_dm800
60 }
61
62 do_install_dm500hd() {
63         do_install_dm800
64 }
65
66 do_stage_dm800se() {
67         do_stage_dm8000
68 }
69
70 do_install_dm800se() {
71         do_install_dm800
72 }
73
74 do_stage_dm7020hd() {
75         do_stage_dm8000
76 }
77
78 do_install_dm7020hd() {
79         do_install_dm800
80 }
81
82 FILES_${PN} = "/tmp"
83 PACKAGE_ARCH := "${MACHINE_ARCH}"
84
85 pkg_postinst() {
86         if [ -d /proc/stb ]; then
87                 if [ -f /tmp/writenfi ]; then
88                         /tmp/writenfi /tmp/secondstage.nfi;
89                         rm /tmp/writenfi /tmp/secondstage.nfi;
90                 fi
91         fi
92 }