ahead of pull bm750 openembeddd vuplus-1.6k
[vuplus_openembedded] / recipes / vuplus / vuplus-bootlogo.bb
1 DESCRIPTION = "Bootlogo support"
2 SECTION = "base"
3 PRIORITY = "required"
4 LICENSE = "proprietary"
5
6 IMAGES_VERSION = "1"
7 BINARY_VERSION = "7"
8
9 PV = "${BINARY_VERSION}.${IMAGES_VERSION}"
10 PR = "r6"
11
12 KERNEL_VERSION = "${@base_contains('PREFERRED_VERSION_linux-${MACHINE}', '2.6.18', '2.6.18', '3.1.1', d)}"
13
14 SRC_URI = "file://bootlogo.mvi file://backdrop.mvi file://bootlogo_wait.mvi file://switchoff.mvi"
15 SRC_URI_append_vuuno = " file://splash_cfe_auto.bin"
16 SRC_URI_append_vuultimo = " file://splash_cfe_auto.bin"
17 SRC_URI_append_vuduo2 = " file://initrd_cfe_auto.bin file://splash_cfe_auto.bin"
18 SRC_URI_append_vusolo2 = " file://initrd_cfe_auto.bin file://splash_cfe_auto.bin"
19
20 S = "${WORKDIR}/"
21
22 MVI = "bootlogo backdrop bootlogo_wait"
23
24 do_install() {
25         install -d ${D}/boot
26         install -d ${D}/usr/share
27         for i in ${MVI}; do
28                 install -m 0755 ${S}/$i.mvi ${D}/usr/share/$i.mvi;
29                 ln -sf /usr/share/$i.mvi ${D}/boot/$i.mvi;
30         done;
31 }
32
33 do_install_vuuno() {
34         install -d ${D}/boot
35         install -d ${D}/usr/share
36         for i in ${MVI}; do
37                 install -m 0755 ${S}/$i.mvi ${D}/usr/share/$i.mvi;
38                 ln -sf /usr/share/$i.mvi ${D}/boot/$i.mvi;
39         done;
40         install -m 0755 ${S}/splash_cfe_auto.bin ${D}/boot/splash_cfe_auto.bin
41 }
42 do_install_vuultimo() {
43         install -d ${D}/boot
44         install -d ${D}/usr/share
45         for i in ${MVI}; do
46                 install -m 0755 ${S}/$i.mvi ${D}/usr/share/$i.mvi;
47                 ln -sf /usr/share/$i.mvi ${D}/boot/$i.mvi;
48         done;
49         install -m 0755 ${S}/vmlinuz.initrd ${D}/boot/vmlinuz.initrd
50         install -m 0755 ${S}/splash_cfe_auto.bin ${D}/boot/splash_cfe_auto.bin
51 }
52 do_install_vuduo2() {
53         install -d ${D}/boot
54         install -d ${D}/usr/share
55         for i in ${MVI}; do
56                 install -m 0755 ${S}/$i.mvi ${D}/usr/share/$i.mvi;
57                 ln -sf /usr/share/$i.mvi ${D}/boot/$i.mvi;
58         done;
59         install -m 0755 ${S}/initrd_cfe_auto.bin ${D}/boot/initrd_cfe_auto.bin
60         install -m 0755 ${S}/splash_cfe_auto.bin ${D}/boot/splash_cfe_auto.bin
61 }
62 do_install_vusolo2() {
63         install -d ${D}/boot
64         install -d ${D}/usr/share
65         for i in ${MVI}; do
66                 install -m 0755 ${S}/$i.mvi ${D}/usr/share/$i.mvi;
67                 ln -sf /usr/share/$i.mvi ${D}/boot/$i.mvi;
68         done;
69         install -m 0755 ${S}/initrd_cfe_auto.bin ${D}/boot/initrd_cfe_auto.bin
70         install -m 0755 ${S}/splash_cfe_auto.bin ${D}/boot/splash_cfe_auto.bin
71 }
72
73 pkg_preinst() {
74         if [ "${KERNEL_VERSION}" = "2.6.18" ]; then
75                 [ -d /proc/stb ] && mount -o rw,remount /boot
76         fi
77 }
78
79 pkg_postinst() {
80         if [ "${KERNEL_VERSION}" = "2.6.18" ]; then
81                 [ -d /proc/stb ] && mount -o ro,remount /boot
82         fi
83 }
84
85 pkg_prerm() {
86         if [ "${KERNEL_VERSION}" = "2.6.18" ]; then
87                 [ -d /proc/stb ] && mount -o rw,remount /boot
88         fi
89 }
90
91 pkg_postrm() {
92         if [ "${KERNEL_VERSION}" = "2.6.18" ]; then
93                 [ -d /proc/stb ] && mount -o ro,remount /boot
94         fi
95 }
96
97 PACKAGE_ARCH := "${MACHINE_ARCH}"
98 FILES_${PN} = "/boot /usr/share"