Last active
July 5, 2024 08:38
-
-
Save balazs4/eee526f623df84b76e18b6241c483414 to your computer and use it in GitHub Desktop.
arch@rpi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/bootshould be more than 200M next time