LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions
User Name
Password
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.

Notices

Reply
 
Search this Thread
Old 12-07-2005, 05:47 PM   #1
ninjabob7
Member
 
Registered: Nov 2005
Distribution: Ubuntu 9.10 and Slackware 13.1
Posts: 78

Rep: Reputation: 15
Saving Knoppix configs for two versions of Knoppix


I use two versions of Knoppix: 4.0.2 and 3.8.2. The problem I had was how to put configuration files for both on the same partition. Since the names of the files, by default, are knoppix.sh and configs.tbz, and the config boot parameter only works with the root directory, I had to figure out how to put both configs in the same directory. After some exploring and tinkering, I modified my knoppix.sh so it would detect what version of knoppix was running and extract a different file depending on the version. Here's the modified knoppix.sh:
Code:
#!/bin/sh
[ "`id -u`" = "0" ] || { echo "You need root privileges to modify the system!" >&2 ; exit 1; }
VERSION=""
if grep 3.8.2 /cdrom/boot/isolinux/boot.msg > /dev/null; then
VERSION=3.8.2
fi
if grep 4.0.2 /cdrom/boot/isolinux/boot.msg > /dev/null; then
VERSION=4.0.2
fi
echo " [1mRunning Knoppix version $VERSION. [0m"
if [ $VERSION = 3.8.2 ]; then
[ -d "$1" ] && CONFIGS="$1/knoppix-3.8.2-configs.tbz"
elif [ $VERSION = 4.0.2 ]; then
[ -d "$1" ] && CONFIGS="$1/knoppix-4.0.2-configs.tbz"
fi
[ -f "$CONFIGS" ] || CONFIGS="/cdrom/KNOPPIX/configs.tbz"
[ -f "$CONFIGS" ] || CONFIGS="/mnt/floppy/configs.tbz"
if [ -f "$CONFIGS" ]; then
echo " [1mExtracting config archive $CONFIGS... [0m"
tar -jpPtf "$CONFIGS" | while read i; do rm -f "$i"; done
tar -jpPxf "$CONFIGS" ; chown -R knoppix.knoppix /home/knoppix
fi
killall pump 2>/dev/null && sleep 2 && killall -9 pump 2>/dev/null && sleep 2
echo " [1mStarting daemons... [0m"
for i in  ifupdown networking; do [ -x /etc/init.d/$i ] && /etc/init.d/$i start; done
To set this up, run the "Save Knoppix Configuration", rename configs.tbz, and overwrite knoppix.sh with this file. You will probably want to back it up so you can fix it quickly the next time you save the configs.
I hope this will be useful to someone.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
KNOPPIX 4.0.2 saving work jhirshon Linux - Newbie 2 10-19-2005 05:01 PM
Knoppix flash drive for saving ThirtySixBelow Linux - Newbie 3 08-23-2005 05:11 AM
Knoppix 3.8.1 on Vmware: Saving Settings Alectrus Linux - Newbie 6 05-09-2005 02:33 AM
Knoppix Versions brianrw Linux - Software 1 09-30-2004 08:52 AM
Saving the config in KNOPPIX? Konig Debian 1 01-09-2004 09:15 AM


All times are GMT -5. The time now is 11:12 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration