Differences between revisions 49 and 50
Revision 49 as of 2014-02-01 21:21:29
Size: 11658
Revision 50 as of 2014-09-13 10:07:05
Size: 11658
Editor: EnricoRossi
Comment: fix trivial error in the echo command
Deletions are marked like this. Additions are marked like this.
Line 247: Line 247:
echo "nameserver > /etc/resolv.conf" echo "nameserver" > /etc/resolv.conf

Wouldn't this lot be better on a separate page? -- SteveMcIntyre

howto build the build environment


  • install cowbuilder / git-buildpackage / debootstrap

 apt-get install cowbuilder git-buildpackage debootstrap 
  • Create cowbuilder image

 sudo cowbuilder --create --basepath=/var/cache/pbuilder/base-sid.cow --mirror http://ftp.de.debian.org/debian --distribution sid 
  • Try to login (and out if it works):

 sudo cowbuilder --login --basepath=/var/cache/pbuilder/base-sid.cow 
  • Configure git-build-package in ~/.gbp.conf (fetch Guido's gbp.conf and change the keyid)

wget https://honk.sigxcpu.org/piki/projects/git-buildpackage/gbp.conf
mv gbp.conf ~/.gbp.conf 
  • Now you can build your stuff from a git-import-orig / git-import-dsc created git repository. (wah, hennr, is gar nicht so kompliziert :P).

mschmi@proxmox-mschmi:~/hennr/flare$ git branch
* master
mschmi@proxmox-mschmi:~/hennr/flare$ git-pbuilder 
WARNING: not invoked by git-buildpackage.
W: /home/mschmi/.pbuilderrc does not exist
I: using cowbuilder as pbuilder

Ubuntu Oneiric Ocelot

  • install cowbuilder / git-buildpackage / debootstrap from Sid so debootstrap know about the newest Ubuntu version

 apt-get install cowbuilder git-buildpackage debootstrap 
  • Fetch the release archive keys

 wget http://ftp.halifax.rwth-aachen.de/ubuntu/project/ubuntu-archive-keyring.gpg
 sudo cp ubuntu-archive-keyring.gpg /usr/share/keyrings/

  • Create a Ubuntu Oneiric Ocelot image :

sudo cowbuilder --create --basepath=/var/cache/pbuilder/base-oneiric.cow --mirror http://ftp.halifax.rwth-aachen.de/ubuntu/ --distribution oneiric --components "main universe" --debootstrapopts --keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg

Schmierzettel for jboss-packaging


* Im Master fehlen: antlr, aopalliance * Im Master zuviel: apache-xmlsec, commons-logging, console, log4j, sun-servlet, xml-apis (allerdings alles nur component-info.xml, keine jars in den Verzeichnissen)

package jbosass5

  • Importing the new upstream tarball to the branch "upstream_jboss.org"

 $ git-import-orig --upstream-branch=upstream_jboss.org --debian-branch=upstream_jboss.org --upstream-tag=upstream_jboss.org/5.1.0.GA --upstream-version=5.1.0.GA ../jboss-5.1.0.GA-src.tar.gz 
  • Checkout branch "upstream", merge the "upstream_jboss.org" and move the thirdparty/ directory out (we need this later :-) )

 git checkout upstream
 git merge upstream_jboss.org
 cp thirdparty/ ../
 git rm -r thirdparty 

  • Tag the "upstream_jboss.org" and "upstream"
  • Merge upstream to master and build package
     git checkout master
     git merge upstream

package jbosass5-libs

  • Rename and pack the copied thirdparty-directory

 mkdir jbossas-libs
 mv thirdparty jbossas-libs/libs
 tar -czf jbossas5-libs_5.1.0.GA.tar.gz jbossas-libs/
  • Import the tarball to the branch "upstream_jboss.org"

git-import-orig --debian-branch=upstream_jboss.org --upstream-branch=upstream_jboss.org  --upstream-tag=upstream_jboss.org/5.1.0.GA --upstream-version=5.1.0.GA ../jbossas5-libs_5.1.0.GA.tar.gz 
  • Merge "upstream_jboss.org" to "upstream"

 git checkout upstream
 git merge upstream_jboss.org

Using usbfoo on Debian

What is USBfoo?

 aptitude install gcc-avr dfu-programmer avr-libc 

Connection hardware

  • Solder a bridge on the backside of the board to set the power supply mode.
  • Insert an usb cable and connect to the host
  • dmesg says

 [20622.464064] usb 3-1: new full speed USB device using uhci_hcd and address 10
 [20622.642160] usb 3-1: New USB device found, idVendor=03eb, idProduct=2ffa
 [20622.642169] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
 [20622.642176] usb 3-1: Product: AT90USB162 DFU
 [20622.642180] usb 3-1: Manufacturer: ATMEL
 [20622.642185] usb 3-1: SerialNumber: 1.0.5
 [20622.642421] usb 3-1: configuration #1 chosen from 1 choice

Compile software, program and run

  • Create a small program.c :

#include <avr/io.h>

