package.py 1.5 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/python
  2. import os
  3. def createNode(mode, uid, gid, minor, major, path):
  4. os.system("/bin/mknod --mode=%d %s c %d %d" % (mode, path, minor, major))
  5. os.system("/bin/chown %s:%s %s" % (uid, gid, path))
  6. def postInstall(fromVersion, fromRelease, toVersion, toRelease):
  7. createNode(600, "root", "root", 1, 11, "/lib/udev/devices/kmsg")
  8. createNode(666, "root", "root", 1, 3, "/lib/udev/devices/null")
  9. createNode(666, "root", "root", 1, 5, "/lib/udev/devices/zero")
  10. createNode(600, "root", "root", 10, 130, "/lib/udev/devices/watchdog")
  11. createNode(666, "root", "root", 10, 229, "/lib/udev/devices/fuse")
  12. createNode(600, "root", "tty", 5, 1, "/lib/udev/devices/console")
  13. createNode(666, "root", "tty", 5, 2, "/lib/udev/devices/ptmx")
  14. createNode(666, "root", "tty", 5, 0, "/lib/udev/devices/tty")
  15. createNode(620, "root", "tty", 4, 1, "/lib/udev/devices/tty1")
  16. createNode(600, "root", "root", 10, 200, "/lib/udev/devices/net/tun")
  17. createNode(600, "root", "root", 36, 0, "/lib/udev/devices/route")
  18. createNode(600, "root", "root", 10, 200, "/lib/udev/devices/skip")
  19. createNode(660, "root", "dialout", 108, 0, "/lib/udev/devices/ppp")
  20. os.system("/sbin/udevadm hwdb --update")
  21. if os.path.exists("/lib/udev/devices/rtc"):
  22. os.unlink("/lib/udev/devices/rtc")
  23. # Migrate UDEV database
  24. if fromVersion and int(fromVersion) < 165:
  25. os.system("/sbin/udevadm info --convert-db &> /dev/null")