Sync from SUSE:SLFO:Main btrfsmaintenance revision 421a033cc98133680ec07d8b518e1864

This commit is contained in:
Adrian Schröter 2024-05-03 11:25:05 +02:00
commit eab1857ec1
5 changed files with 412 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

BIN
btrfs-defrag-plugin.sh Normal file

Binary file not shown.

BIN
btrfsmaintenance-0.5.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

264
btrfsmaintenance.changes Normal file
View File

@ -0,0 +1,264 @@
-------------------------------------------------------------------
Wed Feb 10 12:49:06 UTC 2021 - Thorsten Kukuk <kukuk@suse.com>
- Require libzypp plugin only if zypper is used (Required for e.g.
image based systems).
-------------------------------------------------------------------
Wed Aug 19 09:01:02 UTC 2020 - Callum Farmer <callumjfarmer13@gmail.com>
- Fixes for %_libexecdir changing to /usr/libexec (bsc#1174075)
-------------------------------------------------------------------
Thu Jul 30 00:00:00 CEST 2020 - dsterba@suse.cz
- update to version 0.5
- sysconfig:
- change defaults of MUSAGE and DUSAGE for balance task to do less work,
with a script to switch from existing unmodified defaults to new ones
- document systemd.timer syntax
- make balance, scrub, and trim mutually exclusive tasks
- service file updates:
- delete Install section
- defrag-plugin:
- switch to python3
- add alternative shell implementation of the plugin
- installation docs update
- Removed patches (upstream):
- 0001-README-document-impact-of-balance-quota-groups.patch
- 0002-sysconfig-reduce-default-balance-usage-thresholds-fa.patch
- 0003-sysconfig-document-using-systemd.time-7-for-frequenc.patch
- 0004-btrfsmaintenance-refresh-cron.sh-validate-periods-fo.patch
- 0005-btrfs-defrag-plugin-remove-dependency-on-zypp-plugin.patch
-------------------------------------------------------------------
Tue Jun 11 16:34:56 CEST 2019 - dsterba@suse.cz
- spec: fix typo in macro name
-------------------------------------------------------------------
Tue Jun 11 12:34:37 UTC 2019 - Dominique Leuenberger <dimstar@opensuse.org>
- BuildRequire pkgconfig(systemd) instead of systemd: allow OBS to
shortcut the build queues by allowing usage of systemd-mini
-------------------------------------------------------------------
Tue Mar 12 20:37:45 UTC 2019 - jeffm@suse.com
- Document and adjust balance thresholds and periods (FATE#325529 jsc#SLE-3188).
* README: document impact of balance + quota groups
* sysconfig: reduce default balance usage thresholds
* sysconfig: document using systemd.time(7) for frequency of operations
* btrfsmaintenance-refresh-cron.sh: validate periods for cron-based systems
- Remove python dependency (FATE#326736 jsc#SLE-4130).
* btrfs-defrag-plugin: remove dependency on zypp-plugin-python
- Added patches:
* 0001-README-document-impact-of-balance-quota-groups.patch
* 0002-sysconfig-reduce-default-balance-usage-thresholds-fa.patch
* 0003-sysconfig-document-using-systemd.time-7-for-frequenc.patch
* 0004-btrfsmaintenance-refresh-cron.sh-validate-periods-fo.patch
* 0005-btrfs-defrag-plugin-remove-dependency-on-zypp-plugin.patch
- Added source:
* btrfs-defrag-plugin.sh
- Removed patch:
* python3-support-bsc1070322.diff
-------------------------------------------------------------------
Tue Sep 25 00:00:00 CEST 2018 - dsterba@suse.cz
- update to version 0.4.2
- CVE-2018-14722: expand auto mountpoints in a safe way
- btrfs-defrag: fix missing function to detect btrfs filesystems (#52)
- btrfs-trim: more verbose fstrim output (#60)
- dist-install: print information about timer unit installation (#58)
-------------------------------------------------------------------
Fri Apr 13 13:48:40 UTC 2018 - lpechacek@suse.com
- In openSUSE the defrag plugin must explicitly refer to Python 3.
(bsc#1070322)
- Added patch: python3-support-bsc1070322.diff
-------------------------------------------------------------------
Thu Mar 15 00:00:00 CET 2018 - dsterba@suse.cz
- update to version 0.4.1
- defrag plugin: python2 and 3 compatibility
- defrag plugin: target extent size lowered to 32MiB (#43)
- shell compatibility fixes
- systemd unit type fixes
- Removed patch: python3-support-bsc1070322.diff (upstream)
-------------------------------------------------------------------
Mon Mar 12 13:39:23 CET 2018 - kukuk@suse.de
- Add missing btrfsmaintenance-refresh.path [bsc#1084871]
- Use %license [bsc#1082318]
-------------------------------------------------------------------
Mon Feb 5 15:13:00 UTC 2018 - lpechacek@suse.com
- Move the defrag plugin over to Python 3. (bsc#1070322)
- Added patch: python3-support-bsc1070322.diff
-------------------------------------------------------------------
Mon Jan 15 00:00:00 CET 2018 - dsterba@suse.cz
- update to version 0.4
- add support for systemd timers and use them by default; the alternative
cron scripts are still present (#29, #36)
- add automatic monitoring (via systemd.path) of the config file,
no manual updates by btrfsmaintenance-refresh.service needed (#38)
- fix RPM database path detection
- spec file cleanups
- documentation updates
- removed patches:
- btrfsmaintenance-0.3.1-fix-rpm-db-path.patch (upstream)
- btrfsmaintenance-switch-to-timer.patch (upstream)
- pull-request-36.patch (upstream)
-------------------------------------------------------------------
Fri Dec 22 18:42:10 UTC 2017 - antoine.belvire@opensuse.org
- Fix systemd timers enabled even if period is set to none:
* Micro change in pull-request-36.patch (bsc#1075884)
- Clean spec file:
* Removed support for suse_version <= 1210.
* Removed call to btrfsmaintenance-refresh-cron.sh upon deletion
(not needed anymore since we use systemd timers which are
handled by macros).
* Ran spec-cleaner.
-------------------------------------------------------------------
Sun Dec 17 12:18:45 CET 2017 - kukuk@suse.de
- Switch default of btrfsmaintenance-refresh.service to systemd-timer,
too (btrfsmaintenance-switch-to-timer.patch) [bsc#1073204]
-------------------------------------------------------------------
Wed Dec 6 15:55:53 CET 2017 - kukuk@suse.de
- pull-request-36.patch: update patch
-------------------------------------------------------------------
Wed Dec 6 13:39:46 CET 2017 - kukuk@suse.de
- Don't call btrfsmaintenance-refresh-cron.sh in %post, this is
done already by the systemd macros
-------------------------------------------------------------------
Tue Dec 5 18:53:08 UTC 2017 - kukuk@suse.com
- Add patch to use systemd timer instead of cron (pull-request-36.patch)
-------------------------------------------------------------------
Thu Nov 23 13:44:40 UTC 2017 - rbrown@suse.com
- Replace references to /var/adm/fillup-templates with new
%_fillupdir macro (boo#1069468)
-------------------------------------------------------------------
Fri Nov 10 22:12:08 UTC 2017 - antoine.belvire@opensuse.org
- Fix cron symlinks removal upon package upgrade (boo#904518):
* The problem was in the preun section (in the old RPM).
* This means the symlinks are removed by this update, but won't
be by the next ones.
* Please run 'systemctl start btrfsmaintenance-refresh' one more
time to fix your symlinks.
-------------------------------------------------------------------
Tue Nov 7 22:06:55 UTC 2017 - antoine.belvire@opensuse.org
- Add btrfsmaintenance-0.3.1-fix-rpm-db-path.patch:
* Change RPM database path to /usr/lib/sysimage/rpm for
Tumbleweed.
-------------------------------------------------------------------
Wed Jul 5 09:17:36 UTC 2017 - lnussel@suse.de
- Require btrfsprogs (bsc#1047226)
-------------------------------------------------------------------
Fri Apr 7 00:00:00 CEST 2017 - dsterba@suse.cz
- version 0.3.1
- dist-install: fix installation paths, install functions
- functions: fix syntax to be compatible with dash
- spec: install functions file
-------------------------------------------------------------------
Tue Nov 15 00:00:00 CET 2016 - dsterba@suse.cz
- version 0.3
- add syslog to logging targets
- add none target (/dev/null)
- autodetect btrfs filesystems for balance, scrub and trim
- detect mixed blockgroups and use correct balance filters
- fix uninstall rules
- fix capturing entire output to the log
- fix when cron files are symlinks
- add generic installation script
- doc updates: retention policy tuning
-------------------------------------------------------------------
Fri Mar 4 00:00:00 CET 2016 - dsterba@suse.cz
- version 0.2
- updated documentation
- support debian-like configuration paths
- no hardcoded paths to external utilities
- fixed logger name typos for 'journal' target
- defrag fixes (sysconfig, find arguments)
-------------------------------------------------------------------
Thu Oct 8 00:00:00 CEST 2015 - dsterba@suse.cz
- version 0.1.2
- change default config for trim: off
- journal loggin should work (fixed a typo)
-------------------------------------------------------------------
Mon Jul 13 00:00:00 CEST 2015 - dsterba@suse.com
- version 0.1.1
- fix typo and make journal logging target work
-------------------------------------------------------------------
Wed Nov 19 00:00:00 CET 2014 - dsterba@suse.cz
- cron refresh: remove bashism
- cron refresh: remove debugging messages
- post installation must create the cron links (bsc#904518)
- Removed patches:
* btrfsmaintenance-0.1-fix-bashisms.patch
-------------------------------------------------------------------
Sat Nov 15 04:55:00 UTC 2014 - Led <ledest@gmail.com>
- fix bashism in btrfsmaintenance-refresh-cron.sh script
- add patches:
* btrfsmaintenance-0.1-fix-bashisms.patch
-------------------------------------------------------------------
Wed Oct 29 00:00:00 CET 2014 - dsterba@suse.cz
- add COPYING, README.md
- add config option to specify log target (stdout, or journal)
-------------------------------------------------------------------
Thu Oct 9 18:33:44 CEST 2014 - dsterba@suse.cz
- clean spec
- add Url tag
-------------------------------------------------------------------
Thu Oct 9 16:47:46 CEST 2014 - dsterba@suse.cz
- fix sysconfig file Path: tags
-------------------------------------------------------------------
Wed Sep 24 13:17:22 CEST 2014 - dsterba@suse.cz
- initial import 0.1

122
btrfsmaintenance.spec Normal file
View File

@ -0,0 +1,122 @@
#
# spec file for package btrfsmaintenance
#
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
%define _fillupdir /var/adm/fillup-templates
%endif
Name: btrfsmaintenance
Version: 0.5
Release: 0
Summary: Scripts for btrfs periodic maintenance tasks
License: GPL-2.0-only
Group: System/Base
URL: https://github.com/kdave/btrfsmaintenance
Source0: %{name}-%{version}.tar.bz2
Source1: btrfs-defrag-plugin.sh
BuildRequires: pkgconfig(systemd)
Requires: btrfsprogs
Requires: (libzypp(plugin:commit) if zypper)
Supplements: btrfsprogs
BuildArch: noarch
%{?systemd_ordering}
%description
Scripts for btrfs maintenance tasks like periodic scrub, balance, trim or defrag
on selected mountpoints or directories. Hints for periodic snapshot tuning (eg.
for snapper).
%prep
%setup -q
cp %{SOURCE1} .
%build
%install
# scripts
install -m 755 -d %{buildroot}%{_datadir}/%{name}
install -m 755 btrfs-defrag.sh %{buildroot}%{_datadir}/%{name}
install -m 755 btrfs-balance.sh %{buildroot}%{_datadir}/%{name}
install -m 755 btrfs-scrub.sh %{buildroot}%{_datadir}/%{name}
install -m 755 btrfs-trim.sh %{buildroot}%{_datadir}/%{name}
install -m 755 btrfsmaintenance-refresh-cron.sh %{buildroot}%{_datadir}/%{name}
install -m 644 btrfsmaintenance-functions %{buildroot}%{_datadir}/%{name}
# systemd services and timers
install -m 755 -d %{buildroot}%{_unitdir}
install -m 644 -D btrfsmaintenance-refresh.service %{buildroot}%{_unitdir}
install -m 644 -D btrfsmaintenance-refresh.path %{buildroot}%{_unitdir}
install -m 644 -D btrfs-balance.service %{buildroot}%{_unitdir}
install -m 644 -D btrfs-defrag.service %{buildroot}%{_unitdir}
install -m 644 -D btrfs-scrub.service %{buildroot}%{_unitdir}
install -m 644 -D btrfs-trim.service %{buildroot}%{_unitdir}
install -m 644 -D btrfs-balance.timer %{buildroot}%{_unitdir}
install -m 644 -D btrfs-defrag.timer %{buildroot}%{_unitdir}
install -m 644 -D btrfs-scrub.timer %{buildroot}%{_unitdir}
install -m 644 -D btrfs-trim.timer %{buildroot}%{_unitdir}
install -m 755 -d %{buildroot}%{_sbindir}
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcbtrfsmaintenance-refresh
# zypp plugin
install -m 755 -d %{buildroot}%{_prefix}/lib/zypp/plugins/commit
install -m 755 -D btrfs-defrag-plugin.sh %{buildroot}%{_prefix}/lib/zypp/plugins/commit
# config
install -m 755 -d %{buildroot}%{_fillupdir}
install -m 644 -D sysconfig.btrfsmaintenance %{buildroot}%{_fillupdir}
%pre
# if the new service files don't exist, we migrate from
# old version with old script, remove cron symlinks
[ ! -f %{_unitdir}/btrfs-balance.timer -a -f %{_datadir}/%{name}/btrfsmaintenance-refresh-cron.sh ] && %{_datadir}/%{name}/btrfsmaintenance-refresh-cron.sh uninstall
%service_add_pre btrfsmaintenance-refresh.service btrfsmaintenance-refresh.path btrfs-balance.service btrfs-balance.timer btrfs-defrag.service btrfs-defrag.timer btrfs-scrub.service btrfs-scrub.timer btrfs-trim.service btrfs-trim.timer
%post
%service_add_post btrfsmaintenance-refresh.service btrfsmaintenance-refresh.path btrfs-balance.service btrfs-balance.timer btrfs-defrag.service btrfs-defrag.timer btrfs-scrub.service btrfs-scrub.timer btrfs-trim.service btrfs-trim.timer
%{fillup_only btrfsmaintenance}
%preun
%service_del_preun btrfsmaintenance-refresh.service btrfsmaintenance-refresh.path btrfs-balance.service btrfs-balance.timer btrfs-defrag.service btrfs-defrag.timer btrfs-scrub.service btrfs-scrub.timer btrfs-trim.service btrfs-trim.timer
%postun
%service_del_postun btrfsmaintenance-refresh.service btrfsmaintenance-refresh.path btrfs-balance.service btrfs-balance.timer btrfs-defrag.service btrfs-defrag.timer btrfs-scrub.service btrfs-scrub.timer btrfs-trim.service btrfs-trim.timer
%files
%license COPYING
%doc README.md
%{_fillupdir}/sysconfig.btrfsmaintenance
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/*
%dir %{_prefix}/lib/zypp/
%dir %{_prefix}/lib/zypp/plugins
%dir %{_prefix}/lib/zypp/plugins/commit
%{_prefix}/lib/zypp/plugins/commit/btrfs-defrag-plugin.sh
%{_unitdir}/btrfsmaintenance-refresh.path
%{_unitdir}/btrfsmaintenance-refresh.service
%{_unitdir}/btrfs-balance.service
%{_unitdir}/btrfs-defrag.service
%{_unitdir}/btrfs-scrub.service
%{_unitdir}/btrfs-trim.service
%{_unitdir}/btrfs-balance.timer
%{_unitdir}/btrfs-defrag.timer
%{_unitdir}/btrfs-scrub.timer
%{_unitdir}/btrfs-trim.timer
%{_sbindir}/rcbtrfsmaintenance-refresh
%changelog