Friday, March 2, 2012

A little Intro to Python

Today I had some spare time, So I decided to begin teaching myself python, below is a pointless little program I wrote to get some practice with IF's, Whiles, Prints, and functions. I am enjoying the python language so far, it is quite interesting, and fun!.

##################################################################################



#!/usr/bin/env python

#Simple Yes or No
#By Anthony Boccia
#Learning Some Python, well teaching myself

#This is the yes or no question function
def question():
print ('Is this Right? Yes or No ( Exit - to Quit program)? ')
answer=raw_input()

while answer != 'Yes'  and answer !='No' and answer !='Exit':  #Check for user errors
print('\nERROR: Enter Yes or No ( Exit - to Quit program) ""Case Sensitive""\n')
print ('Is this Right? Yes or No? ')
answer=raw_input()

return answer #Return the user input to the main program

#This is the main program
answermain  = 0
while answermain != 'Exit':

answermain = question()

if answermain == 'Yes' or answermain =='No':

#Check the returned value and output the proper message based on the value of answermain
if answermain == 'No':
print ('\nYou said ' + answermain + ' Very Well then, it is ' + answermain + 't right\n') #noticed how i used the variable again and added a t for not? Clever or lame? you Decide

elif answermain == 'Yes':
print ('\nYou said ' + answermain + ' Very Well then, it is right\n')
else:
print ('Good' + 'bye!') #Message Printed upon Exit by user which kills loop in backend



##################################################################################

Thats all for now, Cheers!

Tuesday, January 10, 2012

FSOSS/Linux Fest 2011 - My Teams Presentation

Yes, it has been a while since I last threw a post up here, I am still alive. I recently graduated :-) and am seeking a job in RedHat Based system administration...But enough of my begging for work. Below you'll find the FedoraARM development team presentation on running a build farm with Fedora on ARM. We Presented at FSOSS 2011 (Free Software and Open Source Symposium) in October. Just now the video was posted. It is a slideshow with voice over so don't expect to many explosions...or any. I hope it will serve well to educated and offer insight to the advancements and the effort towards the on going development of the Fedora Distribution of Linux in the ARM world.

Monday, November 28, 2011

ARMHFP Builders Via Chroot

Recently our Buildfarm http://arm.koji.fedoraproject.org has been upgraded to include ARMV7HL builder support. This was achieved by creating a Fedora 15 Arm chroot on our Pandaboards.

Here are the steps taken:

Prep - Download the completed rootfs, and chrootfs:
RootFS: http://iraq.proximity.on.ca/v7chroot/PANDABOARD/rootfs.tar.gz
Boot: http://iraq.proximity.on.ca/PANDA/boot.tar.gz
ChrootFS: http://iraq.proximity.on.ca/v7chroot/PANDABOARD/v7chroot-final-certless.tgz
MakePandaScript: http://iraq.proximity.on.ca/PANDA/makepanda

Steps for PandaMainroot
1) run the makepanda script on your SDcard, this will create the necessary partition scheme. This should be complete, at this point.

2) Mount the boot partition and explode the boot tarball to it.

mkdir tmpmnt
mount /dev/carddev1 tmpmnt/
tar xfv boot.tar.gz -C tmpmnt/
sync
umount tmpmnt/

3) Follow the same process for the rootfs

mount /dev/carddev2 tmpmnt/
tar xfv rootfs.tar.gz -C tmpmnt/
sync
umount tmpmnt/

4) Place the card in the panda and power it on, if you make it to the login prompt your good to go, login with password fedoraarm.

Note: That you will have to manually setup your networking, as this is currently done via a script in the rootfs, and will not work outside of our farm, some custom tweaking will be necessary . The chroot will still function just fine for building V7HL with mock, provided you have the correct mock config in place. ping fossjon in #fedora-arm for more info.

Steps for Chroot Creation
1) Install the rootfs onto your pandaboard

2) Explode chroot archive into rootfs like so

tar xfvj v7chroot-final-certless.tgz -C /

3) Copy Main root resolv.conf to chroot
Note: This is done to ensure the chroot has DNS info, the ip will be shared via main rootfs

cp /etc/resolv.conf /path/too/chroot/etc/resolv.conf

4) Test connectivity with: ping yahoo.ca

