feat: reduce boot times by creating donefiles w scripts in desktop version

This commit is contained in:
tulili 2023-08-26 23:59:30 -03:00
parent 97fab178c6
commit d6667e85bf
No known key found for this signature in database
2 changed files with 15 additions and 7 deletions

View File

@ -1,6 +1,12 @@
#!/usr/bin/env bash
source /etc/default/bazzite
DONEFILE=/etc/bazzite/hardware_setup_done
if [[ -e "$DONEFILE" ]] ; then
printf "Hardware was already properly set up. To run this script again, delete %s\n" "$DONEFILE"
exit 0
fi
# GLOBAL
SYS_ID="$(cat /sys/devices/virtual/dmi/id/product_name)"
KARGS=$(rpm-ostree kargs)
@ -75,9 +81,11 @@ if [[ ! $KARGS =~ "rd.luks.options" ]]; then
NEEDED_KARGS="$NEEDED_KARGS --append=rd.luks.options=discard"
fi
if [[ ! -z "$NEEDED_KARGS" ]]; then
if [[ -n "$NEEDED_KARGS" ]]; then
echo "Found needed karg changes, applying the following: $NEEDED_KARGS"
rpm-ostree kargs ${NEEDED_KARGS} --reboot
rpm-ostree kargs ${NEEDED_KARGS} --reboot || exit 1
mkdir -p "$(dirname "$DONEFILE")"
touch "$DONEFILE"
else
echo "No karg changes needed"
fi

View File

@ -1,10 +1,10 @@
#!/usr/bin/env bash
source /etc/default/bazzite
FLATPAK_INSTALLED_CONDITION_CHECK="/etc/bazzite/sys_flatpak_configured"
DONEFILE="/etc/bazzite/sys_flatpak_done"
if [[ -f "$FLATPAK_INSTALLED_CONDITION_CHECK" ]] ; then
printf "System flatpaks are already installed (%s)" "$FLATPAK_INSTALLED_CONDITION_CHECK"
if [[ -f "$DONEFILE" ]] ; then
printf "System flatpaks were already installed. To run this script again, delete %s\n" "$DONEFILE"
exit 0
fi
@ -36,5 +36,5 @@ if [[ -f '/etc/flatpak/deck' ]]; then
fi
rm -rf /etc/flatpak/{deck,flathub,objects}
mkdir /etc/bazzite
touch "$FLATPAK_INSTALLED_CONDITION_CHECK"
mkdir -p "$(dirname "$DONEFILE")"
touch "$DONEFILE"