README 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. This package implements Plan 9's IL and 9fs client for FreeBSD 3.2.
  2. > Getting the software
  3. 9pfreebsd.tgz
  4. > Installation
  5. 0. unpack:
  6. mkdir ~/9pfreebsd
  7. cd ~/9pfreebsd
  8. zcat 9pfreebsd.tgz | tar -xf -
  9. this creates the file freebsd-3.2.il-kernel.patch and the
  10. directory mount_9fs.
  11. 1. get a fresh copy of the kernel. for example:
  12. cp -r /usr/src/sys ~/9pfreebsd/freebsd-3.2
  13. 2. apply the patch:
  14. cd ~/9pfreebsd/freebsd-3.2
  15. patch -p0 < ../freebsd-3.2.il-kernel.patch
  16. 3. build a new kernel:
  17. cd ~/9pfreebsd/freebsd-3.2/i386/conf
  18. config IL
  19. cd ../../compile/IL; make depend; make
  20. 4. boot the new kernel:
  21. cp -p /kernel /kernel.good
  22. cp ~/9pfreebsd/freebsd-3.2/compile/IL/kernel /kernel
  23. reboot
  24. 5. build mount_9fs:
  25. cd ~/9pfreebsd; make
  26. > Using IL
  27. 1. connect via IL:
  28. if( (s = socket(AF_INET, SOCK_SEQPACKET, IPPROTO_IL)) < 0 ) {
  29. perror("socket");
  30. exit(1);
  31. }
  32. bzero(&sin, sizeof(sin));
  33. sin.sin_family = AF_INET;
  34. sin.sin_addr.s_addr = dest_addr;
  35. sin.sin_port = htons(dest_port);
  36. if( connect(s, (struct sockaddr *)&sin, sizeof(sin)) < 0 ) {
  37. perror("connect");
  38. exit(1);
  39. }
  40. 2. listen via IL:
  41. if( (s = socket(AF_INET, SOCK_SEQPACKET, IPPROTO_IL)) < 0 ) {
  42. perror("socket");
  43. exit(1);
  44. }
  45. bzero(&sin, sizeof(sin));
  46. sin.sin_family = AF_INET;
  47. sin.sin_addr.s_addr = INADDR_ANY;
  48. sin.sin_port = htons(port_number);
  49. if( bind(s, (struct sockaddr *)&sin, sizeof(sin)) < 0 ) {
  50. perror("bind");
  51. exit(1);
  52. }
  53. if( listen(s, 5) < 0 ) {
  54. perror("listen");
  55. exit(1);
  56. }
  57. len = sizeof(sin);
  58. if ( (c = accept(s, (struct sockaddr *)& sin, &len)) < 0 ) {
  59. perror("accept");
  60. exit(1);
  61. }
  62. > Using 9fs
  63. 1. limitations:
  64. The current implementation is mostly tested with a single user on
  65. the client. No one else can access the mounted file system except
  66. the authenticator. But two users can mount the same file system
  67. on the client with different nodes. This is not yet tested much.
  68. 2. mapping plan9 usernames to UNIX uids
  69. Mount_9fs requires a translation between plan9 usernames and UNIX
  70. uids. /etc/9uid.conf contains the map. The format is:
  71. plan9_username unix_uid
  72. Not all plan9 users have to have an UNIX account on the
  73. client. Just give them a unique uid which can be non-existent in
  74. /etc/passwd.
  75. 3. mounting 9fs:
  76. To mount by a regular user, the root has to set vfs.usermount to 1
  77. first (sysctl -w vfs.usermount=1). Then follow the steps below.
  78. To mount by root:
  79. mount_9fs -u 9user@9auth_server 9fileserver:path node
  80. This mounts "path" on 9fileserver on local "node" on behalf of
  81. "9user". Plan9 authentication server "9auth_server" is
  82. contacted to obtain a ticket.
  83. mount_9fs will prompt for "9username"'s plan9 password.
  84. umount works as usual.
  85. Only the caller of mount_9fs has access to the mounted file system.
  86. 4. WARNING:
  87. The password is stored in kernel memory and can be read via kmem.
  88. > Bugs and Fixes:
  89. You are welcome to contact dong@research.bell-labs.com for bug
  90. reports and fixes.