5) Add the following(6,7) to the main rootfs /etc/rc.d/init.d/koji-config
Note: The koji-config is a script executed at boot time to prep and enable the pandaboard in our build environment, it is native to our set up, yours may differ.

6) Setup bind Mounts from Local root to Chroot

mount -t proc   chroot_proc   /home/v7chroot/root/proc
mount -t sysfs  chroot_sysfs  /home/v7chroot/root/sys
mount -t devpts -o gid=5,mode=0620,ptmxmode=0666,newinstance chroot_devpts /home/v7chroot/root/dev/pts
mount -t tmpfs chroot_shmfs /home/v7chroot/root/dev/shm
mount --bind /var/cache/mock/fedora-15-arm/ccache/ /home/v7chroot/root/tmp/ccache
mount --bind /mnt/koji /home/v7chroot/root/mnt/koji
mount --bind /fs0 /home/v7chroot/root/fs0
mount -o bind /dev/ /home/v7chroot/root/dev

7) Change Kojid config in chroot to the correct hostname for user= and create the correct sym link to the kojid cert for the builder
Note: This step is only necessary for a fedora-arm koji setup, it can be ignored if builder will not  be included in koji.
 
sed -i "s/^user *=.*$/user = $(hostname)-v7hl/" /home/v7chroot/root/etc/kojid/kojid.conf

ln -s /etc/kojid/certs/$(hostname)-v7hl.pem /etc/kojid/localhost.pem

8) Start the Chroot

chroot /home/v7chroot/root

9) You can setup in a startup script a command to start the chroot, and kojid within like so: chroot /home/v7chroot/root/ /sbin/service/ kojid start &

10) Finally, if you wish to have your panda as part of the build effort, ping aeboccia,fossjon,frojoe,ctyler in #fedora-arm on Freenode IRC

Friday, October 21, 2011

Efika Smarttop MX51 - 3.0.4 Kernel

It is with great excitement that i finally announce a completed 3.0.4 kernel for Efika MX Smarttop ARM Systems. Currently we have nine efika's active in our build farm, they are building packages under mock for our F15Arm release; and are currently running the most up to date stable kernel.

Some Minor tweaks, specific to the Fedora-ARM team setup which have been built into the kernel include, IPV6 support and ACL's on ext2,3,4 filesystems. Another large tweak, was scaling back the version number to 2.6.40. This was necessary as some packages look for kernel version 2.6* when building.

Below are links to the built uImage, module tarball, and the config used to build the kernel.

3.0.4-Config-mx51
Modules-2.6.40
Completed uImage

That's all for now. Stay tuned,

SHARPY

Thursday, June 16, 2011

Sigul Signing Server

Welcome to another OpenSource post,

This week I was finally able to get a sigul signing server up and running, for CDOT's fedora arm project. Currently we are signing 25835 RPM's for our F13 -Arm release. There is not a whole lot to post here, as the major part of this task was documentation. If you click here you can view my step by step documentation created to allow anyone to setup their own sigul instance.

Stay tuned,

Wednesday, May 18, 2011

ATI - Catalyst Drivers with Akmod + Watermark Removal

As many know ATI support is not the greatest on Linux, well at least not as far along as Nvidia support, so it can sometimes be tricky getting your ATI drivers to function especially if they are of the HD Mobile chipset variety.
 I have an Asus K52JT model laptop, it's an affordable and well performing I7 but it did come with one price, it has a HD6370M gfx card. It's not a bad card but for a Fedora user it presents a challenge. The following is the walkthrough of the steps to install akmod and remove the pesky Unsupported Hardware watermark that may appear.

Open a terminal and SU to root next issue: yum install akmod-catalyst
*After install the drivers reboot the system

Upon booting up, you may notice a Small Watermark to the bottom right of the screen which reads:
AMD
Unsupported Hardware
This watermark tends to show up when the graphics drivers installed do not want to play nice with your hardware, essentially thinking it's not installed though it is. This is not a problem, to test and make sure that the drivers are indeed working perform the following:


Open a terminal SU to root and issue: glxgears
*Note you should see some FPS rates being generated, this means your gfx drivers are installed and functioning
After ensuring the graphics drivers are functioning it's time to remove the watermark. I found a script to do so posted here, and after some minor modification for my system it ran successfully and removed the watermark.
Create the following script

