chore: Final fixes for testing CDEmu (#1055)

* Actually export the recipe in the justfile.

* Cleanup script file and remove service logic

The service is not activable/deactivable by the user.

* Manually enable the service after install

It doesn't seem to kickstart after install without a restart of the system
This commit is contained in:
Marco Rodolfi 2024-05-01 21:43:22 +02:00 committed by Kyle Gospodnetich
parent 31156bc2b2
commit a2a784f15b
2 changed files with 13 additions and 18 deletions

View File

@ -549,6 +549,7 @@ RUN /usr/libexec/containerbuild/build-initramfs && \
echo "import \"/usr/share/ublue-os/just/80-bazzite.just\"" >> /usr/share/ublue-os/justfile && \
echo "import \"/usr/share/ublue-os/just/81-bazzite-fixes.just\"" >> /usr/share/ublue-os/justfile && \
echo "import \"/usr/share/ublue-os/just/82-bazzite-apps.just\"" >> /usr/share/ublue-os/justfile && \
echo "import \"/usr/share/ublue-os/just/82-bazzite-cdemu.just\"" >> /usr/share/ublue-os/justfile && \
echo "import \"/usr/share/ublue-os/just/82-bazzite-sunshine.just\"" >> /usr/share/ublue-os/justfile && \
echo "import \"/usr/share/ublue-os/just/82-bazzite-waydroid.just\"" >> /usr/share/ublue-os/justfile && \
echo "import \"/usr/share/ublue-os/just/83-bazzite-audio.just\"" >> /usr/share/ublue-os/justfile && \

View File

@ -5,7 +5,6 @@ setup-cdemu ACTION="":
#!/usr/bin/bash
source /usr/lib/ujust/ujust.sh
CDEMU_STATE="$(rpm -qa cdemu-daemon)"
SERVICE_STATE="$(systemctl is-enabled --user cdemu-daemon.service)"
GUI_EDITION="$(cat /etc/os-release | grep VARIANT_ID | sed 's/^.*=//')"
OPTION={{ ACTION }}
if [ "$CDEMU_STATE" == "" ]; then
@ -13,26 +12,23 @@ setup-cdemu ACTION="":
else
CDEMU_STATE="${green}${b}Installed${n}"
fi
if [ "$SERVICE_STATE" == "enabled" ]; then
SERVICE_STATE="${green}${b}Enabled${n}"
else
SERVICE_STATE="${red}${b}Disabled${n}"
fi
if [ "$OPTION" == "help" ]; then
echo "Usage: ujust setup-cdemu <option>"
echo " <option>: Specify the quick option to skip the prompt"
echo " Use 'install' to select Install CDEmu"
echo " Use 'remove' to select Remove CDEmu"
echo " Use 'autostart' to select Toggle Autostart"
echo " Use 'remove-gui-helper' if you don't want to have the GUI"
exit 0
elif [ "$OPTION" == "" ]; then
echo "${bold}CDEmu setup and configuration${normal}"
echo "CDEmu is $CDEMU_STATE"
echo "Service is $SERVICE_STATE"
OPTION=$(Choose "Install CDEmu" "Remove CDEmu" "Toggle Autostart")
OPTION=$(Choose "Install CDEmu" "Remove CDEmu" "Remove GUI Helper")
fi
if [[ "${OPTION,,}" =~ ^install ]]; then
if [[ "$CDEMU_STATE" != "" ]]; then
echo "${red} CDEmu has already been installed!"
exit 0
fi
ublue-update --wait
if [[ "$GUI_EDITION" == "kinoite" ]]; then
# Install packages for KDE 6
@ -41,11 +37,15 @@ setup-cdemu ACTION="":
# Install packages for GNOME
rpm-ostree install --apply-live -y cdemu-daemon cdemu-client gcdemu
fi
systemctl enable --user --now cdemu-daemon.service
# Kickstart the service manually on first install, it doesn't seem to be doing that by default.
systemctl start --user cdemu-daemon.service
echo "CDEmu is installed!"
elif [[ "${OPTION,,}" =~ ^(remove|uninstall) ]]; then
if [[ "$CDEMU_STATE" == "" ]]; then
echo "${red} CDEmu has already been removed!"
exit 0
fi
ublue-update --wait
systemctl disable --user cdemu-daemon.service
if [[ "$GUI_EDITION" == "kinoite" ]]; then
# Remove packages for KDE 6
GUI_STATE="$(rpm -qa kde-cdemu-manager-kf6)"
@ -66,13 +66,7 @@ setup-cdemu ACTION="":
fi
fi
echo "CDEmu has been uninstalled."
elif [[ "${OPTION,,}" =~ autostart ]]; then
if [[ "${SERVICE_STATE,,}" =~ disabled ]]; then
systemctl enable --user --now cdemu-daemon.service
else
systemctl disable --user --now cdemu-daemon.service
fi
elif [[ "${OPTION,,}" =~ remove-gui-helper ]]; then
elif [[ "${OPTION,,}" =~ helper ]]; then
if [[ "$GUI_EDITION" == "kinoite" ]]; then
GUI_STATE="$(rpm -qa kde-cdemu-manager-kf6)"
if [["$GUI_STATE" == ""]]; then