About Docker

In child words, Docker is a tool to ease running « any » applications on « any » systems. Of course there is conditions and rules to follow, but to start using Docker there is no need to bother yet.

The docker story starts as root like that :

[root@localhost ~]# yum install docker
Yum command has been deprecated, redirecting to '/usr/bin/dnf install docker'.
See 'man dnf' and 'man yum2dnf' for more information.
To transfer transaction metadata from yum to DNF, run:
'dnf install python-dnf-plugins-extras-migrate && dnf-2 migrate'

Last metadata expiration check: 0:43:54 ago on Sat Aug 13 08:51:04 2016.
Dependencies resolved.
 Package Arch Version Repository Size
 docker x86_64 2:1.10.3-26.git1ecb834.fc24 updates 6.7 M
 docker-selinux x86_64 2:1.10.3-26.git1ecb834.fc24 updates 74 k
 docker-v1.10-migrator x86_64 2:1.10.3-26.git1ecb834.fc24 updates 1.9 M

Transaction Summary

Total download size: 8.7 M
Installed size: 35 M
Is this ok [y/N]:

And once you say yes … you are already half way, docker is terribly easy to use ..

You need to start the service first:

# systemctl enable docker.service
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
# systemctl start docker

And then you can dowload an image:

> sudo docker pull "atlassian/agent-setup-git:latest"

Trying to pull repository docker.io/atlassian/agent-setup-git ... 
latest: Pulling from docker.io/atlassian/agent-setup-git
6c123565ed5e: Pull complete 
2a3a5d549d2b: Pull complete 
Digest: sha256:e1d2f19b296912e43eed9ea814dcfddbe68a23256791663e53316a0127ddf375
Status: Downloaded newer image for docker.io/atlassian/agent-setup-git:latest

And you can run your first command in this docker:

> sudo docker run "atlassian/agent-setup-git:latest" ls 


You can also start using docker configuration file which look like that:

FROM fedora:24

RUN dnf install -y gtk2-devel cmake libXmu-devel
RUN mkdir /toto
COPY . /toto/
RUN ls /toto

And building an image like that:

> sudo docker build -f DockerFile -t docker.io/bodman/test:fedora24 ./

Docker tends to generate a lot of files to work. The best is to manage where those files are created. With Fedora, in the configuration file /etc/sysconfig/docker find the OPTIONS parameter and add -g /path/to/store/docker/files argument.

To see infos about docker :

docker info

To increase the maximum size of docker images add in the file /etc/sysconfig/docker-storage :

DOCKER_STORAGE_OPTIONS= – -storage-opt dm.basesize=30G



Building Android 4.4_r1 on Fedora 22

First, I create a specific user to build Android :

useradd builder
passwd builder
su - builder

Download the download tool :

mkdir -p ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
export PATH=~/bin:$PATH

Download the repo :

mkdir -p ~/android/source
cd ~/android/source
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
repo init -u https://android.googlesource.com/platform/manifest -b android-4.4_r1

Download the source (very long … ) :

repo sync

Prepare the build :

source build/envsetup.sh
lunch aosp_arm-userdebug
export PATH=/usr/java/jdk1.6.0_45/bin/:$PATH

In the file « build/core/main.mk » remove the test which want a specific version of GNU make. This is not required. However the JDK 1.6 is required !

Start the build (less than 2 hours …) :


If it worked you just need to run the emulator !

DISPLAY=:0 emulator

You may need to share your standard user’s DISPLAY with the builder user :

xhost +SI:localuser:builder

Or the Android kernel in command line :

emulator -sysdir ./out/target/product/generic/  -kernel ./prebuilts/qemu-kernel/arm/kernel-qemu-armv7 -no-window -show-kernel -shell

Source : http://source.android.com/source/initializing.html

Compiling Qemu v0.9.1

Easy :

git clone git://git.qemu-project.org/qemu.git
git checkout v0.9.1

If you get this error :

block-raw-posix.c:242: error: `SIGUSR2' undeclared here (not in a function)
block-raw-posix.c: In function `qemu_aio_init':
block-raw-posix.c:264: error: storage size of 'act' isn't known
block-raw-posix.c:268: warning: implicit declaration of function `sigfillset'
block-raw-posix.c:271: warning: implicit declaration of function `sigaction'
block-raw-posix.c:264: warning: unused variable `act'
block-raw-posix.c: In function `qemu_aio_wait_start':
block-raw-posix.c:348: warning: implicit declaration of function `sigemptyset'
block-raw-posix.c:349: warning: implicit declaration of function `sigaddset'
block-raw-posix.c:350: warning: implicit declaration of function `sigprocmask'
block-raw-posix.c:350: error: `SIG_BLOCK' undeclared (first use in this function)
block-raw-posix.c:350: error: (Each undeclared identifier is reported only once
block-raw-posix.c:350: error: for each function it appears in.)
block-raw-posix.c: In function `qemu_aio_wait':
block-raw-posix.c:364: warning: implicit declaration of function `sigwait'
block-raw-posix.c: In function `qemu_aio_wait_end':
block-raw-posix.c:370: error: `SIG_SETMASK' undeclared (first use in this function)
make: *** [qemu-img-block-raw-posix.o] Error 1

