Page 1 of 1

How To Use 'dir2xzm'

Posted: 21 Jun 2014, 02:25
by WavyLinesAreNotReal
'dir2xzm' allows Porteus to bundle files into a loadable module. So my question is: how do I control where the contents will appear when the module is activated?

Case 1:
I create a module, and I want the contents to appear in the same place where the module is activated.

Case 2:
I create a module, and I want the contents to appear in the home directory of the user, regardless of where the module is activated.

As always, any feedback/answers are appreciated. :good:

Re: How To Use 'dir2xzm'

Posted: 21 Jun 2014, 03:29
by wread
@WavyLines AreNotReal

Elemental Watson:
Case 1) right-click the folder and choose "Make Porteus xzm-Module"
Case 2) Do case 1) and move product to users folder.

Regards! :)

Re: How To Use 'dir2xzm'

Posted: 21 Jun 2014, 03:40
by brokenman
I'm not sure I understand your case 1) ... or perhaps you don't completely understand how modules work.

Essentially modules are a compressed archive like any other (zip,tar,bz2). You can extract them into the current folder where you are.
- right click/extract
- from terminal: xzm2dir module.xzm .

The magic of the module is that when you double click (activate) the module it is mounted into the live file system. Therefore, if you want the contents of your module to appear in the /home/guest folder then the module must be made with this file structure. A working example may help you to understand more clearly.

Code: Select all

mkdir -p /tmp/mymodule/home/guest
echo "Foo" > /tmp/mymodule/home/guest/bar.txt
dir2xzm /tmp/mymodule /tmp/mymodule.xzm
You have just created a module (/tmp/mymodule.xzm) from the folder /tmp/mymodule. This module has in its file structure: /home/guest/bar.txt

Activating it will inject the module into the system and the file bar.txt will appear in /home/guest. Deactivate the module will make the file disappear.

Re: How To Use 'dir2xzm'

Posted: 22 Jun 2014, 13:31
by WavyLinesAreNotReal
@brokenman

Yes! That's exactly what I was looking for. Thanks. :Bravo:

Refering to your example, when 'mymodule.xzm' is activated, the file 'bar.txt' will always appear in the home directory, regardless of where 'mymodule.xzm' is activated from. That's case 2 exactly.

Now as for case 1, I want the file 'bar.txt' to appear automatically in the same directory that 'mymodule.xzm' was activated from. If it's possible, then great! If not, no worries. I know how to create modules now. Thanks again.

Re: How To Use 'dir2xzm'

Posted: 22 Jun 2014, 14:20
by brokenman
Excellent.

For case 1) this is not possible. The module has a predetermined file structure and can not dynamically change according to which directory you are in.