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.

Tuesday, November 19, 2013

Raspberrypi-vc Packaging 0.1 (2nd entry)

Building the package in the arm machine.

I got my Pi up and running and downloaded the spec file I used for my Pi. The BuildArch was set to armv6hl but everything is still the same. The build was successful and wrote 2 rpms. The build time was relatively slow compared to PC, of course, but it was successful.

I tried installing the rpm using $rpm -i raspberrypi-vc-debuginfo-0.1-5.rpm and got no output. No output means good output, usually in Linux. As I have told. 
For the next entry and my 0.1 release, I will finish my spec file properly and try out adding a %build section and the %install section. Also, will try to send for review.

Next entry goals (0.1 3rd entry):
  • Updated (clean) spec file.
  • Try to put something in %build and %install section.
  • Investigate the %install section from src rpm spec file.
  • 0.1 Release

Monday, November 18, 2013

Raspberrypi-vc Packaging 0.1 (1st entry)

The project I chose is packaging the raspberrypi-vc package to build from source. Here are the links necessary regarding the information about this project (includes project planning).

I started by obtaining the source rpm. The spec file was long and very complicated to understand to my level. In reviewing the specfile, I noticed a bunch of subpackages that are also being built along the process. This files are libraries and development tools. Here's how it is laid out:


each %package tag  will build a sub package. Each subpackage needed a directory containing the files necessary for the building process:



each %file needs the name of the subpackage that will be built.

The goal of the project is to make an rpm which was built from. I created a new spec file just like I did in the labs. I did it with the simplest form and with no macros just to test it out if it could work. *Note, I am using my pc to build the rpm (raspberrypi-vc is intented for arm architectures).



I copied the tags from the src specfile but I manually input the source. Just for testing purposes.
After doing $rpmbuild -ba, I got an error : make: *** No targets specified and no makefile found.  Stop.
error: Bad exit status from /var/tmp/rpm-tmp.jDPPf5 (%build)
It means that there are no files that the command $make could identify in the %build section (make %{?_smp_mflags}). In the original spec file, the commands for %build section was not present. Thus I removed the make and the spec file was built successfully without errors.

 Wrote: /home/jfgiagonia/rpmbuild/RPMS/x86_64/raspberrypi-vc-debuginfo-0.1-5.rpfr19.x86_64.rpm

The build from source was successful but with everything strip down. The % build and %install section was empty and there are no changelogs. The next step is try to build it on Pi.

Sources:

SBR600 Project Page -> Look for 'Change Raspberrypi-package...'










Friday, November 8, 2013

Python Lab


Scripting is my very least skill in computers. I found bash to be very difficult to learn but I have somewhat knowledge about it. Comparing to python, I would say this is easier and faster to learn. Although, this is still a challenge for me.

I looked at some of the blog posts to help me understand the 'guess' script and I found amartinenco's script to be the most understandable. So I tried to modifying my script and trying it on my own and this is what I came up:

#!/usr/bin/python
#
# Modify this script to be a number-guessing
# game.
# 1. The secret number should be random (1-100)
# 2. Input should be handled if it's not numeric
# 3. The user should be asked to guess until they
#    get the right number.
# 4. When the user guesses the right number, the
#    number of guesses should be printed
#
# Bonus: Make the script give up if the number hasn't
#        been guessed in 15 tries.

# imports sys program to script
import sys
# imports random program to the sript
import random
secret=random.randint(1,100)



game_finished = 0
count = 1
print "Guess the number from 1-100. You have 15 tries"

while (game_finished == 0):
  try:
     guess=int(raw_input("Enter a guess: "))

     if guess < 1 or guess > 100:
        print "Must be in the (1-100) range"
     else:
        if guess < secret:
           count = count + 1
       print "Too low!"        
        elif guess > secret:
           count = count + 1
       print "Too high!"        
        else:
           print "Correct!"
           game_finished = 1
           print "It took you %i tries to guess the correct number" % (int(count))
     if count == 16:
       print "number of tries exceeded(15). exiting"
       sys.exit()
  except ValueError:
     print "The entered input is invalid"

The only difference from where the script I got from was the exit script when the tries have been exceeded. Python is easier and more exciting to learn compared to other scripts I have learned. As for the future, I would try to have an in depth look at this language as this would be a great skill for the future.

End.


Wednesday, November 6, 2013

SBR600 Project

Greetings!

I have checked the package, raspberrypi-vc package from the koji site and I am lost. This would be a challenge as i do not know which package I need to work on and how to start it. This post is a call for help if you may know what is the first thing I should do.

The objective of my project is to make the raspberrypi-vc package build from source. The expected result is a raspberrypi-vc package that will be built from source, and will be compatible with the current Pidora packaging.

Challenges:
1. Know the purpose of the package.
2. how to obtain the the package.

Tuesday, October 1, 2013

Mock and Koji Lab

Mock and Koji Lab

MOCK LAB


PREPARATION

Installed mock using yum install.
Added my username to the group.
All commands with sudo
Using time, i recorded the time it finished the mock.

















Everything went smooth,no errors( no known errors ), I was curious as to put anything on the Buildrequires and Requires tags are for. I left it commented for now and see if any errors rise. Tried testing rpmbuild again to see the difference and used rpmlint to check the package which mock built. compared to rpmbuild, mock, I think, is slower maybe because it uses internet connection and that it can affect the speed.

*Note, i have fixed an issue where I put directories on the %files of the spec file. I changed the directories to macros in order for it to be dynamic.




 

KOJI LAB


PREPARATION

The fedora-packager-setup was already installed
used this command to interface with the koji server
$/usr/bin/fedora-packager-setup






*It asked for my FAS user and password.

Next step is I imported the certificates to use the interface using firefox.

















QUEUEING the build request

First, we do the command:
$ koji build f18 --scratch units-2.02-1.fc17.src.rpm












*I was hoping there are no errors and it did not have any. Made me happy! The command will build the package using the koji server for x86_34, i386, and i686 architectures

The link of the task is here:

the architectures are built for
    buildArch (units-2.02-1.fc17.src.rpm, x86_64)
    buildArch (units-2.02-1.fc17.src.rpm, i686)

It is very rewarding to see my name on the list of recent tasks. feels good to be a part of this project. (=

Now trying to build rpms for these architectures:

1.) s390
$ s390-koji build f18 --scratch units-2.02-1.fc17.src.rpm
The build had no errors, this is the link to the build.


2.) power pc (PPC)
$ ppc-koji build f18 --scratch units-2.02-1.fc17.src.rpm
Here's the link.


3.) armv6hl / Pidora
$ arm-koji build f18 --scratch units-2.02-1.fc17.src.rpm
Arm build has failed with these errors. mostly jibberish for me.











Will try to ask for help on the chat and classroom in order to make a build for arm. This is very important as the project I will be doing is for the arm architecture.


REFLECTIONS

I can say that this lab is very rewarding. I am the kind of person who intends to lean on the negative and for this lab I was sure to get a lot of errors. But to my surprise, I got none. The koji lab is very interesting. It really gave me the experience of being inlcuded in the fedora community and to see my name on the Recent Tasks page is an accomplishment.
This lab will be very useful for the upcoming project I will do for the Pidora because it will include packaging skills and mock and koji.