diff options
Diffstat (limited to 'hurd/translator')
25 files changed, 1477 insertions, 0 deletions
diff --git a/hurd/translator/cvsfs.mdwn b/hurd/translator/cvsfs.mdwn new file mode 100644 index 00000000..0dd682bf --- /dev/null +++ b/hurd/translator/cvsfs.mdwn @@ -0,0 +1,52 @@ +[[meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]] + +[[meta license="""[[toggle id="license" text="GFDL 1.2+"]][[toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled +[[GNU_Free_Documentation_License|/fdl]]."]]"""]] + +## Setting up cvsfs on GNU/Hurd - A step by step process + +### Description of cvsfs + +cvsfs is a virtual ([[libnetfs]] based) filesystem allowing you to mount +remotely located CVS modules into your local filesystem. The version +controlled files will appear to you just like regular ones. If you just want +to view one file (or a small bunch) you furthermore save a lot of network +bandwidth since only these files will be downloaded. The usual way to do so +would be to check out the whole tree and deleting it after using. + +## Step by Step process in installing cvsfs + +Download and prepare the source files from the CVS repositiory and build them. + + $ cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/hurdextras co cvsfs + $ cd cvsfs/ + $ autoreconf -i + $ ./configure + $ make + $ make install + +Set up the translator and start grazing. + + $ mkdir -p cvsfs_test + $ settrans -a cvsfs_test /hurd/cvsfs cvs.sourceforge.net /cvsroot/projectname modulename + +Example to mount the cvsfs module on hurdextras to a local directory. + + $ mkdir cvs.d + $ settrans -ac cvs.d/cvsfs /hurd/cvsfs cvs.savannah.nongnu.org sources/hurdextras cvsfs + +Now change to that directory and start using ls, emacs, and whatever you feel +like. :-) + +Happy Hacking. + + +## References + + * <http://www.nongnu.org/hurdextras/> + * <http://cvs.sv.nongnu.org/viewcvs/*checkout*/cvsfs/README?root=hurdextras> diff --git a/hurd/translator/emailfs.mdwn b/hurd/translator/emailfs.mdwn new file mode 100644 index 00000000..04b58f33 --- /dev/null +++ b/hurd/translator/emailfs.mdwn @@ -0,0 +1,287 @@ +[[meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]] + +[[meta license="""[[toggle id="license" text="GFDL 1.2+"]][[toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled +[[GNU_Free_Documentation_License|/fdl]]."]]"""]] + +# How cool it would be if the email becomes similar to snail mail? + +## Let see how the snail mail works + +* You write the letter with a pen and paper +* You write the "To" address +* Post it -> Put it in a Post Box + +## How Email works + +* You have your email client (and there comes the limitation, you can't use + your favourite editor) +* Fill in destination email address +* Send it (May be a send button or a keyboard shortcut) + +## What are the problems + +If you want to use a wordprocessor for sending email, it should implement a +feature like mail merge, suppose it doesn't have such a feature then? You copy +and paste it to your email client and if it doesn't support HTML? Well you have +work arounds for all these, but how cool it would be if you have something like +this: + +* You create a file, use any wordprocessor or text editor. +* Right click and see the properties +* Set the "To" field +* Drag it to the Post Box icon on your panel next to Trash + +## How can we implement it? + +An SMTP translator which uses extended atributes + +## Comments + +IRC Logs about the discussion on #hurd + +<!-- That smileys are rendered the wrong way below is a ikiwiki bug. --> + +>>>>>>> 5384ccd0a47e900fbdae993143110538248517a2:emailfs.mdwn + + <manuel>j4v4m4n: isn't the HHG a good enough libtrivfs tutorial? + <manuel> the problem I have with mail, blog, ..., translators is that you want to save mails before sending them, so you can't edit directly into the translator + <j4v4m4n> manuel, may be we want a simpler one, all of us are beginners except AB + <manuel> they're not stream-based so unless you save it into memory and wait for "sync" to send mails, it doesn't seem well suited + <manuel> who's AB? + <j4v4m4n> manuel, create any file with your favourite editor and copy it to the directory where SMTP translator is sitting + <j4v4m4n> manuel, Anand Babu + <manuel> sure, but how is that better than sending it via the "mail" command then? + <manuel> except it's less hype, of course. + <j4v4m4n> manuel, http://savannah.gnu.org/users/ab + <j4v4m4n> manuel, it would be cool :-) + <manuel> still not convinced :) + * schlesix (n=thomas@xdsl-81-173-230-219.netcologne.de) has joined #hurd + <j4v4m4n> manuel, set up SMTP translator on the desktop and may be add it next to the Trash :-) + <j4v4m4n> manuel, have a nice postbox icon + <j4v4m4n> manuel, drag your files to it + <j4v4m4n> manuel, it would be closer to the real world and snail mail + <bvk> j4v4m4n: To whom do they go? + <manuel> bvk: the file must be preformatted, probably + <j4v4m4n> bvk, in snail mail you will write to address on top of the envelop, right? + <manuel> j4v4m4n: yeah well, it could make sense in a desktop envronment + <j4v4m4n> bvk, here we can have it as the first line of the file + <manuel> not sure + <bvk> j4v4m4n: i never used snail :( + <j4v4m4n> manuel, that is what I have in mind + * j4v4m4n like snail mail that email + <manuel> bvk: you never sent a mail via snail mail?! :) + * j4v4m4n like snail mail more than email + <bvk> manuel: nope :( whats that btw? + <j4v4m4n> manuel, or why not have it as the file property itself?? + <bvk> manuel: you know its first time i hear it *snail mail* :(( + <j4v4m4n> bvk, the normal mails which a postman delivers :-) + <j4v4m4n> manuel, you create a file text, open document or whatver format + <manuel> j4v4m4n: I'm quite sure it'd make things more complicated in the end, using file properties, dragging files etc. + <j4v4m4n> manuel, righ click and see properties and set the to field + <bvk> Oh, these english words... :X + <j4v4m4n> manuel, we can use the xtended atributes + <j4v4m4n> manuel, which really showcase the power of hurd + <j4v4m4n> manuel, it becomes closer to the real world + <bvk> actually, is X working on hurd? + <j4v4m4n> bvk, well it used to work and the new Xorg release has som + <j4v4m4n> bvk, well it used to work and the new Xorg release has some broken packages + <j4v4m4n> bvk, if you use an old snapshot repository it will work (xorg 6.9) + * marco_g (n=marco@gnu/the-hurd/marco) has joined #hurd + <marco_g> hi + <j4v4m4n> marco_g, hi + * bvk watching MIT lecture video on 'structure and interpretation of computer programs' + <manuel> bvk: yeah, X was ported on GNU/Hurd five-six years ago or so + <j4v4m4n> manuel, see http://hurd.in/bin/view/Main/EmailFS + <j4v4m4n> manuel, add your comments, if you like + <manuel> j4v4m4n: how would you convert the .odt to a mail? + <j4v4m4n> manuel, attachment + <manuel> with an empty mail? + <manuel> that won't get through *most* spam filters :) + <j4v4m4n> manuel, or may be convert it to HTML + <manuel> well converting it to text or HTML would require a set of rules to convert from any format to text/HTML, like a2ps has (some sort of mailcap file) + <j4v4m4n> manuel, it can be flexible, a parameter to the translator as to what should be done with each formats + <manuel> and there's no convenient way to convert ODT to text AFAIK, you need to use ooffice with a batch program, which you need to provide too + <manuel> well that's really complex + <j4v4m4n> manuel, well how will you send me a CD by post? + <j4v4m4n> manuel, or say a bed? + <j4v4m4n> manuel, courier or parcel, right? so attachment is fine + <manuel> sure but you'll add a note saying "this is a bed from Praveen" + <ness> why not add a note to such a mail + <ness> you could even move multiple files simultaneously to the mail translator + <manuel> hm + <manuel> so how is the translator supposed to know that all the files I move are to be sent in a single mail and not on separate mails? + <manuel> and how'll you be able to add a note to such a mail? I mean, of course you can set it on the xattr but that's quite strange (the attachment is supposed to be an attr of the mail, not the other way) and not convenient at all + <manuel> I'm quite sure using a MUA is still easier + <ness> you could move a complete directory to the mail trans + <ness> (and the desktop icon can do this transparently) + <manuel> hmm so you have to create a directory, write a text file on it (with a special filename, I guess, since you could also have text files as attachments) and add the attachments to the directory + <manuel> and then drag & drop it + * manuel thinks things are getting more and more complicated :) + <ness> the special file name or attribute thing is right + <ness> but you not necisirily need to create a dir + <ness> s/necisirily/necessarily/ + <ness> you just drag 'n' drop multiple files to the icon + <manuel> and how is the translator supposed to know they are dragged at the same time and not one after the other? + <ness> I do not know if it is viable + * antrik (n=olaf@port-212-202-210-130.dynamic.qsc.de) has joined #hurd + <manuel> AFACS, dragging multiple files just make the desktop issue multiple rename() + <moritz> manuel: however the desktop handles that - it would be a rather easy thing to fix, i guess. + * schlesix has quit (Remote closed the connection) + <manuel> moritz: how is the desktop supposed to handle that? + <moritz> if this mail translator approach, is primarily to be used in desktop environments, one could implement the whole thing on the desktop environment layer, not with Hurd translators. + <moritz> manuel: i think it would be rather easy for the desktop to distinguish between actions like "ONE file is dragged" and "MULTIPLE files are dragged". + * schlesix (n=schlesix@xdsl-81-173-230-219.netcologne.de) has joined #hurd + <manuel> oh yeah, but then you loose the transparency, and there's no point in making it a translator. I think we agree on that :) + <moritz> i see rather little point in making it a translator anyway, since only god knows wether we have similar concept to translators in hurd-ng. + <manuel> yeah sure, but praveen wasn't planning it for HurdNG AIUI + <moritz> in that case it would probably be toy project. fine. + <moritz> i need to do some maths. see you. + <manuel> hmm well, you can't write anything else than toy projects, then + <ness> moritz: you shouldn't be too sure about success of ngHurg + <ness> it is an experiment + <antrik> sdschulze: ping + * antrik has quit (Remote closed the connection) + * antrik (n=olaf@port-212-202-210-130.dynamic.qsc.de) has joined #hurd + * bddebian (n=bdefrees@71.224.172.103) has joined #hurd + <j4v4m4n> manuel, This is a lot of input, let me sink these all first :-) + <bddebian> Heya folks + <schlesix> heya bddebian! + <j4v4m4n> it is ofcoures a "nice to have" feature. + <j4v4m4n> These are quite intersting inputs as well + <bddebian> Hi schlesix + <j4v4m4n> manual in the real wprld how will you send multiple things, say you want to send a CD and a bed + <j4v4m4n> manuel, you will package it (files) and then one parcel containing all these things (folder) + <manuel> j4v4m4n: well you want to make sending emails easier than sending real mails :-) + <j4v4m4n> manuel, it won't substitute MUAs + <j4v4m4n> manuel, we need it as the backend + <diocles> geekoe: You asked about GFS yesterday; well, glibc compiled. :) I've not done much more after that. + <antrik> regarding mail translator: take a look at Plan9, they have been doing it for years + <j4v4m4n> manuel, sorry not MUA I meant MTA + * syamajala (n=syamajal@c-24-147-61-120.hsd1.ma.comcast.net) has joined #hurd + <manuel> ah yes sure, but MUA will still be easier to use afaics + <j4v4m4n> manuel, people who are used to Windows say GNU/Linux is tough to use + <j4v4m4n> manuel, but when they start with GNOME or KDE they don't have any issues + <j4v4m4n> antrik, that is a great info I will look into it + <j4v4m4n> manuel, sorry not MUA I meant MTA + * syamajala (n=syamajal@c-24-147-61-120.hsd1.ma.comcast.net) has joined #hurd + <manuel> ah yes sure, but MUA will still be easier to use afaics + <j4v4m4n> manuel, people who are used to Windows say GNU/Linux is tough to use + <j4v4m4n> manuel, but when they start with GNOME or KDE they don't have any issues + <j4v4m4n> antrik, that is a great info I will look into it + <ness> j4v4m4n: they do it quite differently + <manuel> this doesn't answer to the basic question: how is it better than what we have now + <j4v4m4n> manuel, it is different, better is always debatable + <j4v4m4n> manuel, GNOME might work for but some doesn't use X at all + <j4v4m4n> manuel, whether it is good will be depending on the implemetation + <Jeroen> people who used to GNU/Linux say Windows is tough to use + <Jeroen> +are + <unlink> GNU/Linux is at least tougher to say + <Jeroen> no, people have less experience with GNU/Linux + <manuel> "to say", Jeroen + <j4v4m4n> manuel, better and easier are always relative + <j4v4m4n> manuel, there a lot of people still using mutt when you have thunderbird + <manuel> well because they have reasons to say mutt is easier than thunderbird + <Jeroen> the only thing is that you've to learn a few shortcuts when you want to use mutt, you can't just click around + <j4v4m4n> manuel, exactly + <j4v4m4n> manuel, consider this, you want to send a document across to someone + * Blackmore has quit (Read error: 104 (Connection reset by peer)) + * koollman has quit (Remote closed the connection) + <j4v4m4n> manuel, now you open a MUA add the attachment send it + * koollman (n=samson_t@gsv95-1-82-233-13-27.fbx.proxad.net) has joined #hurd + <j4v4m4n> manuel, if you just have to drag it to an icon, would that be easier? + * Casanova (n=prash@unaffiliated/casanova) has joined #hurd + <j4v4m4n> manuel, chmod +to:manuel@somehost doc.pdf ; cp doc.pdf postbox/ + <Jeroen> yeah + <Jeroen> chmod is for setting permissions... + <j4v4m4n> manuel, I am not sure how to set xattr + <manuel> well, setfattr + <Jeroen> well + <j4v4m4n> manuel, ok + <Jeroen> how do you type your subject? + <Jeroen> and there message itself? + <Jeroen> s/there/the/ + <Jeroen> how do you encrypt+sign it with pgp? + <manuel> j4v4m4n: well the problem is still the same you know. OK for to/subject : they'd be extended attributes. but how do you type the message itself? + <antrik> I don't think using xattr for such stuff is a good idea + <antrik> after all, it's not a property of the document + <j4v4m4n> antrik, we can use it only on a particular directory on which our translator sit + <j4v4m4n> manuel, create a folder + <manuel> that'd mean mkdir message; ln -s doc.pdf message/; cat >message/message <<EOF; setfattr -n to -v mmenal@hurdfr.org; setfattr -n subject -v document; mv message postbox + <antrik> the reason why having translators for such stuff is that this way you have a generic service for sending mail, whether you use it through a special UI (MUA), directly with file commands, from a script, or from some other program that just sends mails as a side functionality + * mheath has quit (Connection reset by peer) + <j4v4m4n> manuel, that looks scary :-( + <manuel> not sure it's easier than "mutt; m; mmenal@hurdfr.org; document; >typing the message<; a; doc.pdf; y" + <antrik> manuel: it is easier in some situations + <antrik> (and again, I would not use xattr for such stuff) + <j4v4m4n> manuel, now how do you use mutt on GNOME? + <antrik> in fact, Plan9 explicitely does *not* have any xattr and stuff + <manuel> antrik: well xattr on the directory that represents the message is not illogical + * mheath (n=mheath@c-67-182-231-23.hsd1.co.comcast.net) has joined #hurd + <j4v4m4n> antrik, may be we can think of some other way if you don't wanna xattr + <manuel> j4v4m4n: well I just used the CLI because it's easier to describe, but try to explain the steps in a GUI and you'll see it's the same problem + <j4v4m4n> manuel, right click on desktop -> create folder -> drag the files to the folder -> set attributes to the folder-> drag it to postbox + <j4v4m4n> manuel, it is quite logical step + <manuel> sure, but how is it easier than click on the MUA icon -> create mail -> drag the files to the mail window ; type the attrbutes + contents ; click on send mail + <manuel> looks quite similar to me :-) + <j4v4m4n> manuel, or if you already have the folder just drag it + <kilobug> a POP or IMAP translator would be more useful IMHO (but well, I didn't read all the backlog, so I may be off topic) + <j4v4m4n> manuel, you don't have a MUA here :-) just files and folders + <kilobug> to read mails, I mean + <j4v4m4n> kilobug, that is even easier IMAP->mabox and then mboxfs + <manuel> j4v4m4n: well you have a MUA : that's the translator + <j4v4m4n> kilobug, mboxfs is already available + <j4v4m4n> kilobug, I think someone already wrote IMAP to mbox as well but couldn't find it + <kilobug> j4v4m4n: well, imapfs could work both way, writing changes on the imap server too ;) + <antrik> manuel: the difference is not how it is used; the difference is how it is implemented + <antrik> manuel: if you have a generic mail translator, you have most functionality already there with the file manager; all you need to add is some scripts for better comfort + <antrik> j4v4m4n: the way I would do it (and I guess Plan9 does, though I haven't checked) is either having a file in the mail directory with the headers, or a subdirectory with a single file for each header (probably the latter) + <j4v4m4n> antrik, that would make it too complicated IMHO, it would be close to how it is for snail mail + <antrik> j4v4m4n: I don't see how this would be more complicated than xattr + <j4v4m4n> manuel, you can write your own scripts to automate it for whatver way you want + * azor (n=azor@62-43-135-201.user.ono.com) has joined #hurd + <manuel> antrik: having the functionality in the filesystem is useful because programs can use this functionality without patching; the protocol to use the mail translator is so specific that you either need to be a real user (but then a MUA is a lot more useful) or have a patched program (but then you could use a lib) + <j4v4m4n> antrik, right clicking a file and setting u p to and subject seems easier that creating more files + <antrik> j4v4m4n: I don't think so. maybe it is in gnome, but than I'd consider it a shortcoming of gnome + <antrik> j4v4m4n: in shell "cat foo@example.invalid headers/to" is about as simple as you can get + <manuel> > + <antrik> erm... I mean echo + <antrik> and >, yes + <antrik> sorry + * yoj (n=jao@200.163.8.72) has joined #hurd + <manuel> "echo foo@example.invalid > headers/to" is not easier than "setfattr -n to -v foo@example.invalid" AFAICS. + <antrik> echo foo@example.invalid >headers/to + * yoj (n=jao@200.163.8.72) has left #hurd + * yoj (n=jao@200.163.8.72) has joined #hurd + <kilobug> manuel: it is a tiny bit if your "foo@example.invalid" is the output of a command, mycomplexcommand > headers/to is a bit easier than setfattr -n to -v `mycomplexcommand` + <kilobug> manuel: but it's the same for a value you type directly + <antrik> manuel: objectively it is not simpler, but it uses a generic mechanism users now well, instead of obscure xattr stuff + <antrik> know well + <j4v4m4n> antrik, ok we can think of that, but how about a desktop user? + abeaumont andar antrik arnau azeem azor + <j4v4m4n> antrik, he has to use more clicks and more head aches + <j4v4m4n> antrik, just right click and add to address and subject just you write on the envelop + <kilobug> j4v4m4n: that's good ! it makes him buy more medicine, drug corporations will sponsor you then ! + * kilobug runs away + * j4v4m4n chases kilobug + <j4v4m4n> kilobug, better way would be making outlook run on GNU :-) + <marco_g> Or GNU on outlook \o/ + * yoj (n=jao@200.163.8.72) has left #hurd + <kilobug> this channel is becoming insnae :p + <j4v4m4n> kilobug, or is it the members ?? :-) + <marco_g> I agree with kilobug, we should stop those weirdos here :-/ + * whr` (i=whr@acy238.neoplus.adsl.tpnet.pl) has joined #hurd + <antrik> hm... anyone have the marcus quote at hand? + <j4v4m4n> i got to go as well + <j4v4m4n> bye + <kilobug> bye j4v4m4n + +## Interesting?? + +Join the project -- Add yourself to the list below + +* [[Praveen A]] diff --git a/hurd/translator/examples.mdwn b/hurd/translator/examples.mdwn new file mode 100644 index 00000000..b9f145e3 --- /dev/null +++ b/hurd/translator/examples.mdwn @@ -0,0 +1,93 @@ +[[meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]] + +[[meta license="""[[toggle id="license" text="GFDL 1.2+"]][[toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled +[[GNU_Free_Documentation_License|/fdl]]."]]"""]] + +## Setting up translators - HowTo + +Translators can be got from hurd-extras <http://www.nongnu.org/hurdextras/> + + cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/hurdextras co <modulename> + +* httpfs translator + +<!-- Prevent ikiwiki / Markdown rendering bug. --> + + $ settrans -a tmp/ /hurd/httpfs www.hurd-project.com/ + +or + + $ settrans -a tmp/ /hurd/httpfs www.hurd-project.com/ --proxy=<proxy> --port=<port> + $ cd tmp/ + $ ls -l + +* ftpfs translator + +<!-- Prevent ikiwiki / Markdown rendering bug. --> + + $ settrans -cgap ftp /hurd/hostmux /hurd/ftpfs / + $ cd ftp + ftp$ ls + ftp$ cd ftp.fr.debian.org + ftp/ftp.fr.debian.org $ ls + +* tarfs translator + +You can use tarfs to mount (almost) any tar file: + + $ settrans -ca a /hurd/tarfs -z myfile.tar.gz + $ settrans -ca b /hurd/tarfs -y myfile.tar.bz2 + $ settrans -ca c /hurd/tarfs myfile.tar + +You can even use it to create new tar files: + + $ settrans -ca new /hurd/tarfs -cz newfile.tar.gz + $ cp -r all my files new/ + $ syncfs new + +This is not as fast as `tar czvf newfile.tar.gz all my files` but at least, it's more original. ;) + +* cvsfs translator + +<!-- Prevent ikiwiki / Markdown rendering bug. --> + + $ settrans -ac cvsfs_testing /hurd/cvsfs cvs.savannah.nongnu.org /sources/hurdextras + $ cd cvsfs_testing + +* pfinet translator -- configuring your network interface + +<!-- Prevent ikiwiki / Markdown rendering bug. --> + + $ settrans -fgca /servers/socket/2 /hurd/pfinet -i <interface> -a <ip address> -m <subnet mask> -g <gateway ip> + +* Console translator -- setting up virtual consoles + +<!-- Prevent ikiwiki / Markdown rendering bug. --> + + $ console -d vga -d pc_mouse -d pc_kbd -d generic_speaker /dev/vcs + +* iso9660fs translator -- 'mounting' your cdrom + +<!-- Prevent ikiwiki / Markdown rendering bug. --> + + $ settrans -ac /cdrom /hurd/iso9660fs /dev/<cdrom device file> + +* ext2fs translator -- 'mounting' an ext2fs partition + +<!-- Prevent ikiwiki / Markdown rendering bug. --> + + $ settrans -ac /linux /hurd/ext2fs /dev/<partition device file> + +* unionfs translator + +To join "foo/" "bar/" and "baz/" in the directory "quux/", just do: + + $ settrans -capfg quux/ /hurd/unionfs foo/ bar/ baz/ + +If you want to join even quux/ contents in the union itself, add -u as a translator argument. +You can add filesystems at run-time with the fsysopts command. diff --git a/hurd/translator/ext2fs.mdwn b/hurd/translator/ext2fs.mdwn new file mode 100644 index 00000000..cfa8c997 --- /dev/null +++ b/hurd/translator/ext2fs.mdwn @@ -0,0 +1,18 @@ +[[meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]] + +[[meta license="""[[toggle id="license" text="GFDL 1.2+"]][[toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled +[[GNU_Free_Documentation_License|/fdl]]."]]"""]] + +The `ext2fs` translator from the upstream Hurd code base can only handle file +systems with sizes of less than roughly 2 GiB. + +A patch exists to lift this limitation (and is being used in the +[[Debian_GNU/Hurd_distribution|running/debian]]), but it introduces another +incompatibility: `ext2fs` then only supports block sizes of 4096 bytes. +Smaller block sizes are commonly automatically selected by `mke2fs` when using +small backend stores, like floppy devices. diff --git a/hurd/translator/fatfs.mdwn b/hurd/translator/fatfs.mdwn new file mode 100644 index 00000000..b534b97e --- /dev/null +++ b/hurd/translator/fatfs.mdwn @@ -0,0 +1,11 @@ +[[meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]] + +[[meta license="""[[toggle id="license" text="GFDL 1.2+"]][[toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled +[[GNU_Free_Documentation_License|/fdl]]."]]"""]] + +The current `fatfs` translator is read-only. diff --git a/hurd/translator/hostmux.mdwn b/hurd/translator/hostmux.mdwn new file mode 100644 index 00000000..5fab2dc5 --- /dev/null +++ b/hurd/translator/hostmux.mdwn @@ -0,0 +1,31 @@ +Multiplexes arbitrary host names, making access to many differnt host fast and easy. + +For each host accessed via a directory an new translator is started with the hostname as option. Say, /hostmuxdemo should let you access your favourite host with your translator mytranslatorfs. + +<code>**ls /hostmuxdemo/mybox/**</code> would give the result of mytranslatorfs applied to host mybox. + +## <a name="Usage"> Usage </a> + +Hostmux takes translator options as argument and (in the easiest case ) starts the translator with the given arguments and the hostname as the last argument. + +### <a name="ftpfs"> ftpfs </a> + +ftpfs is a good example, that is even very usefull. With hostmux and ftpfs you can access anonymous ftp via the filesystem, sparing out complicate use of a ftp client. + +We assume you want to access the ftp root at all servers. The example host is ftp.yourbox.com. + +Usermux is called via <code>**settrans -fgap /ftp /hurd/hostmux /hurd/ftpfs /**</code> . + +* <code>**-fg**</code> makes settrans try hard to remove an existing old translator from <code>**/ftp**</code> +* <code>**ap**</code> sets an active translator (starts the translator) and a passive translator (stores translator information in the filesystem with which an active translator can be started on access of this node) +* <code>**/ftp**</code> is where we want to set the translator +* <code>**/hurd/hostmux**</code> is obviously our hostmux translator that will be started at <code>**/ftp**</code> and handle filesystem operations on <code>**/ftp**</code> and everything below (like <code>**/ftp/ftp.yourbox.com/pub/**</code>) +* <code>**/hurd/ftpfs /**</code> is the argument to hostmux. + +When <code>**/ftp**</code> is accessed, the first directory is interpreted as hostname and a new translator is set up with the <code>**hostmux**</code> arguments: + +<code>**ls /ftp/ftp.yourhost.com/pub/**</code> lets hostmux start a new traslator <code>**/hurd/ftpfs / ftp.yourhost.com**</code> and serve it via <code>**/ftp/ftp.yourhos t.com/**</code> as directory. Subsequent the directory <code>**pub/**</code> on <code>**/ftp.yourhost.com/**</code> can be accessed via the new created translator. + +You can see the new created translator in the process list: <code>**ps ax | grep ftpsfs**</code> . You shoud see <code>**/hurd/ftpfs / ftp.yourhost.com**</code> . + +-- [[Main/PatrickStrasser]] - 13 Jul 2004 diff --git a/hurd/translator/magic.mdwn b/hurd/translator/magic.mdwn new file mode 100644 index 00000000..f6d0494b --- /dev/null +++ b/hurd/translator/magic.mdwn @@ -0,0 +1,21 @@ +[[meta copyright="Copyright © 2006, 2007, 2008 Free Software Foundation, Inc."]] + +[[meta license="""[[toggle id="license" text="GFDL 1.2+"]][[toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled +[[GNU_Free_Documentation_License|/fdl]]."]]"""]] + +The magic translator provides `/dev/fd`. + + $ showtrans /dev/fd + /hurd/magic --directory fd + +The `/dev/fd` directory holds the open file descriptors for your current +process. You can't see them with `ls -l /dev/fd/` but you can see them +individually like this: + + $ ls -l /dev/fd/0 + crw--w---- 1 bing tty 0, 0 Nov 19 18:00 /dev/fd/0 diff --git a/hurd/translator/mboxfs.mdwn b/hurd/translator/mboxfs.mdwn new file mode 100644 index 00000000..be959d0b --- /dev/null +++ b/hurd/translator/mboxfs.mdwn @@ -0,0 +1,11 @@ +[[meta copyright="Copyright © 2008 Free Software Foundation, Inc."]] + +[[meta license="""[[toggle id="license" text="GFDL 1.2+"]][[toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled +[[GNU_Free_Documentation_License|/fdl]]."]]"""]] + +<http://www.nongnu.org/hurdextras/#mboxfs> diff --git a/hurd/translator/pfinet.mdwn b/hurd/translator/pfinet.mdwn new file mode 100644 index 00000000..acd7b855 --- /dev/null +++ b/hurd/translator/pfinet.mdwn @@ -0,0 +1,11 @@ +[[meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]] + +[[meta license="""[[toggle id="license" text="GFDL 1.2+"]][[toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled +[[GNU_Free_Documentation_License|/fdl]]."]]"""]] + +Notes about [[IPv6]]. diff --git a/hurd/translator/pfinet/ipv6.mdwn b/hurd/translator/pfinet/ipv6.mdwn new file mode 100644 index 00000000..37fabcb7 --- /dev/null +++ b/hurd/translator/pfinet/ipv6.mdwn @@ -0,0 +1,60 @@ +[[meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]] + +[[meta license="""[[toggle id="license" text="GFDL 1.2+"]][[toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled +[[GNU_Free_Documentation_License|/fdl]]."]]"""]] + +[[Stefan_Siegl|stesie]] has added IPv6 support to the pfinet [[translator]]. +This was [Savannah task #5470](http://savannah.gnu.org/task/?5470). + + +# Implementation + +Because the IPv4 and IPv6 protocols are +quite related to each other (think of mapped IPv4 addresses, etc.), there is no +separate [[server|translator]] for IPv6 but support for the latter has been +incorporated into the common pfinet. Unfortunately it's a little bit clumsy +now to set the [[translator]] up, since it has to be bound to +*/servers/socket/2* (like before) as well as */servers/socket/26* (for IPv6). + +To achieve this, you can tell pfinet to install [[active_translators|active]] +on specified nodes, using **-4** and **-6** options. This is, you have to +install a [[passive_translator|passive]] on */servers/socket/2* that also binds +the IPv6 port and vice versa. + + +# Examples + +Normal IPv4 network setup, address 192.168.7.23/24 and gateway 192.168.7.1. +IPv6 address shall be assigned using IPv6 auto-configuration. + + settrans -fgp /servers/socket/2 ↩ + /hurd/pfinet -6 /servers/socket/26 ↩ + -i eth0 -a 192.168.7.23 -m 255.255.255.0 -g 192.168.7.1 + settrans -fgp /servers/socket/26 ↩ + /hurd/pfinet -4 /servers/socket/2 ↩ + -i eth0 -a 192.168.7.23 -m 255.255.255.0 -g 192.168.7.1 + +Quite the same, but with static IPv6 address assignment: + + settrans -fgp /servers/socket/2 ↩ + /hurd/pfinet -6 /servers/socket/26 ↩ + -i eth0 -a 192.168.7.23 -m 255.255.255.0 -g 192.168.7.1 ↩ + -A 2001:4b88:10e4:0:216:3eff:feff:4223/64 -G 2001:4b88:10e4::1 + settrans -fgp /servers/socket/26 ↩ + /hurd/pfinet -4 /servers/socket/2 ↩ + -i eth0 -a 192.168.7.23 -m 255.255.255.0 -g 192.168.7.1 ↩ + -A 2001:4b88:10e4:0:216:3eff:feff:4223/64 -G 2001:4b88:10e4::1 + + +# Binaries + +For your convenience -- this work is not yet available in the Debian packages +-- binaries of a patched (multicast reception) GNU Mach kernel (including +default driver set and debugging support) and a stripped pfinet translator +(named `pfinet6` here) are being provided at +<http://brokenpipe.de/GnuHurd/pfinet6/> diff --git a/hurd/translator/procfs.mdwn b/hurd/translator/procfs.mdwn new file mode 100644 index 00000000..eb07a8f6 --- /dev/null +++ b/hurd/translator/procfs.mdwn @@ -0,0 +1,19 @@ +[[meta copyright="Copyright © 2008 Free Software Foundation, Inc."]] + +[[meta license="""[[toggle id="license" text="GFDL 1.2+"]][[toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled +[[GNU_Free_Documentation_License|/fdl]]."]]"""]] + +<http://www.nongnu.org/hurdextras/#procfs> + + * [[`ps`|procps]] + * [[`top`|top]] + * [[`htop`|htop]] + * `gtop` + * [[`killall`|killall]] + * `pkill` + * ... diff --git a/hurd/translator/procfs/htop.mdwn b/hurd/translator/procfs/htop.mdwn new file mode 100644 index 00000000..5228c702 --- /dev/null +++ b/hurd/translator/procfs/htop.mdwn @@ -0,0 +1,25 @@ +[[meta copyright="Copyright © 2008 Free Software Foundation, Inc."]] + +[[meta license="""[[toggle id="license" text="GFDL 1.2+"]][[toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled +[[GNU_Free_Documentation_License|/fdl]]."]]"""]] + + open("/proc/stat", O_RDONLY) = 3 + open("/proc/meminfo", O_RDONLY) = 3 + open("/proc/stat", O_RDONLY) = 3 + open("/proc", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|0x80000) = 3 + open("/proc/1/task", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|0x80000) = 4 + open("/proc/1/status", O_RDONLY) = 4 + open("/proc/1/statm", O_RDONLY) = 4 + open("/proc/1/stat", O_RDONLY) = 4 + open("/proc/1/cmdline", O_RDONLY) = 4 + open("/proc/2/task", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|0x80000) = 4 + open("/proc/2/status", O_RDONLY) = 4 + open("/proc/2/statm", O_RDONLY) = 4 + open("/proc/2/stat", O_RDONLY) = 4 + open("/proc/2/cmdline", O_RDONLY) = 4 + [...] diff --git a/hurd/translator/procfs/killall.mdwn b/hurd/translator/procfs/killall.mdwn new file mode 100644 index 00000000..99790a36 --- /dev/null +++ b/hurd/translator/procfs/killall.mdwn @@ -0,0 +1,23 @@ +[[meta copyright="Copyright © 2008 Free Software Foundation, Inc."]] + +[[meta license="""[[toggle id="license" text="GFDL 1.2+"]][[toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled +[[GNU_Free_Documentation_License|/fdl]]."]]"""]] + + open("/proc/stat", O_RDONLY) = 3 + open("/proc/self/stat", O_RDONLY) = 3 + open("/proc/uptime", O_RDONLY) = 3 + open("/proc/sys/kernel/pid_max", O_RDONLY) = 4 + open("/proc/meminfo", O_RDONLY) = 4 + open("/proc", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|0x80000) = 5 + open("/proc/1/stat", O_RDONLY) = 6 + open("/proc/1/status", O_RDONLY) = 6 + open("/proc/1/cmdline", O_RDONLY) = 6 + open("/proc/2/stat", O_RDONLY) = 6 + open("/proc/2/status", O_RDONLY) = 6 + open("/proc/2/cmdline", O_RDONLY) = 6 + [...] diff --git a/hurd/translator/procfs/procps.mdwn b/hurd/translator/procfs/procps.mdwn new file mode 100644 index 00000000..99790a36 --- /dev/null +++ b/hurd/translator/procfs/procps.mdwn @@ -0,0 +1,23 @@ +[[meta copyright="Copyright © 2008 Free Software Foundation, Inc."]] + +[[meta license="""[[toggle id="license" text="GFDL 1.2+"]][[toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled +[[GNU_Free_Documentation_License|/fdl]]."]]"""]] + + open("/proc/stat", O_RDONLY) = 3 + open("/proc/self/stat", O_RDONLY) = 3 + open("/proc/uptime", O_RDONLY) = 3 + open("/proc/sys/kernel/pid_max", O_RDONLY) = 4 + open("/proc/meminfo", O_RDONLY) = 4 + open("/proc", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|0x80000) = 5 + open("/proc/1/stat", O_RDONLY) = 6 + open("/proc/1/status", O_RDONLY) = 6 + open("/proc/1/cmdline", O_RDONLY) = 6 + open("/proc/2/stat", O_RDONLY) = 6 + open("/proc/2/status", O_RDONLY) = 6 + open("/proc/2/cmdline", O_RDONLY) = 6 + [...] diff --git a/hurd/translator/procfs/top.mdwn b/hurd/translator/procfs/top.mdwn new file mode 100644 index 00000000..f0030d61 --- /dev/null +++ b/hurd/translator/procfs/top.mdwn @@ -0,0 +1,18 @@ +[[meta copyright="Copyright © 2008 Free Software Foundation, Inc."]] + +[[meta license="""[[toggle id="license" text="GFDL 1.2+"]][[toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled +[[GNU_Free_Documentation_License|/fdl]]."]]"""]] + + open("/proc/stat", O_RDONLY) = 3 + open("/proc/sys/kernel/pid_max", O_RDONLY) = 3 + open("/proc", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|0x80000) = 3 + open("/proc/1/stat", O_RDONLY) = 4 + open("/proc/1/statm", O_RDONLY) = 4 + open("/proc/2/stat", O_RDONLY) = 4 + open("/proc/2/statm", O_RDONLY) = 4 + [...] diff --git a/hurd/translator/random.mdwn b/hurd/translator/random.mdwn new file mode 100644 index 00000000..afb76953 --- /dev/null +++ b/hurd/translator/random.mdwn @@ -0,0 +1,70 @@ +[Savannah task #5130: random translator](http://savannah.gnu.org/task/?5130) + +See the attached [[mbox.bz2]] containing all the emails concerning this topic +which I was able to gather from public archives. (!) This is not up-to-date +anymore, as [[MichaelCasadevall]] is currently working on this. + +# Description + +Sources of entropy are for example disk access latencies or keystroke patterns +or behavior on networks. This suggests that for implementing a random +translator a kernel part is needed as well, to gather that entropy. That +kernel part would then export the gathered entropy via a kernel device, named +perhaps `entropy`. + +# Setup Pseudo Random Devices + +Stuck getting SSH to work? You need a pseudo random generator (PRG). + +There are several solutions to the lack of `/dev/random` and `/dev/urandom`, +but they are not yet in the default installation. + +* Marcus' work can be downloaded at + [random.tar.gz](ftp://alpha.gnu.org/gnu/hurd/contrib/marcus/random.tar.gz). + (Identical to <http://kilobug.free.fr/hurd/random-64.tar.gz>?) + * [A patch](http://mail.gnu.org/pipermail/bug-hurd/2002-August/010248.html) + that was probably already incorporated from August 14, 2002. + * Clemmitt Sigler [reported + success](http://lists.gnu.org/archive/html/help-hurd/2002-10/msg00076.html) + October 11, 2002 and Marcus [described + some](http://lists.gnu.org/archive/html/help-hurd/2002-10/msg00081.html) of + the internals. + +* [Entropy Gathering Daemon](http://egd.sourceforge.net/). + * [request for packaging](http://bugs.debian.org/145498). + +* [OSKit Entropy + Patch](http://lists.gnu.org/archive/html/bug-hurd/2003-01/msg00000.html) from + Derek Davies - Jan 2003. + * See also [this page](http://www.ddavies.net/oskit-entropy/). + * Note that this patch can (and should) be used with this [OSKit NIC + patch](ftp://flux.cs.utah.edu/flux/oskit/mail/html/oskit-users/msg01570.html). + +* [Sune Kirkeby's incomplete port of the Linux /dev/\{,u\}random device + driver](http://ibofobi.dk/stuff/hurd-entropy/) + * [The files](http://download.ibofobi.dk/hurd-entropy/), including a [patch + for GNU + Mach](http://download.ibofobi.dk/hurd-entropy/gnumach-entropy.diff.bz2). + +* Quick and dirty way: + + sudo cp /bin/bash /dev/random + sudo ln -s random /dev/urandom + +--- + +# Setup Tips + +Here are some tips on how to actually setup the two random devices using +Kilobugs' [random-64 server](http://kilobug.free.fr/hurd/random-64.tar.gz). +His tarball is a complete Hurd server including a pre-built binary - so you +don't need GCC or magic fingers for this! :) + +After untaring the package you copy the random binary to the `/hurd` +directory. Then you setup the translators for random and urandom. + + # settrans -c /dev/random /hurd/random \ + --seed-file /var/run/random-seed --secure + # settrans -c /dev/urandom /hurd/random \ + --seed-file /var/run/urandom-seed --fast + # chmod 0644 /dev/random /dev/urandom diff --git a/hurd/translator/random/mbox.bz2 b/hurd/translator/random/mbox.bz2 Binary files differnew file mode 100644 index 00000000..a9a4d4a6 --- /dev/null +++ b/hurd/translator/random/mbox.bz2 diff --git a/hurd/translator/storeio.mdwn b/hurd/translator/storeio.mdwn new file mode 100644 index 00000000..49d70e1b --- /dev/null +++ b/hurd/translator/storeio.mdwn @@ -0,0 +1,30 @@ +[[meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]] + +[[meta license="""[[toggle id="license" text="GFDL 1.2+"]][[toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled +[[GNU_Free_Documentation_License|/fdl]]."]]"""]] + +`storeio` is a *translator for devices and other stores*. + +It relies heavily on [[libstore]]. + + +# Examples + +You can make a file's content available as some block device (where `foo` is +the name of the file to map): + + settrans -ca node /hurd/storeio -T file foo + +You can even `ungzip` files on the fly (`bunzip2` is available as well): + + settrans -ca node /hurd/storeio -T gunzip foo.gz + +You can use the *typed store*, to create filter chains (of course this example +is kind of useless since you could use the `gunzip` store directly): + + settrans -ca node /hurd/storeio -T type gunzip:file:foo.gz diff --git a/hurd/translator/stowfs.mdwn b/hurd/translator/stowfs.mdwn new file mode 100644 index 00000000..022e3d5e --- /dev/null +++ b/hurd/translator/stowfs.mdwn @@ -0,0 +1,11 @@ +[[meta copyright="Copyright © 2008 Free Software Foundation, Inc."]] + +[[meta license="""[[toggle id="license" text="GFDL 1.2+"]][[toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled +[[GNU_Free_Documentation_License|/fdl]]."]]"""]] + +[[meta redir=unionfs#stowfs]] diff --git a/hurd/translator/tmpfs.mdwn b/hurd/translator/tmpfs.mdwn new file mode 100644 index 00000000..6d10c163 --- /dev/null +++ b/hurd/translator/tmpfs.mdwn @@ -0,0 +1,22 @@ +[[meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]] + +[[meta license="""[[toggle id="license" text="GFDL 1.2+"]][[toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled +[[GNU_Free_Documentation_License|/fdl]]."]]"""]] + +`tmpfs` is a file system server for temporary data storage without using a real +(permanent) [[backing_store]]. + +It is based on [[libdiskfs]]. + +It's not working correctly at the moment. + +[[inline +pages="hurd/translator/tmpfs/*" +show=0 +actions=yes +rootpage="hurd/translator/tmpfs" postformtext="Add a new item titled:"]] diff --git a/hurd/translator/tmpfs/notes_bing.mdwn b/hurd/translator/tmpfs/notes_bing.mdwn new file mode 100644 index 00000000..2392bd61 --- /dev/null +++ b/hurd/translator/tmpfs/notes_bing.mdwn @@ -0,0 +1,98 @@ +[[meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]] + +[[meta license="""[[toggle id="license" text="GFDL 1.2+"]][[toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled +[[GNU_Free_Documentation_License|/fdl]]."]]"""]] + +1. to run tmpfs as a regular user, /servers/default-pager must be executable by + that user. by default it seems to be set to read/write. + + $ sudo chmod ugo+x /servers/default-pager + + Then I get this error: + + tmpfs: /build/mbanck/hurd-20060825/build-tree/hurd/tmpfs/dir.c:62: diskfs_get_directs: Assertion `__builtin_offsetof (struct tmpfs_dirent, name) >= __builtin_offsetof (struct dirent, d_name)' failed. + +2. i rearranged the struct tempfs_dirent in tmpfs.h to line up with the struct + dirent. now the assert passes at line 62 of dir.c passes. + + struct tmpfs_dirent + { + struct tmpfs_dirent *next; + struct disknode *dn; + + char padding[3]; + uint8_t namelen; + char name[0]; + }; + + now ls works on an empty directory. + you can touch files, and run `ls' on them. + mkdir, rmdir works too. + fsysopts works + df works + +3. creating a symlink fails. + + old patch to get symlinks working: + + http://www.mail-archive.com/bug-hurd@gnu.org/msg11844.html + --- node.c.orig 2005-07-24 09:56:39.000000000 -0400 + +++ node.c 2005-07-24 09:55:46.000000000 -0400 + @@ -330,6 +330,7 @@ + create_symlink_hook (struct node *np, const char *target) + { + assert (np->dn->u.lnk == 0); + + np->dn_stat.st_size = strlen (target); + if (np->dn_stat.st_size > 0) + { + const size_t size = np->dn_stat.st_size + 1; + @@ -337,6 +338,7 @@ + if (np->dn->u.lnk == 0) + return ENOSPC; + memcpy (np->dn->u.lnk, target, size); + + np->dn->type = DT_LNK; + adjust_used (size); + recompute_blocks (np); + } + @@ -380,8 +382,6 @@ + error_t + diskfs_truncate (struct node *np, off_t size) + { + - if (np->allocsize <= size) + - return 0; + + if (np->dn->type == DT_LNK) + { + @@ -392,6 +392,9 @@ + return 0; + } + + + if (np->allocsize <= size) + + return 0; + + + assert (np->dn->type == DT_REG); + + if (default_pager == MACH_PORT_NULL) + + now symlinks work. + +4. can't write data to a file + + +--- + +miscellaneous notes: + +`diskfs_disk_name` could be `NULL`, but it is `"swap"` + +using `default_pager_object_set_size (np->dn->u.reg.memobj, size);` to truncate and grow. + +why are our blocks 512? shouldn't it something else? or at least settable? +or does [[libdiskfs]] demand this? + +`diskfs_get_filemap_pager_struct (struct node *np)` returns null. +shouldn't it return `default_pager`? diff --git a/hurd/translator/tmpfs/notes_various.mdwn b/hurd/translator/tmpfs/notes_various.mdwn new file mode 100644 index 00000000..90636b61 --- /dev/null +++ b/hurd/translator/tmpfs/notes_various.mdwn @@ -0,0 +1,212 @@ +[[meta copyright="Copyright © 2005, 2006, 2007, 2008 + Free Software Foundation, Inc."]] + +[[meta license="""[[toggle id="license" text="GFDL 1.2+"]][[toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled +[[GNU_Free_Documentation_License|/fdl]]."]]"""]] + + <antrik> hde: what's the status on tmpfs? + <hde> Broke + <hde> k0ro traced the errors like the assert show above to a pager problem. + See the pager cannot handle request from multiple ports and tmpfs sends + request using two differ ports, so to fix it the pager needs to be hacked + to support multiple requests. + <hde> You can enable debugging in the pager by changing a line from dprintf + to ddprintf I can tell you how if you want. + <antrik> and changing tmpfs to use a single port isn't possible?... + <hde> antrik, I am not sure. + <hde> IIRC k0ro was saying it cannot be changed and I cannot recall his + reasons why. + <sdschulze> antrik: Doing it the quick&dirty way, I'd just use an N-ary + tree for representing the directory structure and mmap one new page (or + more) for each file. + <hde> sdschulze, What are you talking about? + <sdschulze> hde: about how I would implement tmpfs + <hde> O + <azeem> sdschulze: you don't need to reimplement it, just fix it :) + <sdschulze> azeem: Well, it seems a bit more difficult than I considered. + <sdschulze> I had assumed it was implemented the way I described. + <hde> O and the assert above gets triggered if you don't have a + default-pager setup on /servers/default-pager + <hde> the dir.c:62 assert that is. + <azeem> hde: you sure? I think I have one + <hde> I am almost sure. + <azeem> mbanck@beethoven:~$ showtrans /servers/default-pager + <azeem> /hurd/proxy-defpager + <azeem> isn't that enough? + <hde> It is suppose to be. + <hde> Try it as root + <hde> I was experiecing alot of bugs as a normal user, but according to + marcus it is suppose to work as root, but I was getting alot of hangs. + <azeem> hde: same issue, sudo doesn't work + <hde> sucky, well then there are alot of bugs. =) + <azeem> eh, no + <azeem> I still get the dir.c assert + <sdschulze> me too + <sdschulze> Without it, I already get an error message trying to set tmpfs + as an active translator. + +--- + + <hde> I think I found the colprit. + <hde> default_pager_object_set_size --> This is were tmpfs is hanging. + <hde> mmm Hangs on the message to the default-pager. + +--- + + <hde> Well it looks like tmpfs is sending a message to the default-pager, + the default-pager then receives the message and, checks the seqno. I + checked the mig gen code and noticed that the seqno is the reply port, it + this does not check out then the default pager is put into a what it + seems infinte condition_wait hoping to get the correct seqno. + <hde> Now I am figuring out how to fix it, and debugging some more. + +--- + + <marco_g> hde: Still working on tmpfs? + <hde> Yea + <marco_g> Did you fix a lot already? + <hde> No, just trying to narrow down the reason why we cannot write file + greater then 4.5K. + <marco_g> ahh + <marco_g> What did you figure out so far? + <hde> I used the quick marcus fix for the reading assert. + <marco_g> reading assert? + <hde> Yea you know ls asserted. + <marco_g> oh? :) + <hde> Because, the offsets changed in sturct dirent in libc. + <hde> They added 64 bit checks. + <hde> So marcus suggested a while ago on bug-hurd to just add some padding + arrays to the struct tmpfs_dirent. + <hde> And low and behold it works. + <marco_g> Oh, that fix. + <hde> Yup + <hde> marco_g, I have figured out that tmpfs sends a message to the + default-pager, the default-pager does receive the message, but then + checks the seqno(The reply port) and if it is not the same as the + default-pagers structure->seqno then she waits hoping to get the correct + one. Unfortantly it puts the pager into a infinite lock and never come + out of it. + <marco_g> hde: That sucks... + <marco_g> But at least you know what the problem is. + <hde> marco_g, Yea, now I am figuring out how to fix it. + <hde> Which requires more debugging lol. + <hde> There is also another bug, default_pager_object_set_size in + <hde> mach-defpager does never return when called and makes tmpfs hang. I + <hde> will have a closer look at this later this week. + +--- + + <hde> Cool, now that I have two pagers running, hopefully I will have less + system crashes. + <marcus> running more than one pager sounds like trouble to me, but maybe + hde means something different than I think + <hde> Well the other pager is only for tmpfs to use. + <hde> So I can debug the pager without messing with the entire system. + <hde> marcus, I am trying ti figure out why diskfs_object_set_size waits + forever. This way when the pager becomes locked forever I can turn it + off and restart it. When I was doing this with only one mach-defpager + running the system would crash. + <marcus> hde: how were you able to start two default pagers?? + <hde> Well you most likely will not think my way of doing it was correct, + and I am also not sure if it is lol. I made my hacked version not stop + working if one is alreay started. + +--- + + <hde> See, the default-pager has a function called + default_pager_object_set_size this sets the size for a memory object, + well it checks the seqno for each object if it is wrong it goes into a + condition_wait, and waits for another thread to give it a correct seqno, + well this never happens. + <hde> Thus, you get a hung tmpfs and default-pager. + <hde> pager_memcpy (pager=0x0, memobj=33, offset=4096, other=0x20740, + size=0x129df54, prot=3) at pager-memcpy.c:43 + <hde> bddebian, See the problem? + <bddebian> pager=0x0? + <hde> Yup + <hde> Now wtf is the deal, I must debug. + <hde> -- Function: struct pager * diskfs_get_filemap_pager_struct + <hde> (struct node *NP) + <hde> Return a `struct pager *' that refers to the pager returned by + <hde> diskfs_get_filemap for locked node NP, suitable for use as an + <hde> argument to `pager_memcpy'. + <hde> That is failing. + <hde> If it is not one thing it is another. + <bddebian> All of Mach fails ;-) + <hde> It is alot of work to make a test program that uses libdiskfs. + +--- + + <bing> to run tmpfs as a regular user, /servers/default-pager must be + executable by that user. by default it seems to be set to read/write. + <bing> $ sudo chmod ugo+x /servers/default-pager + <bing> you can see the O_EXEC in tmpfs.c + <bing> maybe this is just a debian packaging problem + <bing> it's probably a fix to native-install i'd guess + +--- + + <bing> tmpfs is failing on default_pager_object_create with -308, which + means server died + <bing> i'm running it as a regular user, so it gets it's pager from + /servers/default-pager + <bing> and showtrans /servers/default-pager shows /hurd/proxy-defpager + <bing> so i'm guessing that's the server that died + +--- + + <bing> this is about /hurd/tmpfs + <bing> a filesystem in memory + <bing> such that each file is it's own memory object + <andar> what does that mean exactly? it differs from a "ramdisk"? + <bing> instead of the whole fs being a memory object + <andar> it only allocates memory as needed? + <bing> each file is it's own + <bing> andar: yeah + <bing> it's not ext2 or anything + <andar> yea + <bing> it's tmpfs :-) + <bing> first off, echo "this" > that + <bing> fails + <bing> with a hang + <bing> on default_pager_object_create + <andar> so writing to the memory object fails + <bing> well, it's on the create + <andar> ah + <bing> and it returns -308 + <bing> which is server died + <bing> in mig-speak + <bing> but if i run it as root + <bing> things behave differently + <bing> it gets passed the create + <bing> but then i don't know what + <bing> i want to make it work for the regular user + <bing> it doesn't work as root either, it hangs elsewhere + <andar> but it at least creates the memory object + <bing> that's the braindump + <bing> but it's great for symlinks! + <andar> do you know if it creates it? + <bing> i could do stowfs in it + +--- + + <antrik> bing: k0ro (I think) analized the tmpfs problem some two years ago + or so, remember?... + <antrik> it turns out that it broke due to some change in other stuff + (glibc I think) + <antrik> problem was something like getting RPCs to same port from two + different sources or so + <antrik> and the fix to that is non-trivial + <antrik> I don't remember in what situations it broke exactly, maybe when + writing larger files? + <bing> antrik: yeah i never understood the explanation + <bing> antrik: right now it doesn't write any files + <bing> the change in glibc was to struct dirent + <antrik> seems something more broke in the meantime :-( + <antrik> ah, right... but I the main problem was some other change + <antrik> (or maybe it never really worked, not sure anymore) diff --git a/hurd/translator/unionfs.mdwn b/hurd/translator/unionfs.mdwn new file mode 100644 index 00000000..7eee5245 --- /dev/null +++ b/hurd/translator/unionfs.mdwn @@ -0,0 +1,17 @@ +[[meta copyright="Copyright © 2008 Free Software Foundation, Inc."]] + +[[meta license="""[[toggle id="license" text="GFDL 1.2+"]][[toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled +[[GNU_Free_Documentation_License|/fdl]]."]]"""]] + +<http://www.nongnu.org/hurdextras/#unionfs> + + +<a name="stowfs"></a> +# `stowfs` + +... is a special mode of `unionfs`. diff --git a/hurd/translator/writing/example.mdwn b/hurd/translator/writing/example.mdwn new file mode 100644 index 00000000..170812ad --- /dev/null +++ b/hurd/translator/writing/example.mdwn @@ -0,0 +1,303 @@ +[[meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]] + +[[meta license="""[[toggle id="license" text="GFDL 1.2+"]][[toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled +[[GNU_Free_Documentation_License|/fdl]]."]]"""]] + +## Data User-Server Translator Example + +The code examples were written by Anand Babu. + +We have a data.h header file, a data.defs file, a data-user.c, data-server.c +sources files and a Makefile. + +data.h: +------- + + #ifndef _data_user_ + #define _data_user_ + + /* Module data */ + + #include <mach/kern_return.h> + #include <mach/port.h> + #include <mach/message.h> + + #include <mach/std_types.h> + #include <mach/mach_types.h> + #include <device/device_types.h> + #include <device/net_status.h> + #include <sys/types.h> + #include <sys/stat.h> + #include <sys/statfs.h> + #include <sys/resource.h> + #include <sys/utsname.h> + #include <hurd/hurd_types.h> + + /* Routine data_set_value */ + #ifdef mig_external + mig_external + #else + extern + #endif + kern_return_t S_data_set_value + #if defined(LINTLIBRARY) + (data_port, value) + mach_port_t data_port; + int value; + { return S_data_set_value(data_port, value); } + #else + ( + mach_port_t data_port, + int value + ); + #endif + + /* Routine data_get_value */ + #ifdef mig_external + mig_external + #else + extern + #endif + kern_return_t S_data_get_value + #if defined(LINTLIBRARY) + (data_port, value) + mach_port_t data_port; + int *value; + { return S_data_get_value(data_port, value); } + #else + ( + mach_port_t data_port, + int *value + ); + #endif + + #endif /* not defined(_data_user_) */ + +data.defs: +---------- + + /* Definitions for data interface + + This file is part of the GNU Hurd. + + The GNU Hurd is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + The GNU Hurd is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with the GNU Hurd; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + + subsystem data 45000; + + #include <hurd/hurd_types.defs> + + #ifdef STACK_IMPORTS + STACK_IMPORTS + #endif + + /* intr-rpc.defs defines the INTR_INTERFACE macro to make the generated RPC + stubs send-interruptible, and to prefix them with `hurd_intr_rpc_'. */ + INTR_INTERFACE + + /* set integer value to data */ + routine data_set_value ( + data_port: mach_port_t; + value: int); + + /* get integer value from data */ + routine data_get_value ( + data_port: mach_port_t; + out value: int); + +data-user.c: +------------ + + #include <stdio.h> + #include <hurd.h> + #include <hurd/hurd_types.h> + #include "data.h" + + #ifndef _GNU_SOURCE + #define _GNU_SOURCE + #endif + + int + main(int argc, char *argv[]) + { + int value=0; + mach_port_t data_server_port; + + data_server_port = file_name_lookup ("/tmp/trans", 0, 0); + printf ("data_server_port [%u]\n", data_server_port); + S_data_set_value (data_server_port, 99); + S_data_get_value (data_server_port, &value); + printf ("data->get_value: [%d]\n", value); + + return 0; + } + +data-server.c: +-------------- + + #ifndef _GNU_SOURCE + #define _GNU_SOURCE + #endif + + #include <stdio.h> + #include <getopt.h> + #include <errno.h> + #include <sys/stat.h> + #include <error.h> + + #include <hurd/ports.h> + #include <hurd/hurd_types.h> + #include <hurd/trivfs.h> + + #include "data.h" + + extern boolean_t S_data_server + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); + + int trivfs_fstype = FSTYPE_MISC; + int trivfs_fsid = 0; + int trivfs_support_read = 0; + int trivfs_support_write = 0; + int trivfs_support_exec = 0; + int trivfs_allow_open = 0x00; + int trivfs_protid_nportclasses = 0; + int trivfs_cntl_nportclasses = 0; + + int data_value; + + int demuxer (mach_msg_header_t *inp, mach_msg_header_t *outp) + { + return (S_data_server(inp,outp)||trivfs_demuxer(inp,outp)); + } + + void trivfs_modify_stat (struct trivfs_protid *cred, io_statbuf_t *st) + { + } + error_t trivfs_goaway (struct trivfs_control *fsys, int flags) + { + exit (0); + } + + kern_return_t S_data_set_value (mach_port_t data_port, int value) + { + data_value = value; + return 0; + } + + kern_return_t S_data_get_value (mach_port_t data_port, int *value) + { + *value = data_value; + return 0; + } + + int + main(int argc, char *argv[]) + { + int err; + mach_port_t bootstrap; + struct trivfs_control *fsys; + + if (argc > 1) + { + fprintf(stderr, "Usage: settrans [opts] node %s\n", program_invocation_name); + exit (1); + } + + task_get_bootstrap_port (mach_task_self (), &bootstrap); + if (bootstrap == MACH_PORT_NULL) + error(2, 0, "Must be started as a translator"); + + /* Reply to our parent */ + err = trivfs_startup (bootstrap, 0, 0, 0, 0, 0,&fsys); + mach_port_deallocate (mach_task_self (), bootstrap); + if (err) { + return (0); + } + + ports_manage_port_operations_one_thread (fsys->pi.bucket, demuxer, 0); + + return 0; + } + +Makefile: +--------- + + CC = gcc + MIG = mig + CFLAGS = -Wall -g -D_GNU_SOURCE + LDFLAGS = -lthreads -lports -ltrivfs -lfshelp -lshouldbeinlibc + INCLUDES = -I. + LCHDRS = + MIGCOMSFLAGS = -prefix S_ + OBJS = $(SRCS:.c=.o) + TAGS = etags.emacs21 + + all: data-server data-user + tags: + $(TAGS) $(SRCS) $(LCHDRS) + + stubs: data.defs + $(MIG) $(MIGCOMSFLAGS) -server dataServer.c -user dataUser.c $^ + data-server: data-server.c dataServer.c + $(CC) $^ $(CFLAGS) $(INCLUDES) $(LDFLAGS) -o $@ + data-user: data-user.c dataUser.c + $(CC) $^ $(CFLAGS) $(INCLUDES) -o $@ + clean: + rm -f *.o data-server data-user + + start: data-server data-user + settrans -ac /tmp/trans data-server + ps -x | grep data-server + end: + settrans -fg /tmp/trans + +Building +-------- + +Do + + make stubs + +to create the dataUser.c and dataServer.c files generated by mig. Create the +executables using: + + make all + +Testing +------- + +Start the data-server translator using: + + settrans -ac /tmp/trans data-server + +You can check if it is running using + + ps -x | grep data-server + +Run the data-user executable to get the resultant output. + +You can remove the translator using: + + settrans -fg /tmp/trans + +To remove the built files use: + + make clean + +Happy Hacking! diff --git a/hurd/translator/xmlfs.mdwn b/hurd/translator/xmlfs.mdwn new file mode 100644 index 00000000..cff15f59 --- /dev/null +++ b/hurd/translator/xmlfs.mdwn @@ -0,0 +1,11 @@ +[[meta copyright="Copyright © 2008 Free Software Foundation, Inc."]] + +[[meta license="""[[toggle id="license" text="GFDL 1.2+"]][[toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled +[[GNU_Free_Documentation_License|/fdl]]."]]"""]] + +<http://www.nongnu.org/hurdextras/#xmlfs> |