distribution/packages/sysutils/autostart/sources/autostart
fewtarius 4b9e65325f
* Update kernel and OS to support AyaNeo Air / Air Pro fan control.
* Bump WIFI drivers.
* Add WIFI module quirk and WIFI not waking from sleep on Air.
* Fix splash screen on rotated displays.
* Move autostart to its own package.
2022-12-19 17:14:32 -05:00

59 lines
1.5 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}
### Apply device quirks
if [ -e "/usr/sbin/dmidecode" ]
then
QUIRK_DEVICE=$(echo "$(dmidecode -s system-manufacturer) $(dmidecode -s system-product-name)")
else
QUIRK_DEVICE=$(cat /sys/firmware/devicetree/base/model 2>/dev/null)
fi
QUIRK_DEVICE=$(echo ${QUIRK_DEVICE} | sed -e "s#[/]#-#g")
if [ -d "/usr/lib/autostart/quirks/${QUIRK_DEVICE}" ]
then
echo "Executing ${QUIRK_DEVICE} quirks." 2>&1 >>${BOOTLOG}
for script in "/usr/lib/autostart/quirks/${QUIRK_DEVICE}"/*
do
echo "Executing ${script}" 2>&1 >>${BOOTLOG}
"${script}" 2>&1 >>${BOOTLOG} &
done
fi
### 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
clear >/dev/console
DEVICE_CPU_GOVERNOR=$(get_setting system.cpugovernor)
${DEVICE_CPU_GOVERNOR} 2>&1 >>${BOOTLOG}
date 2>&1 >>${BOOTLOG}