Showing posts with label RaspberryPi. Show all posts
Showing posts with label RaspberryPi. Show all posts

Saturday, April 27, 2013

Raspberry Pi as a PXE server with a proxy DHCP.


This is a great approach for easy deploying various distros over the network instead of using cd-rom/usb sticks. Since I already had a PI running as a torrent client/server and SAMBA why not implement some additional features? After some hours of hacking I manage to get the stuff working perfectly.

Let's get started. Please let me know if any step generates any issues.

Login as root

pi@pi ~ $sudo su -
root@pi:~#apt-get update
root@pi:~#apt-get install syslinux-common #This is for pxe booting files.
root@pi:~#apt-get install dnsmasq #Since I already have a router providing DHCP we need to use a proxy dhcp. dnsmasq is a great set of tools providing us with both tftp and proxy dhcp.

#mkdir /srv/tftpboot #root folder for pxe server.

root@pi:/srv/tftpboot#cp /usr/lib/syslinux/pxelinux.0 . #copy neccacary files for pxe boot.
root@pi:/srv/tftpboot#cp /usr/lib/syslinux/menu.c32 .

root@pi:/srv/tftpboot#mkdir pxelinux.cfg #folder for boot menu

root@pi:/srv/tftpboot/pxelinux.cfg

root@pi:/srv/tftpboot/#vim.tiny default #Menu file

Add following info for /srv/tftboot/pxelinux.cfg/default:

DEFAULT menu.c32
PROMPT 0

MENU TITLE PXE Boot

LABEL Test
MENU LABEL Test

Edit dnsmasq settings. Just add following lines at the end of the file.

# vim.tiny /etc/dnsmasq.conf

interface=eth0
dhcp-range=192.168.0.0,proxy
dhcp-boot=pxelinux.0
pxe-service=x86PC,"Booting from Network...",pxelinux
enable-tftp
tftp-root=/srv/tftpboot
dhcp-boot=pxelinux.0,servername,192.168.0.10

#restart dnsmasq to load config

root@pi:/srv/tftpboot#service dnsmasq restart

Try to boot a machine with pxe booting. Just to verify that's working.

Next we need to install nfs support for sharing the mounted iso files.

root@pi:/srv/tftpboot#apt-get install nfs-kernel-server

root@pi:/srv/tftpboot#mkdir /tftpboot/iso #this is where we put distro iso files
root@pi:/srv/tftpboot#mkdir /tftpboot/nfs #this is where we share nfs files
root@pi:/srv/tftpboot#mkdir /tftpboot/nfs/ubuntu #folder for ubuntu dist

Edit nfs shares

root@pi:/srv/tftpboot/#vim.tiny /etc/exports

Add following line:

/srv/tftpboot/nfs/ubuntu/ *(ro,sync,no_subtree_check)

root@pi:/srv/tftpboot# mount -o loop iso/ubuntu-13.04.iso nfs/ubuntu/ #mount iso file to nfs folder
mount: warning: nfs/ubuntu/ seems to be mounted read-only.

Then we need to enable rpcbind and restart nfs

root@pi:/srv/tftpboot#update-rc.d rpcbind enable && update-rc.d nfs-common enable
root@pi:/srv/tftpboot#service rpcbind start
root@pi:/srv/tftpboot#service nfs-kernel-server restart

Add following entry to the /srv/tftpboot/pxelinux.cfg/default

DEFAULT menu.c32
PROMPT 0

MENU TITLE PXE Boot

LABEL Test
MENU LABEL Test

LABEL Ubuntu
        MENU LABEL ^Ubuntu 13.04
        KERNEL nfs/ubuntu/casper/vmlinuz
        APPEND initrd=nfs/ubuntu/casper/initrd.lz boot=casper netboot=nfs
 nfsroot=192.168.0.180:/srv/tftpboot/nfs/ubuntu

Change IP to your server IP in default config file

That should be all. Works flawless for me(I/O performance of the PI is not awesome but definitely works fine). A really neat way of installing without using cd-rom or usb.

Sunday, July 22, 2012

