mirror of
https://github.com/ublue-os/bazzite.git
synced 2025-01-26 09:35:24 +00:00
Permission fixes for rmlint script (#1191)
* Permission fixes for rmlint script Forgot to run sudo before creating files into /etc * Small typo fix * Add an external file to copy back I can't get cat to properly parse and escape it correctly from an inline bash script
This commit is contained in:
parent
c8275031d1
commit
bea94c2f11
@ -6,7 +6,7 @@ enable-rmlint ACTION="":
|
||||
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}"
|
||||
RMLINT_STATE="${red}${b}not enabled${n}"
|
||||
else
|
||||
RMLINT_STATE="${green}${b}already enabled${n}"
|
||||
fi
|
||||
@ -28,8 +28,8 @@ enable-rmlint ACTION="":
|
||||
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
|
||||
sudo mkdir /etc/systemd/system/btrfs-dedup@.service.d/
|
||||
sudo bash -c 'cat << EOL > /etc/systemd/system/btrfs-dedup@.service.d/override.conf
|
||||
[Unit]
|
||||
Description=Btrfs deduplication on %f
|
||||
ConditionPathIsMountPoint=%f
|
||||
@ -69,7 +69,7 @@ enable-rmlint ACTION="":
|
||||
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/
|
||||
sudo rm /etc/systemd/system/btrfs-dedup@.service.d/override.conf
|
||||
sudo rmdir /etc/systemd/system/btrfs-dedup@.service.d/
|
||||
echo "rmlint has been disabled."
|
||||
fi
|
||||
|
@ -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
|
Loading…
x
Reference in New Issue
Block a user