One way to solve it is to change the source :

--- a/block-raw-posix.c
+++ b/block-raw-posix.c
@@ -44,13 +44,14 @@
 #ifdef __linux__
 #include <sys/ioctl.h>
 #include <linux/cdrom.h>
 #include <linux/fd.h>
+#include <signal.h>



ARM bare metal example

Here is the simplest example of bare metal program I know. This is a mix of examples I found, because for some obscure reasons, none of these sources provided a working example with a recent GNU GCC. I’ll only give the source for each file and a makefile.


.globl _start
 .extern STACK_TOP
 ldr sp, =STACK_TOP
 bl start
 b 1b
 .size _start, . - _start


 /* QEMU loads the kernel in Flash here. I strongly suggest you look at the
 * memory map provided in the CoreTile TRM (see below).
 . = 0x80010000 ;
/* Make sure our entry stub goes first */
 .stub : { _start.o(.text) }
 .text : { *(.text) }
 .rodata : { *(.rodata) }
 .data : { *(.data) }
 .bss : { *(.bss COMMON) }
 . += 0x10000;


#define UART0_BASE 0x1c090000
 void start()
 *(volatile long int *)(UART0_BASE) = 'A';


all : kernel.elf
test : kernel.elf
 qemu-system-arm -M vexpress-a15 -cpu cortex-a15 -kernel kernel.elf -nographic
_start.o : _start.arm
 $(CROSS_COMPILE)as -march=armv7-a -mcpu=cortex-a15 $^ -o $@
 start.o : start.c
 $(CROSS_COMPILE)gcc -ffreestanding -Wall -Wextra -Werror -c $^ -o $@
 kernel.elf : linker.ld _start.o start.o
 $(CROSS_COMPILE)ld -T $^ -o $@

Then make elf will build the binary, and make test should launch Qemu 🙂

Sources : https://balau82.wordpress.com/2010/02/14/simplest-bare-metal-program-for-arm/ , http://wiki.osdev.org/ARMv7-A_Bare_Bones

Preparing a minimal x86 linux system for Qemu

The fast way only !

Downloads :

wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.0.3.tar.xz
wget https://busybox.net/downloads/busybox-1.23.2.tar.bz2
tar xf linux-4.0.3.tar.xz
tar xf busybox-1.23.2.tar.bz2

