clamav compiled and runs on Raspberry Pi - Raspberry Pi Forums


i know discussion "viruses on raspi" in
http://www.raspberrypi.org/phpbb3/viewtopic.php?f=63&t=2988&p=39587&hilit=clamav#p39587
, antivirus tools on linux machine may not much.
know main security issue between keyobard , chair. ;-)
not discuss again.

have been using several antivirus tools on normal linux machine scan files,
use under windows.
haven't had virus in years.

out of interest wanted compile clamav on raspberry pi:
http://www.clamav.net/lang/en/ sources 0.98 .

since raspberry not on internet sftp'd stuff raspberry.
clamav-0.98 $ ./configure --sysconfdir=/etc
ended in
"...
checking gzopen in -lz... yes
checking how link libbz2... -lbz2
checking bz2_bzdecompressinit in -lbz2... no
checking bzlib.h usability... no
checking bzlib.h presence... no
checking bzlib.h... no
configure: warning: ****** bzip2 support disabled
..."
first updated bzip2:
clamav-0.98 $ bzip2 --version
bzip2, block-sorting file compressor. version 1.0.6, 6-sept-2010.

http://archive.raspbian.org/raspbian/pool/main/b/bzip2/ has debs.
updating:
sudo dpkg -i libbz2-1.0_1.0.6-5_armhf.deb
sudo dpkg -i bzip2_1.0.6-5_armhf.deb
sudo dpkg -i libbz2-dev_1.0.6-5_armhf.deb

, configure works:
clamav-0.98 $ ./configure --sysconfdir=/etc
...
checking inflateend in -lz... yes
checking gzopen in -lz... yes
checking how link libbz2... -lbz2
checking bz2_bzdecompressinit in -lbz2... yes
checking bzlib.h usability... yes
checking bzlib.h presence... yes
checking bzlib.h... yes

then:
configure: error: user clamav (and/or group clamav) doesn't exist. please read
documentation !

of course - http://www.clamav.net/doc/latest/html/node14.html shows has done:
clamav-0.98 $ sudo groupadd clamav
clamav-0.98 $ sudo useradd -g clamav -s /bin/false -c "clam antivirus" clamav

clamav-0.98 $ ./configure --sysconfdir=/etc gets finished now.

clamav-0.98 $ make all
results in error:
...
cc thrmgr.o
cc server-th.o
cc scanner.o
cc others.o
cc fan.o
in file included fan.c:38:0:
fan-syscalllib.h:14:3: error: #error "system call numbers not defined architecture"
fan-syscalllib.h: in function ‘fanotify_init’:
fan-syscalllib.h:19:17: error: ‘__nr_fanotify_init’ undeclared (first use in function)
fan-syscalllib.h:19:17: note: each undeclared identifier reported once each function appears in
fan-syscalllib.h: in function ‘fanotify_mark’:
fan-syscalllib.h:25:17: error: ‘__nr_fanotify_mark’ undeclared (first use in function)
make[2]: *** [fan.o] error 1
make[2]: *** waiting unfinished jobs....
make[2]: leaving directory `/home/pi/technical/antivir/clamav/clamav-0.98/clamd'
make[1]: *** [all-recursive] error 1
make[1]: leaving directory `/home/pi/technical/antivir/clamav/clamav-0.98'
make: *** [all] error 2

solution here:
http://osdir.com/ml/scm-fedora-commits/2013-10/msg02105.html
need patch/change in
clamav-0.98/clamd/fan-syscalllib.h
one:
#if defined(__x86_64__)
# define __nr_fanotify_init 300
# define __nr_fanotify_mark 301
#elif defined(__i386__)
# define __nr_fanotify_init 338
# define __nr_fanotify_mark 339

this:
#if defined(__x86_64__)
# define __nr_fanotify_init 300
# define __nr_fanotify_mark 301
#elif defined(__i386__)
# define __nr_fanotify_init 338
# define __nr_fanotify_mark 339
#elif defined(__arm_eabi__)
# define __nr_fanotify_init 367
# define __nr_fanotify_mark 368
#else
# error "system call numbers not defined architecture"
#endif

make finished after approx 1h

since use clamav on normal linux machine, packed updated
/usr/local/share/clamav/
/usr/local/share/clamav/main.cld
/usr/local/share/clamav/bytecode.cld
/usr/local/share/clamav/daily.cld
/usr/local/share/clamav/mirrors.dat

transferred them raspberry pi, unpacked , bingo:
can script with:
reportoutp=clamavscan`date +%y%m%d_%h%m%s`;
nice -17 clamscan --max-recursion=300 --max-dir-recursion=300 --max-files=1000000 --max-filesize=4095m --max-scansize=4095m -r --detect-pua=yes --log=$reportoutp "$@" | grep "infected files:";

numbers guesses maybe there better settings.
scanning of ~pi on raspberry pi took 42min 750mb. ;-)

br
pete



raspberrypi



Comments

Popular posts from this blog

CS5 Adobe Media Encoder: Encode failed because the source duration is nil.

cf_sql_integer vs cf_sql_bigint vs cf_sql_int??

localhost/joomla15/administrator doesnt work - Joomla! Forum - community, help and support