-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
continue to work on installer for pi5 / bookworm
- Loading branch information
Showing
3 changed files
with
197 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
#!/bin/sh | ||
|
||
# deactivate power saving: | ||
for cpu in /sys/devices/system/cpu/cpu[0-9]*; do echo -n performance \ | ||
| sudo tee $cpu/cpufreq/scaling_governor; done | ||
|
||
## Stop the ntp service | ||
#sudo service ntp stop | ||
|
||
## Stop the triggerhappy service | ||
sudo service triggerhappy stop | ||
|
||
## Stop the dbus service. Warning: this can cause unpredictable behaviour when running a desktop environment on the RPi | ||
sudo service dbus stop | ||
|
||
## Stop the console-kit-daemon service. Warning: this can cause unpredictable behaviour when running a desktop environment on the RPi | ||
sudo killall console-kit-daemon | ||
|
||
## Stop the polkitd service. Warning: this can cause unpredictable behaviour when running a desktop environment on the RPi | ||
sudo killall polkitd | ||
|
||
## Kill the usespace gnome virtual filesystem daemon. Warning: this can cause unpredictable behaviour when running a desktop environment on the RPi | ||
killall gvfsd | ||
|
||
## Kill the userspace D-Bus daemon. Warning: this can cause unpredictable behaviour when running a desktop environment on the RPi | ||
killall dbus-daemon | ||
|
||
## Kill the userspace dbus-launch daemon. Warning: this can cause unpredictable behaviour when running a desktop environment on the RPi | ||
killall dbus-launch | ||
|
||
## Stop all wifi/bluetooth devices | ||
rfkill block all | ||
|
||
# activate WiFi if required: | ||
if test -e /boot/ovclient-wifi.txt; then | ||
# remove DOS line ends: -e 's/\r//1' | ||
# the first line contains the SSID: | ||
SSID=$(cat /boot/ovclient-wifi.txt|sed -e '1 ! d' -e 's/\r//1') | ||
# the second line the WIFI password: | ||
PW=$(cat /boot/ovclient-wifi.txt|sed -e '2 ! d' -e 's/\r//1') | ||
COUNTRYCODE=DE | ||
test -e /boot/ovclient-country.txt && COUNTRYCODE=$(cat /boot/ovclient-country.txt) | ||
echo "connecting to WiFi ${SSID}" | ||
if test -n "${SSID}"; then | ||
sudo raspi-config nonint do_wifi_country "${COUNTRYCODE}" | ||
sleep 2 | ||
rfkill unblock wifi | ||
sleep 10 | ||
sudo raspi-config nonint do_wifi_ssid_passphrase "${SSID}" "${PW}" | ||
sleep 20 | ||
fi | ||
fi | ||
|
||
if test ! -e /boot/ovclient-noupdate; then | ||
# if not on overlayfs then update/reinstall: | ||
if (cat /proc/mounts | grep -e " / ")|grep -q -e overlay; then | ||
echo "overlay fs, not updating" | ||
else | ||
# get the latest installer script: | ||
./install | ||
# test for openMHA install request: | ||
if test -e /boot/ov-client-instmha; then | ||
rm -f /boot/ov-client-instmha | ||
sudo apt install --no-install-recommends --assume-yes openmha openmha-examples | ||
fi | ||
# activate overlay image in case the installation script failed, and try the best we can: | ||
sudo raspi-config nonint enable_overlayfs | ||
# ready, reboot: | ||
sudo shutdown -r now | ||
fi | ||
fi | ||
|
||
|
||
# start client: | ||
while true; do | ||
|
||
sudo su -l ov -c "ov-client" | ||
# test for modified configuration: | ||
if test -e ~ov/ov-client.cfg; then | ||
sudo mv ~ov/ov-client.cfg /boot/ | ||
sync | ||
fi | ||
# test for firmware update: | ||
if test -e ~ov/ov-client.firmwareupdate; then | ||
# firmware update requested: disable overlayfs and restart | ||
sudo rm -f ~ov/ov-client.firmwareupdate | ||
sudo raspi-config nonint disable_overlayfs | ||
sudo shutdown -r now | ||
fi | ||
# test for openMHA install request: | ||
if test -e ~ov/ov-client.installopenmha; then | ||
# firmware update requested: disable overlayfs and restart | ||
sudo rm -f ~ov/ov-client.installopenmha | ||
sudo touch /boot/ov-client-instmha | ||
sudo raspi-config nonint disable_overlayfs | ||
sudo shutdown -r now | ||
fi | ||
# check for development version: | ||
if test -e ~ov/ov-client.usedevversion; then | ||
echo "switching to development version" | ||
# switch to development version: | ||
sudo rm -f ~ov/ov-client.usedevversion | ||
# identify OS release code name: | ||
OSREL=`lsb_release -a|grep Codename|sed 's/Codename:[[:blank:]]*//1'` | ||
OSRELHTCH="$OSREL" | ||
if test "$OSREL" = "buster"; then | ||
OSRELHTCH=bionic | ||
fi | ||
# identify OS architecture: | ||
OSARCH=`dpkg-architecture | grep -e 'DEB_BUILD_ARCH='|sed 's/[^=]*=//1'` | ||
(echo "";echo "deb [arch=${OSARCH]´}] http://aptdev.hoertech.de ${OSRELHTCH} universe")|sudo tee -a /etc/apt/sources.list | ||
sudo apt update --assume-yes | ||
sudo apt install --no-install-recommends --assume-yes ov-client | ||
fi | ||
if test -e ~ov/ov-client.wificfg; then | ||
echo "switching wifi" | ||
sudo mv ~ov/ov-client.wificfg /boot/ovclient-wifi.txt | ||
sync | ||
# activate WiFi if required: | ||
# remove DOS line ends: -e 's/\r//1' | ||
# the first line contains the SSID: | ||
SSID=$(cat /boot/ovclient-wifi.txt|sed -e '1 ! d' -e 's/\r//1') | ||
# the second line the WIFI password: | ||
PW=$(cat /boot/ovclient-wifi.txt|sed -e '2 ! d' -e 's/\r//1') | ||
COUNTRYCODE=DE | ||
test -e /boot/ovclient-country.txt && COUNTRYCODE=$(cat /boot/ovclient-country.txt) | ||
echo "connecting to WiFi ${SSID}" | ||
if test -n "${SSID}"; then | ||
sudo raspi-config nonint do_wifi_country "${COUNTRYCODE}" | ||
sleep 1 | ||
rfkill unblock wifi | ||
sleep 5 | ||
sudo raspi-config nonint do_wifi_ssid_passphrase "${SSID}" "${PW}" | ||
sleep 20 | ||
fi | ||
fi | ||
if test -e ~ov/ov-client.hifiberry; then | ||
HBERRY=$(cat ~ov/ov-client.hifiberry) | ||
sudo rm -f ~ov/ov-client.hifiberry | ||
sudo sed -i -e 's/[^#]*hifiberry-/#&/g' /boot/config.txt|| echo "unable to disable hifiberry modules" | ||
if test "${HBERRY}" != "none"; then | ||
sudo sed -i -e "/dtoverlay*.hifiberry-${HBERRY}/ d" /boot/config.txt|| echo "unable to add new hifiberry entry" | ||
( | ||
echo "" | ||
echo "dtoverlay=hifiberry-${HBERRY}" | ||
) | sudo tee /boot/config.txt | ||
fi | ||
sudo sed -i -e '/^$/N;/^\n$/D' /boot/config.txt||echo "unable to remove multiple empty lines" | ||
sync | ||
sudo shutdown -r now | ||
fi | ||
sleep 7 | ||
done |
This file contains 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