4

Since I'm thinking of using my pi to do some downloads, i would like to setup a peerblock/peerguardian equivalent.

I searched the internet, and I've found this.

i'm using latest raspbmc,

cat /scripts/upd_hist/build_info
raspbmc-rls-1.0-hardfp-b20130616-u20130616

uname output:

Linux raspbmc 3.6.11 #2 PREEMPT Sat Jun 15 21:45:28 UTC 2013 armv6l GNU/Linux

./autogen.sh output:

pglgui/Makefile.am:65: `%'-style pattern rules are a GNU make extension
pglgui/Makefile.am:81: `%'-style pattern rules are a GNU make extension

./configure –without-qt4 –disable-dbus output:

pgl.......................................... : Version 2.2.2
Prefix....................................... : /usr/local
Exec_Prefix.................................. : ${prefix}
Initd........................................ : ${prefix}/etc/init.d
Logdir....................................... : ${prefix}/var/log/pgl
Piddir....................................... : ${prefix}/var/run
Tmpdir....................................... : /tmp
Blocklists................................... : ${prefix}/var/spool/pgl
Localblocklist............................... : ${prefix}/etc/pgl/blocklists.local
Masterblocklist.............................. : ${prefix}/var/lib/pgl
LSB (use built-in functions if empty)........ :

logrotate.................................... : yes
cron......................................... : yes
networkmanager............................... : yes
zlib......................................... : yes
dbus......................................... : no
lowmem....................................... : no
QT-gui....................................... : no

.............................................
Developer debug:
PGLD_CFLAGS:
PGLD_CPPFLAGS:   -DVERSION=\"2.2.2\" -DPACKAGE_NAME=\"pgl\" -DPIDFILE=\"${prefix}/var/run/pgld.pid\"   -DHAVE_ZLIB
PGLD_LDFLAGS:
PGLD_LIBS: -lnetfilter_queue -lnfnetlink   -lz
QT_CXXFLAGS:
QT_CPPFLAGS: -DVERSION=\"2.2.2\" -DPGLCMDDEFAULTSPATH=\"${exec_prefix}/lib/pgl/pglcmd.defaults\" -D_REENTRANT -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED
QT_LDFLAGS:
QT_LIBS:'

make output (where the error occurs):

make[2]: Entering directory `/home/mushi/peerguardian/pgl-2.2.2/pgld'
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.2.2\" -DPACKAGE_NAME=\"pgl\" -DPIDFILE=\"/usr/local/var/run/pgld.pid\"   -DHAVE_ZLIB   -g -O2 -MT pgld.o -MD -MP -MF .deps/pgld.Tpo -c -o pgld.o `test -f 'src/pgld.c' || echo './'`src/pgld.c
In file included from /usr/include/linux/kernel.h:4:0,
                 from /usr/include/linux/sysctl.h:25,
                 from /usr/include/linux/netfilter.h:6,
                 from /usr/include/linux/netfilter_ipv4.h:8,
                 from src/pgld.h:42,
                 from src/pgld.c:22:
/usr/include/linux/sysinfo.h:8:2: error: unknown type name '__kernel_long_t'
/usr/include/linux/sysinfo.h:9:2: error: unknown type name '__kernel_ulong_t'
/usr/include/linux/sysinfo.h:10:2: error: unknown type name '__kernel_ulong_t'
/usr/include/linux/sysinfo.h:11:2: error: unknown type name '__kernel_ulong_t'
/usr/include/linux/sysinfo.h:12:2: error: unknown type name '__kernel_ulong_t'
/usr/include/linux/sysinfo.h:13:2: error: unknown type name '__kernel_ulong_t'
/usr/include/linux/sysinfo.h:14:2: error: unknown type name '__kernel_ulong_t'
/usr/include/linux/sysinfo.h:15:2: error: unknown type name '__kernel_ulong_t'
/usr/include/linux/sysinfo.h:18:2: error: unknown type name '__kernel_ulong_t'
/usr/include/linux/sysinfo.h:19:2: error: unknown type name '__kernel_ulong_t'
/usr/include/linux/sysinfo.h:21:22: error: '__kernel_ulong_t' undeclared here (not in a function)
make[2]: *** [pgld.o] Error 1
make[2]: Leaving directory `/home/mushi/peerguardian/pgl-2.2.2/pgld'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mushi/peerguardian/pgl-2.2.2'
make: *** [all] Error 2'

trying to compile pgl 2.2.2

0

3 Answers 3

1

I'm the author of the "found this" page =)

Please, for God's sake don't run anything as superuser, except sudo make install step.

Looks, like raspbmc is missing some kernel header files, there are two ways to correct this problem:

  1. you may use apt-get to install linux-headers, but this is likely to break your raspbmc installation, since the raspbmc explicitly warns against using apt-get.

  2. you may use another raspbian installation to compile the peerguardian and then tar-copy-untar and sudo make install on your raspbmc.

Personally, I'd prefer the latter.

10
  • i don't understand headless and raspbmc in the same sentence, do you have TV/monitor attached or not? if not, what's the purpose of raspbmc?
    – lenik
    Jul 24, 2013 at 8:32
  • i've completed the original question with all the outputs i get. my plan is to use pi as a mediacenter and for torrent download,using cron to schedule these activities. i don't have X installed. thank you for your time!
    – mushi
    Jul 24, 2013 at 8:47
  • updated the answer. the best way seems to use another SD card to temporary install raspbian to compile peerguardian.
    – lenik
    Jul 24, 2013 at 9:44
  • Thank you. for the moment I don't have a second card, but will try. maybe someone else interested could do it meanwhile?.. =)
    – mushi
    Jul 24, 2013 at 10:13
  • i've made the compiled build available at lazydroid.com/files/pgl-2.2.2-compiled.tgz -- download, untar and sudo make install. this file will be available for a few days.
    – lenik
    Jul 24, 2013 at 19:30
2

You just have to edit /usr/include/linux/sysinfo.h and add the following code :

#ifndef __kernel_long_t
typedef long     __kernel_long_t;
typedef unsigned long   __kernel_ulong_t;
#endif

it is ugly but it works.

0

Try running all the build steps as sudo. I've often found that without that things often don't compile correctly. Other than that, my next guess would be that you're missing somekind of dependency.

3
  • didn't work, same error...
    – mushi
    Jul 23, 2013 at 16:13
  • According to the author, the gui dependencies "may or may not be required". Have you tried compiling with them?
    – Jacobm001
    Jul 23, 2013 at 16:28
  • yes.. i'm stuck. so little information online about how to correctly set this up on a pi...
    – mushi
    Jul 23, 2013 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.