devices:raspberrypi
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| devices:raspberrypi [2021/12/30 08:53] – [Raspberry Pi] warnaud | devices:raspberrypi [2025/03/06 10:38] (current) – new conf warnaud | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Raspberry Pi ====== | ||
| + | Model B+\\ | ||
| + | OS: [[https:// | ||
| + | Installed with [[https:// | ||
| + | Interface: http:// | ||
| + | SSHKeys on root\\ | ||
| + | |||
| + | ====== Archlinux ====== | ||
| + | Start fdisk to partition the SD card: | ||
| + | <code bash> | ||
| + | Delete old partitions and create a new one:\\ | ||
| + | Type o. to clear out any partitions\\ | ||
| + | Type p to list & check partitions. \\ | ||
| + | Type n for new, p for primary, 1 for the first partition , press ENTER to accept the default first sector, type **+200M** for the last sector.\\ | ||
| + | Type t for type, type c to set the first partition to type W95 FAT32 (LBA).\\ | ||
| + | Type n for new, p for primary, 2 for the second partition on the drive, and then press ENTER twice to accept the default first and last sector.\\ | ||
| + | Write the partition table and exit by typing w.\\ | ||
| + | <code bash> | ||
| + | cd /root | ||
| + | mkfs.vfat / | ||
| + | mkdir boot | ||
| + | mount / | ||
| + | |||
| + | mkfs.ext4 / | ||
| + | mkdir root | ||
| + | mount / | ||
| + | |||
| + | curl -O http:// | ||
| + | bsdtar -xpf ArchLinuxARM-rpi-latest.tar.gz -C root | ||
| + | sync | ||
| + | |||
| + | mv root/boot/* boot | ||
| + | |||
| + | umount boot root | ||
| + | </ | ||
| + | First boot: | ||
| + | <code bash> | ||
| + | ssh alarm@IP #passwd alarm | ||
| + | su # pass root | ||
| + | pacman-key --init | ||
| + | pacman-key --populate archlinuxarm | ||
| + | passwd | ||
| + | </ | ||
| + | ===== Update& | ||
| + | <code bash> | ||
| + | pacman -Syu | ||
| + | pacman -S htop ccze dfc zsh vim base-devel git go #go for yay</ | ||
| + | ===== Extra-config ===== | ||
| + | ==== hostname ==== | ||
| + | <code bash> | ||
| + | ==== fixed IP ==== | ||
| + | <code bash> | ||
| + | vi / | ||
| + | <code perl> | ||
| + | [Match] | ||
| + | Name=eth0 | ||
| + | |||
| + | [Network] | ||
| + | Address=192.168.1.10/ | ||
| + | Gateway=192.168.1.1 | ||
| + | DNS=192.168.1.11 | ||
| + | </ | ||
| + | ==== VIM über älles==== | ||
| + | <code bash> pacman -R vi | ||
| + | ln -s `which vim` / | ||
| + | ==== AUR Helper ==== | ||
| + | Let's install [[https:// | ||
| + | <code bash> | ||
| + | su - alarm | ||
| + | mkdir /tmp/yay | ||
| + | curl https:// | ||
| + | cd /tmp/yay | ||
| + | makepkg | ||
| + | su | ||
| + | pacman -U yay*.xz</ | ||
| + | ==== Pi-Hole ==== | ||
| + | :!: as user **alarm** :!: | ||
| + | <code bash> | ||
| + | alarm@dns2 ~]$ yay -S pi-hole-server | ||
| + | :: Checking for conflicts... | ||
| + | :: Checking for inner conflicts... | ||
| + | [Repo: | ||
| + | [Repo Make: | ||
| + | [Aur: | ||
| + | |||
| + | ==> Remove make dependencies after install? [y/N] | ||
| + | 2 pi-hole-ftl | ||
| + | 1 pi-hole-server | ||
| + | ==> Packages to cleanBuild? | ||
| + | ==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4) | ||
| + | ==> A | ||
| + | :: Deleting (1/2): / | ||
| + | :: Deleting (2/2): / | ||
| + | :: (1/2) Downloaded PKGBUILD: pi-hole-ftl | ||
| + | :: (2/2) Downloaded PKGBUILD: pi-hole-server | ||
| + | 2 pi-hole-ftl | ||
| + | 1 pi-hole-server | ||
| + | ==> Diffs to show? | ||
| + | ==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4) | ||
| + | ==> N | ||
| + | </ | ||
| + | coffee time LOL\\ | ||
| + | the compilation used to break @ 33% \\ < | ||
| + | .... | ||
| + | [ 31%] Built target api | ||
| + | [ 32%] Building C object src/ | ||
| + | [ 33%] Building C object src/ | ||
| + | / | ||
| + | / | ||
| + | 206560 | if( pgno<1 || pBt==0 || pgno> | ||
| + | | ||
| + | ^[[{standard input}: Assembler messages: | ||
| + | cc: fatal error: Killed signal terminated program cc1 | ||
| + | compilation terminated.make[2]: | ||
| + | |||
| + | </ | ||
| + | Looks like the issue is the lack of memory to using https:// | ||
| + | <code bash> | ||
| + | fallocate -l 1G / | ||
| + | dd if=/ | ||
| + | chmod 600 / | ||
| + | echo " | ||
| + | mkswap / | ||
| + | swapon / | ||
| + | |||
| + | echo "/ | ||
| + | </ | ||
| + | Once installed, start/ | ||
| + | <code bash> | ||
| + | It will fail silently thanks to SystemD and its systemd-resolved.service... | ||
| + | <code bash> vi / | ||
| + | <code perl> | ||
| + | [Resolve] | ||
| + | DNSStubListener=no | ||
| + | </ | ||
| + | Restart both... | ||
| + | <code bash> systemctl restart systemd-resolved pihole-FTL</ | ||
| + | == Php == | ||
| + | * Install <code bash> yay -S php-sqlite</ | ||
| + | * / | ||
| + | [...] | ||
| + | extension=pdo_sqlite | ||
| + | [...] | ||
| + | extension=sockets | ||
| + | [...] | ||
| + | extension=sqlite3 | ||
| + | [...]</ | ||
| + | == Lighttpd == | ||
| + | <code bash> yay -S lighttpd php-cgi | ||
| + | cp / | ||
| + | systemctl enable --now lighttpd | ||
| + | </ | ||
| + | == Hosts == | ||
| + | < | ||
| + | <code perl> | ||
| + | 127.0.0.1 | ||
| + | 192.168.1.10 | ||
| + | </ | ||
| + | === Unbound === | ||
| + | Let's install a real recursive DNS | ||
| + | == Install == | ||
| + | <code bash>yay -S unbound</ | ||
| + | == Config == | ||
| + | -> https:// | ||
| + | In / | ||
| + | <code perl> | ||
| + | server: | ||
| + | # If no logfile is specified, syslog is used | ||
| + | # logfile: "/ | ||
| + | verbosity: 0 | ||
| + | |||
| + | interface: 127.0.0.1 | ||
| + | port: 5335 | ||
| + | do-ip4: yes | ||
| + | do-udp: yes | ||
| + | do-tcp: yes | ||
| + | |||
| + | # May be set to yes if you have IPv6 connectivity | ||
| + | do-ip6: no | ||
| + | |||
| + | # You want to leave this to no unless you have *native* IPv6. With 6to4 and | ||
| + | # Terredo tunnels your web browser should favor IPv4 for the same reasons | ||
| + | prefer-ip6: no | ||
| + | |||
| + | # Use this only when you downloaded the list of primary root servers! | ||
| + | # If you use the default dns-root-data package, unbound will find it automatically | ||
| + | root-hints: "/ | ||
| + | |||
| + | # Trust glue only if it is within the server' | ||
| + | harden-glue: | ||
| + | |||
| + | # Require DNSSEC data for trust-anchored zones, if such data is absent, the zone becomes BOGUS | ||
| + | harden-dnssec-stripped: | ||
| + | |||
| + | # Don't use Capitalization randomization as it known to cause DNSSEC issues sometimes | ||
| + | # see https:// | ||
| + | use-caps-for-id: | ||
| + | |||
| + | # Reduce EDNS reassembly buffer size. | ||
| + | # Suggested by the unbound man page to reduce fragmentation reassembly problems | ||
| + | edns-buffer-size: | ||
| + | |||
| + | # Perform prefetching of close to expired message cache entries | ||
| + | # This only applies to domains that have been frequently queried | ||
| + | prefetch: yes | ||
| + | msg-cache-size: | ||
| + | rrset-cache-size: | ||
| + | serve-expired: | ||
| + | serve-expired-ttl: | ||
| + | cache-max-ttl: | ||
| + | cache-min-ttl: | ||
| + | minimal-responses: | ||
| + | |||
| + | # One thread should be sufficient, can be increased on beefy machines. In reality for most users running on small networks or on a single machine, it should be unnecessary to seek performance enhancement by increasing num-threads above 1. | ||
| + | num-threads: | ||
| + | |||
| + | # Ensure kernel buffer is large enough to not lose messages in traffic spikes | ||
| + | so-rcvbuf: 4m | ||
| + | |||
| + | # Ensure privacy of local IP ranges | ||
| + | private-address: | ||
| + | # | ||
| + | private-address: | ||
| + | private-address: | ||
| + | private-address: | ||
| + | # | ||
| + | # | ||
| + | | ||
| + | # Aliases | ||
| + | local-data: " | ||
| + | </ | ||
| + | <code bash> | ||
| + | curl -o / | ||
| + | unbound-checkconf | ||
| + | systemctl enable unbound</ | ||
| + | |||
| + | Now just enter 127.0.0.1# | ||
| + | == Admin pass == | ||
| + | <code bash> pihole -a -p</ | ||
| + | == Fix Network == | ||
| + | <code bash>vi / | ||
| + | <code perl> | ||
| + | [Match] | ||
| + | Name=eth0 | ||
| + | |||
| + | [Network] | ||
| + | Address=192.168.1.10/ | ||
| + | Gateway=192.168.1.1 | ||
| + | DNS=192.168.1.10 | ||
| + | </ | ||
| + | ====== PiOS Lite ====== | ||
| + | Put " | ||
| + | <code bash> | ||
| + | sudo raspi-config # change/set timezone& | ||
| + | exit #reconnect | ||
| + | sudo apt install -y htop | ||
| + | sudo curl -sSL https:// | ||
| + | pihole -a -p MyP4sw0rdIsFabul0us | ||
| + | rm ~/ | ||
| + | sudo apt install -y unbound | ||
| + | </ | ||
| + | ===== Unbound Config ===== | ||
| + | -> https:// | ||
| + | <code bash> sudo mv / | ||
| + | sudo vi / | ||
| + | In / | ||
| + | <code perl> | ||
| + | server: | ||
| + | # If no logfile is specified, syslog is used | ||
| + | # logfile: "/ | ||
| + | verbosity: 0 | ||
| + | |||
| + | interface: 127.0.0.1 | ||
| + | port: 5335 | ||
| + | do-ip4: yes | ||
| + | do-udp: yes | ||
| + | do-tcp: yes | ||
| + | |||
| + | # May be set to yes if you have IPv6 connectivity | ||
| + | do-ip6: no | ||
| + | |||
| + | # You want to leave this to no unless you have *native* IPv6. With 6to4 and | ||
| + | # Terredo tunnels your web browser should favor IPv4 for the same reasons | ||
| + | prefer-ip6: no | ||
| + | |||
| + | # Use this only when you downloaded the list of primary root servers! | ||
| + | # If you use the default dns-root-data package, unbound will find it automatically | ||
| + | # | ||
| + | |||
| + | # Trust glue only if it is within the server' | ||
| + | harden-glue: | ||
| + | |||
| + | # Require DNSSEC data for trust-anchored zones, if such data is absent, the zone becomes BOGUS | ||
| + | harden-dnssec-stripped: | ||
| + | |||
| + | # Don't use Capitalization randomization as it known to cause DNSSEC issues sometimes | ||
| + | # see https:// | ||
| + | use-caps-for-id: | ||
| + | |||
| + | # Reduce EDNS reassembly buffer size. | ||
| + | # Suggested by the unbound man page to reduce fragmentation reassembly problems | ||
| + | edns-buffer-size: | ||
| + | |||
| + | # Perform prefetching of close to expired message cache entries | ||
| + | # This only applies to domains that have been frequently queried | ||
| + | prefetch: yes | ||
| + | |||
| + | # One thread should be sufficient, can be increased on beefy machines. In reality for most users running on small networks or on a single machine, it should be unnecessary to seek performance enhancement by increasing num-threads above 1. | ||
| + | num-threads: | ||
| + | |||
| + | # Ensure kernel buffer is large enough to not lose messages in traffic spikes | ||
| + | so-rcvbuf: 1m | ||
| + | |||
| + | # Ensure privacy of local IP ranges | ||
| + | private-address: | ||
| + | private-address: | ||
| + | private-address: | ||
| + | private-address: | ||
| + | private-address: | ||
| + | private-address: | ||
| + | </ | ||
| + | <code bash> | ||
| + | |||
| + | Now just enter 127.0.0.1# | ||
| + | ===== Update pi-hole ===== | ||
| + | <code bash> | ||
| + | pihole -v | ||
| + | pihole -up | ||
| + | </ | ||
| + | ====== Reference ====== | ||
| + | |||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | |||
