Guest User

Untitled

a guest
Jun 18th, 2018
57
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [root@Sailfish nemo]# cat /lib/udev/rules.d/998-droid-system.rules
  2. SUBSYSTEM=="graphics", SYMLINK+="$env{SUBSYSTEM}/%k"
  3. SUBSYSTEM=="block", SYMLINK+="$env{SUBSYSTEM}/%k"
  4. SUBSYSTEM=="oncrpc", SYMLINK+="$env{SUBSYSTEM}/%k"
  5. SUBSYSTEM=="adsp", SYMLINK+="$env{SUBSYSTEM}/%k"
  6. SUBSYSTEM=="msm_camera", SYMLINK+="$env{SUBSYSTEM}/%k"
  7. SUBSYSTEM=="mtd", SYMLINK+="$env{SUBSYSTEM}/%k"
  8. SUBSYSTEM=="block", SYMLINK+="$env{SUBSYSTEM}/%k"
  9. SUBSYSTEM=="misc", KERNEL=="log_events", SYMLINK+="alog/events"
  10. SUBSYSTEM=="misc", KERNEL=="log_radio", SYMLINK+="alog/radio"
  11. SUBSYSTEM=="misc", KERNEL=="log_system", SYMLINK+="alog/system"
  12. SUBSYSTEM=="misc", KERNEL=="log_main", SYMLINK+="alog/main"
  13.  
  14. # Partition symlinks, compatible with the android way of setting up the
  15. # symlinks.
  16.  
  17. # Pass collected (see below) information down to lower levels.
  18. SUBSYSTEM=="?*", ENV{PLATFORM_FOLDER}=="", IMPORT{parent}="PLATFORM_FOLDER"
  19. SUBSYSTEM=="?*", ENV{PLATFORM_DEVICE}=="", IMPORT{parent}="PLATFORM_DEVICE"
  20. # Collect information about the platform devices:
  21. # /sys/devices/platform/FOLDER
  22. SUBSYSTEM=="platform", KERNEL!="", DEVPATH=="/devices/platform/*", DEVPATH!="/devices/platform/*/*", DEVPATH=="/devices/platform/*", ENV{PLATFORM_FOLDER}="$kernel"
  23. # /sys/devices/platform/FOLDER/DEVICE
  24. SUBSYSTEM=="platform", KERNEL!="", DEVPATH=="/devices/platform/*", DEVPATH!="/devices/platform/*/*/*", DEVPATH=="/devices/platform/*/*", ENV{PLATFORM_DEVICE}="$kernel"
  25. # /sys/devices/FOLDER
  26. SUBSYSTEM=="platform", KERNEL!="", DEVPATH!="/devices/platform/*", DEVPATH!="/devices/*/*", DEVPATH=="/devices/*", ENV{PLATFORM_FOLDER}="$kernel"
  27. # /sys/devices/FOLDER/DEVICE
  28. SUBSYSTEM=="platform", KERNEL!="", DEVPATH!="/devices/platform/*", DEVPATH!="/devices/*/*/*", DEVPATH=="/devices/*/*", ENV{PLATFORM_DEVICE}="$kernel"
  29.  
  30. # This will set up the bootdevice symlink, given that androidboot.bootdevice
  31. # is set on the commandline. If it is not given on the cmdline, android-init
  32. # will create the bootdevice (if the paths are correct, which they now should
  33. # be). If android-init doesn't create the bootdevice symlink and there is no
  34. # androidboot.bootdevice on the cmdline, then the bootdevice symlink is not
  35. # required.
  36. IMPORT{cmdline}="bootdevice"
  37. # Unfortunately we cannot compare two variables, therefore use a workaround
  38. # with a file.
  39. ENV{bootdevice}!="", RUN+="/bin/touch /tmp/udev-$env{bootdevice}"
  40. SUBSYSTEM=="platform", KERNEL!="", DEVPATH=="/devices/platform/*", DEVPATH!="/devices/platform/*/*/*", DEVPATH=="/devices/platform/*/*", TEST=="/tmp/udev-$env{PLATFORM_DEVICE}", RUN+="/bin/mkdir -p /dev/block/platform/$env{PLATFORM_FOLDER}/$env{bootdevice}"
  41. SUBSYSTEM=="platform", KERNEL!="", DEVPATH=="/devices/platform/*", DEVPATH!="/devices/platform/*/*/*", DEVPATH=="/devices/platform/*/*", TEST=="/tmp/udev-$env{PLATFORM_DEVICE}", RUN+="/bin/ln -s /dev/block/platform/$env{PLATFORM_FOLDER}/$env{bootdevice} /dev/block/bootdevice"
  42. SUBSYSTEM=="platform", KERNEL!="", DEVPATH!="/devices/platform/*", DEVPATH!="/devices/*/*/*", DEVPATH=="/devices/*/*", TEST=="/tmp/udev-$env{PLATFORM_DEVICE}", RUN+="/bin/mkdir -p /dev/block/platform/$env{PLATFORM_FOLDER}/$env{bootdevice}"
  43. SUBSYSTEM=="platform", KERNEL!="", DEVPATH!="/devices/platform/*", DEVPATH!="/devices/*/*/*", DEVPATH=="/devices/*/*", TEST=="/tmp/udev-$env{PLATFORM_DEVICE}", RUN+="/bin/ln -s /dev/block/platform/$env{PLATFORM_FOLDER}/$env{bootdevice} /dev/block/bootdevice"
  44. # On certain devices the path is .../$PLATFORM_FOLDER/$PLATFORM_DEVICE/...,
  45. # but on others there is no $PLATFORM_DEVICE subdirectory, or in other words,
  46. # PLATFORM_FOLDER=platform device, PLATFORM_DEVICE=empty string. (1).
  47. SUBSYSTEM=="platform", KERNEL!="", DEVPATH=="/devices/platform/*", DEVPATH!="/devices/platform/*/*", DEVPATH=="/devices/platform/*", TEST=="/tmp/udev-$env{PLATFORM_FOLDER}", RUN+="/bin/mkdir -p /dev/block/platform/$env{bootdevice}"
  48. SUBSYSTEM=="platform", KERNEL!="", DEVPATH=="/devices/platform/*", DEVPATH!="/devices/platform/*/*", DEVPATH=="/devices/platform/*", TEST=="/tmp/udev-$env{PLATFORM_FOLDER}", RUN+="/bin/ln -s /dev/block/platform/$env{bootdevice} /dev/block/bootdevice"
  49. SUBSYSTEM=="platform", KERNEL!="", DEVPATH!="/devices/platform/*", DEVPATH!="/devices/*/*", DEVPATH=="/devices/*", TEST=="/tmp/udev-$env{PLATFORM_FOLDER}", RUN+="/bin/mkdir -p /dev/block/platform/$env{bootdevice}"
  50. SUBSYSTEM=="platform", KERNEL!="", DEVPATH!="/devices/platform/*", DEVPATH!="/devices/*/*", DEVPATH=="/devices/*", TEST=="/tmp/udev-$env{PLATFORM_FOLDER}", RUN+="/bin/ln -s /dev/block/platform/$env{bootdevice} /dev/block/bootdevice"
  51.  
  52. # Create the partition symlinks.
  53. ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_NAME}=="?*", SYMLINK+="block/platform/$env{PLATFORM_FOLDER}/$env{PLATFORM_DEVICE}/by-name/$env{ID_PART_ENTRY_NAME}"
  54. ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_NAME}=="?*", SYMLINK+="block/platform/$env{PLATFORM_FOLDER}/$env{PLATFORM_DEVICE}/by-num/p$env{ID_PART_ENTRY_NUMBER}"
  55. ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_NAME}=="?*", SYMLINK+="block/platform/$env{PLATFORM_FOLDER}/$env{PLATFORM_DEVICE}/$name"
  56.  
  57. # Backwards compatibility for old SailfishOS approach (might not be necessary)
  58. # NOTE: if the comment marked with (1) applies then this will not do anything.
  59. ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_NAME}=="?*", SYMLINK+="block/platform/$env{PLATFORM_FOLDER}/by-name/$env{ID_PART_ENTRY_NAME}"
RAW Paste Data