Saturday, December 21, 2013

Raspberrypi-userland

 Building a new package called raspberrypi-userland package. The files are located in this site.

RPM BUILDING

With the help of Adam Pensrose's spec file I mange to create a spec file with global commands. The build was successful and there were no errors encountered.

RPM LINT

Using rpmlint command, I checked for errors and found a couple. I fixed them and did the packaging process again.

ARCH

The architecture that I am building it on is on f17, for my next blog I will build the package in the arm architecture (Pi).

Files and Links
Spec file
Source RPM (tar.gz)








Sunday, December 15, 2013

Raspberrypi-vc Packaging (Final Release)

Changing the package 'raspberrypi-vc' to build from source is very complicated (for me). As I reach the deadline, here's what I tried to accomplish and the challenges I faced:

1.) I always look the original spec file from agreene and I would say, at first I did not understand most of what was there. Because of that, I did not know how to start my project (I thought it was a simple 'kind-of-a-lab' project but it isn't) which is a problem. I did talk with Chris and told me to start off from scratch and so I did but then I got stuck.

2.) As I build the package from a skeleton spec with everything almost empty, I looked everywhere for a make file or anything with a script (python mostly) just to be able to build it but there was none. I looked at almost all of the packages in the project and everything includes a make file or something to put in the %build section and it makes it really easier. As for mine, I found none for raspberrypi-vc package except when I looked inside the hello_pi directory(I found the rebuild.sh, a python script). It shed some light but I faced another challenge.

