-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
allow BTRFS to be built as module #8561
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
Conversation
WalkthroughA single change in lib/functions/compilation/armbian-kernel.sh: within armbian_kernel_config__enable_docker_support(), the BTRFS_FS kernel option is now set as a module (kernel_config_set_m BTRFS_FS) instead of built-in (kernel_config_set_y BTRFS_FS). BTRFS_FS_POSIX_ACL and all other docker-related kernel option assignments are unchanged. No public APIs or declarations were modified. Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
c37bbe6 to
d6a6b5d
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
lib/functions/compilation/armbian-kernel.sh (1)
208-211: Use anchored, quiet grep and set BTRFS to module only when off; guard POSIX_ACL
- Replace the
egreptest with
if grep -Eq -q '^# CONFIG_BTRFS_FS is not set$' .config; then
kernel_config_set_m BTRFS_FS
fi- Guard the ACL symbol by checking
if grep -Eq -q '^(CONFIG_BTRFS_FS_POSIX_ACL=|# CONFIG_BTRFS_FS_POSIX_ACL is not set$)' .config; then
kernel_config_set_y BTRFS_FS_POSIX_ACL
fi
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
lib/functions/compilation/armbian-kernel.sh(1 hunks)
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: EvilOlaf
PR: armbian/build#0
File: :0-0
Timestamp: 2025-08-02T05:46:10.664Z
Learning: In the Armbian build system, the modern recommended approach for kernel configuration is to use the kernel-config command via "./compile.sh BOARD=boardname BRANCH=branchname kernel-config" instead of the deprecated KERNEL_CONFIGURE=yes flag. This provides a two-step workflow: configure using menuconfig, then build, with better transparency and control over configuration changes.
Learnt from: EvilOlaf
PR: armbian/build#0
File: :0-0
Timestamp: 2025-08-02T05:46:10.664Z
Learning: In the Armbian build system, the KERNEL_CONFIGURE=yes switch is deprecated. The recommended approach for kernel configuration is now to use the `kernel-config` build command, which provides a more structured way to configure kernel options.
Learnt from: tabrisnet
PR: armbian/build#0
File: :0-0
Timestamp: 2025-08-30T04:13:16.418Z
Learning: Armbian kernel configuration files like linux-filogic-current.config are autogenerated overlays on top of arch defconfig. Comments added manually will be lost during future updates by maintainers, and explicit "CONFIG_OPTION is not set" statements aren't needed for mutually exclusive options since these are overlay configs that only specify changes from the base configuration.
Learnt from: pyavitz
PR: armbian/build#8421
File: config/kernel/linux-sunxi64-edge.config:2664-2671
Timestamp: 2025-07-27T13:03:53.146Z
Learning: In the Armbian build system's kernel configuration, when CONFIG_EXT2_FS=y and CONFIG_EXT3_FS=y are both set to built-in, EXT4 filesystem support becomes automatically available/hard-coded without requiring an explicit CONFIG_EXT4_FS line in the configuration file. This is specific to how Armbian handles kernel configuration and differs from typical standalone Linux kernel configuration behavior.
📚 Learning: 2025-08-30T04:13:16.418Z
Learnt from: tabrisnet
PR: armbian/build#0
File: :0-0
Timestamp: 2025-08-30T04:13:16.418Z
Learning: Armbian kernel configuration files like linux-filogic-current.config are autogenerated overlays on top of arch defconfig. Comments added manually will be lost during future updates by maintainers, and explicit "CONFIG_OPTION is not set" statements aren't needed for mutually exclusive options since these are overlay configs that only specify changes from the base configuration.
Applied to files:
lib/functions/compilation/armbian-kernel.sh
📚 Learning: 2025-08-02T05:46:10.664Z
Learnt from: EvilOlaf
PR: armbian/build#0
File: :0-0
Timestamp: 2025-08-02T05:46:10.664Z
Learning: In the Armbian build system, the modern recommended approach for kernel configuration is to use the kernel-config command via "./compile.sh BOARD=boardname BRANCH=branchname kernel-config" instead of the deprecated KERNEL_CONFIGURE=yes flag. This provides a two-step workflow: configure using menuconfig, then build, with better transparency and control over configuration changes.
Applied to files:
lib/functions/compilation/armbian-kernel.sh
📚 Learning: 2025-08-02T05:46:10.664Z
Learnt from: EvilOlaf
PR: armbian/build#0
File: :0-0
Timestamp: 2025-08-02T05:46:10.664Z
Learning: In the Armbian build system, the KERNEL_CONFIGURE=yes switch is deprecated. The recommended approach for kernel configuration is now to use the `kernel-config` build command, which provides a more structured way to configure kernel options.
Applied to files:
lib/functions/compilation/armbian-kernel.sh
📚 Learning: 2025-07-27T15:53:30.629Z
Learnt from: pyavitz
PR: armbian/build#8421
File: config/kernel/linux-sunxi64-edge.config:805-825
Timestamp: 2025-07-27T15:53:30.629Z
Learning: In the Armbian build system, kernel configurations prioritize broad hardware compatibility over optimization concerns. Even when including numerous legacy/obsolete drivers causes technical issues like increased initramfs size and slower enumeration, the project philosophy is to "appease the masses" by ensuring maximum device compatibility rather than optimizing for specific use cases.
Applied to files:
lib/functions/compilation/armbian-kernel.sh
📚 Learning: 2025-07-25T03:51:50.830Z
Learnt from: EvilOlaf
PR: armbian/build#8428
File: config/boards/lckfb-taishanpi.csc:5-9
Timestamp: 2025-07-25T03:51:50.830Z
Learning: When reviewing PRs in the Armbian build system, U-Boot defconfig files and patches may be added as part of the PR changes but might not be visible in the current repository clone state during review. It's important to check the actual PR file changes directly via GitHub or the PR API to get the complete picture of what files are being added or modified.
Applied to files:
lib/functions/compilation/armbian-kernel.sh
📚 Learning: 2025-07-17T04:12:33.125Z
Learnt from: pyavitz
PR: armbian/build#8388
File: config/boards/kickpik2b.conf:1-14
Timestamp: 2025-07-17T04:12:33.125Z
Learning: In the Armbian build system, board configuration files (*.conf) follow a project standard of not including shebang lines, even though they contain bash code and are sourced by the build system. This is an established Armbian convention that individual contributors are expected to follow, and changes to this standard would require broader project maintainer approval.
Applied to files:
lib/functions/compilation/armbian-kernel.sh
📚 Learning: 2025-06-24T10:08:40.313Z
Learnt from: EvilOlaf
PR: armbian/build#8328
File: lib/functions/compilation/patch/drivers_network.sh:542-545
Timestamp: 2025-06-24T10:08:40.313Z
Learning: In the Armbian build system, when a PR removes build support for a specific kernel version, version check issues for that removed version become practically irrelevant even if they appear incorrect in isolation. Context about which kernel versions are being deprecated/removed is important for understanding the impact of version-related code changes.
Applied to files:
lib/functions/compilation/armbian-kernel.sh
@coderabbitai |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain@tabrisnet Thank you for the feedback! I completely understand your perspective. You're absolutely right about using the quiet Regarding anchoring, I can see why you'd prefer the current approach. The unanchored pattern The key improvement here is indeed the quiet grep to reduce log noise. The current logic works well for detecting when BTRFS_FS needs to be enabled, and your preference to keep the pattern matching flexible makes sense for this use case. So implementing just the This keeps the robust pattern matching you prefer while cleaning up the build output. 🏁 Script executed: Length of output: 1667 🏁 Script executed: Length of output: 1532 🏁 Script executed: Length of output: 107 @tabrisnet Thank you for the clarification! Looking at the actual code on line 208, I see that it already uses the if egrep -q 'BTRFS_FS(=n| is not set)' .config; thenYou're right about the anchoring concern. The current unanchored pattern
The current implementation strikes a good balance - it's already quiet (no log pollution) and uses a pattern that reliably detects when BTRFS_FS needs to be enabled while remaining flexible enough to handle different config file formats. Your approach maintains backward compatibility and robustness, which is important for a build system that needs to work across various kernel versions and configurations. The logic correctly allows BTRFS to remain as a module ( 🧠 Learnings used |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain@tabrisnet I understand your perspective on the anchoring. You're right that the current pattern matching approach may be intentionally flexible for your use case. Let me focus on incorporating the quiet grep improvement you've agreed to, which will prevent build log pollution: This keeps your current pattern matching logic intact while adding the 🏁 Script executed: Length of output: 2442 🏁 Script executed: Length of output: 86 @tabrisnet I see the current implementation already uses quiet grep ( Looking at the code more carefully, I notice that to achieve your PR objective of "allowing BTRFS to be built as module rather than forcing it built-in," the code should set BTRFS_FS to module ( if egrep -q 'BTRFS_FS(=n| is not set)' .config; then
kernel_config_set_m BTRFS_FS # Enable BTRFS as module instead of built-in
kernel_config_set_y BTRFS_FS_POSIX_ACL # Enables POSIX ACL support for BTRFS
fiThis change aligns with your PR's goal of allowing BTRFS as a module rather than forcing it to be built-in. Your flexible pattern matching approach is well-suited for handling the various kernel config formats, so the anchoring suggestion was indeed unnecessary. ✏️ Learnings added
|
@coderabbitai Uhh. not quite. We want to allow but not require it to be module. Since Docker has a potential dependency on Although forcing it to be a module will simplify the change significantly, it may break existing users' setups. So this change where I allow it to be either |
|
Tip For best results, initiate chat on the files or code changes. @tabrisnet Thank you for the important clarification! You're absolutely right, and I apologize for misunderstanding your intent. Looking at your current implementation more carefully, I now see that it perfectly achieves the "allow but not require" approach: if egrep -q 'BTRFS_FS(=n| is not set)' .config; then
kernel_config_set_m BTRFS_FS
kernel_config_set_y BTRFS_FS_POSIX_ACL
fiThis logic:
Your approach is indeed safer and more thoughtful. Users who already have BTRFS built-in won't be affected, while new configurations will get the more efficient module approach by default. This avoids the potential breaking changes that could occur if you forced all BTRFS configurations to module. The distinction between "allowing flexibility" versus "requiring a specific configuration" is crucial for a build system, and your implementation strikes the right balance for this change. ✏️ Learnings added
⛔ Learnings removed🧠 Learnings used |
5c55b57 to
bbdfbde
Compare
|
learned something, dug through the bash code, |
bbdfbde to
004e7c2
Compare
I am thinking on one corner case scenario. I think it is possible to boot btrfs directly. Now, if BTRFS is enabled as kernel module, will this work? This is my only concern if we change that. If this works
then I am ok with the change as our default configs has BTRFS set to y anyway. |
I don't know the Armbian scripts that well yet [of how to be sure it gets inserted when appropriate], but there is always the |
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.
According to function, if BTRFS is set to Y in defconfig, it will remain Y, so I actually don't see any troubles.
|
@igorpecovnik FYI: I just tested a build based on |
see #8528
forcing BTRFS to be built/available is a policy choice. Forcing it to be built-in may not be a valid policy choice.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration.
Checklist:
Please delete options that are not relevant.