diff --git a/README.md b/README.md index 44634b8..166869b 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # uPnP renderer -## Version 1 +## Version 2 -This repository contains files used to set up our uPnP renderer on a freshly installed Armbian. Target is Buster. +This repository contains files used to set up our uPnP renderer on a freshly installed Armbian. Target is Bullseye. ### Introduction -Version 1 implementation works roughly as follows: +Version 2 implementation works roughly as follows: * the Armbian-based device is connected to local network, and to an audio output device (usually via USB); * MPD and upmpdcli are installed on the device. diff --git a/setup.sh b/setup.sh index 218b0d2..1c0bbac 100644 --- a/setup.sh +++ b/setup.sh @@ -20,10 +20,12 @@ init() { install_packages() { echo "Starting packages installation" - curl https://www.lesbonscomptes.com/pages/jf-at-dockes.org.pgp | gpg --import - - gpg --export '7808CE96D38B9201' | apt-key add - sed -i -e "s/$deb_apt_default_repo/$deb_apt_repo/g" /etc/apt/sources.list - echo "deb http://www.lesbonscomptes.com/upmpdcli/downloads/raspbian/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/upmpdcli.list + + wget -P /usr/share/keyrings/ https://www.lesbonscomptes.com/pages/lesbonscomptes.gpg + wget -P /etc/apt/sources.list.d/ https://www.lesbonscomptes.com/upmpdcli/pages/upmpdcli-rbullseye.list + sed -i -e "s/deb-src/#deb-src/g" /etc/apt/sources.list.d/upmpdcli-rbullseye.list + apt update apt upgrade -y apt install -y vim tree tmux neofetch mpd upmpdcli @@ -35,11 +37,6 @@ add_users() { chmod 700 /home/$user } -set_sudo_conf() { # TODO that doesn't seem to work - echo "Setting sudo configuration" - sed -i -e "s/%sudo ALL=(ALL:ALL) ALL/%sudo ALL=(ALL:ALL) $sudo_no_passwd ALL/g" /etc/sudoers -} - get_conf() { echo "Getting configuration" sudo -H -u $user mkdir $sync_directory_path @@ -51,21 +48,14 @@ get_conf() { set_conf() { echo "Setting configuration" - #sudo -H -u $user chmod uo+x $sync_directory_path/clean-cloud.sh $sync_directory_path/scan-to-cloud.sh ln -s $sync_directory_path/*.service $systemd_units_path/ ln -s $sync_directory_path/*.timer $systemd_units_path/ - #ln -s $sync_directory_path/*.socket $systemd_units_path/ # TODO add a check here - #ln -s $sync_directory_path/*.mount $systemd_units_path/ - #ln -s $sync_directory_path/*.path $systemd_units_path/ systemctl daemon-reload systemctl enable conf-sync.timer mpd.service upmpdcli.service restart-upmpdcli.timer } set_upmpdcli_service() { echo "Setting custom upmpdcli service unit" - # Old way, less clean - #cp /lib/systemd/system/upmpdcli.service $systemd_units_path/ - #sed -i -e "s/upmpdcli -c \/etc\/upmpdcli.conf/upmpdcli -f %H/g" $systemd_units_path/upmpdcli.service mkdir $systemd_units_path/upmpdcli.service.d echo "[Service]" > $systemd_units_path/upmpdcli.service.d/exec.conf echo "ExecStart=" >> $systemd_units_path/upmpdcli.service.d/exec.conf @@ -74,11 +64,11 @@ set_upmpdcli_service() { set_alsa_conf() { echo "Setting ALSA configuration" - echo "defaults.pcm.card $audio_device -defaults.ctl.card $audio_device" > $alsa_conf_file_path + echo "defaults.pcm.card $audio_device" > $alsa_conf_file_path + echo "defaults.ctl.card $audio_device" >> $alsa_conf_file_path } -set_cpufreq() { +set_cpufreq() { # This is specifically for our Orange Pi Zero; may not be required in all cases echo "Setting CPU frequency to performance" sed -i -e "s/GOVERNOR=ondemand/GOVERNOR=performance/g" /etc/default/cpufrequtils } @@ -91,6 +81,8 @@ rcs_links() { ln -s /home/$user/.bashrc /root/.bashrc sudo -H -u $user ln -s $sync_directory_path/vimrc /home/$user/.vimrc ln -s /home/$user/.vimrc /root/.vimrc + sudo -H -u $user ln -s $sync_directory_path/tmux.conf /home/$user/.tmux.conf + ln -s /home/$user/.tmux.conf /root/.tmux.conf } ssh_pubkey() { @@ -115,10 +107,9 @@ hostname='pi2' fqdn='pi2.kto.black' keymap='fr' timezone='Europe/Paris' -deb_apt_default_repo='httpredir.debian.org' +deb_apt_default_repo='deb.debian.org' deb_apt_repo='ftp.fr.debian.org' user='alex' -sudo_no_passwd="NOPASSWD:" sync_directory_path="/home/$user/.sync" systemd_units_path='/etc/systemd/system' audio_device='0' @@ -131,7 +122,6 @@ remote_pubkey='home.pub' init install_packages add_users -set_sudo_conf get_conf set_conf set_upmpdcli_service