import CS rust-zram-generator-1.1.2-1.el9
This commit is contained in:
parent
601116b3c7
commit
687a7d4924
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,2 +1,2 @@
|
||||
SOURCES/zram-generator-0.3.2.crate
|
||||
SOURCES/zram-generator-v0.3.2-vendor.tar.gz
|
||||
SOURCES/zram-generator-1.1.2-vendor.tar.xz
|
||||
SOURCES/zram-generator-1.1.2.crate
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
987e5137e6c9c6e64f5a2a452d273c43f1ce5a04 SOURCES/zram-generator-0.3.2.crate
|
||||
9613428de5eadbcee227c8113d4116feaa205422 SOURCES/zram-generator-v0.3.2-vendor.tar.gz
|
||||
d5a0ba53ba1a61597ed7f9a1a442912da45cc699 SOURCES/zram-generator-1.1.2-vendor.tar.xz
|
||||
86da9f84394b081521039e694bbd74bbf9db67d6 SOURCES/zram-generator-1.1.2.crate
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
.\" generated with Ronn-NG/v0.9.1
|
||||
.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
|
||||
.TH "ZRAM\-GENERATOR" "8" "February 2021" "zram-generator developers"
|
||||
.\" generated with Ronn-NG/v0.10.1
|
||||
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
|
||||
.TH "ZRAM\-GENERATOR" "8" "May 2024" "zram-generator developers"
|
||||
.SH "NAME"
|
||||
\fBzram\-generator\fR \- Systemd unit generator for zram swap devices
|
||||
.SH "SYNOPSIS"
|
||||
@ -10,7 +10,7 @@
|
||||
.br
|
||||
\fB/usr/lib/systemd/system\-generators/zram\-generator\fR \-\-reset\-device \fBDEVICE\fR
|
||||
.SH "DESCRIPTION"
|
||||
\fBzram\-generator\fR is a generator that creates systemd units to format and use compressed RAM devices, either as swap or a mount point\.
|
||||
\fBzram\-generator\fR is a generator that creates systemd units to format and use compressed RAM devices, either as swap or a file system\.
|
||||
.P
|
||||
The generator will be invoked by systemd early at boot\. The generator will then:
|
||||
.IP "1." 4
|
||||
@ -29,27 +29,31 @@ Setting the \fBZRAM_GENERATOR_ROOT\fR environment variable makes the generator r
|
||||
.br
|
||||
For the ramifications of \fBZRAM_GENERATOR_ROOT\fR on config handling, see zram\-generator\.conf(5)\.
|
||||
.P
|
||||
Generated \fIdev\-zramN\.swap\fR units depend on \fBsystemd\-swap\-create@zramN\.service\fR, which will:
|
||||
Generated \fIdev\-zramN\.swap\fR units depend on \fBsystemd\-zram\-setup@zramN\.service\fR, which will:
|
||||
.IP "1." 4
|
||||
read configuration files from \fI{/etc,/lib}/systemd/zram\-generator\.conf[\.d]\fR (see zram\-generator\.conf(5) for details);
|
||||
.IP "2." 4
|
||||
set the desired compression algorithm, if any; if the current kernel doesn\'t understand the specified algorithm, a warning is issued, but execution continues;
|
||||
set the desired compression algorithm, if any; if the current kernel doesn't understand the specified algorithm, a warning is issued, but execution continues;
|
||||
.IP "3." 4
|
||||
set the desired blockdev size and format it as swap with \fIsystemd\-makefs(8)\fR\.
|
||||
.IP "" 0
|
||||
.P
|
||||
Generated \fIpath\-to\-mount\-point\.mount\fR units depend on \fBsystemd\-swap\-create@zramN\.service\fR\. The effect is similar to what happens for swap units, but of course they are formatted with a file system\.
|
||||
Generated \fIpath\-to\-mount\-point\.mount\fR units depend on \fBsystemd\-zram\-setup@zramN\.service\fR\. The effect is similar to what happens for swap units, but of course they are formatted with a file system\.
|
||||
.P
|
||||
When the unit is stopped, the zram device is reset, freeing memory and allowing the device to be reused\.
|
||||
.P
|
||||
\fBzram\-generator\fR implements systemd\.generator(7)\.
|
||||
.SS "Applying config changes"
|
||||
This generator is invoked in early boot, and the devices it configures will be created very early too, so the easiest way to apply config changes is to simply reboot the machine\.
|
||||
.P
|
||||
Nevertheless, sometimes it may be useful to add new devices or apply config changes at runtime\. Applying new configuration means restarting the units, and that in turn means recreating the zram devices\. This means that \fIfile systems are temporarily unmounted and their contents lost\fR, and \fIpages are moved out of the compressed swap device\fR into other memory\. If this is acceptable, \fBsystemctl restart systemd\-zram\-setup@zramN\fR or \fBsystemctl restart systemd\-zram\-setup@*\fR may be used to recreate a specific device or all configured devices\. (If the device didn't exist, \fBrestart\fR will create it\.) If the way the device is used (e\.g\. the mount point or file system type) is changed, \fBsystemctl daemon\-reload\fR needs to be called first to recreate systemd units\. If a device or mount point is removed from configuration, the unit should be stopped before calling \fBdaemon\-reload\fR\. Otherwise, systemd will not know how to stop the unit properly\.
|
||||
.SH "REPORTING BUGS"
|
||||
<\fIhttps://github\.com/systemd/zram\-generator/issues\fR>
|
||||
\fIhttps://github\.com/systemd/zram\-generator/issues\fR
|
||||
.SH "SEE ALSO"
|
||||
zram\-generator\.conf(5), systemd\.generator(7), systemd\.swap(5)
|
||||
.P
|
||||
<\fIhttps://github\.com/systemd/zram\-generator\fR>
|
||||
\fIhttps://github\.com/systemd/zram\-generator\fR
|
||||
.P
|
||||
Linux documentation of zram: <\fIhttps://kernel\.org/doc/html/latest/admin\-guide/blockdev/zram\.html\fR>
|
||||
Linux documentation of zram: \fIhttps://kernel\.org/doc/html/latest/admin\-guide/blockdev/zram\.html\fR
|
||||
.br
|
||||
and the zram sysfs ABI: <\fIhttps://kernel\.org/doc/Documentation/ABI/testing/sysfs\-block\-zram\fR>
|
||||
and the zram sysfs ABI: \fIhttps://kernel\.org/doc/Documentation/ABI/testing/sysfs\-block\-zram\fR
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
.\" generated with Ronn-NG/v0.9.1
|
||||
.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
|
||||
.TH "ZRAM\-GENERATOR\.CONF" "5" "February 2021" "zram-generator developers"
|
||||
.\" generated with Ronn-NG/v0.10.1
|
||||
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
|
||||
.TH "ZRAM\-GENERATOR\.CONF" "5" "May 2024" "zram-generator developers"
|
||||
.SH "NAME"
|
||||
\fBzram\-generator\.conf\fR \- Systemd unit generator for zram swap devices (configuration)
|
||||
.SH "SYNOPSIS"
|
||||
@ -22,7 +22,7 @@
|
||||
.SH "DESCRIPTION"
|
||||
These files configure devices created by zram\-generator(8)\. See systemd\.syntax(5) for a general description of the syntax\.
|
||||
.SH "CONFIGURATION DIRECTORIES AND PRECEDENCE"
|
||||
The default configuration doesn\'t specify any devices\. Consult \fI/usr/share/zram\-generator/zram\-generator\.conf\.example\fR for an example configuration file\.
|
||||
The default configuration doesn't specify any devices\. Consult \fI/usr/share/zram\-generator/zram\-generator\.conf\.example\fR for an example configuration file\.
|
||||
.P
|
||||
When packages need to customize the configuration, they can install configuration snippets in \fI/usr/lib/systemd/zram\-generator\.conf\.d/\fR\. Files in \fI/etc/\fR are reserved for the local administrator, who may use this logic to override the configuration files installed by vendor packages\. The main configuration file is read before any of the configuration directories, and has the lowest precedence; entries in a file in any configuration directory override entries in the single configuration file\. Files in the \fI*\.conf\.d/\fR configuration subdirectories are sorted by their filename in lexicographic order, regardless of which of the subdirectories they reside in\. When multiple files specify the same option, for options which accept just a single value, the entry in the file with the lexicographically latest name takes precedence\. It is recommended to prefix all filenames in those subdirectories with a two\-digit number and a dash, to simplify the ordering of the files\.
|
||||
.P
|
||||
@ -33,7 +33,7 @@ The generator understands the following option on the kernel command\-line: \fBs
|
||||
Each device is configured independently in its \fB[zramN]\fR section, where N is a nonnegative integer\. Other sections are ignored\.
|
||||
.P
|
||||
Devices with the final size of \fI0\fR will be discarded\.
|
||||
.IP "\[ci]" 4
|
||||
.IP "\(bu" 4
|
||||
\fBhost\-memory\-limit\fR=
|
||||
.IP
|
||||
Sets the upper limit on the total usable RAM (as defined by \fIMemTotal\fR in \fB/proc/meminfo\fR, confer proc(5)) above which the device will \fInot\fR be created\.
|
||||
@ -41,25 +41,15 @@ Sets the upper limit on the total usable RAM (as defined by \fIMemTotal\fR in \f
|
||||
This takes a nonnegative number, representing that limit in megabytes, or the literal string \fInone\fR, which can be used to override a limit set earlier\.
|
||||
.IP
|
||||
Defaults to \fInone\fR\.
|
||||
.IP "\(bu" 4
|
||||
\fBzram\-size\fR=
|
||||
.IP
|
||||
For compatibility with earlier versions, \fBmemory\-limit\fR is allowed as an alias for this option\. Its use is discouraged, and administrators should migrate to \fBhost\-memory\-limit\fR\.
|
||||
.IP "\[ci]" 4
|
||||
\fBzram\-fraction\fR=
|
||||
Sets the size of the zram device as a function of \fIMemTotal\fR, available as the \fBram\fR variable\.
|
||||
.IP
|
||||
Defines the scaling factor of the zram device\'s size with relation to the total usable RAM\.
|
||||
Arithmetic operators (^%/*\-+), e, π, SI suffixes, log(), int(), ceil(), floor(), round(), abs(), min(), max(), and trigonometric functions are supported\.
|
||||
.IP
|
||||
This takes a nonnegative floating\-point number representing that factor\.
|
||||
.IP
|
||||
Defaults to \fI0\.5\fR\.
|
||||
.IP "\[ci]" 4
|
||||
\fBmax\-zram\-size\fR=
|
||||
.IP
|
||||
Sets the limit on the zram device\'s size obtained by \fBzram\-fraction\fR\.
|
||||
.IP
|
||||
This takes a nonnegative number, representing that limit in megabytes, or the literal string \fInone\fR, which can be used to override a limit set earlier\.
|
||||
.IP
|
||||
Defaults to \fI4096\fR\.
|
||||
.IP "\[ci]" 4
|
||||
Defaults to \fImin(ram / 2, 4096)\fR\.
|
||||
.IP "\(bu" 4
|
||||
\fBcompression\-algorithm\fR=
|
||||
.IP
|
||||
Specifies the algorithm used to compress the zram device\.
|
||||
@ -68,20 +58,28 @@ This takes a literal string, representing the algorithm to use\.
|
||||
.br
|
||||
Consult \fI/sys/block/zram0/comp_algorithm\fR for a list of currently loaded compression algorithms, but note that additional ones may be loaded on demand\.
|
||||
.IP
|
||||
If unset, none will be configured and the kernel\'s default will be used\.
|
||||
.IP "\[ci]" 4
|
||||
If unset, none will be configured and the kernel's default will be used\.
|
||||
.IP "\(bu" 4
|
||||
\fBwriteback\-device\fR=
|
||||
.IP
|
||||
Write incompressible pages, for which no gain was achieved, to the specified device under memory pressure\. This corresponds to the \fI/sys/block/zramX/backing_dev\fR parameter\.
|
||||
.IP
|
||||
Takes a path to a block device, like \fI/dev/disk/by\-partuuid/2d54ffa0\-01\fR or \fI/dev/zvol/tarta\-zoot/swap\-writeback\fR\.
|
||||
.IP
|
||||
If unset, none is used, and incompressible pages are kept in RAM\.
|
||||
.IP "\(bu" 4
|
||||
\fBswap\-priority\fR=
|
||||
.IP
|
||||
Controls the relative swap priority, a value between \-1 and 32767\. Higher numbers indicate higher priority\.
|
||||
.IP
|
||||
If unset, 100 is used\.
|
||||
.IP "\[ci]" 4
|
||||
.IP "\(bu" 4
|
||||
\fBmount\-point\fR=
|
||||
.IP
|
||||
Format the device with a file system (not as swap) and mount this file system over the specified directory\. When neither this option nor \fBfs\-type\fR= is specified, the device will be formatted as swap\.
|
||||
.IP
|
||||
Note that the device is temporary: contents will be destroyed automatically after the file system is unmounted (to release the backing memory)\.
|
||||
.IP "\[ci]" 4
|
||||
.IP "\(bu" 4
|
||||
\fBfs\-type\fR=
|
||||
.IP
|
||||
Specifies how the device shall be formatted\. The default is \fIext2\fR if \fBmount\-point\fR is specified, and \fIswap\fR otherwise\. (Effectively, the device will be formatted as swap, if neither \fBfs\-type\fR= nor \fBmount\-point\fR= are specified\.)
|
||||
@ -89,6 +87,12 @@ Specifies how the device shall be formatted\. The default is \fIext2\fR if \fBmo
|
||||
Note that the device is temporary: contents will be destroyed automatically after the file system is unmounted (to release the backing memory)\.
|
||||
.IP
|
||||
Also see systemd\-makefs(8)\.
|
||||
.IP "\(bu" 4
|
||||
\fBoptions\fR=
|
||||
.IP
|
||||
Sets mount or swapon options\. Availability depends on \fBfs\-type\fR\.
|
||||
.IP
|
||||
Defaults to \fIdiscard\fR\.
|
||||
.IP "" 0
|
||||
.SH "ENVIRONMENT VARIABLES"
|
||||
Setting \fBZRAM_GENERATOR_ROOT\fR during parsing will cause \fI/proc/meminfo\fR to be read from \fI$ZRAM_GENERATOR_ROOT/proc/meminfo\fR instead, and \fI{/usr/lib,/usr/local/lib,/etc,/run}/systemd/zram\-generator\.conf\fR to be read from \fI$ZRAM_GENERATOR_ROOT/{/usr/lib,/usr/local/lib,/etc,/run}/systemd/zram\-generator\.conf\fR\.
|
||||
@ -96,7 +100,7 @@ Setting \fBZRAM_GENERATOR_ROOT\fR during parsing will cause \fI/proc/meminfo\fR
|
||||
The default configuration will yield the following:
|
||||
.IP "" 4
|
||||
.nf
|
||||
zram device size [MB]
|
||||
zram device size
|
||||
^
|
||||
│
|
||||
4G>│ ooooooooooooo
|
||||
@ -107,18 +111,70 @@ The default configuration will yield the following:
|
||||
│ o
|
||||
│ o
|
||||
512M>│ o
|
||||
0───────────────────────> total usable RAM [MB]
|
||||
0───────────────────────> total usable RAM
|
||||
^ ^ ^
|
||||
1G 4G 8G
|
||||
.fi
|
||||
.IP "" 0
|
||||
.P
|
||||
A piecewise\-linear size 1:1 for the first 4G, then 1:2 above, up to a max of 32G:
|
||||
.br
|
||||
\~\~\fBzram\-size = min(min(ram, 4096) + max(ram \- 4096, 0) / 2, 32 * 1024)\fR
|
||||
.IP "" 4
|
||||
.nf
|
||||
zram device size
|
||||
^
|
||||
32G>| oooooooooooooo
|
||||
| o
|
||||
30G>| o
|
||||
|
|
||||
/=/
|
||||
|
|
||||
8G>│ o
|
||||
│ o
|
||||
│ o
|
||||
│ o
|
||||
│ o
|
||||
4G>│ o
|
||||
│ o
|
||||
│ o
|
||||
1G>│ o
|
||||
0───────────────────────────────────||──────────────────────> total usable RAM
|
||||
^ ^ ^ ^ ^ ^ ^
|
||||
1G 4G 8G 12G 56G 60G 64G
|
||||
.fi
|
||||
.IP "" 0
|
||||
.SH "OBSOLETE OPTIONS"
|
||||
.IP "\(bu" 4
|
||||
\fBmemory\-limit\fR=
|
||||
.IP
|
||||
Compatibility alias for \fBhost\-memory\-limit\fR\.
|
||||
.IP "\(bu" 4
|
||||
\fBzram\-fraction\fR=
|
||||
.IP
|
||||
Defines the scaling factor of the zram device's size with relation to the total usable RAM\.
|
||||
.IP
|
||||
This takes a nonnegative floating\-point number representing that factor\.
|
||||
.IP
|
||||
Defaulted to \fI0\.5\fR\. Setting this or \fBmax\-zram\-size\fR overrides \fBzram\-size\fR\.
|
||||
.IP "\(bu" 4
|
||||
\fBmax\-zram\-size\fR=
|
||||
.IP
|
||||
Sets the limit on the zram device's size obtained by \fBzram\-fraction\fR\.
|
||||
.IP
|
||||
This takes a nonnegative number, representing that limit in megabytes, or the literal string \fInone\fR, which can be used to override a limit set earlier\.
|
||||
.IP
|
||||
Defaulted to \fI4096\fR\. Setting this or \fBzram\-fraction\fR overrides \fBzram\-size\fR\.
|
||||
.IP "" 0
|
||||
.SH "REPORTING BUGS"
|
||||
<\fIhttps://github\.com/systemd/zram\-generator/issues\fR>
|
||||
\fIhttps://github\.com/systemd/zram\-generator/issues\fR
|
||||
.SH "SEE ALSO"
|
||||
zram\-generator(8), systemd\.syntax(5), proc(5)
|
||||
.P
|
||||
<\fIhttps://github\.com/systemd/zram\-generator\fR>
|
||||
\fIhttps://github\.com/systemd/zram\-generator\fR
|
||||
.P
|
||||
Linux documentation of zram: <\fIhttps://kernel\.org/doc/html/latest/admin\-guide/blockdev/zram\.html\fR>
|
||||
Linux documentation of zram: \fIhttps://kernel\.org/doc/html/latest/admin\-guide/blockdev/zram\.html\fR
|
||||
.br
|
||||
and the zram sysfs ABI: <\fIhttps://kernel\.org/doc/Documentation/ABI/testing/sysfs\-block\-zram\fR>
|
||||
and the zram sysfs ABI: \fIhttps://kernel\.org/doc/Documentation/ABI/testing/sysfs\-block\-zram\fR
|
||||
.P
|
||||
\fBfasteval\fR documentation for the entire \fBzram\-size\fR arithmetic DSL: \fIhttps://docs\.rs/fasteval/0\.2\.4/fasteval/#the\-fasteval\-expression\-mini\-language\fR
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
%global crate zram-generator
|
||||
|
||||
Name: rust-%{crate}
|
||||
Version: 0.3.2
|
||||
Release: 7%{?dist}
|
||||
Version: 1.1.2
|
||||
Release: 1%{?dist}
|
||||
Summary: Systemd unit generator for zram swap devices
|
||||
|
||||
License: MIT
|
||||
URL: https://crates.io/crates/%{crate}
|
||||
Source: %{crates_source}
|
||||
Source1: %{crate}-v%{version}-vendor.tar.gz
|
||||
Source1: %{crate}-%{version}-vendor.tar.xz
|
||||
Source2: zram-generator.conf
|
||||
Source3: zram-generator.8
|
||||
Source4: zram-generator.conf.5
|
||||
@ -40,7 +40,7 @@ cp -a %{S:2} .
|
||||
%build
|
||||
export SYSTEMD_UTIL_DIR=%{_systemd_util_dir}
|
||||
%cargo_build
|
||||
make systemd_service SYSTEMD_SYSTEM_UNIT_DIR=%{_unitdir} SYSTEMD_SYSTEM_GENERATOR_DIR=%{_systemdgeneratordir}
|
||||
%make_build SYSTEMD_SYSTEM_UNIT_DIR=%{_unitdir} SYSTEMD_SYSTEM_GENERATOR_DIR=%{_systemdgeneratordir} systemd-service
|
||||
cp -a %{S:3} %{S:4} man/
|
||||
|
||||
%install
|
||||
@ -65,6 +65,9 @@ install -Dpm0644 -t %{buildroot}%{_mandir}/man5 man/zram-generator.conf.5
|
||||
%{_mandir}/man5/zram-generator.conf.5*
|
||||
|
||||
%changelog
|
||||
* Fri Dec 12 2025 Michal Sekletár <msekleta@redhat.com> - 1.1.2-1
|
||||
- Rebase to version 1.1.2 (RHEL-118397)
|
||||
|
||||
* Thu Aug 12 2021 <msekleta@redhat.com> - 0.3.2-7
|
||||
- Rebuild (#1990555)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user