-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mount-options: Add Mount Options Support #90
Conversation
src/config.rs
Outdated
@@ -38,6 +39,7 @@ impl Device { | |||
disksize: 0, | |||
swap_priority: 100, | |||
mount_point: None, | |||
mount_options: Some("".to_string()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes no sense. Either make this just String, or actually only write it if it's set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nabijaczleweli sorry that I have zero experience on rust, and what I could handle is modify from similar logic, e.g. fs-type
and mount-point
.
What am I looking for from here is: if mount-options
is empty string or None, just print an empty string to the generated file with Options=""
.
May you provide some code snippet as reference, so I could modify it correctly?
66ded65
to
9e44984
Compare
@nabijaczleweli test case added and passing as expected; BTW, after reboot the device is now format and override as swap by systemd, so the mount failed (because
Any idea why incorrectly detect |
9e44984
to
064ab12
Compare
@nabijaczleweli any more hits could be provided for #90 (comment)? |
83abe00
to
7f0eb95
Compare
Please drop the first commit from this pull request. |
Then the CI will fail due to missing kernel module, are you sure? |
455e4be
to
5150a6b
Compare
You are pulling in unrelated changes into the pull request. If the requirement for a new module is added in this pull request, then the commit to install the module should also be in this pull request. If not, then not. And the other changes to Makefiles make this pull request unmergeable. Please clean it up to keep only the relevant parts. |
Could we make #92 and #93 get merged? I will follow up this PR afterward. |
35bb962
to
e678eb5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mostly looks reasonable, but:
- please rebase on top of current
main
- please explain in the commit message what the change is. (Right now there's a discussion of why the change is useful, which is good, but cannot be the only content of the commit message.)
- the new option needs to be described in the docs (at least in
man/zram-generator.conf.md
). - why are the test cases renamed? Either drop that change, or if there's some good reason for it, make it a separate commit and justify.
1eab6ef
to
d074e71
Compare
Done
Doesn't the commit title
Done
After reorder, the options provided is now increased from 1 -> 2 -> 3, which simpler for tracing:
|
d074e71
to
f0a866c
Compare
OK. But it needs to be a separate commit.
The title doesn't explain what the option name is, and what it does. A person looking at the commit list should be able to figure out what a commit does from the description. A much better title would be "Add Options= setting to set mount options" and then have some more details in the commit body, for example a very simple example of the option and the effect on the generated unit. |
All units in units/ follow this pattern, as do all other generators that we provide. The question of the order was raised in systemd/zram-generator#90 (comment), and I think it's nice to make it consistent everywhere (What= before Where= matches mount(8) and fstab(5)).
Please undo all the unrelated changes from commit, like the file system type and default options. Let's try to do one thing first correctly. |
f0a866c
to
410ed7d
Compare
410ed7d
to
4b45efd
Compare
All units in units/ follow this pattern, as do all other generators that we provide. The question of the order was raised in systemd/zram-generator#90 (comment), and I think it's nice to make it consistent everywhere (What= before Where= matches mount(8) and fstab(5)).
4b45efd
to
23cd05b
Compare
See #96
Done |
When using zram for file system, we need to enable `discard` mount option for issue discard/TRIM commands to the underlying zram block device when blocks are freed. Else deleted files are not zero-ed, so zram does not remove the compressed pages. For example, setting `/etc/systemd/zram-generator.conf` as below could format the file system as ext4 with TRIM enabled: $ cat /etc/systemd/zram-generator.conf [zram11] mount-point = /var/compressed fs-type = ext4 mount-options = discard Fixes systemd#89 Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
23cd05b
to
c7c5cf1
Compare
Replaced by #103. |
When using zram for file system, we need to enable
discard
mount option for issue discard/TRIM commands to the underlying zram block device when blocks are freed. Else deleted files are not zero-ed, so zram does not remove the compressed pages.Fixes #89