modules/adb: Decouple implementation details
The service and mount points are more of an implementation detail of the
GadgetFS handling library and not an implementation detail of the init
library.
In turn, this means that we are decoupling this from the init, follow-up
on the next commit...
@@ -26,36 +26,12 @@ with lib;
mobile.boot.stage-1 = {
usb.features = [ "adb" ];
- tasks = [
- (pkgs.writeText "adbd-task.rb" ''
- class Tasks::ADBD < SingletonTask
- def initialize()
- add_dependency(:Mount, "/dev/usb-ffs/adb")
- Targets[:SwitchRoot].add_dependency(:Task, self)
- end
-
- def run()
- System.spawn("adbd")
- end
- end
- '')
- ];
-
extraUtils = with pkgs; [{
package = adbd;
extraCommand = ''cp -fpv "${glibc.out}"/lib/libnss_files.so.* "$out"/lib/'';
}];
};
- boot.specialFileSystems = {
- # This is required for gadgetfs configuration.
- "/dev/usb-ffs/adb" = {
- device = "adb";
- fsType = "functionfs";
- options = [ "nosuid" "noexec" "nodev" ];
- };
- };
-
boot.postBootCommands = ''
# Restart adbd early during stage-2
${pkgs.procps}/bin/pkill -x adbd
