Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
584 lines (453 sloc) 20.1 KB
#!/bin/bash
########################################
# RuneAudio v0.5-beta cookbook #
# written by: Orion (production image) #
# edited for 2018 kernel by Gearhead #
# HW platform: RaspberryPi B1 and B2 #
########################################
# install base ArchLinux system (follow guide https://wiki.archlinux.org/index.php/Installation_guide, choose syslinux bootloader
# all rune packages are shown with armv6h for the B1/PiZero, substitute armv7h for the B2/3
# general system update
pacman-key --init
pacman-key --populate archlinuxarm
pacman -Syu --noconfirm
# configure ssh to allow root login
# edit /etc/ssh/sshd_config and add:
# PermitRootLogin yes
# to the file
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
# change root password to rune
echo -e "rune\nrune" | passwd root
# change hostname to runeaudio
rm /etc/hostname
echo "runeaudio" >> /etc/hostname
# uninstall unecessary packages
pacman -R jfsutils lvm2 man-db man-pages reiserfsprogs
# install git support (22.47 MiB)
pacman -S git --noconfirm
# install chrony
pacman -S chrony --noconfirm
# first time sync
chronyd -q 'pool pool.ntp.org iburst'
# install Redis (1.53 MiB)
pacman -S redis --noconfirm
#########################################
### -- additional system libraries -- ###
#########################################
# install libmcrypt (0.25 MiB)
pacman -S libmcrypt --noconfirm
# install libjpeg-turbo (1.15 MiB)
pacman -S libjpeg --noconfirm
# install apr-util (nginx req.) (1.63 MiB)
pacman -S apr-util --noconfirm
# Jansson
pacman -S jansson --noconfirm
# pixpuf - image loading library
pacman -S gdk-pixbuf2 --noconfirm
pacman -S libnotify
##########################
### -- system tools -- ###
##########################
# install wget (3.05 MiB)
pacman -S wget --noconfirm
# install ethtool (0.25 MiB)
pacman -S ethtool --noconfirm
###########################
### -- network tools -- ###
###########################
# install avahi (2.30 MiB)
pacman -S avahi --noconfirm
# install nettools (0.49 MiB)
pacman -S net-tools --noconfirm
# install ifplugd (0.13 MiB)
pacman -S ifplugd --noconfirm
# install wireless tools (0.33 MiB)
pacman -S wireless_tools --noconfirm
# install wpa_supplicant (1.43 MiB)
pacman -S wpa_supplicant wpa_actiond --noconfirm
# install hostapd (0.85 MiB)
pacman -S hostapd --noconfirm
# install nfs-utils (2.49 MiB)
pacman -S nfs-utils --noconfirm
# install libupnp (0.46 MiB)
pacman -S libupnp --noconfirm
# install libxml2 (8.10 MiB)
pacman -S libxml2 --noconfirm
# install yasm (2.80 MiB)
pacman -S yasm --noconfirm
# install nss-mdns
pacman -S nss-mdns --noconfirm
pacman -S nss nspr --noconfirm
# install dnsmasq
pacman -S dnsmasq --noconfirm
##############################
### -- filesystem tools -- ###
##############################
# install NTFS support (1.50 MiB)
pacman -S ntfs-3g --noconfirm
# install dosfstools (0.25 MiB)
pacman -S dosfstools --noconfirm
# install exFAT support (0.19 MiB)
pacman -S exfat-utils --noconfirm
# install sshfs support (0.07 MiB)
pacman -S sshfs --noconfirm
# install cifs-utils (0.63 MiB)
pacman -S cifs-utils --noconfirm
# install ftpfs (0.06 MiB)
pacman -S curlftpfs --noconfirm
# install libnfs
pacman -S libnfs --noconfirm
# install USB automount daemon (0.34 MiB)
# >>> REMEMBER to enable kernel polling when using devmon without udisks:
# http://ignorantguru.github.com/udevil/#polling
pacman -S udevil --noconfirm
# add sudo
pacman -S sudo --noconfirm
# install Midnight Commander
pacman -S mc --noconfirm
#########################
### -- AUDIO stack -- ###
#########################
# install ALSA utils (9.66 MiB)
pacman -S alsa-utils --noconfirm
# install
pacman -S celt --noconfirm
# install SOX (3.08 MiB)
pacman -S sox --noconfirm
# wavpack libao
pacman -S wavpack, libao -noconfirm
############################
### -- install RuneUI -- ###
############################
cd /
ln -s /srv/http/ /var/www
##############################
# -- setup filesystem ACL -- #
##############################
# setup tmpfs directory
#chmod 777 /run
# set up locale
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen
localectl set-locale LANG=en_US.UTF-8
# stop auditd from spamming dmesg
# add audit=0 to cmdline.txt
# enable line numbers for nano
echo "set linenumbers" >> /etc/nanorc
cd /var/www
# clone RuneUI git repo
git clone -b 0.5b https://github.com/gearhead/RuneUI.git /var/www
# install motd
cp /var/www/app/config/_os/etc/motd /etc/
cp /var/www/app/config/_os/etc/issue /etc/
# setup colorls
cp /var/www/app/config/_os/etc/bash.bashrc /etc/bash.bashrc
# setup log directory
rm -r /var/log/*
mkdir /var/log
mkdir /var/log/runeaudio
# set up temp directories
mkdir /var/tmp
mkdir /var/www/tmp
echo "logs /var/log tmpfs nodev,nosuid,noatime,mode=1777,size=5M 0 0" >> /etc/fstab
echo "rune-logs /var/log/runeaudio tmpfs nodev,nosuid,noatime,mode=1777,size=5M 0 0" >> /etc/fstab
echo "var-tmp /var/tmp tmpfs nodev,nosuid,noatime,mode=1777,size=5M 0 0" >> /etc/fstab
echo "http-tmp /srv/http/tmp tmpfs nodev,nosuid,noatime,mode=1777,size=5M,uid=http,gid=http 0 0" >> /etc/fstab
mount -a
# setup webserver directory
chown -R http.http /srv/http/
# these are done in the git repository kg 2018
#chmod 644 $(find /srv/http/ -type f)
#chmod 755 $(find /srv/http/ -type d)
#chmod -R 755 /srv/http/command/
#chmod -R 755 /srv/http/db/redis_datastore_setup
#chmod -R 755 /srv/http/db/redis_acards_details
# remove default user
userdel -r alarm
# install RuneAudio MPD package dependencies
# install libmpdclient (0.27 MiB)
pacman -S libmpdclient --noconfirm
# install faad2 (0.39 MiB)
pacman -S faad2 --noconfirm
# install sqlite3 (1.21 MiB)
pacman -S sqlite3 --noconfirm
# install libmad (0.13 MiB)
pacman -S libmad --noconfirm
# install libmms (0.09 MiB)
pacman -S libmms --noconfirm
# install libid3tag (0.12 MiB)
pacman -S libid3tag --noconfirm
# install audiofile (0.31 MiB)
pacman -S audiofile --noconfirm
# install mpg123 (0.69 MiB)
pacman -S mpg123 --noconfirm
# install mpc (0.10 MiB)
pacman -S mpc --noconfirm
pacman -S jsoncpp --noconfirm
pacman -S libmicrohttpd --noconfirm
# perl modules
pacman -S perl-uri --noconfirm
pacman -S perl-encode-locale perl-file-listing perl-html-parser perl-html-tagset
pacman -S perl-http-cookies perl-http-daemon perl-http-date perl-http-message perl-http-negotiate perl-io-html
pacman -S perl-libwww perl-lwp-mediatypes perl-net-http perl-parse-yapp perl-try-tiny perl-www-robotrules
# install smartmontools
pacman -S smartmontools --noconfirm
# install parted
pacman -S parted --noconfirm
# random number generator
#pacman -S haveged --noconfirm
# install python2 flask for web based alsamixer
pacman -S python2-flask --noconfirm
# install cronie
pacman -S cronie --noconfirm
# ----->>>> DOWNLOAD PACKAGES FROM RuneOS REPO <<<<----- #
# get packages somehow
cd /usr/local/src/
# ----->>>> INSTALL RuneOS packages <<<<----- #
# these need to be fixed in the package
Sep 22 12:13:26 runeaudio sh[6327]: user 'shairport-sync': directory '/home/shairport-sync' does not exist
Sep 22 12:13:26 runeaudio sh[6327]: user 'upmpdcli': directory '/home/upmpdcli' does not exist
# install ffmpeg-rune
pacman -Sd --nodeps libva
pacman -U ffmpeg-rune-3.4.1-3-armv6h.pkg.tar.xz --noconfirm
# install mpd-rune
pacman -U mpd-rune-0.20.20-1-armv6h.pkg.tar.xz --noconfirm
#mpd-watchdog needs to be added to the package
# install mpdscribble-rune
pacman -U mpdscribble-0.22-8-armv6h.pkg.tar.xz --noconfirm
# install nginx-rune
pacman -U nginx-rune-1.14.0-6-armv6h.pkg.tar.xz --noconfirm
# install php-rune
pacman -U php-rune-5.6.33-1-armv6h.pkg.tar.xz --noconfirm
# error: failed to commit transaction (conflicting files)
# php-rune: /var/run exists in filesystem (owned by filesystem)
# Errors occurred, no packages were upgraded.
# packagefile is broken, needs to be fixed, added --force to try
# !!! got to here Need to re-build php to install cleanly !!!
# install phpredis-rune
pacman -U phpredis-rune-2.2.7-2-armv6h.pkg.tar.xz --noconfirm
# install php support
pacman -U php-libevent-0.1.0-2-armv6h.pkg.tar.xz --noconfirm
pacman -U php-pthreads-2.0.11-1-armv6h.pkg.tar.xz --noconfirm
pacman -U phpiredis-rune-1.0.0.3-armv6h.pkg.tar.xz --noconfirm
# cannot get this to compile
# install samba4-rune
pacman -U samba4-rune-4.8.1-1-armv6h.pkg.tar.xz --noconfirm
# appears to use python2, Look at Arch pkgfile to see if this has been upgraded to use python3
# also will not install due to other packages which are installed
#error: failed to commit transaction (conflicting files)
# samba4-rune: /usr/include/samba-4.0/wbclient.h exists in filesystem (owned by libwbclient)
# samba4-rune: /usr/lib/libwbclient.so.0 exists in filesystem (owned by libwbclient)
# samba4-rune: /usr/lib/libwbclient.so.0.14 exists in filesystem (owned by libwbclient)
# samba4-rune: /usr/lib/pkgconfig/wbclient.pc exists in filesystem (owned by libwbclient)
# samba4-rune: /usr/lib/samba/libreplace-samba4.so exists in filesystem (owned by libwbclient)
# samba4-rune: /usr/lib/samba/libwinbind-client-samba4.so exists in filesystem (owned by libwbclient)
# Errors occurred, no packages were upgraded.
# re-work package to not install libsmbclient and allow that as a std Arch package...
pacman -S libmpd --noconfirm
pacman -S libmpcdec --noconfirm
pacman -S openal --noconfirm
pacman -S libvdpau --noconfirm
pacman -S smbclient --noconfirm
# install shairport-sync-rune
pacman -U shairport-sync-rune-3.1.7-1-armv6h.pkg.tar.xz --noconfirm
pacman -U alac-0.r21.1588be3-1-armv7h.pkg.tar.xz
#install libupnp-rune
pacman -U libupnp-rune-20180123-1-armv6h.pkg.tar.xz --noconfirm
# install upmpdcli-rune
pacman -U upmpdcli-rune-1.2.15-3-armv6h.pkg.tar.xz --noconfirm
# install ashuffle
pacman -U ashuffle-rune-0.22-6-armv6h.pkg.tar.xz --noconfirm
# instapp spotify
pacman -U libspotify-12.1.103-3-armv6h.pkg.tar.xz --noconfirm
# does not install
# armv7 takes a different package - libspotify-12.1.51-3-armv7h.pkg.tar.xz
pacman -U spop-rune-0.0.4-1-armv6h.pkg.tar.xz --noconfirm
# install hfs support
pacman -U hfsprogs-rune-332.25-10-armv6h.pkg.tar.xz --noconfirm
pacman -U hfsutils-rune-3.2.6-5-armv6h.pkg.tar.xz --noconfirm
#install webUI for alsa mixer
pacman -U amixer-webui-0.r55.cedaebb-1-armv6h.pkg.tar.xz
# install snapcast
pacman -U snapcast-0.14.0-1-armv6h.pkg.tar.xz
# not built or installed, yet
# Install bluetooth components
pacman -S bluez --noconfirm
pacman -U bluez-utils-compat-5.49-1-armv6h.pkg.tar.xz
pacman -U bluez-alsa-git-v1.2.0.r64.g9045edb-1-armv6h.pkg.tar.xz
pacman -U pi-bluetooth
# Add those lines to /etc/dbus-1/system.d/bluetooth.conf
# <policy user="bluealsa">
# <allow send_destination="org.bluez"/>
#</policy>
# Users can use this service when they are members of the "audio" group.
pacman -U pi-bluetooth-1-1-armv6h.pkg.tar.xz
Enable with:
# To enable this at startup, you have to edit
# /etc/bluetooth/main.conf
# AutoEnable=true
# Install patched kernel for 384k and DSD
linux-raspberrypi-dsd-384k-4.14.34-1-armv6h.pkg.tar.xz
# ----->>>> INSTALL Go Daddy Intermediate CA (Jamendo) <<<<----- #
cp -Rv /var/www/app/config/_os/usr/share/ca-certificates /usr/share/
cp -Rv /var/www/app/config/_os/etc/ca-certificates /etc/
# update SSL certs database
trust extract-compat -v
# responds with this:
(p11-kit:2062) extract_certificate: skipping certificate that doesn't match trust flags
(p11-kit:2062) extract_certificate: skipping certificate that doesn't match trust flags
(p11-kit:2063) extract_certificate: skipping certificate that doesn't match trust flags
(p11-kit:2063) extract_certificate: skipping certificate that doesn't match trust flags
(p11-kit:2064) extract_certificate: skipping certificate that doesn't match trust flags
(p11-kit:2064) extract_certificate: skipping certificate that doesn't match trust flags
(p11-kit:2065) extract_certificate: skipping certificate that doesn't match trust flags
(p11-kit:2065) extract_certificate: skipping certificate that doesn't match trust flags
(p11-kit:2066) extract_certificate: skipping certificate without a value
(p11-kit:2066) extract_certificate: skipping certificate without a value
(p11-kit:2066) extract_certificate: skipping certificate without a value
(p11-kit:2066) extract_certificate: skipping certificate without a value
(p11-kit:2066) extract_certificate: skipping certificate without a value
(p11-kit:2066) extract_certificate: skipping certificate without a value
(p11-kit:2066) extract_certificate: skipping certificate without a value
(p11-kit:2455) extract_certificate: skipping certificate that doesn't match trust flags
(p11-kit:2455) extract_certificate: skipping certificate that doesn't match trust flags
# ----->>>> SYSTEM CONFIGURATION <<<<----- #
# install RuneAudio system tweaks
#cp -Rv /var/www/app/config/_os/etc/* /etc
#rm /etc/profile.d/proxy.sh
#cp -R /var/www/app/config/_os/usr/* /usr
rm -rf /etc/security/limits.d/
# set up Rune config files# Reset the service and configuration files to the distribution standard
#cp /var/www/app/config/defaults/chrony.conf /etc/chrony.conf
cp /var/www/app/config/defaults/hostapd.conf /etc/hostapd/hostapd.conf
cp /var/www/app/config/defaults/journald.conf /etc/systemd/journald.conf
cp /var/www/app/config/defaults/mpdscribble.conf /etc/mpdscribble.conf
rm -f /etc/nginx/nginx.conf
cp /var/www/app/config/defaults/nginx-prod.conf /etc/nginx/nginx-prod.conf
ln -s /etc/nginx/nginx-prod.conf /etc/nginx/nginx.conf
mkdir /etc/nginx/html
cp /var/www/app/config/defaults/50x.html /etc/nginx/html/50x.html
cp /var/www/app/config/defaults/nsswitch.conf /etc/nsswitch.conf
cp /var/www/app/config/defaults/php-fpm.conf /etc/php/php-fpm.conf
cp /var/www/app/config/defaults/redis.conf /etc/redis.conf
cp /var/www/app/config/defaults/shairport-sync.conf /etc/shairport-sync.conf
mkdir -p /etc/samba
rm -f /etc/samba/*.conf
cp /var/www/app/config/defaults/smb-dev.conf /etc/samba/smb-dev.conf
cp /var/www/app/config/defaults/smb-prod.conf /etc/samba/smb-prod.conf
ln -s /etc/samba/smb-prod.conf /etc/samba/smb.conf
#cp /var/www/app/config/defaults/spopd.conf /etc/spop/spopd.conf
cp /var/www/app/config/defaults/upmpdcli.conf /etc/upmpdcli.conf
cp /var/www/app/config/defaults/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf
#cp /var/www/app/config/defaults/fstab /etc/fstab
cp /var/www/app/config/defaults/hosts /etc/hosts
#cp /var/www/app/config/defaults/start_chromium.sh /etc/X11/xinit/start_chromium.sh
cp /var/www/app/config/defaults/ashuffle.service /usr/lib/systemd/system/ashuffle.service
cp /var/www/app/config/defaults/avahi_runeaudio.service /etc/avahi/services/runeaudio.service
cp /var/www/app/config/defaults/local-browser.service /usr/lib/systemd/system/local-browser.service
cp /var/www/app/config/defaults/php-fpm.service /usr/lib/systemd/system/php-fpm.service
cp /var/www/app/config/defaults/redis.service /usr/lib/systemd/system/redis.service
cp /var/www/app/config/defaults/rune_PL_wrk.service /usr/lib/systemd/system/rune_PL_wrk.service
cp /var/www/app/config/defaults/rune_SSM_wrk.service /usr/lib/systemd/system/rune_SSM_wrk.service
cp /var/www/app/config/defaults/rune_SY_wrk.service /usr/lib/systemd/system/rune_SY_wrk.service
cp /var/www/app/config/defaults/shairport-sync.service /usr/lib/systemd/system/shairport-sync.service
cp /var/www/app/config/defaults/spopd.service /usr/lib/systemd/system/spopd.service
cp /var/www/app/config/defaults/udevil.service /usr/lib/systemd/system/udevil.service
cp /var/www/app/config/defaults/upmpdcli.service /usr/lib/systemd/system/upmpdcli.service
cp /var/www/app/config/defaults/config.txt /boot/config.txt
# set up services and stop them
systemctl unmask systemd-journald
systemctl disable ashuffle mpd mpdscribble nmbd smbd udevil upmpdcli hostapd shairport-sync
systemctl disable local-browser rune_SSM_wrk rune_PL_wrk dhcpcd systemd-timesyncd php-fpm ntpd bluetooth
systemctl enable avahi-daemon haveged nginx redis rune_SY_wrk sshd systemd-resolved systemd-journald chronyd
Sys responds with:
Created symlink /etc/systemd/system/multi-user.target.wants/rune_SY_wrk.service → /usr/lib/systemd/system/rune_SY_wrk.service.
The unit files have no installation config (WantedBy, RequiredBy, Also, Alias
settings in the [Install] section, and DefaultInstance for template units).
This means they are not meant to be enabled using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
.wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
D-Bus, udev, scripted systemctl call, ...).
4) In case of template units, the unit is meant to be enabled with some
instance name specified.
systemctl stop ashuffle mpd spopd smbd nmbd shairport-sync local-browser rune_SSM_wrk rune_PL_wrk rune_SY_wrk upmpdcli bluetooth
#
# enable bluetooth
systemctl enable brcm43438.service
# disable RNGD - not installed
#systemctl disable rngd
# disable systemd-journald
systemctl disable systemd-journald
systemctl mask systemd-journald
systemctl mask systemd-journal-flush.service
# disable systemd-logind
systemctl disable systemd-logind
systemctl mask systemd-logind
systemctl enable avahi-daemon haveged nginx redis rune_SY_wrk sshd systemd-resolved systemd-journald chronyd
systemctl enable amixer-webui brcm43438 cronie
# did not enable these - looking at the runeui reset, first
# enable php done from rune_SY
#systemctl enable php-fpm
# enable nginx
systemctl enable nginx
# enable mpd
# systemctl enable mpd
# enable redis
systemctl enable redis
# enable RuneAudio background workers
#systemctl enable rune_PL_wrk
#systemctl enable rune_SY_wrk
# enable rune_shutdown
cp /var/www/app/config/_os/usr/lib/systemd/system/rune_shutdown.service /usr/lib/systemd/system/
systemctl enable rune_shutdown
#
# enable alsamixer on 8080
ln -s /usr/bin/python2 /usr/bin/python
systemctl enable amixer-webui.service
# finished here on out
# link Orion Optimize script
ln -s /srv/http/command/orion_optimize.sh /usr/sbin/
systemctl start redis
./var/www/db/redis_datastore_setup reset
./var/www/command/refresh_ao
chmod a+x /var/www/command/*
# create /mnt directory structure
mkdir /mnt/MPD
mkdir /mnt/MPD/USB
mkdir /mnt/MPD/Webradio
mkdir /mnt/MPD/NAS
mkdir /mnt/MPD/LocalStorage
chown -R mpd.audio /mnt/MPD
# set timezone to -11 hours of GMT - any user adjustment will always go forward
timedatectl set-timezone Pacific/Pago_Pago
redis-cli set timezone "Pacific/Pago_Pago"
# reboot system
reboot
#pacman -S zita-alsa-pcmi zita-resampler
# pacman -S dialog
# pacman -S libasyncns json-glib
# dconf glib-networking gsettings-desktop-schemas libsoup libomxil-bellagio
#find . -name "*.*" | xargs file | grep "CRLF"
# hciattach-rpi3 is not in the packages directory
# diff -y installed_scr.txt installed_kit.txt | colordiff
####### ARRRRGH! it's back!!! no boot
# comparison to pi1 image calls for these packages to be installed
#pacman -S dbus-glib dnsmasq
#pacman -S gdk-pixbuf2
#pacman -S libao
#pacman -S iniparser
# next line does not exist...
#pacman -S dconf wavpack, libasyncns, jansson, json-glib, procinfo-ng
#pacman -S perl-encode-locale perl-file-listing perl-html-parser perl-html-tagset
#pacman -S perl-http-cookies perl-http-daemon perl-http-date perl-http-message perl-http-negotiate perl-io-html
#pacman -S perl-libwww perl-lwp-mediatypes perl-net-http perl-parse-yapp perl-try-tiny perl-www-robotrules
#find . -name "*.*" | xargs file | grep "CRLF"
# hciattach-rpi3 is not in the packages directory
# diff -y installed_scr.txt installed_kit.txt | colordiff
# pacman -S bluez dconf glib-networking
# pacman -S zita-alsa-pcmi zita-resampler wavpack nspr
# pacman -S libsm libsoup libasyncns libnotify nss wpa_actiond
You can’t perform that action at this time.