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
Restart adb in stage-2 #41
Conversation
* Move adb to a separate module. It used to be in stage-1, but it is no longer stage-1 specific, as it is now started in stage-2 as well. * After switching to stage-2 kill the old adbd and start a new one.
Apparently this shouldn’t work 🤔, because systemd is supposed to kill all processes, so, probably, it’s safer to set argv0 so that it starts with a |
I don't understand why systemd doesn't kill adbd. Perhaps it will only do so if it's the first process in the new root, or if it's the process doing the root switching? In any case, I'm sure it won't do any harm to kill the stage-1 adbd ourselves "just in case". |
(documentation for the expected systemd behaviour: https://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons/ ) |
@lheckemann I think this documentation only applies when systemd manages stage1 and root is switched with |
(Which actually brings the question: do we want to use systemd for our stage1, since @samueldr was saying that one of his goals is pioneering a better stage1 for NixOS?) |
init = lib.mkOrder AFTER_DEVICE_INIT '' | ||
( | ||
mkdir -p /dev/usb-ffs/adb | ||
mount -t functionfs adb /dev/usb-ffs/adb/ |
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.
Playing with WIP and bleeding edge code is always fun 💦
With the lavender port, I had to implement the new gadgetfs stuff, and my experience with it is that the functionfs stuff is actually related to it... When I'll be back home, with devices ready to test, I'll figure out what's actually required to happen and in what order for those devices. I'll comment here with what is needed to be done.
Though, if I remember correctly, with the pixel 2 I had kernel panics when doing things in the wrong order, but it might not be functionfs-related, fuzzy about the details, and don't have one of those handy currently.
Hi, sorry this took so long to re-review and actually test. This works. There'll be bits that need changing for "new style" usb gadget, but that's entirely irrelevant to this PR. |
No description provided.