PDA

View Full Version : Remastering, removing KDE, starting X



mikeypants
07-19-2003, 04:56 AM
Hello all.

I've recently started playing with the idea of remastering Knoppix, and been having some fun removing, adding, and thinking of what to install.

I've removed a great deal of programs and libraries to get the compressed KNOPPIX down to 196 MB, and I've decided to test it out.

The biggest thing I've done is remove KDE completely (which doesn't seem too absurd, as lots have seem to have done it before), and use fluxbox instead (for now, but I might head towards Ratpoison for my final idea, which is along the lines of Damn Small Linux).

I've also edited /etc/init.d/knoppix-autoconfig, and switched the line..



case "$DESKTOP" in gnome|kde|larswm|xfce|windowmaker|wmaker|icewm|flu xbox|twm) ;; *) DESKTOP="KDE"; ;; esac


..to..



case "$DESKTOP" in gnome|kde|larswm|xfce|windowmaker|wmaker|icewm|flu xbox|twm) ;; *) DESKTOP="fluxbox"; ;; esac


Anyways, when I go to test my KNOPPIX out and reboot with my floppy, I can't get X to start up. If I boot with no options, X won't start. If i try booting with "knoppix 2", and then "startx", "/usr/bin/fluxbox", or "startx /usr/bin/fluxbox", I get an error of "no screens found". I'd post the whole error, but I can't copy and paste. If I try rebooting again later, I'll write it down.

I guess my question is, is there anything I've missed in the config files while remastering? I can't seem to find any other info except for changing the /etc/init.d/knoppix-autoconfig file.

If anyone can help out, I'd appreciate it. Thanks.

mikeypants
07-19-2003, 05:48 AM
Actually, this might have answered my own question.

I think I saw something about no XF86Config, but i'm not positive.

However, later in /etc/init.d/knoppix-autoconfig, there's a line that looks for..

/usr/sbin/mkxf86config

..and I don't seem to have that in my KNOPPIX directory.

Looks like I'll be rebooting with the Knoppix CD and copying the script out. I'll post later if there's any more problems.

mikeypants
07-22-2003, 07:15 PM
I found out what the problem was.

1. It was the xf86config-knoppix package. After reinstalling the script from my last post, everything ALMOST started OK, then...

2. Upon starting X, I got an error msg about the 'default' font for X missing. It was because I took out all of the xfonts-* packages, except for xfonts-100dpi and xfonts-75dpi. After trying again from scratch and keeping all xfonts-* packages in, X starts up just fine, even with my switch to fluxbox (joy!).

However, I'd like the 30 MB of free space that I can get if I remove all of the extra fonts. So, does anyone know which font the 'default' is, and how to change it to something else?

mikeypants
07-23-2003, 07:10 PM
Yet again, after lots of Googling, I found my own answer. Again, in case this is helpful to anyone..

