diff options
author | Andrei Gherzan <andrei@gherzan.ro> | 2012-11-14 23:49:03 +0200 |
---|---|---|
committer | Andrei Gherzan <andrei@gherzan.ro> | 2012-11-27 22:42:43 +0200 |
commit | c71508dae6ea55fdd20f91fc19d99917d486276e (patch) | |
tree | 84ad3f44e4806a728123ad6d2eff955a60916f96 | |
parent | cf62711b7cb045ea118c86b42e2d099ea8999047 (diff) | |
download | meta-raspberrypi-c71508dae6ea55fdd20f91fc19d99917d486276e.tar.gz |
userland: Initial integration
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
-rwxr-xr-x | recipes-bcm/userland/userland-git/install_vmcs | 279 | ||||
-rw-r--r-- | recipes-bcm/userland/userland_git.bb | 43 |
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 | |||
6 | cmd="$0" | ||
7 | cmd_dir="`dirname -- "$cmd"`" | ||
8 | cmd_dir=`(cd "$cmd_dir">/dev/null;pwd)` | ||
9 | cmd_name="`basename -- $cmd`" | ||
10 | |||
11 | # this command should be run as root from ${dir_install}/sbin | ||
12 | |||
13 | dir_install="`dirname -- "$cmd_dir"`" | ||
14 | dir_data="$dir_install/share/install" | ||
15 | dir_sd="/sd" | ||
16 | |||
17 | do_force=false | ||
18 | |||
19 | # install contents of $dir_data into the system | ||
20 | |||
21 | if [ "`whoami`" != "root" ]; then | ||
22 | echo "$cmd_name: you need to be root to execute this command">&2 | ||
23 | exit 1 | ||
24 | fi | ||
25 | |||
26 | [ "_$1" = "_-f" -o "_$1" = "_--force" ] && { do_force=true; shift; } | ||
27 | |||
28 | |||
29 | # Uninstall script | ||
30 | |||
31 | ################################# | ||
32 | ################################# | ||
33 | |||
34 | create_uninstall() | ||
35 | { cat <<'EOF' | ||
36 | #!/bin/sh | ||
37 | |||
38 | #### | ||
39 | #### WARNING: this script is written and overwritten by $cmd - don't edit | ||
40 | #### | ||
41 | |||
42 | cmd="$0" | ||
43 | cmd_dir="`dirname -- "$cmd"`" | ||
44 | cmd_dir=`(cd "$cmd_dir">/dev/null;pwd)` | ||
45 | cmd_name="`basename -- "$cmd"`" | ||
46 | |||
47 | # this command should be run from <dir_install>/sbin | ||
48 | |||
49 | if [ "`whoami`" != "root" ]; then | ||
50 | echo "$cmd_name: you need to be root to execute this command">&2 | ||
51 | exit 1 | ||
52 | fi | ||
53 | |||
54 | # uninstall the new libraries | ||
55 | |||
56 | if [ -f /etc/ld.so.conf.d/vmcs.conf ]; then | ||
57 | rm /etc/ld.so.conf.d/vmcs.conf | ||
58 | ldconfig | ||
59 | fi | ||
60 | |||
61 | vcfiled=/etc/init.d/vcfiled | ||
62 | if [ -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 | ||
69 | fi | ||
70 | |||
71 | EOF | ||
72 | } | ||
73 | |||
74 | |||
75 | ################################# | ||
76 | ################################# | ||
77 | |||
78 | rc=0 | ||
79 | |||
80 | # install un-installation script | ||
81 | |||
82 | if [ -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 | ||
89 | fi | ||
90 | create_uninstall > "$cmd_dir/uninstall_vmcs" | ||
91 | chmod +x "$cmd_dir/uninstall_vmcs" | ||
92 | |||
93 | # install the new libraries | ||
94 | |||
95 | if $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 | ||
106 | else | ||
107 | echo "$cmd_name: don't know how to install libraries, sorry">&2 | ||
108 | rc=2 | ||
109 | fi | ||
110 | |||
111 | # install VC file daemon | ||
112 | |||
113 | if $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 | ||
127 | fi | ||
128 | |||
129 | # make sure vchiq device finder is installed | ||
130 | |||
131 | if $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 | ||
144 | fi | ||
145 | |||
146 | # set up a module directory from SD card if possible | ||
147 | |||
148 | current_moddir=/lib/modules | ||
149 | pkg_moddir=${dir_install}$current_moddir | ||
150 | sd_moddir=/boot$current_moddir | ||
151 | |||
152 | if [ -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 "------------------------" | ||
162 | fi | ||
163 | |||
164 | if $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 | ||
169 | fi | ||
170 | |||
171 | # install the vchiq module from install dir (if present) | ||
172 | |||
173 | current_mod=${current_moddir}/`uname -r`/extra/vchiq.ko | ||
174 | pkg_mod=${dir_install}$current_mod | ||
175 | |||
176 | if [ -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 | ||
189 | fi | ||
190 | |||
191 | if [ ! -f "$current_mod" ]; then | ||
192 | echo "$cmd_name: no vchiq module found for this kernel (`uname -r`)">&2 | ||
193 | rc=9 | ||
194 | else | ||
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 | ||
201 | fi | ||
202 | |||
203 | if $do_force || [ ! -f "${current_moddir}/`uname -r`/modules.dep" ]; then | ||
204 | depmod | ||
205 | fi | ||
206 | |||
207 | # install vlls | ||
208 | |||
209 | if $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 | ||
221 | fi | ||
222 | |||
223 | # warn about empty media files ... player X needs some | ||
224 | |||
225 | if [ -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" | ||
228 | elif [ ! -d "$dir_sd/mediafiles/" ]; then | ||
229 | echo "$cmd_name: warning - $dir_sd/mediafiles does not exist, some applications require this">&2 | ||
230 | else | ||
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 | ||
235 | fi | ||
236 | |||
237 | |||
238 | # start up anything we rely on | ||
239 | |||
240 | if [ -x /sbin/modprobe -a -f /proc/modules ]; then | ||
241 | modprobe -q vchiq | ||
242 | fi | ||
243 | |||
244 | if [ -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 | ||
249 | else | ||
250 | echo "$cmd_name: couldn't find expected file - /etc/init.d/vchiq">&2 | ||
251 | rc=11 | ||
252 | fi | ||
253 | |||
254 | if [ -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 | ||
273 | else | ||
274 | echo "$cmd_name: couldn't find expected file - /etc/init.d/vcfiled">&2 | ||
275 | rc=16 | ||
276 | fi | ||
277 | |||
278 | exit $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 @@ | |||
1 | DESCRIPTION = "This repository contains the source code for the ARM side \ | ||
2 | libraries used on Raspberry Pi. These typically are installed in /opt/vc/lib \ | ||
3 | and includes source for the ARM side code to interface to: EGL, mmal, GLESv2,\ | ||
4 | vcos, openmaxil, vchiq_arm, bcm_host, WFC, OpenVG." | ||
5 | LICENSE = "Broadcom" | ||
6 | LIC_FILES_CHKSUM = "file://LICENCE;md5=957f6640d5e2d2acfce73a36a56cb32f" | ||
7 | |||
8 | PR = "r0" | ||
9 | |||
10 | PROVIDES = "virtual/libgles2 \ | ||
11 | virtual/egl" | ||
12 | COMPATIBLE_MACHINE = "raspberrypi" | ||
13 | |||
14 | SRCREV = "ef62d33406ee01864d58b80f6d0c0355ed86aaa1" | ||
15 | SRC_URI = "git://github.com/raspberrypi/userland.git;protocol=git;branch=master \ | ||
16 | file://install_vmcs \ | ||
17 | " | ||
18 | S = "${WORKDIR}/git" | ||
19 | |||
20 | inherit cmake | ||
21 | |||
22 | EXTRA_OECMAKE = " \ | ||
23 | -DCMAKE_BUILD_TYPE=Release \ | ||
24 | " | ||
25 | |||
26 | do_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 | |||
32 | FILES_${PN} = "/opt/vc/lib/*.so \ | ||
33 | /opt/vc/sbin \ | ||
34 | /opt/vc/bin \ | ||
35 | /etc \ | ||
36 | " | ||
37 | FILES_${PN}-dbg += "/opt/vc/lib/.debug \ | ||
38 | /opt/vc/sbin/.debug \ | ||
39 | /opt/vc/bin/.debug \ | ||
40 | " | ||
41 | FILES_${PN}-dev = "/opt/vc/include/" | ||
42 | FILES_${PN}-staticdev = "/opt/vc/lib/*.a" | ||
43 | FILES_${PN}-doc = "/opt/vc/share/" \ No newline at end of file | ||