#!/bin/sh
DRIVER=/usr/lib64/xorg/modules/drivers/fglrx_drv.so
for x in $(objdump -d $DRIVER|awk '/call/&&/EnableLogo/{print "\\x"$2"\\x"$3"\\x"$4"\\x"$5"\\x"$6}'); do
sed -i "s/$x/\x90\x90\x90\x90\x90/g" $DRIVER
done


The original source can be found here. I had to modify the top line to lib64 from lib, the best way to check if you need to would be to search for that fglrx_drv.so find its directory and change the top line as per your situation.


Execute the script, and reboot. Upon boot you should no longer have the watermark problem :-)

Thanks for reading, Stay tuned.

Tuesday, May 17, 2011

PandaBoard - XSession with Firefox On F13beta3

Welcome,

The following is a walk through on how to install graphics drivers, xorg and firefox, on a panda board running Fedora-Arm 13 beta3 release, and configure it to open an X session with Firefox to display a desired page on boot. For CDOT purposes it displays a Status Dashboard web page on an external monitor.

1. Boot up your pandaboard and login

2. Issue command yum install xorg*

This installs all available, fonts, and other things needed for X to function, without a desktop environment, essentially just XSERVER.

* The specific driver in use is omapfb, and is available in the cdot fedora-arm repo's. If you wish to specify solely the xorg base system and single driver you can.

Optional: If you want you can install a Window manager, I did for testing purposes as it was annoying not being able to close more move windows. I used icewm, installed with yum install icewm. But you can use any window manager it's your choice.

3. vi /etc/X11/xorg.conf and add the following:

Section "ServerFlags"
   Option "IgnoreABI" "True"
EndSection

Section "Device"
    Identifier "Card"
    Driver "omapfb"
EndSection

Section "Screen"
 Identifier "Screen0"
 Device  "Card0"
 Monitor "Monitor0"
 Subsection "Display"
  Depth   24
  Modes "1024x768"
 EndSubsection
 Subsection "Display"
  Depth   32
  Modes "1024x768"
 EndSubsection
EndSection

* You can edit the Modes as you wish depending on the monitor size you have and what you prefer.

4. Reboot the system

5. Next install firefox the latest for arm being 3.6: yum install firefox

6. Next for a quick test of X and firefox issue the following:

export DISPLAY=:0

xinit /usr/bin/firefox http://www.google.ca &  <--This should open display :0 with a terminal and a firefox window.

7. Getting the window to display on boot will require two things, the first being a javascript html file, which I found easiest for my purposes and should be just fine for any other instance. The scripts to do this were written for me by Jon Chiappetta, they are displayed here.

Once you have created the popup.html file you can begin to write a service for your Dashboard to start on boot.

8. First create a service script file, to boot the Xdisplay and firefox on boot

vi /etc/init.d/servicename <--pick a name...any name

Add the following to the file

#!/bin/sh
#
# CDOT-Service Status notification daemon #<-- Change this to reflect your service info
#
# Author:       Fedora_Arm team #<-- Change this to reflect your authors name
#
# chkconfig: 2345 98 20
#
# description:  This is the status board service \   #<-- edit the description as you desire.
#               For CDOT Dashboard
# processname:  zdotstats #<-- Match your service name, so it is easy to identify in the process list
#
RETVAL=0;
start() {
echo "Starting YourService"
export DISPLAY=:0
#We login as root, as it is the only user we have on the machine, and nothing critical is hosted.
export USER=root
export HOME=/root
xinit &
killall firefox
rm -f /root/.mozilla/firefox/i7l6qmmk.default/sessionstore*
/usr/bin/firefox http://yourhost.com/popup.html &
}

stop() {
echo "Stopping your service"
pkill xinit
}

restart() {
pkill xinit
/usr/bin/xinit &
}

case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac

exit $RETVAL

9. Issue command: chkconfig --add servicename
           chkconfig servicename on

* This will add your service to the list of services and turn it on for all run levels, if you want you can specify using the --levels option.

10. Test the service with command: service servicename start
If all is well, your x session should start and open your popup page in firefox automatically.

11. Finally reboot your system, and if all is in good order your X session should start and open firefox to your popup page on boot.