How to make DSL smaller?


Forum: Other Help Topics
Topic: How to make DSL smaller?
started by: QmQ

Posted by QmQ on May 05 2005,17:07
Hello everyone :)

Firstly (as this is my first post) I'd like to say hi ("Hi.") ;) and say that DSL's a superb tool, or whatever to call it.


Now, to the point.

I'd like to make my own 'version' of DSL, but not just to add .DSL packages to the current version, but to remove a few I don't need and add a few I desire :)
Is this called REMASTERING?

If so please just tell me and I shall read through that 36 pages long topic and this one can be deleted.

If however what I want is not remastering, then please tell me if it can be done. (and how would be nice too ;) )


Thanks for help.

Regards,
QmQ

Posted by QmQ on May 05 2005,17:24
Thanks :)

I'm under DSL now (LiveCD) and I have no idea how to mount my USB pendrive so I could write the image there...
Could you help me? :)

Posted by friedgold on May 05 2005,17:34
When it comes down to it remastering DSL is basically just

-Extract files from KNOPPIX image (easiest to do from within DSL since the image is already mounted)
-Make you changes to these files
-Recreate the KNOPPIX image
-Remake the .iso and burn to cd

The big remastering thread / < this page > has lots of info on remastering DSL

The easiest way to make your changes is to chroot into the directory you've extracted the files to. Once you've done this you could re-enable apt-get and use that to remove some stuff. Since not everything in DSL is a debian package some programs will need to removed manually

I found some useful info < on the Knoppix Remastering Howto > (remastering knoppix is pretty much the same as remastering DSL)

So you could do something like

Extract files from KNOPPIX image (see The remastering thread / < this page >)

chroot /path/to/files/
mount -t proc /proc proc
dpkg-restore
dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -n Shows packages sorted by size
apt-get remove --purge <name-of-package-to-remove> Remove stuff
deborphan Show any orphaned packages
deborphan | xargs apt-get -y remove Remove orphaned packages
apt-get clean Clear out apt-get cache
rm <other stuff to remove here>
umount /proc
exit

Then recreate the KNOPPIX image, make your DSL iso, and burn your DSL cd (again see the remastering thread / < this page >)

One draw back of this method is apt-get is enabled which takes up additional space. It probably possible to remove apt manually after its been restored, but I wouldn't know which files to delete

Posted by friedgold on May 05 2005,17:46
Quote (QmQ @ May 05 2005,13:24)
Thanks :)

I'm under DSL now (LiveCD) and I have no idea how to mount my USB pendrive so I could write the image there...
Could you help me? :)

To mount your pendrive try opening emelfm and going to /mnt. You should see something like sda/sdb/sdc/sdd indicating your usb drive. Simply right click on it and choose mount
Posted by QmQ on May 05 2005,17:48
Yes, thanks, I've just managed a second before I saw this reply :)
Though I had to restart the computer with the USB drive for DSL to see it.

I'll now try to make my own DSL :D

Another question:
How to change the refresh rate?! This 60Hz is killing my eyes! :P


EDIT
Yet another one:

The mount proc part doesn't want to work...
It says that the mount point proc doesn't exist.
Am I doing something wrong? :P

Posted by QmQ on May 05 2005,21:18
OK, I've been trying to do this for quite some time now and I think I know what the problem is.


This part:
Code Sample

chroot /path/to/files/
mount -t proc /proc proc


doesn't work at all :( It says:
Code Sample

root@box:/mnt/test/cd# chroot /mnt/test/cd
chroot: /bin/bash: No such file or directory

and  that's it. No idea what to do next.

Maybe the proc mounting doesn't work cause of this. No idea.

And finally, MANY of my apt-get purges end with errors of this kind:

Code Sample

Purging configuration files for xfonts-75dpi ...
dpkg: error processing xfonts-75dpi (--purge):
cannot remove old config file `/etc/X11/fonts/75dpi/xfonts-75dpi.alias' (= `/KNOPPIX/etc/X11/fonts/75dpi/xfonts-75dpi.alias'): Read-only file system
Errors were encountered while processing:
xfonts-75dpi


