Skip to content

Add dmesg based disk selection - #71

Merged
jamesyc merged 3 commits into
airport-extreme-supportfrom
dmsg-based-disk-selection
Apr 29, 2026
Merged

jamesyc merged 3 commits into
airport-extreme-supportfrom
dmsg-based-disk-selection

Conversation

@jamesyc

@jamesyc jamesyc commented Apr 29, 2026

Copy link
Copy Markdown
Owner

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces hardcoded disk and volume candidates with dynamic discovery logic in the Samba startup script and the Python probing module. The discovery process uses dmesg and sysctl to identify disk wedges while filtering out metadata. Review feedback highlights performance inefficiencies in the discovery logic, specifically the overhead of repeated dmesg calls within loops, and suggests optimizing helper functions to reuse pre-calculated disk lists.

Comment thread src/timecapsulesmb/assets/boot/samba4/start-samba.sh Outdated
Comment thread src/timecapsulesmb/assets/boot/samba4/start-samba.sh
Comment thread src/timecapsulesmb/assets/boot/samba4/start-samba.sh Outdated
Comment thread src/timecapsulesmb/device/probe.py Outdated
@jamesyc

jamesyc commented Apr 29, 2026

Copy link
Copy Markdown
Owner Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces hardcoded disk device candidates with a dynamic discovery mechanism that identifies HFS disk wedges using dmesg and sysctl. The changes include new shell functions for filtering data partitions and excluding configuration or swap wedges, which are integrated into both the Samba boot script and the Python probe module. Review feedback correctly identified a potential issue where newline-separated device names could break shell pattern matching in case statements, and suggested normalizing these into space-separated strings.

Comment thread src/timecapsulesmb/assets/boot/samba4/start-samba.sh Outdated
Comment thread src/timecapsulesmb/device/probe.py Outdated
… device name preceded by a newline instead of a space.
@jamesyc
jamesyc merged commit 4dfe18f into airport-extreme-support Apr 29, 2026
4 checks passed
@jamesyc
jamesyc deleted the dmsg-based-disk-selection branch April 29, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant