Ora che il baselayout e le librerie di sistema sono state installate, occorre installare tutte le utility standard unix, ovvero tutto il set dei comandi che compongono un buon ambiente di shell.
Anzichè installare un mucchio di pacchetti differenti, con conseguente spreco di spazio, si può optare per l'utilizzo di un progetto chiamato busybox (http://www.busybox.net/). Come si può leggere dal sito del progetto, busybox combina tutte le più comuni utility unix dentro un singolo e piccolo eseguibile. Funziona come un rimpiazzo perfettamente compatibile con tutte le più utili utility GNU (come fileutils, shellutils, etc). Busybox è stato progettato per i sistemi embedded, è possibile infatti costruire un sistema embedded unendolo ad un kernel, popolando la directory /dev/ con i device node necessari, e aggiungendo alcuni file di configurazione ad /etc/.
Per emergere busybox dobbiamo prima emergerlo dentro il development_rootfs, e poi installare il pacchetto binario dentro l'embedded_rootfs con l'opzione -K:
# emerge busybox # ROOT=/embedded_rootfs emerge -K busybox |
L'ebuild di busybox non si occupa di creare tutti i link simbolici necessari, per tanto sono necessari i seguenti comandi:
# mkdir /embedded_rootfs/proc # mount -o bind /proc/ /embedded_rootfs/proc/ # chroot /embedded_rootfs /bin/busybox --install -s # umount /embedded_rootfs/proc |
Le opzioni --install e -s creano tutti i link simbolici necessari, per avere conferma che essi siano stati creati corretamente basta usare il comando ls:
# ls -l /embedded_rootfs/bin/ | grep busybox lrwxrwxrwx 1 root root 12 Jul 26 20:54 [ -> /bin/busybox lrwxrwxrwx 1 root root 12 Jul 26 20:54 [[ -> /bin/busybox lrwxrwxrwx 1 root root 12 Jul 26 20:54 addgroup -> /bin/busybox lrwxrwxrwx 1 root root 12 Jul 26 20:54 adduser -> /bin/busybox lrwxrwxrwx 1 root root 12 Jul 26 20:54 ar -> /bin/busybox lrwxrwxrwx 1 root root 12 Jul 26 20:54 arping -> /bin/busybox lrwxrwxrwx 1 root root 12 Jul 26 20:54 ash -> /bin/busybox lrwxrwxrwx 1 root root 12 Jul 26 20:54 awk -> /bin/busybox lrwxrwxrwx 1 root root 12 Jul 26 20:54 basename -> /bin/busybox lrwxrwxrwx 1 root root 12 Jul 26 20:54 bunzip2 -> /bin/busybox -rwxr-xr-x 1 root root 632416 Jul 14 14:19 busybox lrwxrwxrwx 1 root root 12 Jul 26 20:54 bzcat -> /bin/busybox lrwxrwxrwx 1 root root 12 Jul 26 20:54 cal -> /bin/busybox lrwxrwxrwx 1 root root 12 Jul 26 20:54 cat -> /bin/busybox lrwxrwxrwx 1 root root 12 Jul 26 20:54 chgrp -> /bin/busybox lrwxrwxrwx 1 root root 12 Jul 26 20:54 chmod -> /bin/busybox lrwxrwxrwx 1 root root 12 Jul 26 20:54 chown -> /bin/busybox lrwxrwxrwx 1 root root 12 Jul 26 20:54 chvt -> /bin/busybox lrwxrwxrwx 1 root root 12 Jul 26 20:54 clear -> /bin/busybox ....... ....... ....... [output troncato] |