Objectif : Installer une version pré-compilée pour ARM de la dernière version stable
BusyBox pour bénéficier de
commandes supplémentaires et notamment des serveurs
ftpd et
httpd intégrés.
On se passera ainsi des serveurs python ftpd et httpd abordés précédemment et beaucoup moins performants.
Note : La dernière version de Busybox v 1.20.0 est désormais intégrée dans la
nouvelle mise à jour du RootFS
release r2.
On procède à l'installation du binaire dans /usr/bin dont la partition est modifiable à volonté.
Une fois connecté en telnet sur le Karotz
Installation sur /usr/bin ou sbin au choix
#
cd /usr/bin
#
mkdir busybox.120
#
cd busy*
#
wget http://www.busybox.net/downloads/binaries/latest/busybox-armv4tl
#
mv busybox-armv4tl busybox
#
chmod +x busybox
Vérification de la version
#
./busybox |
head
On peut installer quelques liens symboliques si nécessaire
#
cd /usr/bin
#
ln -s
/usr/bin/busybox.120/busybox ftpd
#
ln -s
/usr/bin/busybox.120/busybox httpd
#
httpd --help
#
ftpd --help
On démarrera ensuite les serveurs Web httpd et Ftp ftpd avec inetd.
Exemple de script wizz_start.sh à appeler à la fin de yaffs_start.sh
#!/bin/bash
#
# Start ftpd & httpd daemon
WIZZ_INETD_MORE=/tmp/wizz_inetd_more.conf
echo "21 stream tcp nowait root /usr/bin/ftpd ftpd -w /usr" > $WIZZ_INETD_MORE
echo "80 stream tcp nowait root /usr/bin/httpd httpd -i -c /usr/httpd.conf -h /usr/www" >> $WIZZ_INETD_MORE
/sbin/inetd $WIZZ_INETD_MORE
Le répertoire HOME du serveur Web est ici
/usr/www.
Les
scripts cgi/system exécutables -
#!bin/sh ou
#!/usr/bin/python - (chmod +x ...) doivent être posés dans
/usr/www/cgi-bin
Ajouter un fichier de conf pour le serveur Web httpd dans /usr/httpd.conf
# define the server root. It will override -h
# H:/usr/www
# Allow address from 196.168.0.0
A:192.168.
A:127.0.0.1
# Deny from other IP connections
D:*
# 404 (not found) error page
# E404:/usr/www/404.html
# Show index.html when a directory is requested
# I:index.html
Note : Voir aussi le post sur le
template Bootstrap+JQuery+CGI.
Cf docs :
-
http://www.busybox.net/downloads/BusyBox.html
-
http://git.busybox.net/busybox/tree/networking/httpd.c