-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add resolv_conf_mv=auto option #24
base: master
Are you sure you want to change the base?
Add resolv_conf_mv=auto option #24
Conversation
That only works on Linux. |
Is there any portable check to ensure two files are on the same filesystem, but they are not identical file? Something similar to Checked openbsd stat manual. Does it need just %d format instead? |
It requires stat -c %d to be working. Try to not require stat by checking it is executable first. Should be able to handle both bind-mounted /etc/resolv.conf and atomic move from temp file. Not using %D format, that seems to be Linux-specific.
ecbd9ce
to
a4179ca
Compare
There is no portable way of working this out. |
Ah. Okay, maybe configure could sort this detail at build time. It would require just trivial check on build and would not clutter those conditions more than necessary. |
Linux uses stat -c to print just selected properies. Unfortunately *BSD systems use -f for the same thing. Detect it during build and include chosen variant.
@@ -106,6 +107,10 @@ dragonfly*|freebsd*) | |||
if [ -z "$STATUSARG" ]; then | |||
STATUSARG="onestatus" | |||
fi | |||
echo "STAT_FMT= stat -f" >>$CONFIG_MK | |||
;; | |||
*bsd*) |
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 think the whole stat check needs to be in it's own section.
I'm tempted to suggest that we assume BSD style by default and add an exception for Linux.
The only potential issue I think is kFreeBSD which may use the coreutils stat rather than the FreeBSD one.
Also some stat's just don't offer the functionality we need such as Plan9 or disabled as in the case for busybox.
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.
Those unusual cases should be able to handle by make STAT_FMT=
. I am not sure how often is crossbuilding done for such systems. I think configure could test the output by actually checking stat -c %d .
and that it does report a number. Not sure if such check would work on busybox systems. At least stat from alpine docker image and BusyBox v1.36.1 has -c %d support.
I expect Linux systems are dominant today. But if the BSD variant is likely to work on different systems, which may use openresolv, it would be okay. It should have own case "$OS" just for stat check, is that what you mean?
It requires stat -c %D to be working. Try to not require stat by checking it is executable first. Should be able to handle both bind-mounted /etc/resolv.conf and atomic move from temp file.
It should work also for issue #19