Skip to content
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

login: Do not dereference proot binds /bin and /etc #353

Merged
merged 2 commits into from
Jul 10, 2024

Conversation

azuwis
Copy link
Contributor

@azuwis azuwis commented May 6, 2024

/bin and /etc are symlinks to /system/bin and /system/etc, by default proot will dereference and override them with new contents.

After this change, /system/bin and /system/etc are kept untouched, so commands like /system/bin/ping can be run directly.

@t184256
Copy link
Collaborator

t184256 commented May 7, 2024

Nice, this might've been the stuff I've been fighting about a year ago, judging by the age of the bin-less branch

@t184256
Copy link
Collaborator

t184256 commented May 7, 2024

(also, consider adding yourself to AUTHORS)

@azuwis
Copy link
Contributor Author

azuwis commented Jul 10, 2024

@t184256 Anything left for this PR to be merged?

@t184256
Copy link
Collaborator

t184256 commented Jul 10, 2024

No, actually; with no email notifications from that update of yours, I just forgot about it. Rebased, waiting for the CI...

@t184256
Copy link
Collaborator

t184256 commented Jul 10, 2024

Hm, now tests that check for the absence of some commands fail. If that's because they now find the system ones, why would /system/bin be in $PATH?

@azuwis
Copy link
Contributor Author

azuwis commented Jul 10, 2024

I've just checked my old nix-on-droid setup (not upgraded to current HEAD yet), /system/bin is indeed in $PATH in failsafe mode, but not in normal mode.

I changed the shell to zsh in normal mode, related?

@t184256
Copy link
Collaborator

t184256 commented Jul 10, 2024

Sorry, the mistake is probably on CI side, as test_channels_uiautomator passes (when tests run properly by typing the command into the app), it's test_channels_shell fails (when tests are run in a hackish way to get better output). I'll see what happens to $PATH there...

t184256 and others added 2 commits July 10, 2024 13:32
`/bin` and `/etc` are symlinks to `/system/bin` and `/system/etc`, by
default proot will dereference and override them with new contents.

After this change, `/system/bin` and `/system/etc` are kept untouched,
so commands like `/system/bin/ping` can be run directly.
@t184256
Copy link
Collaborator

t184256 commented Jul 10, 2024

Yeah, a CI problem indeed. Added a commit that sets empty PATH, because just unsetting it isn't enough (something's too smart and sets defaults back), and also unsetting everything messes up more stuff. Let's see whether that solves the issue...

@t184256 t184256 merged commit 8bcadce into nix-community:master Jul 10, 2024
11 checks passed
@t184256
Copy link
Collaborator

t184256 commented Jul 10, 2024

Done, thank you for that great fix, and sorry for forgetting about this one!

@azuwis azuwis deleted the system-bin branch July 12, 2024 01:18
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.

2 participants