Slitaz -- yocto - distcc

root@slitaz:~# tazpkg info distcc

Tazpkg information
Package : distcc
Version : 3.1
Category : development
Short desc : Distributed compilation for C/C++
Maintainer : erjo@slitaz.org
Depends : popt lzo
Build deps : popt-dev lzo-dev
Web site : http://distcc.org

root@slitaz:~# tazpkg get-install libglu-mesa
root@slitaz:~# tazpkg get-install bash
root@slitaz:~# tazpkg get-install sudo
root@slitaz:~# tazpkg get-install iptables
root@slitaz:~# tazpkg get-install distcc

root@slitaz:~# visudo

root@slitaz:~# /etc/init.d/distccd start
Starting Distcc daemon: Distccd... distccd[3082] (dcc_discard_root) discarded root privileges, changed to uid=100 gid=101

root@slitaz:~# . /opt/poky/1.0/environment-setup-i586-poky-linux
root@slitaz:~# export LD_LIBRARY_PATH=/usr/lib:/lib:/usr/local/lib
root@slitaz:~# netstat -nlt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0* LISTEN
tcp 0 0* LISTEN
tcp 0 0* LISTEN
netstat: /proc/net/tcp6: No such file or directory

root@slitaz:/media/Audio1/slitaz/cook/yocto# poky-qemu qemuarm zImage-2.6.37-qemuarm-1.0.bin yocto-image-lsb-sdk-qemuarm-1.0.rootfs.ext3 &
Continuing with the following parameters:
KERNEL: [zImage-2.6.37-qemuarm-1.0.bin]
ROOTFS: [yocto-image-lsb-sdk-qemuarm-1.0.rootfs.ext3]
FSTYPE: [ext3]
Setting up tap interface under sudo
Acquiring lockfile for tap0...
Starting distccd...
Running qemu-system-arm...
/opt/poky/1.0/sysroots/i686-pokysdk-linux/usr/bin/qemu-system-arm -kernel zImage-2.6.37-qemuarm-1.0.bin -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=no,downscript=no -M versatilepb -hda yocto-image-lsb-sdk-qemuarm-1.0.rootfs.ext3 -no-reboot -show-cursor -usb -usbdevice wacom-tablet -no-reboot --append "root=/dev/sda console=ttyAMA0,115200 console=tty ip= mem=128M highres=off "

root@slitaz:/media/Audio1/slitaz/cook/yocto# ps ax | tail -11
3083 distcc 0:00 /usr/bin/distccd --daemon --verbose -j 4 --allow --pid-file /var/run/distccd/distccd.pid --log-file /var/log/distccd/distccd.log
3084 distcc 0:00 /usr/bin/distccd --daemon --verbose -j 4 --allow --pid-file /var/run/distccd/distccd.pid --log-file /var/log/distccd/distccd.log
3085 distcc 0:00 /usr/bin/distccd --daemon --verbose -j 4 --allow --pid-file /var/run/distccd/distccd.pid --log-file /var/log/distccd/distccd.log
3086 distcc 0:00 /usr/bin/distccd --daemon --verbose -j 4 --allow --pid-file /var/run/distccd/distccd.pid --log-file /var/log/distccd/distccd.log
3087 distcc 0:00 /usr/bin/distccd --daemon --verbose -j 4 --allow --pid-file /var/run/distccd/distccd.pid --log-file /var/log/distccd/distccd.log
3100 tux 0:00 xterm
3101 tux 0:00 sh
3103 root 0:00 /bin/bash /opt/poky/1.0/sysroots/i686-pokysdk-linux/usr/bin/poky-qemu qemuarm zImage-2.6.37-qemuarm-1.0.bin yocto-image-lsb-sdk-qemuarm-1.0.rootfs.ext3
3203 root 0:58 /opt/poky/1.0/sysroots/i686-pokysdk-linux/usr/bin/qemu-system-arm -kernel zImage-2.6.37-qemuarm-1.0.bin -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=no,downscript=no -M versatilepb -hda yocto-image-lsb-sdk-qemuarm-1.0.rootfs.ext3 -no-reboot -show-cursor -usb -usbdevice wacom-tablet -no-reboot --append root=/dev/sda console=ttyAMA0,115200 console=tty ip= mem=128M highres=off
3232 root 0:00 ps ax
3233 root 0:00 tail -11

5.1.3. Developing Externally in QEMU

Running Poky QEMU images is covered in the Yocto Project Quick Start in the "A Quick Test Run" section.

Poky's QEMU images contain a complete native toolchain. This means you can develop applications within QEMU similar to the way you would in a normal system. Using qemux86 on an x86 machine is fast since the guest and host architectures match. On the other hand, using qemuarm can be slower but gives faithful emulation of ARM-specific issues. To speed things up, these images support using "distcc" to call a cross-compiler outside the emulated system. If "runqemu" was used to start QEMU, and "distccd" is present on the host system, any Bitbake cross-compiling toolchain available from the build system is automatically used from within QEMU simply by calling "distcc". You can accomplish this by defining the cross-compiler variable (e.g. export CC="distcc"). Alternatively, if a suitable SDK/toolchain is present in /opt/poky it is also automatically be used.

There are several options for connecting into the emulated system. QEMU provides a framebuffer interface that has standard consoles available. There is also a serial connection available that has a console to the system running on it and uses standard IP networking. The images have a dropbear ssh server running with the root password disabled to allow standard ssh and scp commands to work. The images also contain an NFS server that exports the guest's root filesystem, which allows it to be made available to the host.