Duke Nukem Pi!


wget http://apt.duke4.net/pool/main/d/duke3d-shareware/duke3d-shareware_1.3d-20_all.deb
wget http://www.berryterminal.com/dl/eduke32_2.0.0rpi+svn2789_armel.deb
sudo dpkg -i duke3d-shareware_1.3d-20_all.deb
sudo dpkg -i eduke32_2.0.0rpi+svn2789_armel.deb
If you want to use head phones instead of HDMI audio: amixer cset numid=3 1
eduke32 
Source: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=35&t=9934

Wednesday, July 18, 2012

How to Overclock your Raspberry Pi’s CPU to 850MHz+ (& RAM to 500MHz)

http://fusionstrike.com/2012/overclock-raspberry-pi-cpu-850mhz-ram-500mhz

From site:
Overclocking your Raspberry Pi is ridiculously easy because the values are simply stored in a text file on the root of the device, they can be easily edited and changed via Nano or VI, and if you brick the device or get a kernal panic, you can change the values by plugging your SD card into a computer and editing the file there.

Pre-compiled XBMC for Raspbian

http://www.memetic.org/pre-compiled-xbmc-for-raspbian/

From site:
As there are no .deb packages for XBMC on Raspbian armhf yet and it takes almost a day to compile it by hand, I’ve tar’d up my pre-compiled version and made it available. My version is confirmed to work on Raspbian Pisces and DarkBasic images from June/July.

Monday, July 16, 2012

Boost your Raspberry Pi!

Found an interesting post regarding tweaking your Raspberry for higher performance.


Basically you can gain up to 25% performance simply modifing some text file :)
There are lot of thing to do, to cut down RAM usage, tune the sd card and hack a bit the CPU.
Here the complete list of improvment:
RAM usage: remove not needed services and daemon, change start.elf file
Disk tuning: we use an sdcard so everything is writing/reading from our sdcard will drop our (already very low) performance. There are lot of improvment we can use to minimize the hidden i/o and it can be integrated in the kernel or not. So, we have to remove unecessary log from /etc/rsyslog.conf, change the disk scheduler to deadline, add noatime/relatime, noadirtime, writeback to ext4 partition and use squashfs+aufs as filesystem for /usr
CPU Hack: just change in config.txt the arm_freq, gpu_freq and sdram_freq... at your own risk!!!

http://rpitc.blogspot.se/2012/06/rpi-tuning-boost-your-rpi.html

Sunday, July 15, 2012

Rasberry Pi as a simple seedbox!

Why not? This was my second purpose beside using XBMC. So here we go!

Gonna make use of Transmission, which is a excellent bittorrent client. I assume that you have already installed Debian(otherwise head over here: http://elinux.org/RPi_Easy_SD_Card_Setup).

Make sure to enable SSH-access.

ssh-keygen (I hit enter for all three options to accept defaults and no passphrase)
sudo service ssh start (to start sshd)
sudo update-rc.d ssh defaults (to run the ssh server on startup by default)

Install and configure Transmisson.
sudo apt-get update ; apt-get upgrade
sudo apt-get install transmission-daemon
sudo mkdir /Downloads
sudo chown debian-transmission /Downloads

Next we need to configure Transmisson.

sudo service transmission-daemon stop

The config file is located at /etc/transmission-daemon/setting-json

Change rpc-authentication-required to false and download-dir to /Downloads

Start the service and we are ready to go!

sudo service transmission-daemon start
Thats it!

Wednesday, July 11, 2012

Raspberry Pi!


Finally got my hands on one(actually i got two!) of these bad boys. 


So what’s Raspberry Pi? The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video(more at: http://www.raspberrypi.org/faqs).


One of these babies will replace my 10-years old Xbox1(running XBMC) bedroom media solution. Actually im trying Raspmbc(http://www.raspbmc.com) at the moment and it's looking pretty sweet(still in beta stage). Maybe implement the other one in my car? Or just running a simple server with torrent/NAS support. Time will tell :-)

Since there is no official case for the Raspberry, I had to build my own :-)