Friday, September 7, 2012

Sheeva Plug Basic Loading Fedora Arm 17

This is a rough post i'll tidy up later!!

basically you will be writing an image to usb or sdcard on your laptop/pc.
then on the plug you setup uboot variable.
then you boot the media in  the plug.
then consoled onto the plug you setup your software.
----------------------------------------------------------

Uboot settings are below for either sdcard or usb

#boot from usb
printenv
set bootargs 'console=ttyS0,115200 root=/dev/sda2 rootdelay=5'
set loadInitrd 'fatload usb 0:1 0x7400000 uInitrd-kirkwood'
set loadImage 'fatload usb 0:1 0x6400000 uImage-kirkwood'
set bootcmd 'usb start; ${loadImage}; ${loadInitrd} ; bootm 0x6400000 0x7400000; reset'
saveenv

#boot from sdcard
setenv bootargs_console 'console=ttyS0,115200, root=/dev/mmcblk0p2 rootdelay=5'
setenv bootcmd_mmc 'mmcinit; fatload mmc 0:1 0x6400000 uImage-kirkwood; fatload mmc 0:1 0x7400000 uInitrd-kirkwood'
setenv bootcmd 'setenv bootargs $(bootargs_console); run bootcmd_mmc; bootm 0x6400000 0x7400000'
saveenv

--------------------------------------------------------
Do this stuff from your laptop

#howto write an image to raw device! note the fedora image will resize upon boot.
xzcat (imagename eg>)f17arm-latest-arm-rpi-xfce-mmcblk0.img.xz |sudo dd bs=1M of=/dev/sdb(or other device)

#howto open terminal quickly to catch boot interupt
sudo chown uucp /dev/ttyUSB0; sudo cu -s 115200 -l /dev/ttyUSB0

------------------------------------------------------------
now put your stick in your plug and boot up!

initial root passwd for fedora is fedoraarm, do change the password

setup network
For static IP configuration you need to edit the following files using a text editor such as vi. Edit /etc/sysconfig/network as follows, enter:
# cat /etc/sysconfig/network
Sample static ip configuration:


NETWORKING=yes
HOSTNAME=fedoraArm
GATEWAY=10.4.50.5


Edit /etc/sysconfig/network-scripts/ifcfg-eth0, enter:
# cat /etc/sysconfig/network-scripts/ifcfg-eth0
Sample static ip configuration:


# Intel Corporation 82573E Gigabit Ethernet Controller (Copper)
DEVICE=eth0
BOOTPROTO=static
DNS1=208.67.220.220
DHCPCLASS=
HWADDR=00:50:43:01:c1:e6
IPADDR=10.4.50.30
NETMASK=255.255.255.0
ONBOOT=yes


Edit /etc/resolv.conf and setup DNS servers note you can't, it set by script


Finally, you need to restart the networking service, enter:
# /etc/init.d/network restart
To verify new static ip configuration for eth0, enter:
# ifconfig eth0
# route -n
# ping 192.168.1.254
# ping google.com


#To enable routing etc on laptop for allowing sheeva plug through my laptop over wireless. set eth0 to static 10.4.50.5
sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

#change password for root
passwd

#setup dev tools to build cgminer
yum groupinstall 'Development Tools'
yum install libusb libudev openssl-* ncurses-* libcurl-devel

mkdir /root/src
cd /root/src

#compile cgminer
wget http://ck.kolivas.org/apps/cgminer/cgminer-2.7.5.tar.bz2
tar -xvjf cgminer-2.7.5.tar.bz2
cd cgminer-2.7.5
CFLAGS="-O2 -Wall -march=native" ./configure --enable-bitforce
make
make install


#compile bfgminer
cd /root/src
wget http://luke.dashjr.org/programs/bitcoin/files/bfgminer/2.7.5/bfgminer-2.7.5.tbz2
tar -xvjf bfgminer-2.7.5.tbz2
cd bfgminer-2.7.5
./configure
make
make install