3.)  I edited the spec file to include the rebuild.sh and I got errors that says some files where missing. I addressed the issue by editing the makefile through the specfile and adding the specific directory on where to find it (I put this in %build section sed -i -e '1iSDKSTAGE=/home/jfgiagonia/rpmbuild/BUILD/raspberrypi-firmware-4c14569/hardfp\' Makefile.include). The file could not be found issue is fixed but again another issue came up.

4.)  The next issue that came up, and probably the one thing holding me is:
/usr/bin/ld: skipping incompatible /home/jfgiagonia/rpmbuild/BUILD/raspberrypi-firmware-4c14569/hardfp/opt/vc/lib//libGLESv2.so when searching for -lGLESv2
/usr/bin/ld: cannot find -lGLESv2
/usr/bin/ld: skipping incompatible /home/jfgiagonia/rpmbuild/BUILD/raspberrypi-firmware-4c14569/hardfp/opt/vc/lib//libEGL.so when searching for -lEGL
/usr/bin/ld: cannot find -lEGL
/usr/bin/ld: skipping incompatible /home/jfgiagonia/rpmbuild/BUILD/raspberrypi-firmware-4c14569/hardfp/opt/vc/lib//libopenmaxil.so when searching for -lopenmaxil
/usr/bin/ld: cannot find -lopenmaxil
/usr/bin/ld: skipping incompatible /home/jfgiagonia/rpmbuild/BUILD/raspberrypi-firmware-4c14569/hardfp/opt/vc/lib//libbcm_host.so when searching for -lbcm_host
/usr/bin/ld: cannot find -lbcm_host
/usr/bin/ld: skipping incompatible /home/jfgiagonia/rpmbuild/BUILD/raspberrypi-firmware-4c14569/hardfp/opt/vc/lib//libvcos.so when searching for -lvcos
/usr/bin/ld: cannot find -lvcos
/usr/bin/ld: skipping incompatible /home/jfgiagonia/rpmbuild/BUILD/raspberrypi-firmware-4c14569/hardfp/opt/vc/lib//libvchiq_arm.so when searching for -lvchiq_arm
/usr/bin/ld: cannot find -lvchiq_arm
collect2: error: ld returned 1 exit status
make: *** [hello_teapot.bin] Error 1
rm models.o video.o triangle.o
make: Leaving directory `/home/jfgiagonia/rpmbuild/BUILD/raspberrypi-firmware-4c14569/hardfp/opt/vc/src/hello_pi/hello_teapot'
error: Bad exit status from /var/tmp/rpm-tmp.zjVMmP (%build)

This goes on to every file that the make file compiles.

5.) Building from source on the Pi is very slow that's why most of my building was done on a PC. Maybe my sd card was not fast enough but that being said, I tried it on Pi and still, it does not build properly.

Thoughts:
Overall I would still say that building packages is very interesting. It gives you quite a skill to look for errors and find solutions. It is like a job of a QA Analyst so that the software does not or have less bugs. Also, talking to other people in the community for help is one thing you can develop on this project. I could have talked to more people and I might have found solutions to this but I got caught up with other projects and practicals (my fault anyway). The project has taught me to prioritize and plan things carefully in order to not be caught by the deadlines. It is a very important skill not only in school but also on other places like work. As I end, everything what I have done in this course is worth it. From the communications lab (and every lab) until the project. Chris is a very good teacher and I would recommend IT students to get him as your instructor in any subject he is teaching.

Files:
Source RPM
Spec File
(I copied the header information from the original spec file)

Links:
My Project
Github Source Files

Saturday, December 14, 2013

Raspberrypi-vc Packaging

As I go back on finding the errors from my previous blog, I found out what was causing it. The Makefile.include did not provide any directory on where to point out the necessary files so fixed it by adding a manual entry on the specfile to have it point to the appropriate directory.

%build
cd hardfp/opt/vc/src/hello_pi
sed -i -e '1iSDKSTAGE=/home/jfgiagonia/rpmbuild/BUILD/raspberrypi-firmware-4c14569/hardfp\' Makefile.include
./rebuild.sh


And then when I tried to do rpmbuild -ba I got new errors that I could not figure out yet what's causing it.

Error:
jpeg.c:361:171: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
cc -o hello_jpeg.bin -Wl,--whole-archive jpeg.o -lilclient -L/home/jfgiagonia/rpmbuild/BUILD/raspberrypi-firmware-4c14569/hardfp/opt/vc/lib/ -lGLESv2 -lEGL -lopenmaxil -lbcm_host -lvcos -lvchiq_arm -lpthread -lrt -L../libs/ilclient -L../libs/vgfont -Wl,--no-whole-archive -rdynamic
/usr/bin/ld: skipping incompatible /home/jfgiagonia/rpmbuild/BUILD/raspberrypi-firmware-4c14569/hardfp/opt/vc/lib//libGLESv2.so when searching for -lGLESv2
/usr/bin/ld: cannot find -lGLESv2
/usr/bin/ld: skipping incompatible /home/jfgiagonia/rpmbuild/BUILD/raspberrypi-firmware-4c14569/hardfp/opt/vc/lib//libEGL.so when searching for -lEGL
/usr/bin/ld: cannot find -lEGL
/usr/bin/ld: skipping incompatible /home/jfgiagonia/rpmbuild/BUILD/raspberrypi-firmware-4c14569/hardfp/opt/vc/lib//libopenmaxil.so when searching for -lopenmaxil
/usr/bin/ld: cannot find -lopenmaxil
/usr/bin/ld: skipping incompatible /home/jfgiagonia/rpmbuild/BUILD/raspberrypi-firmware-4c14569/hardfp/opt/vc/lib//libbcm_host.so when searching for -lbcm_host
/usr/bin/ld: cannot find -lbcm_host
/usr/bin/ld: skipping incompatible /home/jfgiagonia/rpmbuild/BUILD/raspberrypi-firmware-4c14569/hardfp/opt/vc/lib//libvcos.so when searching for -lvcos
/usr/bin/ld: cannot find -lvcos
/usr/bin/ld: skipping incompatible /home/jfgiagonia/rpmbuild/BUILD/raspberrypi-firmware-4c14569/hardfp/opt/vc/lib//libvchiq_arm.so when searching for -lvchiq_arm
/usr/bin/ld: cannot find -lvchiq_arm
collect2: error: ld returned 1 exit status
make: *** [hello_jpeg.bin] Error 1





Searching for further fixes until next post.

PS. I may not able to finish this project up to release 0.3. The packaging process is very complicated and I have never touched the makefiles before.


Wednesday, December 4, 2013

Raspberrypi-vc Packaging 0.1 (3nd entry)

Building the raspberrypi-vc from source was harder than I thought. The spec file I got from the source RPM was setup in a very complicated way ( for me ) but I understood it in a way. I found a makefile in the hello_pi folder and tried to work it from there and see if it would build it from source.

These lines were added to the %build section:

cd hardfp/opt/vc/src/hello_pi/
make -C libs/ilclient
make -C libs/vgfont
./rebuild.sh


OUTPUT:

[jfgiagonia@f17 SPECS]$ rpmbuild -ba raspberrypi-vc.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.td65cK
+ umask 022
+ cd /home/jfgiagonia/rpmbuild/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /home/jfgiagonia/rpmbuild/BUILD
+ rm -rf raspberrypi-firmware-4c14569
+ /usr/bin/gzip -dc /home/jfgiagonia/rpmbuild/SOURCES/4c1456944b5f6cc9e5141077ed4e158398811fc1
+ /usr/bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd raspberrypi-firmware-4c14569
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.Qx5RP8
+ umask 022
+ cd /home/jfgiagonia/rpmbuild/BUILD
+ cd raspberrypi-firmware-4c14569
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd hardfp/opt/vc/src/hello_pi/
+ make -C libs/ilclient
make: Entering directory `/home/jfgiagonia/rpmbuild/BUILD/raspberrypi-firmware-4c14569/hardfp/opt/vc/src/hello_pi/libs/ilclient'
cc -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g -DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -ftree-vectorize -pipe -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM -Wno-psabi -I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -I./ -I../libs/ilclient -I../libs/vgfont -g -c ilclient.c -o ilclient.o -Wno-deprecated-declarations
ilclient.c:50:33: fatal error: interface/vcos/vcos.h: No such file or directory
compilation terminated.
make: *** [ilclient.o] Error 1
make: Leaving directory `/home/jfgiagonia/rpmbuild/BUILD/raspberrypi-firmware-4c14569/hardfp/opt/vc/src/hello_pi/libs/ilclient'
error: Bad exit status from /var/tmp/rpm-tmp.Qx5RP8 (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.Qx5RP8 (%build)

Good news was at least there was make file that would actually run. The error 'interface/vcos/vcos.h: No such file or directory was because the ilcient.c file needed it to proceed with make. The problem is this file can only be gotten from raspberrypi/userland on github and it is itself, another source code different from what i am working on. I will be working to see if there is a way on my next entry.

PS. This is a very difficult packaging process from the normal packages I tried before. Tinkering with the make files and scripts are not my best assets but I will try the best I can to accomplish a build from source package.