int main (void) {
  /* set data direction register d to output */
  DDRD = 0xff;

  /* set port d to 0x00 this activates the red led on the board */
  PORTD = 0x00;

  /* loop until reset */
  while(1) { 
     /* narf! */
  /* this will never reached */
  return 0
  • Compile with avr-gcc

 avr-gcc -Wall -mmcu=at90usb162 program.c -o program 

  • Create a HEX to flash into the device

 avr-objcopy program -O ihex program.hex 

  • Flash into the device (think about permissions, sudo...):

dfu-programmer at90usb162 erase
dfu-programmer at90usb162 flash program.hex
  • After the flashing press the reset button and your program runs (red led on)
  • To reprogram bring usbfoo in programming mode: press reset, press hwb, release reset, release hwb. Now you should see the same dmesg message as before.



  • Start with a minimal Debian squeeze installation.
  • Install Apache2 and MySQL. Set a MySQL root password during installation.

apt-get install --no-install-recommends mysql-server apache2 libapache2-mod-php5 php5-suhosin 
  • Install Icinga and the idoutils (for Icinga Data Out

apt-get install icinga icinga-idoutils --no-install-recommends 
  • Set a password for icingaadmin during installation. Let debconf configure apache2 for icinga. During configuration of icinga-idoutils you asked for yout MySQL admin password. Set an ido database password.

Building own Debian image for Raspberry Pi

The Raspberry Pi is a small ARM computer (http://raspberrypi.org). It boots only from a fat partition of a SD card.

  • Create two partions on a SD card:
    • for firmware and bootloader: size 100MB, partition type 0b WIN95 Fat32
    • for root file system: as many you want, partition type 83 Linux
  • Format both partions and mount them (here is /dev/sdx the sdcard):

 mkdosfs -F32 /dev/${RASPBERRY_SDCARD}1
 mkfs.ext4 /dev/${RASPBERRY_SDCARD}2
 mkdir /mnt/raspberry_root
 mkdir /mnt/raspberry_boot
 mount /dev/${RASPBERRY_SDCARD}1 /mnt/raspberry_boot
 mount /dev/${RASPBERRY_SDCARD}2 /mnt/raspberry_root
  • Now lets install a basic Debian with debootstrap. If you have a local apt-cacher then just use it.

 debootstrap --foreign --arch=armel wheezy /mnt/raspberry_root/ [http://IP_OF_LOCAL_APT_CACHER/debian]
  • Because of the different architecture (PC/Laptop -> amd64, raspberry -> armel) we cannot chroot into the new system. Use Qemu to solve the problem! Install a static qemu version an copy the binary to the new rootfs:

apt-get install qemu-user-static
cp /usr/bin/qemu-arm-static /mnt/raspberry_root/usr/bin/
  • Now we can run the second stage of debootrap installing:

chroot /mnt/raspberry_root/
cd /debootstrap
./debootstrap --second-stage
  • After successfully debootstrap you should see a message like I: Base system installed successfully.. Stay in the chroot environment and configure the new system:

    • First add a Debian repository to sources.list and install the packet  locales  and then configure the locales you want

echo "deb http://ftp.de.debian.org/debian wheezy main" > /etc/apt/sources.list
apt-get update
apt-get install locales && dpkg-reconfigure locales
  • While this you get the following error

    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
            LANGUAGE = (unset),
            LC_ALL = (unset),
            LANG = "de_DE.utf8"
        are supported and installed on your system.
    perl: warning: Falling back to the standard locale ("C").
    /usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
    /usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory
    /usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory

that means you have right now no working locales, that's o.k., you are installing them right now

  • Install more packages  apt-get install vim ntpdate ssh less 

  • Set hostname: echo "raspy" > /etc/hostname 

  • Set a root password:  passwd 

  • Configure the network ( /etc/network/interfaces )

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
# or if statically preferred add something like this
#iface eth0 inet static
#    address   
#    netmask  
#    gateway
  • and dns (/etc/resolv.conf) :

echo "nameserver" > /etc/resolv.conf
  • adding a regular fstab file

proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1
  • To be able to Login via UART (COM) modifiy  /etc/inittab  and change the getty part

T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
  • Now lets populate the boot partition. As mentioned here: http://elinux.org/RPi_Advanced_Setup#Setting_up_the_boot_partition we need some files. As i understand it works like this: The GPU reads it's firmware (start.elf, bootcode.bin, loader.bin) from the sdcard and then loads the kernel (kernel.img) with some configuration (cmdline.txt).

    • We can ether use the automatic rpi-firmware update from https://github.com/Hexxeh/rpi-update or fetch them from the offical Github Repository.

    • rpi-update: Downloads also the kernel modules and the propritary Broadcom tools. I used the installation from the host system to the sdcard:

 wget https://raw.github.com/Hexxeh/rpi-update/master/rpi-update
 chmod +x rpi-update
 mkdir /mnt/raspberry_root/lib/modules
 # this is needed because rpi-update complains if no start.elf etc is found
 for file in start.elf bootcode.elf loader.bin kernel.img ; do touch  /mnt/raspberry_boot/$file; done
 ROOT_PATH=/mnt/raspberry_root BOOT_PATH=/mnt/raspberry_boot ./rpi-update
  • Add a cmdline.txt with the following content (stolen from a wiki without exactly understanding):

smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=noop rootwait
  • Finally put the sdcard in your raspberry and power on! You should end up with a runnig Debian system :-). But now hit ctrl+alt+del on the Raspberry put the card back in the reader an configure all the important stuff in the rootfs (hostname, network, root password etc)

How to start to contribute to Debian