Here is the comprehensive list of steps to have the fantastic Zoneminder application in your Guruplug (should work also in Sheeva plugs). I wrote all the steps I followed after reflashing my Guruplug with the original kernel and rootfs.
Change mysql root password
mysqladmin -u root -pnosoup4u password 'yournewpwd'
Change ssh keys
rm /etc/ssh/ssh_host_*
dpkg-reconfigure openssh-server
Comment or delete all the lines in init_setup.sh and wlan.sh-To have a fixed IP address, add these lines in your init_setup.sh, replace the XXX with your own parameters:
ifconfig eth0 xxx.xxx.xxx.xxx netmask 255.255.255.0 up
route add -net xxx.xxx.xxx.xxx netmask 255.255.255.0 eth0
route add default gw xxx.xxx.xxx.xxx eth0
Also, edit the file /etc/network/interfaces to look like this, as above, replace the XXX with your settings:
# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address xxx.xxx.xxx.xxx
netmask xxx.xxx.xxx.xxx
gateway xxx.xxx.xxx.xxx
Reboot, now the ipaddress should be the one you selected.
Update your system:
apt-get update && apt-get upgrade
In case of problems with GPG keys
apt-get install debian-archive-keyring && apt-get update && apt-get upgrade
I removed some apps that I'm not planning to use, then install some packages
apt-get purge alsa-base linux-sound-base
apt-get autoremove && apt-get clean
apt-get install locales localepurge
dpkg-reconfigure locales
dpkg-reconfigure tzdata
apt-get install di htop chkconfig
apt-get install ntp
apt-get autoremove && apt-get clean
Setup your ntp
vi /etc/ntp.conf
add servers (for Spain) to the file and save it
server 0.es.pool.ntp.org
server 1.es.pool.ntp.org
server 2.es.pool.ntp.org
server 3.es.pool.ntp.org
Change /etc/apt/sources.list to have these lines
deb-src http://security.debian.org/ wheezy/updates main
deb http://security.debian.org wheezy/updates main contrib non-free
deb http://ftp.fr.debian.org/debian/ squeeze main contrib non-free
deb-src http://ftp.fr.debian.org/debian/ squeeze main contrib non-free
deb http://ftp.us.debian.org/debian wheezy main contrib non-free
deb http://http.us.debian.org/debian stable main contrib non-free
#deb http://ftp.us.debian.org/debian/ lenny main contrib non-free
#deb http://www.backports.org/debian lenny-backports main contrib non-free
#deb http://download.webmin.com/download/repository sarge contrib
#deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib
#deb http://ftp.es.debian.org/debian/ wheezy main
#deb http://ftp.es.debian.org/debian/ wheezy main
#deb-src http://ftp.es.debian.org/debian/ wheezy main
#deb http://security.debian.org/ wheezy/updates main
In case of errors complaining about buffer size, edit or create a file /etc/apt/apt.conf file and add
APT::Cache-Limit 33554432;
Update your system again
apt-get update && apt-get upgrade
apt-get dselect-upgrade (fix broken dependencies & update system)
apt-get clean && apt-get autoremove
apt-get purge bluez samba alsa-base alsa-utils lighttpd
apt-get autoremove
apt-get install mysql-server apache2
dpkg-reconfigure apache2
After restarting apache2, fix the error "Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName"
vi /etc/apache2/httpd.conf
Add line -> ServerName localhost
/etc/init.d/apache2 restart
apt-get install ufw preload fail2ban ffmpeg libjs-mootools
apt-get install ntp tzdata fail2ban locate nmap tar zip
apt-get install debian-archive-keyring bc coreutils
apt-get purge exim4
apt-get install postfix mailx phpmyadmin
Update kernel
cd /root
wget http://sheeva.with-linux.com/sheeva/README-PLUG-UPDATE.sh
mv README-PLUG-UPDATE.sh upgradeGuru.sh
chmod +x upgradeGuru.sh
./upgradeGuru.sh 3.0.7 --nandkernel
rm sheeva-3*
reboot
Install systemd to improve performance
apt-get install systemd
apt-get autoremove
In case Webmin is needed, but be careful, you will need almost 100Mbytes, so installing it in flash is not recommended. Uncomment this line in /etc/apt/sources.list
#deb
http://download.webmin.com/download/repository sarge contrib
Then:
wget -q http://www.webmin.com/jcameron-key.asc -O- | apt-key add -
apt-get install webmin
Install the packages needed to compile and run ZM
apt-get install autoconf automake make
apt-get install gcc
apt-get install g++
apt-get install libphp-serialization-perl libgnutls-dev gnutls-bin
apt-get install build-essential libmysqlclient-dev libjpeg8-dev
apt-get install libcrypto++-dev libssl-dev perl libdate-manip-perl
perl -MCPAN -e shell
install Sys::Mmap Device::SerialPort Net::SFTP::Foreign Expect Archive::Zip MIME::Lite MIME::Entity X10::ActiveHome LWP::UserAgent
quit
apt-get install gawk mawk php5 php5-mysql libdbd-mysql-perl libwww-perl
apt-get install libavformat-dev libswscale-dev libavutil-dev libv4l-dev
apt-get install libpcre3-dev libsys-mmap-perl libavcodec-dev libavdevice-dev libbz2-dev
apt-get install dh-autoreconf libnet-ssleay-perl openssl libauthen-pam-perl
apt-get clean && apt-get autoremove
Get ZM and modify bugs
cd /usr/src
wget http://www.zoneminder.com/downloads/ZoneMinder-1.25.0.tar.gz
tar -xzvf ZoneMinder-1.25.0.tar.gz
mv ZoneMinder-1.25.0 zm
Important, to compile Zoneminder in Arm, edit /usr/src/zm/scr/zm_signal.cpp, change all the occurrences of
context.cr2 to
context.fault_addressAcknowledgment to the user paketecuento from plugcomputer.org, he gave me the clue!
Compile ZM
export CFLAGS="-march=armv5te -O2 -mtune=arm926ej-s -Fno-strict-aliasing -msoft-float -D__GCC_FLOAT_NOT_NEEDED" && \
export CXXFLAGS="${CFLAGS}" && \
export CPPFLAGS="${CFLAGS}"
./configure --with-webdir=/usr/share/zoneminder --with-cgidir=/usr/lib/cgi-bin --prefix=/usr/bin \
ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=zmuser \
ZM_DB_PASS=zpass ZM_SSL_LIB=openssl --enable-debug=no \
--with-webgroup=www-data --with-webuser=www-data --enable-mmap=yes --with-libarch=lib --with-ffmpeg=/usr/local/bin CPPFLAGS="-D__STDC_CONSTANT_MACROS ${CPPFLAGS}"
make
automake
aclocal
mysqladmin -u root -p -f drop zm
mysql -u root -p < db/zm_create.sql
mysql -u root -p
grant select,insert,update,delete on zm.* to 'zmuser'@localhost identified by 'zmpass';
quit
mysqladmin -p reload
make install
make clean
Install Cambozola
cd /usr/src && wget http://www.charliemouse.com:8080/code/cambozola/cambozola-latest.tar.gz
tar -xzvf cambozola-latest.tar.gz
cp cambozola-0.92/dist/cambozola.jar /var/www/zm
Create the startup script
vi /etc/init.d/zoneminder
Paste this lines
#!/bin/sh
prog=ZoneMinder
ZM_PATH_BIN="/usr/bin/bin"
command="$ZM_PATH_BIN/zmpkg.pl"
start() {
echo -n "Starting $prog: "
$command start
RETVAL=$?
[ $RETVAL = 0 ] && echo success
[ $RETVAL != 0 ] && echo failure
return $RETVAL
}
stop() {
echo -n "Stopping $prog: "
$command stop
RETVAL=$?
[ $RETVAL = 0 ] && echo success
[ $RETVAL != 0 ] && echo failure
}
status() {
result=`$command status`
if [ "$result" = "running" ]; then
echo "ZoneMinder is running"
RETVAL=0
else
echo "ZoneMinder is stopped"
RETVAL=1
fi
}
case "$1" in
'start')
start
;;
'stop')
stop
;;
'restart')
stop
start
;;
'status')
status
;;
*)
echo "Usage: $0 { start | stop | restart | status }"
RETVAL=1
;;
esac
exit $RETVAL
Save it, then
chmod 755 /etc/init.d/zoneminder
service zoneminder status
Configure apache, edit the file /etc/apache2/sites-enabled/000-default , replace:
DocumentRoot /var/www
by
DocumentRoot /usr/share/zoneminder
and
<Directory /var/www/>
by
<Directory /usr/share/zoneminder/>
service apache2 restart
To remove errors "zmwatch[2429].ERR [Shared data size conflict in shared_data for monitor Monitor-1, expected 328, got 316]", edit /usr/local/share/perl/5.12.4/ZoneMinder/Memory.pm and replace:
$arch = int(3.2*length(~0));
with
$arch = 32;
Cleanup & free some space
apt-get purge autoconf automake make gcc g++-4.6 libstdc++6-4.6-dev
Now you could setup your Zoneminder surveillance system in this small beast!
Hope it helps,
PacoLM