armbian-zram-config: refine check for existing /tmp mount#9514
armbian-zram-config: refine check for existing /tmp mount#9514igorpecovnik merged 2 commits intoarmbian:mainfrom
Conversation
activate_compressed_tmp has a guard clause preventing zram tmpfs creation when a manually created `tmpfs /tmp` exists. Extend this behaviour to include *any* `/tmp` mount in /etc/fstab.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughModified the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/bsp/common/usr/lib/armbian/armbian-zram-config`:
- Line 143: The current one-liner grep (grep -qE
'^[^#]+[[:space:]]+/tmp[[:space:]]' /etc/mtab && return) only inspects /etc/mtab
and wrongly skips fstab entries and mount sources containing ‘#’;
replace/augment this with a field-wise check of /etc/fstab: skip blank/comment
lines, split each line into fields and test whether the second field (mount
point) is exactly /tmp (and treat whitespace safely), and if such an fstab entry
exists return; keep the existing /etc/mtab check as a fast-path but ensure the
new fstab check runs before creating zram-backed /tmp so no declared noauto/bind
fstab entries are missed.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a137651d-b76f-4e93-a261-9aff5b6fe58a
📒 Files selected for processing (1)
packages/bsp/common/usr/lib/armbian/armbian-zram-config
Co-authored-by: tabrisnet <96966042+tabrisnet@users.noreply.github.com>
tabrisnet
left a comment
There was a problem hiding this comment.
nothing obviously wrong
tabris@brunnt:~/build/armbian-build$ grep -E '^[^#[:space:]][^[:space:]]*[[:space:]]+/dev/shm[[:space:]]' /etc/mtab
tmpfs /dev/shm tmpfs rw,nosuid,nodev,inode64 0 0
this system doesn't have a separately mounted /tmp so I modified the regex to match something the system does have. works as expected.
|
✅ This PR has been reviewed and approved — all set for merge! |
Description
activate_compressed_tmphas a guard clause preventing zram tmpfs creation when a "tmpfs /tmp" entry exists.This PR extends this behavior to include any
/tmpmount in /etc/fstab, preventing duplicate /tmp entries.How Has This Been Tested?
/opt/tmp /tmp none bind 0 0-- guard-code succesfully triggerstmpfs /tmp tmpfs defaults,nosuid 0 0(Default) -- guard-code successfully triggers as before/tmpis not present (whenactivate_compressed_tmpshould run)Checklist:
Summary by CodeRabbit
Release Notes