summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrei Gherzan <andrei@gherzan.ro>2012-11-14 23:49:03 +0200
committerAndrei Gherzan <andrei@gherzan.ro>2012-11-27 22:42:43 +0200
commitc71508dae6ea55fdd20f91fc19d99917d486276e (patch)
tree84ad3f44e4806a728123ad6d2eff955a60916f96
parentcf62711b7cb045ea118c86b42e2d099ea8999047 (diff)
downloadmeta-raspberrypi-c71508dae6ea55fdd20f91fc19d99917d486276e.tar.gz
userland: Initial integration
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
-rwxr-xr-xrecipes-bcm/userland/userland-git/install_vmcs279
-rw-r--r--recipes-bcm/userland/userland_git.bb43
2 files changed, 322 insertions, 0 deletions
diff --git a/recipes-bcm/userland/userland-git/install_vmcs b/recipes-bcm/userland/userland-git/install_vmcs
new file mode 100755
index 0000000..980522e
--- /dev/null
+++ b/recipes-bcm/userland/userland-git/install_vmcs
@@ -0,0 +1,279 @@
1#!/bin/sh
2
3# edit this file only at <vc4>\makefiles\cmake\scripts\install_vmcs
4# update (via root staging area) using cmake {args} <vc4>, etc.
5
6cmd="$0"
7cmd_dir="`dirname -- "$cmd"`"
8cmd_dir=`(cd "$cmd_dir">/dev/null;pwd)`
9cmd_name="`basename -- $cmd`"
10
11# this command should be run as root from ${dir_install}/sbin
12
13dir_install="`dirname -- "$cmd_dir"`"
14dir_data="$dir_install/share/install"
15dir_sd="/sd"
16
17do_force=false
18
19# install contents of $dir_data into the system
20
21if [ "`whoami`" != "root" ]; then
22 echo "$cmd_name: you need to be root to execute this command">&2
23 exit 1
24fi
25
26[ "_$1" = "_-f" -o "_$1" = "_--force" ] && { do_force=true; shift; }
27
28
29# Uninstall script
30
31#################################
32#################################
33
34create_uninstall()
35{ cat <<'EOF'
36#!/bin/sh
37
38####
39#### WARNING: this script is written and overwritten by $cmd - don't edit
40####
41
42cmd="$0"
43cmd_dir="`dirname -- "$cmd"`"
44cmd_dir=`(cd "$cmd_dir">/dev/null;pwd)`
45cmd_name="`basename -- "$cmd"`"
46
47# this command should be run from <dir_install>/sbin
48
49if [ "`whoami`" != "root" ]; then
50 echo "$cmd_name: you need to be root to execute this command">&2
51 exit 1
52fi
53
54# uninstall the new libraries
55
56if [ -f /etc/ld.so.conf.d/vmcs.conf ]; then
57 rm /etc/ld.so.conf.d/vmcs.conf
58 ldconfig
59fi
60
61vcfiled=/etc/init.d/vcfiled
62if [ -x $vcfiled ]; then
63 $vcfiled stop
64 if update-rc.d -f vcfiled remove; then
65 rm -f $vcfiled
66 else
67 echo "$cmd_name: failed to install $vcfiled, sorry">&2
68 fi
69fi
70
71EOF
72}
73
74
75#################################
76#################################
77
78rc=0
79
80# install un-installation script
81
82if [ -f "$cmd_dir/uninstall_vmcs" ]; then
83 if mv -f "$cmd_dir/uninstall_vmcs" "$cmd_dir/uninstall_last_vmcs"; then
84 echo "$cmd_name: previous installation's uninstallation script saved in">&2
85 echo "$cmd_name: $cmd_dir/uninstall_last_vmcs">&2
86 else
87 echo "$cmd_name: failed to rename previous installation's uninstallation script">&2
88 fi
89fi
90create_uninstall > "$cmd_dir/uninstall_vmcs"
91chmod +x "$cmd_dir/uninstall_vmcs"
92
93# install the new libraries
94
95if $do_force || [ -d /etc/ld.so.conf.d ]; then
96 if $do_force || [ ! -f /etc/ld.so.conf.d/vmcs.conf ]; then
97 if [ ! -f "$dir_data/vmcs.conf" ]; then
98 echo "$cmd_name: expected file missing in $dir_data/vmcs.conf">&2
99 rc=1
100 else
101 mkdir -p /etc/ld.so.conf.d
102 cp -af "$dir_data/vmcs.conf" /etc/ld.so.conf.d/vmcs.conf
103 ldconfig
104 fi
105 fi
106else
107 echo "$cmd_name: don't know how to install libraries, sorry">&2
108 rc=2
109fi
110
111# install VC file daemon
112
113if $do_force || [ ! -f /etc/init.d/vcfiled ]; then
114 if [ ! -f "$dir_data/vcfiled" ]; then
115 echo "$cmd_name: expected file missing in $dir_data/vcfiled">&2
116 rc=3
117 else
118 cp -af "$dir_data/vcfiled" /etc/init.d/vcfiled
119 if ! update-rc.d vcfiled defaults 16; then
120 echo "$cmd_name: don't know how to install new /etc/init.d/vcfiled, sorry">&2
121 rc=4
122 elif ! update-rc.d vcfiled enable; then
123 echo "$cmd_name: failed to enable new /etc/init.d/vcfiled, sorry">&2
124 rc=5
125 fi
126 fi
127fi
128
129# make sure vchiq device finder is installed
130
131if $do_force || [ ! -f /etc/init.d/vchiq ]; then
132 if [ ! -f "$dir_data/vchiq" ]; then
133 echo "$cmd_name: expected file missing in $dir_data/vchiq">&2
134 else
135 cp -af "$dir_data/vchiq" /etc/init.d/vchiq
136 if ! update-rc.d vchiq defaults 12; then
137 echo "$cmd_name: don't know how to install new /etc/init.d/vchiq, sorry">&2
138 rc=6
139 elif ! update-rc.d vchiq enable; then
140 echo "$cmd_name: failed to enable new /etc/init.d/vchiq, sorry">&2
141 rc=7
142 fi
143 fi
144fi
145
146# set up a module directory from SD card if possible
147
148current_moddir=/lib/modules
149pkg_moddir=${dir_install}$current_moddir
150sd_moddir=/boot$current_moddir
151
152if [ -h "$pkg_moddir" ]; then
153 # this should never have been made into a symbolic link - it will mean
154 # different things on the ARM and the build machines
155 # Unfortunately a previous version of this script made it symbolic
156 rm "$pkg_moddir"
157 echo "------------------------"
158 echo "$cmd_name: Damage to $pkg_moddir caused by previous script version has"
159 echo "$cmd_name: been corrected. Sorry, but you have to re-build the "
160 echo "$cmd_name: vchiq module now"
161 echo "------------------------"
162fi
163
164if $do_force || [ ! -f "$pkg_moddir" ]; then
165 if [ -d "$sd_moddir" ]; then
166 echo "$cmd_name: Installing any newer modules from SD card"
167 cp -auT "$sd_moddir" "$current_moddir"
168 fi
169fi
170
171# install the vchiq module from install dir (if present)
172
173current_mod=${current_moddir}/`uname -r`/extra/vchiq.ko
174pkg_mod=${dir_install}$current_mod
175
176if [ -f "$pkg_mod" ]; then
177 if $do_force || \
178 [ ! -f "$current_mod" ] || \
179 [ "$pkg_mod" -nt "$current_mod" ]; then
180 mkdir -p "`dirname -- "$current_mod"`"
181 # copy new vchiq module over - try to keep same date for debugging
182 if cp -af "$pkg_mod" "$current_mod"; then
183 echo "$cmd_name: updated vchiq module taken from $pkg_moddir">&2
184 else
185 echo "$cmd_name: couldn't overwrite $current_mod">&2
186 rc=8
187 fi
188 fi
189fi
190
191if [ ! -f "$current_mod" ]; then
192 echo "$cmd_name: no vchiq module found for this kernel (`uname -r`)">&2
193 rc=9
194else
195 # make sure the module is loaded automatically when we reboot
196 # before the vcqhiq script runs by placing its name in /etc/modules
197 # (This is suppose to have been done already in mklinux)
198 if ! grep "^vchiq$" /etc/modules>/dev/null; then
199 echo vchiq >> /etc/modules
200 fi
201fi
202
203if $do_force || [ ! -f "${current_moddir}/`uname -r`/modules.dep" ]; then
204 depmod
205fi
206
207# install vlls
208
209if $do_force || [ ! -f "$dir_sd/vlls" ]; then
210 if [ -d /boot/vlls/ ]; then
211 # remove $dir_sd/vlls assuming it is a symbolic link
212 rm -f "$dir_sd/vlls"
213 ln -s /boot/vlls "$dir_sd/vlls"
214 else
215 echo "$cmd_name: Warning - no VLLs in $dir_sd/vlls">&2
216 echo "$cmd_name: installation would normally link this location to /boot/vlls"
217 echo "$cmd_name: ensure VLLs are present in /boot/vlls (probably the "
218 echo "$cmd_name: DOS partition of your SD card), and rerun this "
219 echo "$cmd_name: installation">&2
220 fi
221fi
222
223# warn about empty media files ... player X needs some
224
225if [ -d "$dir_install/mediafiles/" -a ! -d "$dir_sd/mediafiles" ]; then
226 rm -f "$dir_sd/mediafiles"
227 ln -s "$dir_install/mediafiles" "$dir_sd/mediafiles"
228elif [ ! -d "$dir_sd/mediafiles/" ]; then
229 echo "$cmd_name: warning - $dir_sd/mediafiles does not exist, some applications require this">&2
230else
231 filecount=`ls "$dir_sd/mediafiles/" | wc -l`
232 if [ -z "$filecount" -o $filecount -eq 0 ]; then
233 echo "$cmd_name: warning - /sd/mediafiles is empty, some apps need content">&2
234 fi
235fi
236
237
238# start up anything we rely on
239
240if [ -x /sbin/modprobe -a -f /proc/modules ]; then
241 modprobe -q vchiq
242fi
243
244if [ -x /etc/init.d/vchiq ]; then
245 if ! /etc/init.d/vchiq start; then
246 echo "$cmd_name: /etc/init.d/vchiq failed - rc $?"
247 rc=10
248 fi
249else
250 echo "$cmd_name: couldn't find expected file - /etc/init.d/vchiq">&2
251 rc=11
252fi
253
254if [ -x /etc/init.d/vcfiled ]; then
255 if ! /etc/init.d/vcfiled start; then
256 echo "$cmd_name: /etc/init.d/vcfiled failed - rc $?"
257 rc=12
258 elif ! pidof vcfiled>/dev/null; then
259 echo "$cmd_name: vcfiled daemon not started"
260 if [ ! -x "${dir_install}/sbin/vcfiled" ]; then
261 echo "$cmd_name: ${dir_install}/sbin/vcfiled missing or bad?"
262 rc=13
263 elif ! head -0 /dev/vchiq >/dev/null; then
264 echo "$cmd_name: /dev/vchiq bad?"
265 echo "$cmd_name: vchiq module file information -"
266 ls -l "$current_mod"
267 rc=14
268 else
269 echo "$cmd_name: /etc/init.d/vcfiled bad?"
270 rc=15
271 fi
272 fi
273else
274 echo "$cmd_name: couldn't find expected file - /etc/init.d/vcfiled">&2
275 rc=16
276fi
277
278exit $rc
279
diff --git a/recipes-bcm/userland/userland_git.bb b/recipes-bcm/userland/userland_git.bb
new file mode 100644
index 0000000..c2c6641
--- /dev/null
+++ b/recipes-bcm/userland/userland_git.bb
@@ -0,0 +1,43 @@
1DESCRIPTION = "This repository contains the source code for the ARM side \
2libraries used on Raspberry Pi. These typically are installed in /opt/vc/lib \
3and includes source for the ARM side code to interface to: EGL, mmal, GLESv2,\
4vcos, openmaxil, vchiq_arm, bcm_host, WFC, OpenVG."
5LICENSE = "Broadcom"
6LIC_FILES_CHKSUM = "file://LICENCE;md5=957f6640d5e2d2acfce73a36a56cb32f"
7
8PR = "r0"
9
10PROVIDES = "virtual/libgles2 \
11 virtual/egl"
12COMPATIBLE_MACHINE = "raspberrypi"
13
14SRCREV = "ef62d33406ee01864d58b80f6d0c0355ed86aaa1"
15SRC_URI = "git://github.com/raspberrypi/userland.git;protocol=git;branch=master \
16 file://install_vmcs \
17 "
18S = "${WORKDIR}/git"
19
20inherit cmake
21
22EXTRA_OECMAKE = " \
23 -DCMAKE_BUILD_TYPE=Release \
24 "
25
26do_configure_prepend () {
27 sed -i "/10-vchiq.rules/d" ${S}/interface/vchiq_arm/CMakeLists.txt
28 mkdir -p makefiles/cmake/scripts
29 cp ${WORKDIR}/install_vmcs ${S}/makefiles/cmake/scripts
30}
31
32FILES_${PN} = "/opt/vc/lib/*.so \
33 /opt/vc/sbin \
34 /opt/vc/bin \
35 /etc \
36 "
37FILES_${PN}-dbg += "/opt/vc/lib/.debug \
38 /opt/vc/sbin/.debug \
39 /opt/vc/bin/.debug \
40 "
41FILES_${PN}-dev = "/opt/vc/include/"
42FILES_${PN}-staticdev = "/opt/vc/lib/*.a"
43FILES_${PN}-doc = "/opt/vc/share/" \ No newline at end of file