mirror of
https://github.com/ublue-os/bazzite.git
synced 2025-01-29 00:32:52 +00:00
chore: readd rmlint as an optional package (#1102)
* feat(just): add recipe to restart proton (#1091) * feat(just): add recipe to restart proton useful for when a game gets stuck at "launching" or "exiting" * chore: fix grammar * chore: Just syntax fix * chore(gnome): remove MUTTER_DEBUG_FORCE_KMS_MODE (#1094) This is no longer needed for VRR in v40+ and it breaks direct scanout. Signed-off-by: Tayler Geiger <mail@tayler.dev> * fix(ujust): Add --or-update flag for Flatpak command (#1095) * chore(gnome): Add missing 3037 fix to deck images * chore: Remove no longer needed patch from steamdeck-dsp * Readd rmlint as an optional ujust command * Missed a leftover from the old file --------- Signed-off-by: Tayler Geiger <mail@tayler.dev> Co-authored-by: HikariKnight <2557889+HikariKnight@users.noreply.github.com> Co-authored-by: Kyle Gospodnetich <me@kylegospodneti.ch> Co-authored-by: Tayler Geiger <tayler@redhat.com> Co-authored-by: Pat Connors <121328689+nicknamenamenick@users.noreply.github.com>
This commit is contained in:
parent
179a9dea5f
commit
9f56df27c5
@ -42,6 +42,7 @@ RUN curl -Lo /usr/bin/copr https://raw.githubusercontent.com/ublue-os/COPR-comma
|
||||
curl -Lo /etc/yum.repos.d/_copr_matte-schwartz-sunshine.repo https://copr.fedorainfracloud.org/coprs/matte-schwartz/sunshine/repo/fedora-"${FEDORA_MAJOR_VERSION}"/matte-schwartz-sunshine-fedora-"${FEDORA_MAJOR_VERSION}".repo && \
|
||||
curl -Lo /etc/yum.repos.d/_copr_rok-cdemu.repo https://copr.fedorainfracloud.org/coprs/rok/cdemu/repo/fedora-"${FEDORA_MAJOR_VERSION}"/rok-cdemu-fedora-"${FEDORA_MAJOR_VERSION}".rep && \
|
||||
curl -Lo /etc/yum.repos.d/_copr_rodoma92-kde-cdemu-manager.repo https://copr.fedorainfracloud.org/coprs/rodoma92/kde-cdemu-manager/repo/fedora-"${FEDORA_MAJOR_VERSION}"/rodoma92-kde-cdemu-manager-fedora-"${FEDORA_MAJOR_VERSION}".repo && \
|
||||
curl -Lo /etc/yum.repos.d/_copr_rodoma92-rmlint.repo https://copr.fedorainfracloud.org/coprs/rodoma92/rmlint/repo/fedora-"${FEDORA_MAJOR_VERSION}"/rodoma92-rmlint-fedora-"${FEDORA_MAJOR_VERSION}".repo && \
|
||||
curl -Lo /etc/yum.repos.d/tailscale.repo https://pkgs.tailscale.com/stable/fedora/tailscale.repo && \
|
||||
sed -i 's@gpgcheck=1@gpgcheck=0@g' /etc/yum.repos.d/tailscale.repo && \
|
||||
ostree container commit
|
||||
@ -556,6 +557,7 @@ RUN /usr/libexec/containerbuild/build-initramfs && \
|
||||
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-rmlint.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 && \
|
||||
echo "import \"/usr/share/ublue-os/just/84-bazzite-virt.just\"" >> /usr/share/ublue-os/justfile && \
|
||||
|
@ -0,0 +1,75 @@
|
||||
# vim: set ft=make :
|
||||
|
||||
# Reenable rmlint trim feature
|
||||
enable-rmlint ACTION="":
|
||||
#!/usr/bin/bash
|
||||
source /usr/lib/ujust/ujust.sh
|
||||
OPTION={{ ACTION }}
|
||||
if [[ ! -f "/etc/systemd/system/btrfs-dedup@.service.d/override.conf" ]]; 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
|
||||
mkdir /etc/systemd/system/btrfs-dedup@.service.d/
|
||||
bash -c 'cat << EOL > /etc/systemd/system/btrfs-dedup@.service.d/override.conf
|
||||
[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
|
||||
EOL'
|
||||
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
|
||||
rm /etc/systemd/system/btrfs-dedup@.service.d/override.conf
|
||||
rmdir /etc/systemd/system/btrfs-dedup@.service.d/
|
||||
echo "rmlint has been disabled."
|
||||
fi
|
Loading…
x
Reference in New Issue
Block a user