Creating a dsl Extension

From DSL Wiki

   This page in other languages: EspaƱol

Note: This is a WIP

Contents

Creating a .dsl extension

From Debian packages (.deb -> .dsl)

Let's begin with the simplest scenario. There is a Woody debian package somepackage.deb that you want to convert to somepackage.dsl

If you've enabled apt:

   ~$ apt-get install somepackage

Now open a non-root shell and run user CBagger1's script deb2dsl - this is included in dsl's base system.

   ~$ deb2dsl

A series of boxes will open - simply fill in the details. Note: if somepackage.deb is for a command line program only, you can leave the "path to executable" and "menu name" (or whatever they are) boxes blank. Otherwise, you can often check the path to somepackage's main binary before running deb2dsl by doing

   ~$ which somepackage

deb2dsl will output somepackage.dsl in /home/dsl


Important points:

1. somepackage.deb needs to have been sucessfully installed before running deb2dsl (advanced users have workarounds but we'll leave this until later). This is because deb2dsl looks on the system for the installed files and then copies these into somepackage.dsl. There are good reasons for this behavior.

2. If downloading a deb package other than by apt-get (most likely via the web), put it in /home/dsl. deb2dsl checks both apt-get's cache and /home/dsl and looks for deb packages.

Note: any deb packages found in rthese locations that are also installed WILL GET INCLUDED in somepackage.dsl (this should give you a clue as to how to build extensions comprised of multiple deb packages). So make sure you do not have any irrelevant installed deb packages in these places.

After compiling from source


From rpms or various found binaries

Hand-crafting a .dsl

Once you have the system set up properly, do the following from a console:

1. switch to the / (root) directory.

2. Create a .tar.gz file with the .dsl extension containing all files you want put into the system when the .dsl is loaded.

For example:

   dsl@box:~/ cd /
   dsl@box:/ tar cvzf /mydsl/myCustomMyDSL.dsl /path/to/file1 /path/to/file2 /path/to/path1/
   tar: Removing leading `/' from member names
   path/to/file1
   path/to/file2
   path/to/path1/foo.txt
   path/to/path1/bar.txt
   ... and so on
   dsl@box:/

And that's it! your DSL extension is created as per the tar command line. (/mydsl/MyCustomMyDSL.dsl in the given example, which takes the files /path/to/file1 and /path/to/file2, and everything in /path/to/path1/.

a tar cvzf * will not work! You must enter a complete file list or via the -T parameter.

Polishing your .dsl extension

Unpacking and editing your raw extension

Here's One Way

  • Click on the file manager EMELFM.
  • Open your extension directory in one panel.
  • Copy the extension to the opposite panel.
  • In the opposite panel, change the extension name by inserting ".docs" in the middle of the name.
  • Move the new extention back into your extension directory.
  • Open the executibles extension by double clicking on it.
  • Go through all directories, removing text files that are not needed for execution, such as:
    • READMEs
    • Any dirs beginning with doc
    • Any dirs beginning with man
    • The lib/menu directory
    • The lintian stuff
    • Various other non-executable text files.
  • Close the extension, click on "Yes" to rebuild the extension.
  • Open the documents extension by double clicking on it.
  • Go through all directories, removing all executible files.
  • Close the extension and rebuild it.

Another Way

TODO

Deleting unnecesary files

Assuming initial testing of your raw extension goes well, you can now prune out unneeded files. This is necessary because .dsl extensions use ramdisk (hence, ram) - almost as a matter of principle we dsl users like to save ram (and also it's of huge help to those running old hardware).


The following files can be safely removed:

  • READMEs
  • Any dirs beginning with doc
  • Any dirs beginning with man
  • The lib/menu directory
  • The lintian stuff
  • Various other non-executable text files.


Removing COPYING or license documents, and removing the AUTHORS (or equivalent) files is a little more contentious. Strictly speaking, these ought not be removed. The AUTHORS file acknowledges the program's authors (fair enough), and COPYING actually is often legally required to remain with a distributed program under the terms of its license (usually GPL); both should be compressed with gzip rather than removed. Be that as it may, many extension builders do seem to remove these, apparently assuming that the web site information in the extension's info file will suffice.

Adding a desktop icon

TODO