-
-
Notifications
You must be signed in to change notification settings - Fork 580
Add GNU/Hurd support #1931
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
Merged
Merged
Add GNU/Hurd support #1931
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
71fbe04
Start work on GNU
yelninei e968bca
Fork netif_linux to netif_gnu.
yelninei 1a2f4b4
Port netif_gnu to the new api.
yelninei e508100
disable ffPackagesGetNix on when it is not defined
yelninei add2bfd
Fix localip_linux on GNU
yelninei d553bc4
WIP: shepherd initsystem
yelninei 5342430
localip: Remove AF_LINK on GNU.
yelninei 75a023f
CMake (GNU): enable a lot of things
CarterLi 82a1eaf
Chore: tidy tabs
CarterLi 1d32344
Global (GNU): code cleanups
CarterLi 20fafa5
WM (GNU): enable
CarterLi 4a7b3a8
Processing (GNU): hurd uses `cmdline` instead of `comm`
CarterLi e9104c3
Terminal (GNU): enable version detection
CarterLi 74e0732
Common (GNU): more `__GNU__` tests
CarterLi 4b7f231
Processing (GNU): fix command name reading
CarterLi 062963d
CMake (GNU): disable wifi support
CarterLi 0b2c044
InitSystem: tidy
CarterLi 13110e3
LocalIP (GNU): adds MAC addr detection support
CarterLi a80ea2b
CPUUsage: adds user guidance when CPU time fails to increase
CarterLi 588c4c0
Chore: silense compiler warnings
CarterLi 0998b1e
DiskIO (Linux): trim trailing white spaces
CarterLi bfb93cd
Processing (Linux): enhances robustness when extracting process name …
CarterLi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include "netif.h" | ||
#include "common/io/io.h" | ||
|
||
#include <net/if.h> | ||
#include <stdio.h> | ||
|
||
#define FF_STR_INDIR(x) #x | ||
#define FF_STR(x) FF_STR_INDIR(x) | ||
|
||
bool ffNetifGetDefaultRouteImplV4(FFNetifDefaultRouteResult* result) | ||
{ | ||
FILE* FF_AUTO_CLOSE_FILE netRoute = fopen("/proc/route", "r"); | ||
|
||
if (!netRoute) return false; | ||
|
||
// skip first line | ||
FF_UNUSED(fscanf(netRoute, "%*[^\n]\n")); | ||
unsigned long long destination; //, gateway, flags, refCount, use, metric, mask, mtu, ... | ||
while (fscanf(netRoute, "%" FF_STR(IF_NAMESIZE) "s%llx%*[^\n]", result->ifName, &destination) == 2) | ||
{ | ||
if (destination != 0) continue; | ||
result->ifIndex = if_nametoindex(result->ifName); | ||
// TODO: Get the preferred source address | ||
return true; | ||
} | ||
result->ifName[0] = '0'; | ||
return false; | ||
} | ||
|
||
bool ffNetifGetDefaultRouteImplV6(FFNetifDefaultRouteResult* result) | ||
{ | ||
// TODO: AF_INET6 | ||
FF_UNUSED(result); | ||
return false; | ||
} |
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
I would not add this as it is just misleading and wrong
Instead it would be better to try to support shepherd instead but this can be done in a followup at a later time
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.
I don't use guix. Google said that guile is a programing language. Is guile here the name of guile interpreter process?
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.
Yes, the main shepherd program is a guile script that starts with
Right now the guile version is being detected which is not the version of the initsystem.
The correct path to the shepherd executable is in
/proc/1/cmdline
but it is the string after the first 2 null bytes.There is also a minor problem that on non-linux systems
shepherd --version
has an additional extra line in the output:I guess this can be detected by checking if the line starts with
shepherd
and skipping the first\n
if it does not.I'll see if I can make this work
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.
We did similar special handling for python. Perhaps we can use the same logic.