Trên GitHub, systemd/zram-generator đã đạt 795 sao, ngôn ngữ Rust. Systemd unit generator for zram devices
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
This generator provides a simple and fast mechanism to configure swap on /dev/zram* devices.
The main use case is create swap devices, but devices with a file system can be created too, see below.
Configuration
A default config file may be located in /usr.
This generator checks the following locations:
/run/systemd/zram-generator.conf
/etc/systemd/zram-generator.conf
/usr/local/lib/systemd/zram-generator.conf
/usr/lib/systemd/zram-generator.conf
… and the first file found in that list wins.
In addition, "drop-ins" will be loaded from .conf files in
/etc/systemd/zram-generator.conf.d/,
/usr/lib/systemd/zram-generator.conf.d/, etc.
The main configuration file is read before any of the drop-ins and has
the lowest precedence; entries in the drop-in files override entries
in the main configuration file.
See systemd.unit(5) for a detailed description of this logic.
See zram-generator.conf.example for a list of available settings.
A zram device will be created for each section. No actual
configuration is necessary (the default of zram-size = min(ram / 2, 4096) will be
used unless overriden), but the configuration file with at least one
section must exist.
This will set up a /dev/zram1 with ext2 and generate a mount unit for /var/compressed.
In case you want this path to be user-writable, since util-linux v2.39 you can use
[zram1]
options = X-mount.mode=1777
(and/or the relevant X-mount.{owner,group}= arguments, cf. mount(8)).
Otherwise, you can use the following "high-quality hack":
for the above example, create an
override for [email protected], for example with systemctl edit,
containing the following (note the sticky bit as required for [/var]/tmp):
The second purpose of this program is to serve as an example of a systemd
generator in rust.
Installation
It is recommended to use an existing package:
Fedora: sudo dnf install zram-generator-defaults (or sudo dnf install zram-generator to install without the default configuration)
Debian: For Debian 12 Bookworm or later, install systemd-zram-generator from the official Debian repos. For earlier Debian releases, packages are provided by nabijaczleweli, see https://debian.nabijaczleweli.xyz/README.
Arch: sudo pacman -S zram-generator (or https://aur.archlinux.org/packages/zram-generator-git/ for the latest git commit)
To install directly from sources, execute make build && sudo make install NOBUILD=true:
zram-generator binary is installed in the systemd system generator directory (usually /usr/lib/systemd/system-generators/)
zram-generator(8) and zram-generator.conf(5) manpages are installed into /usr/share/man/manN/, this requires ronn.
units/[email protected] is copied into the systemd system unit directory (usually /usr/lib/systemd/system/)
zram-generator.conf.example is copied into /usr/share/doc/zram-generator/
You need though create your own config file at one of the locations listed above.
To install and configure with puppet puppet-zram_generator is available.
tl;dr
Install zram-generator using one of the methods listed above.
Create a zram-generator.conf config file.
Run systemctl daemon-reload to create new device units.
Run systemctl start /dev/zram0 (adjust the name as appropriate to match the config).
Call zramctl or swapon to confirm that the device has been created and is in use.
Once installed and configured, the generator will be invoked by systemd early at boot,
there is no need to do anything else.
Testing
The tests require either the zram module to be loaded, or root to run modprobe zram.
Set the ZRAM_GENERATOR_ROOT environment variable to use that
instead of / as root.
The "{generator}" template in units/[email protected]/binary-location.conf
can be substituted for a non-standard location of the binary for testing.
Authors
Written by Zbigniew Jędrzejewski-Szmek <[email protected]>,
Igor Raits <[email protected]>, наб <[email protected]>, and others.
See https://github.com/systemd/zram-generator/graphs/contributors for the full list.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/systemd/zram-generator là nguồn chính thức.
systemd/zram-generator có bao nhiêu sao?
systemd/zram-generator có 795 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/systemd/zram-generator. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
systemd/zram-generator có phải mã nguồn mở không?
Có — systemd/zram-generator phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/systemd/zram-generator.
systemd/zram-generator còn đang phát triển không?
Commit gần nhất trên systemd/zram-generator là 1.2 năm trước (theo timestamp GitHub). Repo có 70 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
systemd/zram-generator là gì?
systemd/zram-generator (systemd/zram-generator) là dự án Rust trên GitHub. Theo mô tả gốc: Systemd unit generator for zram devices
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về zram-generator?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về zram-generator.