Welcome! Log In Create A New Profile

Advanced

Howto: pi-hole ad-blocker on Seagate Dockstar

Posted by rsinklair 
Howto: pi-hole ad-blocker on Seagate Dockstar
May 28, 2020 04:37PM
In case this is useful for anyone else, here's my notes on

How to install pi-hole 5.0 on Seagate Dockstar running Debian 10
---------------------------------------------------------

This was performed on a fresh install of the standard install ( Debian-5.2.9-kirkwood-tld-1-rootfs-bodhi.tar.bz2 )

install curl:
# apt install curl


Download pi-hole installscript. But first, install latest ca-certificates if you don't have them , otherwise curl refuses to connect to some https sites
# apt install ca-certificates

# curl -sSL https://install.pi-hole.net > pihole-basic-install.sh


Note: had to edit the install script to change 'binary' to 'l_binary' on one line in pihole-basic-install.sh, as otherwise it exited during the 'FTL Checks' section -
...
 	 	printf "%b  %b Detected ARM architecture\\n" "${OVER}" "${TICK}"
     		# set the binary to be used
     -->        l_binary="pihole-FTL-arm-linux-gnueabi"
    ...

# bash pihole-basic-install.sh

The install script runs through lots of checks, asks you some questions, then downloads lighttpd, php, dnsmasq etc
....
...
   FTL Checks...

  [â] Detected ARM architecture
   Checking for existing FTL binary...
  [â] Downloading and Installing FTL
  [â] Installing scripts from /etc/.pihole

   Installing configs from /etc/.pihole...
  [â] No dnsmasq.conf found... restoring default dnsmasq.conf...
...
.....
  [â] Swapping databases
   Number of gravity domains: 87259 (84818 unique domains)
   Number of exact blacklisted domains: 0
   Number of regex blacklist filters: 0
   Number of exact whitelisted domains: 0
   Number of regex whitelist filters: 0
  [â] pihole-FTL: no process found
  [â] Cleaning up stray matter
  [â] Restarting DNS server

  [â] DNS service is NOT running
/opt/pihole/updatecheck.sh: line 77: /usr/bin/pihole-FTL: No such file or directory
/opt/pihole/updatecheck.sh: line 91: /usr/bin/pihole-FTL: No such file or directory
   Web Interface password: xxxx
   This can be changed using 'pihole -a -p'

   View the web interface at http://pi.hole/admin or http://192.168.17.39/admin

   You may now configure your devices to use the Pi-hole as their DNS server
   Pi-hole DNS (IPv4): 192.168.17.39
   If you set a new IP address, please restart the server running the Pi-hole

   The install log is located at: /etc/pihole/install.log
Installation Complete!

Looks good, however looks like there was a problem with getting the pre-compiled pihole-FTL binary ( which is the core part of pi-hole) :

# /usr/bin/pihole-FTL --version
-bash: /usr/bin/pihole-FTL: No such file or directory
# ls -l /usr/bin/pihole-FTL
-rwxr-xr-x 1 root root 6860972  May 27 08:59 /usr/bin/pihole-FTL

How strange : 'No such file' error , but it's clearly there - have we got some weird filesystem corruption or something ?!

