clacker
Group: Members
Posts: 570
Joined: June 2004 |
|
Posted: Aug. 11 2004,02:23 |
|
There are a lot of ways to make DSL files. I'm a huge fan of deb2dsl, but I've noticed that a few deb files defy being made into dsl files by using that script. I've been able to make some of these into DSLs by using the following method, although if deb2dsl works (and most of the time it works fine) I like to use it.
First I load the dsl-dpkg.dsl and gnu-utils.dsl using emelfm and the MyDSL button. dsl-dpkg.dsl contains dpkg and apt-get, with which you get and install the deb files and dependencies from Debian, and gnu-utils contains the -cnewer switch for the find command which you need for this method.
Next, I become root with a sudo su command.
Now edit the /etc/apt/sources.list file with your favorite editor. Change the word "stable" to "unstable" on the second line. You need to do this because some of the other parts of the DSL installation are from the unstable packages, and this keeps you from un-installing and re-installing those packages to make things work.
apt-get update to get the latest file lists from the unstable packages.
Make a file to use as a time marker. We want to keep files created after this point, and this file acts as a time stamp. I like to use touch mymarker, which make a zero byte file.
Install your application with apt-get install mypackage (in my case I used apt-get install freecraft).
Once your installation is finished, with no errors, this would be the place to try using deb2dsl. Your package did instally correctly right? No errors? In a perfect world, this is your last step. But if deb2dsl worked, you wouldn't need the rest of this procedure, would you? If you know it didn't work there isn't any need to try it now.
Now you need to make a list of all of the files that have been changed since you began the installation. You do this with the find command. I used:
find / -not -type 'd' -cnewer mymarker | sort > myfiles
find / looks for files in the / directory and it's subdirectories. The -not -type 'd' switches select everything except directories. In other words, it finds both files and links, but doesn't print out directories. The -cnewer mymarker part looks at files modified after the mymarker file was created. sort puts every line in alphabetical order so you can read it easier.
Now I used grep to remove lines from the /dev, /proc, and /KNOPPIX directories using the -v switch.
cat myfiles | grep -v "\/dev\/" | grep -v "\/proc\/" | grep -v "\/KNOPPIX\/" > mydslfiles
I opened the file up in an editor (scite) and removed the *.deb files and basically looked around for other things I could trim (like the dsl I made with deb2dsl in my home directory). Then I wrapped the whole thing up with:
tar --numeric-owner -czvf freecraft.dsl -T mydslfiles
The -czvf switches are for creating a tar, with gzip compression, verbose output, using the following name for the archive. The -T switch tells tar to read the files to include in the archive from the following file.
I saved my dsl somewhere permanent, and then re-booted my live CD, and dumped and extracted all of the files to a temporary directory:
mkdir temp cp /mnt/hda1/optional/freecraft.dsl temp cd temp tar -xzvf freecraft.dsl
I put the etc directory under the ramdisk directory. We don't want the /ramdisk directory, but we can get rif of it be clever re-tarring. Create a ramdisk/var/tmp/mydsl.menu directory containing a file called freecraft with the line: [exec] (freecraft) {freecraft}
Change the mode on this file to 644 with chmod 644 freecraft
I re-tarred the package while I was in the ~/temp/ramdisk directory using tar --numeric-owner -czvf freecraft.dsl *
It's not nearly as easy and convenient as deb2dsl, but sometimes this way works for me when the other way doesn't. I know it's dangerous and cavalier, so it might not be good for those with a HD install. Any improvements (and there must be) or comments (and you know you have one) are welcome.
|