Refactor: Add architecture detection function#12
Merged
SamNet-dev merged 1 commit intoSamNet-dev:masterfrom Mar 10, 2026
Merged
Refactor: Add architecture detection function#12SamNet-dev merged 1 commit intoSamNet-dev:masterfrom
SamNet-dev merged 1 commit intoSamNet-dev:masterfrom
Conversation
- Create detect_architecture() function to map uname output to binary suffixes - Supports: 386, amd64, arm64, armv7 - Replace hardcoded 'amd64' with dynamic detection in: - do_manage_users() - step_install_dnstm() - step_ssh_user() - Improves compatibility with non-x86_64 systems
Owner
|
Thanks for the contribution @roozbeh-gholami! 🙌 Great catch on the hardcoded amd64 — this was definitely needed for ARM support. Clean implementation with proper fallback. One small bug we spotted: in the Thanks again! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Added architecture detection function to support multiple system architectures.
Problem
The original script was hardcoded to download
amd64binaries, breaking installation on ARM64, ARM, and 32-bit x86 systems.Solution
detect_architecture()function that detects the system's CPU architecture usinguname -mx86_64/amd64→amd64i386/i686→386aarch64/arm64→arm64armv7l/armv7→armv7dnstmbinarysshtun-userbinary (2 locations)Testing
Tested on x86_64 systems; should now support ARM64 and ARM systems without code changes.