PDA

View Full Version : FYI -- saving configuration to (larger) non-floppy device



Phyxis
01-07-2003, 08:48 AM
FYI-

Since the Knoppix saveconfig engine blindly assumes /mnt/floppy is an actual floppy, I decided to play a little game with it:

* Stop autofs daemon
* Mount hd partition or other device (in my case, PocketZip/Clik! drive) on /mnt/floppy
* Run saveconfig, as usual
* sync ; umount /mnt/floppy ;

You've now got all the space you want to save your configuration. This process assumes that you've had the system running for quite a while from a stock CD, and want to get ready for a custom CD or persistent home directory functionality.

god
02-11-2003, 10:49 PM
now am i correct to assume that is one was to do the above, and get the knoppix.sh file, take that, replace the knoppix.sh off of the original CD, then it would automattically boot to the saved options?



As in, add a few book marks, change the desktop, and perhaps add a new user without the ability to change read/write mode, and i would have a working remastered CD, or is that just a pipe dream?

delusion
02-12-2003, 06:01 PM
did anyone try this already?

can you load the setting after you booted knoppix?

'cause if this works KNOPPIX RULES.. well.. it already does, but not 100% yet ;)

god
02-12-2003, 06:06 PM
I have not... that is just something I have come up with after looking over the boards.. I am hoping a knoppix master will tell me if it wouls work...

David Douthitt
02-15-2003, 08:25 PM
I am already doing this - and without modification to Knoppix. However, modifying Knoppix would make this considerably easier (more on this later).

I have a knoppix.sh on a floppy:

exec knoppix.rb

(to run a Ruby script :-)

Then this script checks for a device on /dev/sda1 (in my case, a SanDisk Cruzer USB device with a 128M SD card) and then changes to a directory and does a mount of two ext2 disk images, and then runs a "make" on them. The make files are designed not only to install, but also to update the images on the fly from the running image.

The two disk images are used for slightly different purposes: the largest contains ~knoppix/.kde, ~knoppix/.netscape, and other directories and files from ~knoppix. The other is everything else - mainly stuff in /etc and /home/root.

The "install" uses the backup options to cp (or was it rsync?) to move the old links out of the way (to *.orig) and install a new conf file.

This Ruby script also automatically starts swap files present on a specific drive partition (of the form "swap.[0-9][0-9][0-9]"), and it also starts up selected servers (in my case, ssh, autofs, klogd, syslog, and a few others).

Using this method, I made the following (preserved) modifications to my environment:

* Automatically mount and dismount a private shared NFS share
* Automatically mount and dismount the Cruzer USB Device
* Load the Windows XP theme (think "flying under the radar" :-)
* Configure KDE panel the way I like it
* Add new binaries (into ~knoppix/bin, owned by root, and unwritable) - including Sylpheed, tcptraceroute, lua, and rc.
* Fix missing libraries (put them into ~knoppix/lib, owned by root, etc.)
* Reconfigure xmms menu item to actually be "artsdsp xmms"
* Change startup splash.
* Load xmms skins...
* Configure knoppix and root passwords and shells (/etc/passwd, /etc/shadow...)
* Configure printers.

To summarize, I've created a complete desktop environment just the way I like it and I can put it into my pocket.

The biggest problem is that floppy: I would suggest a change in loading knoppix like thus:

1. If kernel cmd parm "startup" is present, set the startup filename to it.
2. If kernel cmd parm "startdev" is present, set the startup device to it.
3. Attempt to mount the startup device on /mnt/startup.
4. If startup file was named and startup file is present on /mnt/startup, run it.
4b. If start file was unspecified, try "knoppix.sh" "knoppix.pl" "knoppix.rb" in order.

One subtle change that would make a big difference: instead of:

. knoppix.sh

use:

/bin/sh knoppix.sh

...this has two effects, one good, and one possibly bad:

1. The script convention #! becomes active, and you can use any possible scripting language without restriction. If you want csh, ruby, perl, or "other" you can do it - even one that is present only on the startup device - such as lua or rc.

2. Any variables that are set will not be carried over into the running shell. I don't know if this is a problem or not - might even be better that way...

David Douthitt
02-15-2003, 08:28 PM
I almost forgot - you can set KDEHOME (or is it KDE_HOME?) to a specific directory and then all of your user preferences for KDE will be stored there. So just set KDEHOME in your login script to a mounted hard drive or NFS mount or whatever...

Putting the KDE config on a NFS mount could be fantastic!

David Douthitt
02-15-2003, 09:10 PM
* Fix missing libraries (put them into ~knoppix/lib, owned by root, etc.)

Maybe I should say what the missing libraries are, eh?

lrwxrwxrwx 1 root root 28 Feb 15 10:08 libcapplet.so.0 -> /usr/lib/libcapplet.so.1.0.0
lrwxrwxrwx 1 root root 35 Feb 15 10:08 libpanel_applet.so.0 -> /usr/lib/libpanel-applet-2.so.0.0.9
lrwxrwxrwx 1 root root 33 Feb 15 10:08 libstdc++libc6.2-2.so.3 -> /usr/lib/libstdc++-libc6.2-2.so.3

ktheking
03-20-2003, 12:57 AM
This actually works on 3.2 version.
I've tried it with an external USB2 harddrive.

probono
03-20-2003, 02:02 PM
I almost forgot - you can set KDEHOME (or is it KDE_HOME?) to a specific directory and then all of your user preferences for KDE will be stored there. So just set KDEHOME in your login script to a mounted hard drive or NFS mount or whatever... Can you detail that a little bit please?

David Douthitt
03-20-2003, 09:18 PM
I almost forgot - you can set KDEHOME (or is it KDE_HOME?) to a specific directory and then all of your user preferences for KDE will be stored there. So just set KDEHOME in your login script to a mounted hard drive or NFS mount or whatever... Can you detail that a little bit please?

Not much to say. Just set KDEHOME in your login script; that is:

1. Edit ~/.bashrc:


vi ~/.bashrc

2. Add this line to the bottom:


export KDEHOME=/tmp/.mykde

Make sure to use your selected home directory instead of /tmp/.mykde and make sure the directory exists and is owned by user knoppix.

3. Save and exit.

To then make this effective for an already running KDE session, best thing to do is to restart KDE:

1. Save all data.

2. Close all applications.

3. Exit to a shell - I use Ctrl-Alt-F1 to get to the first virtual console.

4. At the root prompt, type:


init 2

..to enter text mode and kill the KDE session. This is where KDE will kill your KDE session, so make sure all of your data is saved.

5. After the change to "init level 2" is completed, then type the following to start KDE back up:


init 5

probono
03-24-2003, 03:59 AM
Ruby scriptThis sounds extremely interesting. If I understand you right, you can override the settings in /etc easily with your solution, something I am trying to do also. Would you mind posting your scripts somewhere?