# od -c /usr/bin/pihole-FTL |head
0000000 177   E   L   F 001 001 001  \0  \0  \0  \0  \0  \0  \0  \0  \0
0000020 003  \0   (  \0 001  \0  \0  \0 240 356 001  \0   4  \0  \0  \0
0000040 330 375   x  \0 002 004  \0 005   4  \0      \0  \t  \0   (  \0
0000060   (  \0   %  \0 001  \0  \0   p 324   , 033  \0 324   , 033  \0
....

# file /usr/bin/pihole-FTL
/usr/bin/pihole-FTL: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, with debug_info, not stripped
# ldd /usr/bin/pihole-FTL
 not a dynamic executable

So looks like no filesystem corruption, it's probably just compiled for a different ARM architecture than what we have

So we have to build FTL from source :
( taken from instructions at https://docs.pi-hole.net/ftldns/compile/ :

# apt install build-essential libgmp-dev m4

Although libnettle (for DNSSEC) was already installed by the main pihole installer above, we are going to need the header files etc, so best build nettle too :

# wget https://ftp.gnu.org/gnu/nettle/nettle-3.6.tar.gz
# tar -xvzf nettle-3.6.tar.gz
# cd nettle-3.6
# ./configure
# make
# make install

Note: before compiling FTL, make sure you have at least 256MB of swap available, as it is a memory-hungry compile.

# apt install libsqlite3-dev

# git clone https://github.com/pi-hole/FTL.git
# cd FTL
# make
# make install
# service pihole-FTL restart


NOTE : If it still runs out of RAM during the make ( e.g. gcc dies unexpectedly after 10 min with something like
cc: fatal error: Killed signal terminated program cc1
   compilation terminated.
   make: *** [Makefile:146: build/database/sqlite3.o] Error 1

then one way to reduce RAM usage during compile is to reduce the amount of optimisation gcc does by editing the Makefile and changing -O3 to -O1 or even -O0 :

HARDENING_FLAGS=-fstack-protector-strong -Wp,-D_FORTIFY_SOURCE=2 -O1 -Wl,-z,relro,-z,now  .......

-O1 worked for me on a Dockstar with 128MB of RAM and 192MB of swap.

You should now see pihole-FTL process running, listening on port 53 , and can configure your laptop etc to use it as a DNS resolver.

You can use pi-hole's handy web-admin interface (URL shown above) to view what it's doing, update the blacklists and to whitelist domains/sites if required.

Cheers
Rob

edit : added swap space info



Edited 1 time(s). Last edit at 05/29/2020 02:59AM by rsinklair.
Re: Howto: pi-hole ad-blocker on Seagate Dockstar
May 28, 2020 05:02PM
Thanks Rob,

Very nice. Another Pi-hole tutorial to add to the Wiki!

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Howto: pi-hole ad-blocker on Seagate Dockstar
June 01, 2020 03:22AM
I've added Rob's tutorial to the Wiki:

Quote
https://forum.doozan.com/read.php?2,23630,23630#msg-23630

Home Automation & Tools

X10
CALDav Calendar Server using Radicale
Pogoplug Network Stack with PiHole: pics, and description
Pi-hole on Pogoplug Mobile
Pi-hole on Pogoplug Pro V3 (OXNAS)
Pi-hole ad-blocker on Seagate Dockstar

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Howto: pi-hole ad-blocker on Seagate Dockstar
June 29, 2020 06:59PM
SOLVED:
I can't install llibsqlite3-dev. This is the error I get even though I have done an apt clean:
root@dockstar:~# apt install libsqlite3-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  sqlite3-doc
The following NEW packages will be installed:
  libsqlite3-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 714 kB of archives.
After this operation, 1967 kB of additional disk space will be used.
E: You don't have enough free space in /var/cache/apt/archives/.

root@dockstar:~# du -ch /var/cache/apt/archives/
4.0K	/var/cache/apt/archives/partial
8.0K	/var/cache/apt/archives/
8.0K	total

Turns out I had run out of space usb stick. duh!



Edited 1 time(s). Last edit at 07/04/2020 04:43PM by jshand.
Re: Howto: pi-hole ad-blocker on Seagate Dockstar
July 18, 2020 04:51PM
Well I just tried to update pihole and ran into the same snag with the FTL file. So i tried to recompile as per your instructions but it doesn't use make anymore it uses cmake. So I installed cmake but I get the following error:
root@dockstar:/FTL/cmake# cmake ..
-- The C compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
IDN
    linked by target "pihole-FTL" in directory /FTL/src

-- Configuring incomplete, errors occurred!
See also "/FTL/cmake/CMakeFiles/CMakeOutput.log".
See also "/FTL/cmake/CMakeFiles/CMakeError.log".

This was just updated 7/15/2020. So perhaps you could take a look at it and update your instructions.
Thanks
-john
Re: Howto: pi-hole ad-blocker on Seagate Dockstar
August 07, 2020 03:21PM
Just tried compiling new pihole version on a new Debian Stretch rootfs with latest kernel, worked fine. Just had to make sure i was using a swap file as noted by rsinklair.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: