distribution/packages/jelos/sources/autostart/autostart

48 lines
1.1 KiB
Bash
Executable file

#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2020 Fewtarius (https://github.com/fewtarius)
. /etc/profile
. /etc/os-release
BOOTLOG="/var/log/boot.log"
performance 2>&1 >${BOOTLOG}
date 2>&1 >>${BOOTLOG}
/usr/bin/show_splash intro 2>&1 >>${BOOTLOG}
### Run device specific start scripts
for script in /usr/lib/autostart/${HW_DEVICE}/*
do
echo "Executing ${script}" 2>&1 >>${BOOTLOG}
${script} 2>&1 >>${BOOTLOG}
done
### Lock is a prerequisite for emustation
rm /var/lock/start.games 2>&1 >>${BOOTLOG}
touch /var/lock/start.games 2>&1 >>${BOOTLOG}
systemctl start ${UI_SERVICE} 2>&1 >>${BOOTLOG} &
### Run common start scripts
for script in /usr/lib/autostart/common/*
do
echo "Executing ${script}" 2>&1 >>${BOOTLOG}
${script} 2>&1 >>${BOOTLOG} &
done
### Run custom start scripts
if [ -d "/storage/.config/autostart" ]
then
for script in /storage/.config/autostart/*
do
echo "Executing ${script}" 2>&1 >>${BOOTLOG}
${script} 2>&1 >>${BOOTLOG} &
done
fi
/usr/bin/show_splash intro 2>&1 >>${BOOTLOG}
DEVICE_CPU_GOVERNOR=$(get_setting system.cpugovernor)
${DEVICE_CPU_GOVERNOR} 2>&1 >>${BOOTLOG}
date 2>&1 >>${BOOTLOG}