A bit of build and installer cleanup.
This commit is contained in:
@@ -4,6 +4,15 @@ UPDATE_AVR=true
|
||||
UPDATE_PY=true
|
||||
REBOOT=false
|
||||
|
||||
remove_services() {
|
||||
for service in "$@"
|
||||
do
|
||||
systemctl stop "${service}.service"
|
||||
systemctl disable "${service}.service"
|
||||
find /etc/systemd -name "${service}.service" -exec rm -f {} \;
|
||||
done
|
||||
}
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--no-avr) UPDATE_AVR=false ;;
|
||||
@@ -185,9 +194,10 @@ if $UPDATE_PY; then
|
||||
fi
|
||||
|
||||
# Install the service that turns off the screen during shutdown
|
||||
cp ./installer/config/bbctrl-poweroff.service /etc/systemd/system/
|
||||
remove_services bbctrl-poweroff onefinity-poweroff
|
||||
cp ./installer/config/onefinity-poweroff.service /etc/systemd/system/
|
||||
systemctl daemon-reload
|
||||
systemctl enable bbctrl-poweroff
|
||||
systemctl enable onefinity-poweroff
|
||||
|
||||
# Expand the file system if necessary
|
||||
chmod +x ./installer/scripts/resize_root_fs.sh
|
||||
@@ -197,8 +207,9 @@ if [ $? -eq 0 ]; then
|
||||
fi
|
||||
|
||||
# Install our logrotate config
|
||||
cp ./installer/config/bbctrl-logrotate /etc/logrotate.d/bbctrl
|
||||
chown root:root /etc/logrotate.d/bbctrl
|
||||
rm -f /etc/logrotate.d/{bbctrl,onefinity}
|
||||
cp ./installer/config/onefinity-logrotate /etc/logrotate.d/onefinity
|
||||
chown root:root /etc/logrotate.d/onefinity
|
||||
|
||||
# Ensure logrotate runs on every boot (for systems with no network, thus bad clock)
|
||||
if [ ! -e /etc/cron.d/reboot ]; then
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import json
|
||||
|
||||
if os.path.exists('dist/latest-beta.txt'):
|
||||
with open('dist/latest-beta.txt', 'r') as f:
|
||||
latest_beta = f.read().strip()
|
||||
|
||||
else: latest_beta = ''
|
||||
|
||||
with open('package.json', 'r') as f:
|
||||
version = json.load(f)['version']
|
||||
|
||||
if latest_beta.startswith(version + '-rc'):
|
||||
print(int(latest_beta[len(version) + 3:]) + 1)
|
||||
|
||||
else:
|
||||
print(1)
|
||||
Reference in New Issue
Block a user