So, as of what I understand the problem is that I try to remove packages from the DSL I'm under and not from the extracted KNOPPIX source hence read-only, hence error.

And all this is probably because of the chroot not working like I'd like it to work, so please help me with that.


Thanks a lot :)

Posted by friedgold on May 06 2005,08:52
From your replies it sounds like /mnt/test/cd/proc and /mnt/test/cd/bin/bash don't exist. They certainly should do if the files have been extracted properly. If you're following < this tutorial > you would extract the files using

mkdir /mnt/test/cd/source
cd /mnt/test/cd
cp -Rp /KNOPPIX/* source
cp -Rp /KNOPPIX/.bash_profile source

This requires you to be booting from a livecd/frugal install (doing it from a hdinstall is a whole different matter). Also you need a decent amount of free space on the device mounted at /mnt/test (probably at least 200MBs). I guess if you've got enough memory you could do the entire remaster in /tmp.

Anyway once you've extracted the files you should be able to chroot into /mnt/test/cd/source.

Posted by QmQ on May 06 2005,16:34
Well, this /mnt/test is a 400MB .IMG file on my FAT32 drive :P and I'm using LiveCD with toram.
I'll try in a few minutes. I'm having a tiny idea of a possible mistake I've been making :P

However, is the chroot needed to mount proc?
If so, then I hope I'll manage.
If not, then something is still bad :(

UPDATE: Yeeee, it's working! :D

Anyhow, what does this 'proc' do? What is it?

Posted by QmQ on May 06 2005,18:49
This is worth a new post :D

It's fine now, I was making an idiotic mistake :]
Still, some apps can't be uninstalled, maybe they're in use or something...

Nevertheless, apart from things on that list I'd very much like to remove:

FLwriter
xZGV
siag
Sylpheed
Beaver
axyFTP
...and maybe a few more, but when I know how to remove one [or a few] of theses I think I'll manage :)

Could you tell me how to do that?
I'd like to remove both the programs and their icons from the standard desktop.

Posted by Guest on May 06 2005,18:54
Quote (QmQ @ May 06 2005,12:34)
Well, this /mnt/test is a 400MB .IMG file on my FAT32 drive :P and I'm using LiveCD with toram.
I'll try in a few minutes. I'm having a tiny idea of a possible mistake I've been making :P

However, is the chroot needed to mount proc?
If so, then I hope I'll manage.
If not, then something is still bad :(

Anyhow, what does this 'proc' do? What is it?

With what you are doing, you are trying to transfer control from one directory tree to another seamlessly and run linux from that new tree.  This will work provided that the new directory tree is fully populated with the bare essentials.

That is not what you want to do.

I think a simple way to reduce the size of DSL is to first run DSL with gnu-utils.dsl and dsl-dpkg.dsl installed, and use the apt-get and dpkg utilities to note down (and not delete yet) all the debian packages installed.  Then copy the contents of /KNOPPIX/ directory to some place and start deleting items from that copy based on the notes you made.  You delete the items manually.  There are some non-Debian things that came with DSL; figure out their dependencies and delete the things you don't need.  And finally, follow the latter part of the "big remastering thread" on how to create the new KNOPPIX cloop file (where they start using "mkisofs -R ...") and the new DSL iso.

Hopefully you did not delete too much...

Posted by QmQ on May 06 2005,20:59
Well, it's like this:

I know how and what to do, it even seems to work, though as for now I've managed to make a non-X version of DSL [ :D startx went into oblivion somewhere in the process ].
But if I try again [I'm too tired to do it now] tomorrow I will probably manage to make a working .ISO without XMMS [no problems with removing it] and that's about it... :(

Those non apt-get programs [Beaver & Co.] probably take a lot of room and I don't need them at all...
But I'm too newbie in linux to remove them alone so if someone could gimme a little hint I'd be grateful :)



And by the way (cause I've never mentioned) I'm trying to make a working DSL with:
- GCC,G++,make (gcc1.dsl)
- emacs (no idea where to get it from apart from GNU page, but it's HUGE there [20MB] :( )
- maybe (I don't really need it for now) xwpe or another debugger
- some additional libraries for C/C++ programming

...and I'd like all that to be an ISO of max. 64MB [Pendrive limit]


So, basicly, I'm making (trying to make ;) )a "programmer's DSL".
Is it even possible to make such a thing and keep it under 64MB?

Hmm. Or maybe someone had already made a similar thing and I'm wasting time and my eyes ( stupid 60Hz refresh :P - still no idea how to set that to 85Hz) instead of doing something creative (like sleeping) ? :)

Posted by Guest on May 07 2005,01:55
I made one of those "Programmer's DSL" remaster containing the following:

gcc, g++, g77, make, coreutils, binutils, findutils, bison, flex, libncurses5-dev, libreadline4-dev, perl, gnuplot

Except for gnuplot, these are the bare essentials that you will need to compile a lot of console-based programs (especially the GNU ones that uses "./config - make - make install").  I added gnuplot because it is needed for plotting in Siag.

All of them were retrieved in one shot by apt-get from the debian testing package using this procedure by clacker:

< http://damnsmalllinux.org/cgi-bin....;t=2363 >

So this procedure created a dsl extension first.  Afterwards, use the procedure from the "big remastering thread" by meo to merge this dsl extension with the original KNOPPIX cloop file and create a new one.  This produced a remaster that is 80MB with nothing removed from the original.

If you want to cut its size further, just wade through the dependencies and delete those things that you do not need.  Example is firefox, which is self-contained in its own folder /usr/local/firefox and is 18MB uncompressed (probably 7MB savings).  Then there is gnuplot and the man files of that "programmers dsl" that was included in the 80MB count.  Other than these, everything else are small that I doubt if you will be able to reduce the remaster size back to 50MB.

Don't let this discourage you though.  The learning process was fun and worth every bit of the effort.

Posted by cbagger01 on May 07 2005,03:48
If you want to save space, maybe you can get by with
"emacs lite" instead of full blown emacs.

For example, older versions of DSL contained the "zile" program which is a much lighter program that works like a stripped down emacs.

It certainly isn't 20MB, that's for sure.

Posted by QmQ on May 07 2005,12:43
You know what, I'm thinking I won't be able to maintain <64 MB size and install all the things I want so I can as well use the standard DSL and add stuff instead of deleting it and record it on a CD and use the USB for storing stuff. :)

I'll install all the mentioned above packages, normal emacs with C syntax higlighting and some other things :)


I'm having problems with man though... The online version is shall we say "fine", but I need to have a normal offline version too. Can it somehow be added?



And thanks for help everyone :)

Posted by Guest on May 07 2005,16:42
Quote (QmQ @ May 07 2005,08:43)
You know what, I'm thinking I won't be able to maintain <64 MB size and install all the things I want so I can as well use the standard DSL and add stuff instead of deleting it and record it on a CD and use the USB for storing stuff. :)

USB remaster is more flexible and faster than CD.  Besides, where is the challenge when you know that you have 700MB of space to fill?  You might just as well use KNOPPIX LiveCD.

If you are open to suggestions, mine will be for you to make your own bare-bones "Programmer's DSL" on your USB pen drive.  This will teach you how to balance functionality and utility.  Afterwards, create extensions (tar.gz, dsl, or uci) of other things you like but are not always needed and put these on the CD-RW.  You can do this on the things you removed from the original DSL iso.  This way you become a "strike anywhere" programmer.

The good thing about this is if you happen to make an extension that you think others will like, you can submit it to the on-line DSL extension repository.  And it will be easy to update your "Programmer's DSL" remaster whenever John releases new versions of the DSL base iso; you may even write a script that will do this automatically.

Posted by QmQ on May 07 2005,23:00
Hmm well that's exactly what I wanted to do in the first place, but I don't seem to be doing it right.
I need to remove a lot of non apt-get things that I do not need, but I have no idea where to find them. I know how to remove [delete :P ] FireFox and Siag but all those other programs I just can't find. I'm too new to linux to know where to look... But I'm trying :>

Anyway, after removing [or deleting] this stuff:
- Firefox
- Siag
- XMMS
- Ted [apt-get name was ted-common, I've found out that it's a text editor]
and remaking the ISO everything boots fine and works apart from the X background & icons. It doesn't simply show up and I have not the slightest idea why that is.
Any ideas?

Posted by Guest on May 08 2005,03:45
Quote (QmQ @ May 07 2005,19:00)
and remaking the ISO everything boots fine and works apart from the X background & icons. It doesn't simply show up and I have not the slightest idea why that is.
Any ideas?

I think you are still trying to do that chroot thing.  This will work with the original Knoppix distributions because they are pure Debian and the dependencies are fully consistent with the items on the package catalogue.  The apt-get and dpkg utilities rely very heavily on the correctness of this catalogue to know what files you actually have on your system.  Whenever a new software is installed (or old software modified) in a non-Debian manner (such as in DSL), the Debian tools will have no clue about this.  Therefore, when you delete the Debian software using the Debian tools, you might remove some files that are needed by the non-Debian things.

My advise for you will be this:  if you want to learn how to remove things, first learn how they got there in the first place.

For example, suppose you want to remove software ABCDXYZ.  Search the net for the source tarball of this software (take note of the version) and unzip it somewhere on your system.  Read its README and INSTALL (and Makefile if possible) files for ideas on how this software will be installed.  Take note of parameters such as the default value for --prefix (/usr, /usr/local, /usr/local/ABCDXYZ, ...) and things to which this parameter is acually prefixed on.  Then you will have some idea on the possible locations of the files on the system.  Then if the Makefile is available, browse through it to look for the rule "install:" and the commands following it.  This will tell you what things actually get installed to which locations.  After noting these things down, browse through the DSL directory tree to look for these items (remember that John had to remove many things such as documentation files).

This way you do not depend on the Debian tools.  And this way you get to understand what your "Programmer's DSL" will be doing when you actually get to use it later.

Posted by QmQ on May 08 2005,13:39
Well, that sounds like a good idea. I shall try.


So I do this:

1. Run original LiveCD DSL
2. Install gnu-utils.dsl and dsl-dpkg.dsl
3. Figure out what is where and how it got there
4. Make a copy of /KNOPPIX/
5. Based on the information I got in point 3 remove the things I don't need from that copy.
6. Recreate the KNOPPIX file and make a new .ISO

Correct me please if I'm wrong anywhere.

I just have a question about point 3 here.
Do I want to remove all things manually?
What I mean is some programs are just untared and some are installed by which I mean that they're somehow on the system's list.

For example XMMS:
It's on the apt-get list but I don't apt-get remove it. I find it's homepage, get the tarball, analyse it and then remove it manually right? What about it's availability in the system? I mean it's presence on the apt-get list. Even when I remove it manually it'll still be there right? And DSL will think it's still installed. So how to do that in a 'clean' way so that I don't crash it all.


I hope I made myself clear enough to be understood cause when I read what I've just written I myself get confused. :blues:

Posted by Guest on May 08 2005,18:42
Quote (QmQ @ May 08 2005,09:39)
Even when I remove it manually it'll still be there right? And DSL will think it's still installed. So how to do that in a 'clean' way so that I don't crash it all.

DSL does not know, and it does not have the ability to know.  Only the Debian package management tools will have to know.  And that is why you first create the "Programmer's DSL" by adding stuff to it, then you start removing things manually.  So essentially, you make use of the Debian package management (a.k.a. apt-get) to retrieve the things you need, and not use it to remove things.

On the other hand, if you were John or Robert or ke4nt1 or cbagger01 or ..., then you obviously would know which things in DSL are Debian and which are not and which Debian things are safe to purge out using Debian tools without affecting the non-Debian things.

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.