Build x86 busybox :

 mkdir -pv build/busybox-x86
 cd busybox-1.23.2
 make O=../build/busybox-x86 defconfig
 make O=../build/busybox-x86 menuconfig
 (BusyboxSettings->Build Options-> Build BB as a static binary = ON)
 cd ../build/busybox-x86
 make install # will install in the _install dir
 cd .. # in build dir
 mkdir -p initramfs-x86
 cd initramfs-x86
 mkdir -pv {bin,sbin,etc,proc,sys,usr/{bin,sbin}}
 cp -a ../busybox-x86/_install/* .
 echo '#!/bin/sh' > init
 echo "mount -t proc none /proc" >> init
 echo "mount -t sysfs none /sys" >> init
 echo "echo -e \"\nBoot took \$(cut -d' ' -f1 /proc/uptime) seconds\n\"" >> init
 echo "exec /bin/sh" >> init
 chmod +x init
 find . -print0 | cpio --null -ov --format=newc | gzip -9 > ../initramfs-busybox-x86.cpio.gz

Build x86 Linux :

 cd linux-4.0.3/
 make O=../build/linux-x86-basic x86_64_defconfig
 make O=../build/linux-x86-basic kvmconfig
 make O=../build/linux-x86-basic -j4

Run it x86 system with Qemu :

qemu-system-x86_64 -kernel linux-x86-basic/arch/x86_64/boot/bzImage -initrd initramfs-busybox-x86.cpio.gz -nographic -append "console=ttyS0"

Debug :

If init is not found at boot, you can check it is in the initramfs file :

$ zcat initramfs-busybox-x86.cpio.gz | cpio -t| grep init
5111 blocks

Build ARMv5 Linux :

For ARM, ensure you have a the compilation toolchain in your PATH.

 cd linux-4.0.3/
 export CROSS_COMPILE=arm-unknown-linux-gnueabi-
 export ARCH=arm
 make O=../build/linux-armv5-basic versatile_defconfig
 make O=../build/linux-armv5-basic -j4

Build ARMv5 busybox :

 export CROSS_COMPILE=arm-unknown-linux-gnueabi-
 export ARCH=arm
 mkdir -pv build/busybox-armv5
 cd busybox-1.23.2
 make O=../build/busybox-armv5 defconfig
 make O=../build/busybox-armv5 menuconfig
 (BusyboxSettings->Build Options-> Build BB as a static binary = ON)
 cd ../build/busybox-armv5
 make install # will install in the _install dir
 cd .. # in build dir
 mkdir -p initramfs-armv5
 cd initramfs-armv5
 mkdir -pv {bin,sbin,etc,proc,sys,usr/{bin,sbin}}
 cp -a ../busybox-armv5/_install/* .
 echo '#!/bin/sh' > init
 echo "mount -t proc none /proc" >> init
 echo "mount -t sysfs none /sys" >> init
 echo "echo -e \"\nBoot took \$(cut -d' ' -f1 /proc/uptime) seconds\n\"" >> init
 echo "exec /bin/sh" >> init
 chmod +x init
 find . -print0 | cpio --null -ov --format=newc | gzip -9 > ../initramfs-busybox-armv5.cpio.gz

Run it x86 system with Qemu :

qemu-system-arm  -M versatilepb  -kernel linux-armv5-basic/arch/arm/boot/zImage -initrd initramfs-busybox-armv5.cpio.gz -nographic -append "console=ttyAMA0,115200"


Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)

You probably forget the initrd or your initramfs is wrong.

Failed to execute /init (error -8)
input: AT Raw Set 2 keyboard as /devices/fpga:06/serio0/input/input0
Starting init: /sbin/init exists but couldn't execute it (error -8)
Starting init: /bin/sh exists but couldn't execute it (error -8)
Kernel panic - not syncing: No working init found.  Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.

Your initramfs is wrong.

source :

I mostly reproduce the proposition from this website, it also proposes more explanation and a way to speed-up the kernel boot : http://mgalgs.github.io/2015/05/16/how-to-build-a-custom-linux-kernel-for-qemu-2015-edition.html

Building a compiler with Crosstool-ng

What is crosstool-ng : http://www.crosstool-ng.org/

Step 1 – Preparation

Download and compile it :

$  git clone git://crosstool-ng.org/crosstool-ng
$  cd crosstool-ng
$  ./configure --enable-local 
$  make

Step 2 – Configuration

Configure your target (ex: arm architecture) :

$ ./ct-ng arm-unknown-linux-gnueabi

If you are not sure about the target you need, you can check the existing ones :

$ ./ct-ng list-samples
[L..] armeb-unknown-linux-gnueabi
[L..] x86_64-unknown-linux-gnu
[L..] x86_64-unknown-linux-uclibc
[L.X] x86_64-w64-mingw32
[L..] xtensa-unknown-linux-uclibc
 L (Local) : sample was found in current directory
 G (Global) : sample was installed with crosstool-NG
 X (EXPERIMENTAL): sample may use EXPERIMENTAL features
 B (BROKEN) : sample is currently broken

Step 3 – Generation

Generate the compiler :

$ ./ct-ng build


Once the compilation is done,

$ export PATH=crosstool-ng/.build/arm-unknown-linux-gnueabi/buildtools/bin/:$PATH
$ export CCPREFIX := arm-unknown-linux-gnueabi-
$ export AS := $(CCPREFIX)as
$ export LD := $(CCPREFIX)ld
$ export CC := $(CCPREFIX)gcc
$ export AR := $(CCPREFIX)ar

You can also repeat the build operation on different target to generate all you need:

$ ./ct-ng arm-unknown-linux-gnueabi 
$ ./ct-ng build
$ export PATH=crosstool-ng/.build/arm-unknown-linux-gnueabi/buildtools/bin/:$PATH

Possible errors

[ERROR] g++-4.6.real: internal compiler error: Killed (program cc1plus)

This happended to me on a board with not enough memory. You can temporarily add more swap :

dd if=/dev/zero of=swap.img bs=1024k count=1000
mkswap swap.img
swapon swap.img



Install Citrix ICA Client on Fedora 15

Comme indiqué sur cette superbe page :


Le client citrix nécessite openmotif, paquet visiblement pas disponible sous Fedora.

On peut heureusement le récupérer sur rpmbones :


Pour finalement faire un yum localinstall du rpm de citrix.

Les fichiers ICA seront ensuite automatiquement reconnus par le client citrix.

Install Party accessibilité

Une install party accessibilité à la cité des sciences. :


Au programme :

- Conférences dans l’Agora :

  • 14 h : Introduction et enjeux des logiciels libres
  • 14 h 30 : Les distributions linux et leur accessibilité
  • 15 h : L’accessibilité de Gnome et Orca
  • 15 h 30 : Le lecteur d’écran NVDA et les loupes VMG et ISMAG

Démonstrations dans le Studio :

  • de 16 h à 18 h : Démonstrations et prise en main de logiciels

- Install Party dans la Classe numérique :

  • de 12h à 18h en continu

En parallèle, nos partenaires vous proposent de vous
accompagner pour installer sur votre ordinateur la distribution de
logiciels libres de votre choix, ainsi que les logiciels
d’accessibilité. Cette action est réservée en priorité aux personnes
ayant un handicap visuel.

Pour cette Install Party, les personnes déficientes
visuelles sont invitées à s’inscrire au plus tard le vendredi 6 juin
auprès des médiatrices de la salle Louis Braille au 01 40 05 78 42.

- Partenaires :