I found the answer here (http://mm.ilug-bom.org.in/pipermail/linuxers/Week-of-Mon-20030317.txt) if anyone's interested.

More specifically, if you don't feel like reading, in /usr/X11R6/lib/X11/fonts/misc, there is a file called fonts.alias. The first line is..


fixed -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1


There's the "default font 'fixed'" that I kept getting errors on. If you change the line to..


fixed -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-1


..remaster, and test again, X starts up without a problem, and that's with ONLY xfonts-base and xfonts-75dpi installed.

(Actually, I only swapped the "semicondensed" with "normal", and that worked as well - I didn't change anything else in the line).

I'll probably end up removing the 75dpi fonts later on, as I have more programs to look at removing first. So far I'm down to 119 MB compressed. Only 70 MB more to cut down before it will fit on a business card CD-R. Rock.

mack
07-25-2003, 12:46 AM
Sounds like you're doing a serious customization and probably running into problems a lot of us did.

Since you're in the process right now, it would be cool if you could keep some log (maybe by posting here :) ) of how you shrink knoppix, what problems you run into, and what was the solution.

I'm sure a lot of people will benefit from such "guide".

I plan to do it myself next time I do some serious remastering, unless someone does it before me :lol:

mikeypants
07-25-2003, 04:17 PM
Hey mack,

No problem at all. I've been keeping some lists of what packages I've removed and other directories / files I've removed as well. I've also got (in my head, yikes) some of the problems that have come up, so I'll try to document them better. I'll straighten everything up and make it neat and post it here later on.

I haven't posted this yet, so here it is. My idea is to knock Knoppix down to fit on a 50 MB business card CD. Yes, Damn Small Linux has accomplished this already, and I've tried it out and it's great. I also have a new appreciation for its author, as getting Knoppix down that small really is a pain in the ass. However, the downsides to D.S.L. for me are..

1. It's based on Knoppix 3.1, not 3.2, so there's no Persistent Home feature (which I need).
2. I have other ideas that I feel need to be customized further, as I'm only looking to play and not work ;D

I've been toying with the idea of a Home Theater PC lately, but mostly for emulation purposes. I have a Nintendo that will be turning 18 this year, and an Atari 2600 that's at least 20, and I'd like to keep them around for a while longer. So, to me, the safest bet is to emulate them. Plus, it keeps the living room nice and clean, as there's only one PC on the floor, and not 5 video game systems. And running it all off a PC is NEAT!

I have 2 "versions" when it comes to this..

1. Set up a PC in the living room (I'm thinking about an NESPC (http://www.junkmachine.com/nintendo/members/tutorial.shtml) with a Mini-ITX mobo (http://www.mini-itx.com), laptop drives, etc.). This will be hooked up to my internal network, and can grab games (as well as mp3s and video eventually) from my server through a SMB mount. No problem, I just have to build the thing and install everything (probably Gentoo, no offense!).

2. If I'm out somewhere and would like to play a game (no video, possibly audio, but I'm shying away from that as I can do that whenever I want with Edna (http://edna.sourceforge.net)), I'd like to be able to grab my business card distro, my Lexar JumpDrive (with /home, frontend, and some ROM files), and my Super Nintendo controller(s) with the parallel port adapter I got. This way, I could pop the CD in whatever PC I'm at, plug the drive and controller in, let Knoppix boot up, auto-start my SDL-Perl frontend after X starts, and play to my lil heart's content. When I'm done, the script and X shutdown, I take everything out of the PC, boot back into Windoze, and go back to work.

As for the remastering, I've knocked the distro down to 80 MB so far, so there's only about 30 MB more to go.

Important things I need on the CD that weren't on D.S.L. (besides the basics that Debian / Knoppix needs to run):

elvis-tiny (for now, in case files need to be edited while I'm chrooted - it's so small it doesn't make a difference if it's installed or not)
fluxbox (only for now - I'm moving towards Ratpoison for a window manager, as it's 80 K compared to 1.3 MB)
libsdl* (for the frontend and emulators)
libsdl-perl (for the frontend)
perl, perl-base, perl-modules (unfortunately, this is 23 MB of space, but its needed for the frontend - I'd rather not rewrite it in C yet, but who knows what will happen..)
ratpoison
ssh (for an "as-of-yet-unimplemented" idea I have where I might use scp to get ROMs from my server to wherever I am..more on this when I figure it out for sure)
xfree86-common

Sadly, after testing things out, I still need X. I tried using the framebuffer only, but the emulators ran pretty badly. If I can get Ratpoison to boot up (problems with the fonts there too), I should be pretty set, as it's so small, it really won't account for much space.

Non-Debian programs (compiled on my Gentoo desktop PC, but run fine in Knoppix (with libpng3 added for zsnes :/ ):

Stella (for Atari)
VisualBoyAdvance (for GameBoy and GameBoy Advance)
DGen (for Genesis)
FCE Ultra (for NES)
ZSNES (for SNES)

The only problem I could see with this is that I can't imagine a lot of people really wanting to use this, as it almost seems OVER-customized. But, this is really just a personal project for me, so if you don't like it / can't use it, that's fine.

It's also a slight pain in the ass to set up, as I haven't really "generalized" it with config files yet, so everything goes by my setup on my JumpDrive. I don't know if I'll be releasing the Perl script yet, but we'll see what happens. I also don't have any of the emulators installed as packages (to keep the size down for now), and that's another problem. But, for now, it'll have to stay that way.

I also have one other slight problem which I noticed during some testing last nite. I don't know what I removed, but now everything runs as root and not as the "knoppix" user. If anyone knows what package that might be, I'd appreciate the help. I have everything set for the /home/knoppix directory (like config files for my emulators), and it's not going to work perfectly unless I fix that.

I'll post some of my other findings here later.

If you'd like, you could check out my website for any other info I might have up there (previous ideas, etc.). I might leave all of this over there as well.

http://www.tonydanzabonanza.com/main.php?page=htpc

mikeypants
07-25-2003, 09:45 PM
I've begun a sort of Knoppix howto / journal / log on my site. You can check it out at..

http://www.tonydanzabonanza.com/main.php?page=knoppix

I'd like to post it in here, but being that I'm probably going to be adding to / modifying it, it will probably be easier for everybody to just go to the site. I'll also update the "kicklist" whenever I make changes. And, being that I'm nearing the end of remastering, there seems to be a lot of tricky stuff to get rid of and workaround, so I'll note all of that too.

Please note that it is definitely a work in progress.

If there's any questions, let me know, and I'll do my best to answer them.

Stephen
07-25-2003, 10:52 PM
I've begun a sort of Knoppix howto / journal / log on my site. You can check it out at..

http://www.tonydanzabonanza.com/main.php?page=knoppix

I'd like to post it in here, but being that I'm probably going to be adding to / modifying it, it will probably be easier for everybody to just go to the site. I'll also update the "kicklist" whenever I make changes. And, being that I'm nearing the end of remastering, there seems to be a lot of tricky stuff to get rid of and workaround, so I'll note all of that too.

Please note that it is definitely a work in progress.

If there's any questions, let me know, and I'll do my best to answer them.
Checked out your page and your javascript is really annoying when you want to bookmark it, you do know it is no protection to taking the graphics all you have to do is disable javascript and then take the graphics just thought I would pass that along.

mikeypants
07-26-2003, 12:13 AM
Whoops! I completely forgot I had that in there! I originally re-used some code from my girlfriend's site where we put that in to divert some jerk-friends of ours from messing with our stuff (back in our Windoze days). I've been using Mozilla and Firebird for the past year and a half, and I haven't ever seen the pop-ups come up.

Sorry about that, it's been removed.

Thanks for the heads up!

IllegalOperation
07-26-2003, 05:21 PM
You know, this thread has given me an idea. I see alot of talented people here with the persistance to achieve a desired result and all for fun.

A few of us who have the time and are willing should get together and all come to agreement on a certain target, and work together at it. Uploading every night to CVS, and when you have 3-4 people all working toward a certain product it gets done quicker and everyone learns from the other. This is how the open sourced community works everywhere else, and alot of nice software for Linux has come to light in this manner.

mack
07-28-2003, 01:13 AM
mikeypants,

Great Journal! Thanks for posting this. :D

I'll follow the same steps on my next remaster (probably in a few days) and post if I run into any additional problems. My customization is for totally different purposes so kicklist is different. This is good. The more people follow the same steps with different kicklists, the more dependecies and weird problems we'll get, and the faq will be more complete. :lol:

And I checked about your problem with everything running as root instead of knoppix. The package in charge of this is called xsession-initscript-knoppix. Specifically, the file /etc/init.d/xsession which you probably modified heavily since you cut down a lot of X/WM stuff, originally starts with 'USER=knoppix' and later the environment is started with 'su - $USER'.

I suggest you just look at the original file and do the same in your modified version.

btw, I understand you hardcoded a lot of things to /home/knoppix. This is probably a bad idea. The "right" way seems to be storing your configuration files in /etc/skel/ (and chown to root.root). 45xsession contains a list of files/directories to copy to the user's home upon init, and its easy to change the username there.

I'll keep looking around and let you know if I run into anything else. :wink:

Mack

mack
07-28-2003, 01:16 AM
You know, this thread has given me an idea. I see alot of talented people here with the persistance to achieve a desired result and all for fun.

A few of us who have the time and are willing should get together and all come to agreement on a certain target, and work together at it. Uploading every night to CVS, and when you have 3-4 people all working toward a certain product it gets done quicker and everyone learns from the other. This is how the open sourced community works everywhere else, and alot of nice software for Linux has come to light in this manner.

Thats what we usually do. :wink:

What project did you have in mind ? (I'm not saying I have time for additional projects right now, but maybe others will).

mikeypants
07-28-2003, 04:31 PM
Hey again mack,



And I checked about your problem with everything running as root instead of knoppix. The package in charge of this is called xsession-initscript-knoppix. Specifically, the file /etc/init.d/xsession which you probably modified heavily since you cut down a lot of X/WM stuff, originally starts with 'USER=knoppix' and later the environment is started with 'su - $USER'.

I suggest you just look at the original file and do the same in your modified version.



That's odd, as I've still kept the xsession-initscript-knoppix package. I'm sure something's come along as other packages were being removed, though. I haven't modified many scripts just yet, as I'm trying to save all script editing for the very end of the remaster, after I've gotten down to my target size of 50 MB. The only real script I've modified is knoppix-autoconfig, and I've added a ratpoisonrc, and both are those are just to test and make sure that X comes up.

Actually, nevermind the above about not knowing the reason - I think the problem might be from running "knoppix 2" to get into text-mode, and THEN I'm calling startx as root, thereby running everything as root! I don't think I've tried booting without that cheatcode, as I'm just making sure the system starts up, then that "startx" starts fluxbox without a problem, and then testing out "startx /usr/bin/ratpoison" to see if it works (which it has, I think, but my ratpoisonrc wasn't totally customized, and I didn't know which Ctrl-key combination opened a new window..oops).

I'm probably going to have to change that file anyways, along with some others, but, again, I'm planning on dealing with all of that later on. I will note my changes, though, so don't worry.




btw, I understand you hardcoded a lot of things to /home/knoppix. This is probably a bad idea. The "right" way seems to be storing your configuration files in /etc/skel/ (and chown to root.root). 45xsession contains a list of files/directories to copy to the user's home upon init, and its easy to change the username there.



That does sound like a better idea, at least for the config files. That way they'll get distributed to the user, whoever it may be (root or knoppix).

:?: However, I'm still not sure what to do in the case of users, as I really don't care who runs everything. There's really going to be nothing at all open on the system to have it taken over (and it's read-only already), so I don't know if it matters whether or not root runs everything, or knoppix. At this rate, I'm planning on leaving everything the same, running everything as knoppix. If there's any other ideas for this, let me know.

The whole reason I kept things in /home/knoppix (on the JumpDrive) were:

1. If the emulators ever get an update, I won't have to remaster, only build the new version. This can be changed, though, as all of the emulators (except VisualBoyAdvance) receive very sporadic updates, if any at all. I wouldn't mind re-mastering for them. I could even keep a copy of the system on my hard disk, since it would be small enough, so I could compile the new emu, copy over, and remaster. Also, if I do remove these, I could install DGen, Stella, and ZSNES in package form. I don't know which way takes up less space, though, and that's what the final decision would probably come down to.

2. If any changes need to be made to my Perl script, I could do it whenever I want under any Linux system (my desktop Gentoo or any version of Knoppix). Again, though, the script might be able to be placed somewhere else in the filesystem, provided it works completely fine and doesn't need any changes (which, at this point, it almost does, so it might not need to be updated ever).

3. The select ROMs I have on the JumpDrive can be changed whenever I'd like. I need to look into all of that anyways, with my scp idea.

4. I also have a script which I use to load up the joystick driver. I run this manually, but would like to make it automatic (which shouldn't be a big deal to place the module in /etc/modules.conf). I also don't think there would be a major problem if I autoload them and the user doesn't have a joystick. This will be looked into later on as well.

5. The persistent home feature just seemed too cool not to use. Plus, it gets mounted on boot, provided I pass the cheatcode to Knoppix, which I was planning on hardcoding in anyways. I don't think it would be a big deal, as I've tried passing the option before, and realizing my JumpDrive wasn't connected, and it just gives a minor error about not finding /dev/sda1 and continues booting. So, if the user didn't have a JumpDrive, they wouldn't have to worry about anything.

:!: Ahh..thoughts are occuring way too fast in my head. I could probably find a place to put a /roms folder in the filesystem, and maybe release the entire system in the same way Knoppixmame and AdvanceCD were released - "here's the system, you put the ROMs in". That way, if I want to, I could keep at least part of my setup, which would only really be ROMs on the JumpDrive that could be changed whenever I want, and the fact that it's still a business card-sized CD (for me). If others want to load up the CD with ROMs and then burn it, they could use a regular 700 MB CD-R or RW. I would also have to make a special script somewhere for my scp-ing ROMs from my server, as I wouldn't want the world grabbing stuff off of me.

This is very cool. If I can get off of the whole "relying on the JumpDrive" mindset I'm in, I could probably release this to the world. Wow, that's a neat concept :shock:

As for remastering, I'm still at the point where I'm still trying to figure what else to rip out. I might copy Damn Small Linux over to see what he's removed, and if I can get any other ideas from it. I'm not done yet at all, I just need to get back into the groove after the weekend, and start removing more packages and testing. Again, any changes will be posted to the log.

Anyways, I've got to get back to work. Unfortunately I mean real work, not playing with Knoppix. I'll hopefully get some time to play later on, and I'll post everything on the log.




You know, this thread has given me an idea. I see alot of talented people here with the persistance to achieve a desired result and all for fun.

A few of us who have the time and are willing should get together and all come to agreement on a certain target, and work together at it. Uploading every night to CVS, and when you have 3-4 people all working toward a certain product it gets done quicker and everyone learns from the other. This is how the open sourced community works everywhere else, and alot of nice software for Linux has come to light in this manner.

Thats what we usually do. :wink:

What project did you have in mind ? (I'm not saying I have time for additional projects right now, but maybe others will).


I also agree with mack here too. I'd love to work on a project, but it never seems like I have enough time on my hands to work on it. I'm surprised I've had enough time to work on my remastering here. Although I would be interested to see if you had any specific project in mind as well.

mack
07-28-2003, 05:17 PM
Actually, nevermind the above about not knowing the reason - I think the problem might be from running "knoppix 2" to get into text-mode, and THEN I'm calling startx as root, thereby running everything as root! I don't think I've tried booting without that cheatcode, as I'm just making sure the system starts up, then that "startx" starts fluxbox without a problem, and then testing out "startx /usr/bin/ratpoison" to see if it works (which it has, I think, but my ratpoisonrc wasn't totally customized, and I didn't know which Ctrl-key combination opened a new window..oops).

Yes, thats the problem. xsession only runs from the runlevel that starts X, so when you "knoppix 2" - start at runlevel2, xsession is never executed and the user is never switched. Furthermore, 45xsession is also not executed, so /etc/skel/* isn't copied to ~knoppix. If you plan to work from runlevel2, you'll need to add some stuff to your scripts, but I suggest you modify runlevel3 instead, and leave runlevel2 as text-only, for solving problems.


Anyways, I've got to get back to work. Unfortunately I mean real work, not playing with Knoppix. I'll hopefully get some time to play later on, and I'll post everything on the log.

hehe, I know the feeling. :lol:
Good luck.

and btw, I like the scp approach. I've used similar things in some project I designed, although I didn't scp because port 22 is sometimes blocked and I wanted something that works everywhere. Instead, I just wget the stuff off some web server (which can be done from just about anywhere, at least via proxies). The files on the web server are GPG'ed so everything is encrypted and signed. I don't even have to trust the web server I use, since I can verify my own signature when running from the CD. 8)

IllegalOperation
07-29-2003, 11:47 AM
I don't have any projects in mind either heh. Time is not on my side either really. Looks like there are a whole lot of roll your owns popping up every day, each with their own personality. Only if there was a group of people who needed something in specific would I approach it, and I would involve others who wished to participate.

I did work for quite awhile installing Gnome with Nautilus on a stripped core, this proved to be semi difficult and Nautilus never did work correctly. Then I found a post by Klause in the newsgroup saying he had problems with Gnome so he added Ice. I left it on the shelf for now.

mikeypants
07-29-2003, 06:50 PM
and btw, I like the scp approach. I've used similar things in some project I designed, although I didn't scp because port 22 is sometimes blocked and I wanted something that works everywhere. Instead, I just wget the stuff off some web server (which can be done from just about anywhere, at least via proxies). The files on the web server are GPG'ed so everything is encrypted and signed. I don't even have to trust the web server I use, since I can verify my own signature when running from the CD. 8)

mack,

That sounds like a great idea as well. I'll try keeping that in mind if the scp idea doesn't work out for some reason.

As for the remaster, I've hit a goldmine - Java left its 52 MB library installed. I'm now down to 53.2 MB. W00t!

Besides that, SourceForge rejected my idea for a project, but I guess I can't totally blame them as there's not too much that's new and fancy for a new distribution project there.

So, I've created a site to follow the project, which is now named TuxStation. You can find it here:

http://dev.tonydanzabonanza.com/tuxstation/

It (as usual) is a work in progress, which I'll be cleaning up ASAP.