-
-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "chore: Drop rmlint and cdemu until updated for F41"
This reverts commit 6b63a0b.
- Loading branch information
Showing
4 changed files
with
168 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
system_files/desktop/shared/usr/share/ublue-os/just/82-bazzite-cdemu.just
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# vim: set ft=make : | ||
|
||
# Setup and configure CDEmu Daemon and Client plus GUI Apps | ||
setup-cdemu ACTION="": | ||
#!/usr/bin/bash | ||
source /usr/lib/ujust/ujust.sh | ||
CDEMU_STATE="$(rpm -qa cdemu-daemon)" | ||
GUI_EDITION="$(cat /etc/os-release | grep VARIANT_ID | sed 's/^.*=//')" | ||
OPTION={{ ACTION }} | ||
if [ "$CDEMU_STATE" == "" ]; then | ||
CDEMU_STATE="${red}${b}Not Installed${n}" | ||
CDEMU_STATE_FLAG="0" | ||
else | ||
CDEMU_STATE="${green}${b}Installed${n}" | ||
CDEMU_STATE_FLAG="1" | ||
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 '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" | ||
OPTION=$(Choose "Install CDEmu" "Remove CDEmu" "Remove GUI Helper") | ||
fi | ||
if [[ "${OPTION,,}" =~ ^install ]]; then | ||
if [[ "$CDEMU_STATE_FLAG" == "1" ]]; then | ||
echo "${red} CDEmu has already been installed!" | ||
exit 0 | ||
fi | ||
ublue-update --wait | ||
if [[ "$GUI_EDITION" == "kinoite" ]]; then | ||
# Install packages for KDE 6 | ||
rpm-ostree install --apply-live -y cdemu-daemon cdemu-client kde-cdemu-manager-kf6 | ||
else | ||
# Install packages for GNOME | ||
rpm-ostree install --apply-live -y cdemu-daemon cdemu-client gcdemu | ||
fi | ||
# 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_FLAG" == "0" ]]; then | ||
echo "${red} CDEmu has already been removed!" | ||
exit 0 | ||
fi | ||
ublue-update --wait | ||
if [[ "$GUI_EDITION" == "kinoite" ]]; then | ||
# Remove packages for KDE 6 | ||
GUI_STATE="$(rpm -qa kde-cdemu-manager-kf6)" | ||
#GUI already removed | ||
if [[GUI_STATE == ""]]; then | ||
rpm-ostree remove -y cdemu-daemon cdemu-client | ||
else | ||
rpm-ostree remove -y cdemu-daemon cdemu-client kde-cdemu-manager-kf6 | ||
fi | ||
else | ||
# Remove packages for GNOME | ||
GUI_STATE="$(rpm -qa gcdemu)" | ||
#GUI already removed | ||
if [["${GUI_STATE,,}" == ""]]; then | ||
rpm-ostree remove -y cdemu-daemon cdemu-client | ||
else | ||
rpm-ostree remove -y cdemu-daemon cdemu-client gcdemu | ||
fi | ||
fi | ||
echo "CDEmu has been uninstalled." | ||
elif [[ "${OPTION,,}" =~ helper ]]; then | ||
if [[ "$GUI_EDITION" == "kinoite" ]]; then | ||
GUI_STATE="$(rpm -qa kde-cdemu-manager-kf6)" | ||
if [["$GUI_STATE" == ""]]; then | ||
echo "GUI has already been removed or the package is not yet installed!" | ||
else | ||
rpm-ostree remove -y kde-cdemu-manager-kf6 | ||
echo "GUI has been removed, you can still mount images using the CLI with the cdemu command." | ||
fi | ||
else | ||
GUI_STATE="$(rpm -qa gcdemu)" | ||
if [["$GUI_STATE" == ""]]; then | ||
echo "GUI has already been removed or the package is not yet installed!" | ||
else | ||
rpm-ostree remove -y gcdemu | ||
echo "GUI has been removed, you can still mount images using the CLI with the cdemu command." | ||
fi | ||
fi | ||
fi |
43 changes: 43 additions & 0 deletions
43
system_files/desktop/shared/usr/share/ublue-os/just/82-bazzite-rmlint.just
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# vim: set ft=make : | ||
|
||
# Reenable rmlint trim feature | ||
enable-rmlint ACTION="": | ||
#!/usr/bin/bash | ||
source /usr/lib/ujust/ujust.sh | ||
OPTION={{ ACTION }} | ||
STATUS="$(cat /etc/conf.d/btrfs-dedup | grep RMLINT_SKIP=\"1\")" | ||
if [[ $STATUS != "" ]]; then | ||
RMLINT_STATE="${red}${b}not enabled${n}" | ||
else | ||
RMLINT_STATE="${green}${b}already enabled${n}" | ||
fi | ||
if [ "$OPTION" == "help" ]; then | ||
echo "Usage: ujust enable-rmlint <option>" | ||
echo " <option>: Specify the quick option to skip the prompt" | ||
echo " Use 'enable' to reenable rmlint functionality" | ||
echo " Use 'disable' to revert to UBlue stock configuration (only duperemove is executed)" | ||
exit 0 | ||
elif [ "$OPTION" == "" ]; then | ||
echo "${bold}rmlint configuration${normal}" | ||
echo "rmlint conf is $RMLINT_STATE" | ||
OPTION=$(Choose "Enable rmlint" "Disable rmlint") | ||
fi | ||
if [[ "${OPTION,,}" =~ ^enable ]]; then | ||
if [[ "${RMLINT_STATE,,}" =~ "^already" ]]; then | ||
echo "${red} rmlint has already been enabled!" | ||
exit 0 | ||
fi | ||
ublue-update --wait | ||
rpm-ostree install --apply-live -y rmlint | ||
sudo sed -i 's@RMLINT_SKIP="1"@RMLINT_SKIP="0"@g' /etc/conf.d/btrfs-dedup | ||
echo "rmlint has been reenabled!" | ||
elif [[ "${OPTION,,}" =~ ^(disable|uninstall) ]]; then | ||
if [[ "${RMLINT_STATE,,}" =~ "^not" ]]; then | ||
echo "${red} rmlint has already been disabled!" | ||
exit 0 | ||
fi | ||
ublue-update --wait | ||
rpm-ostree remove -y rmlint | ||
sudo sed -i 's@RMLINT_SKIP="0"@RMLINT_SKIP="1"@g' /etc/conf.d/btrfs-dedup | ||
echo "rmlint has been disabled." | ||
fi |
30 changes: 30 additions & 0 deletions
30
system_files/desktop/shared/usr/share/ublue-os/just/rmlint-override.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[Unit] | ||
Description=Btrfs deduplication on %f | ||
ConditionPathIsMountPoint=%f | ||
RequiresMountsFor=%f | ||
|
||
[Service] | ||
Type=oneshot | ||
MemoryHigh=1G | ||
ExecCondition=sh -c '[ "$(stat -f -c "%%T" "$1")" = btrfs ]' _ %f/ | ||
ExecStartPre=-find %f/ -mindepth 1 -maxdepth 1 -mtime +14 -name .duperemove.hash -exec rm -f '{}' \; | ||
ExecStartPre=-cp -a %f/.duperemove.hash duperemove.hash | ||
ExecStartPre=-compsize %f/ | ||
ExecStart=rmlint --hidden --types="duplicates" --config=sh:handler=clone %f/ | ||
ExecStart=sh -c 'exec ./rmlint.sh -d -p -r -k' | ||
ExecStart=-compsize %f/ | ||
ExecStart=-sh -c "[ $(sqlite3 -readonly duperemove.hash \"SELECT keyval FROM config where keyname='version_major'\") -ge 4 ] || rm -f duperemove.hash" | ||
ExecStart=duperemove -r -d -h -q --hashfile=duperemove.hash --skip-zeroes --exclude="%f/.duperemove.hash" --exclude="%f/@swapfile/swapfile" %f/ | ||
ExecStartPost=-compsize %f/ | ||
ExecStopPost=-cp -a duperemove.hash %f/.duperemove.hash | ||
TimeoutStartSec=4h | ||
RuntimeDirectory=%p/%i | ||
WorkingDirectory=%t/%p/%i | ||
Nice=19 | ||
CPUSchedulingPolicy=batch | ||
IOSchedulingClass=best-effort | ||
IOSchedulingPriority=7 | ||
OOMScoreAdjust=1000 | ||
CPUWeight=30 | ||
CPUQuota=300% | ||
IOWeight=30 |