Skip to content

Instantly share code, notes, and snippets.

@balazs4
Last active July 5, 2024 08:38
Show Gist options
  • Select an option

  • Save balazs4/eee526f623df84b76e18b6241c483414 to your computer and use it in GitHub Desktop.

Select an option

Save balazs4/eee526f623df84b76e18b6241c483414 to your computer and use it in GitHub Desktop.
arch@rpi
# aarch64
# arch config
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
echo piserver > /etc/hostname
sed -i 's/#en_US.UTF-8/en_US.UTF-8/' /etc/locale.gen
sed -i 's/#C.UTF-8/C.UTF-8/' /etc/locale.gen
locale-gen
echo 'LANG=en_US.UTF-8' > /etc/locale.conf
pacman-key --init
pacman-key --populate archlinuxarm
pacman -Syu
# ssh
pacman -Syu openssh
mkdir -p .ssh
systemctl start sshd.service
systemctl enable sshd.service
curl https://github.com/balazs4.keys >> .ssh/authorized_keys
# rpi config
tune2fs -l /dev/mmcblk0p2
sed -i '/bootargs/ s/$/ fsck.mode=force fsck.repair=yes/' /boot/boot.txt
pacman -Sy uboot-tools
pushd /boot
./mkscr
popd
# pihole docker
pacman -Syu docker
systemctl start docker.service
systemctl enable docker.service
mkdir -p /srv/pihole
tee /srv/pihole/docker-compose.yml < EOF
services:
pihole:
image: pihole/pihole:latest
network_mode: host
environment:
TZ: 'Europe/Berlin'
WEBPASSWORD: '********'
PIHOLE_DNS_: 8.8.4.4;1.0.0.1;8.8.8.8;1.1.1.1
cap_add:
- NET_ADMIN
restart: unless-stopped
EOF
systemctl stop systemd-resolved.service
systemctl disable systemd-resolved.service
docker compose up --file /srv/pihole/docker-compose.yml
# misc
pacman -Syu tmux vim git fzf cronie
# crontab
cat <<EOF > crontab -
10 4 * * * /usr/bin/reboot
20 4 * * * /usr/bin/docker compose --file /srv/pihole/docker-compose.yml exec pihole pihole -g
30 4 * * * /usr/bin/pacman -Sy
EOF
systemctl enable cronie.service
# clean up
rm -rfv /var/cache/pacman/pkg/*
userdel alarm
passwd
sed -i 's/PRESETS=('default' 'fallback')/PRESETS=('default')' /etc/mkinitcpio.d/linux-aarch64.preset
mkinitcpio -P
@balazs4
Copy link
Author

balazs4 commented Jul 5, 2024

Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p2   29G  3.6G   24G  13% /
/dev/mmcblk0p1  200M  150M   51M  75% /boot

/boot should be more than 200M next time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment