lk/distros/arch/scripts/archpi.sh

58 lines
1.3 KiB
Bash
Raw Normal View History

2020-01-02 00:04:35 +00:00
#!/bin/bash
# https://www.unixmen.com/install-arch-linux-raspberry-pi/
pacman-key --init || echo init fail >> log
pacman-key --populate archlinuxarm || echo update fail >> log
pacman -Syyuu || echo update fail >> log
sed -i s/#en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/ /etc/locale.gen
echo 'LANG=en_GB.UTF-8' >> /etc/locale.conf
locale-gen
2020-01-23 20:42:34 +00:00
pacman -S base-devel htop ranger tmux lolcat fortune-mod git figlet rxvt-unicode task timew calcurse fail2ban
# texlive-most
2020-01-02 00:04:35 +00:00
if [[ $2 == all || $1 == all ]]; then
pacman -S nnn feh dmenu rofi xf86-video-fbdev xorg xorg-xinit xorg-server xorg-server-utils xterm
fi
# Audio
echo 'dtparam=audio=on' >> /boot/config.txt
if [[ $1 == audio ]]; then
pacman -S alsa-utils alsa-firmware alsa-lib alsa-plugins
fi
echo 'device_tree_param=spi=on' >> /boot/config.txt
# for a vnc viewer
if [[ $1 == vnc ]]; then
tigervnc gcc geany i3 i3status compton feh sxiv rxvt-unicode
fi
# Swap
cd /var/cache/swap
2020-01-23 20:42:34 +00:00
dd if=/dev/zero of=swapfile bs=1K count=2M
2020-01-02 00:04:35 +00:00
2020-01-23 20:42:34 +00:00
chmod 600 swapfile
2020-01-02 00:04:35 +00:00
2020-01-23 20:42:34 +00:00
mkswap swapfile
2020-01-02 00:04:35 +00:00
2020-01-23 20:42:34 +00:00
swapon swapfile
2020-01-02 00:04:35 +00:00
2020-01-23 20:42:34 +00:00
echo "/var/cache/swap/swapfile none swap sw 0 0" > /etc/fstab
2020-01-30 06:21:31 +00:00
# fail2ban
[ -e sshd.local ] && \
pacman -S fail2ban && \
mv sshd.local /etc/fail2ban/jail.d && \
systemctl start fail2ban
2021-02-09 03:01:03 +00:00
# If it won't reboot, install `arch-install-scripts` then try again and firstly:
# genfstab / > /etc/fstab