Hoping I'll not the only one who wants to use V6.2.1 but needs KDE
I am posting my knoppix v6.2.1. remove LXDE and add KDE re-mastering scripts.
Beware this is very much a wip with many trial and errors merely remarked out.
The other point that I need to make is that some of my listed steps may thus prove unnecessary.
The scripts are developed from my V5.3 scripts based on the info from the wiki re-mastering site.
Three scripts install1, install2 & install3.
sda3 holds all additional files and sda4 is where all the re-mastering takes place.
Boot from v6.2.1 cd, have the scripts previously copied to fdd, mount fdd, copy them to / and run ./install1.sh
There are a couple of pre-requisits:
Additional files required on sda3
startx-startkde-start_kdeinit-start_kdeinit_wrapper from v5.3
dpkg.deb (see later)
Add your nameserver IP ( and route info if required )in install2.sh etc, I never got around to putting into a variable
Note
1 - My first re-master into KDE all of my menu entries running as user root a pop-up box would ask for root password. Although I googled and tried many things in the end as a work around I changed my user from knoppix to root. This is option 3 in my install1 menu
2 - Option 2 removes LXDE and installs KDE. I was forced to downgrade dpkg prior to installing KDE.
I feel this will give me problems in the future, does anyone know a way around this?
3 - Is the lenny-backports the correct place to install KDE from?
4 - Nothing was working in my chroot until I added to install2:
/etc/init.d/dbus start
/etc/init.d/acpid start
Does this sound correct, should I add others?
I tried adding hal but it failed.
5 - Kwite displays a blank page when loading files from my samba share, yet fine when I copy
the same file to my home directory and then re-open it, it is then OK.
6 - Same script does not work on V6.2 but in structure they look very sinilar.
7 - Finally, cannot get V6.2.1 ( original or re-mastered) to pxe connecting to an NFS share.
V6.2 does work however. Thankfully ruymbeke's customised miniroot does work for V6.2.1
over a CIFS share. More info here: http://knoppix.net/forum/threads/115...ot.ini)/page61
Here are my scripts (please let me know if there is a better way of posting code):
UPDATE scripts to follow in following posts due to exceeding character limit
Now I know there must be a better way to post these scripts, please advise.
Here is part1 of install1.shh, hit character limit again
========
#!/bin/bash
#Functions
mainmenu()
{
clear
echo
echo "Eaf Knoppix 6.2.1 RE-Master + KDE Menu - Boots via isolinux"
echo "-------------------------------------------------------------------------"
echo "1 - Quick UK lang & KDE image update -(Big KNOPPIX file untouched) "
echo "2 - Remove lxde & install kde. No startx"
echo "3 - Change default user between knoppix & root"
echo "4 - Update Build - Open into chroot KDE for further remastering"
echo "5 - Update Existing HDD Build - No format or CD copy"
echo "-------------------------------------------------------------------------"
echo "Current variables"
echo "-------------------"
echo "Targetpath=${targetpath} - External file path=/media/${extfilepath} "
echo "-------------------------------------------------------------------------"
echo "C - Change variables"
echo "F - Format ${targetpath}"
echo "X - Exit"
echo "-------------------------------------------------------------------------"
echo
read input>/dev/null
case ${input} in
1) quickbld; bldiso;;
2) basebld ${input}; chroot2 ${input};;
3) setuser; mainmenu;;
4) basebld ${input}; chroot2 ${input};;
5) basebld ${input}; chroot2 ${input};;
[cC]) update;;
[fF]) format ${input};;
[Xx]) exit;;
[Yy]) ;;
*) echo; read -p "Invailid Option"; testmenu;;
esac
mainmenu
exit
}
###
quickbld()
{
echo "You selected option 1, do you want to continue ?"
echo "(Y)es or (N)o"
read confirm
case $confirm in
[Nn]) unset confirm; return;;
esac
# 3. Edit the isolinux.cfg to make the default language "us":
echo "Deleting unneccessary files...."
if [ -f knoppix/autorun* ]; then rm knoppix/autorun*;fi
if [ -f knoppix/index.html ]; then rm knoppix/index.html;fi
if [ -f knoppix/boot/isolinux/german.kbd ]; then rm knoppix/boot/isolinux/german.kbd;fi
if [ -f knoppix/KNOPPIX/index* ]; then rm /knoppix/KNOPPIX/index*;fi
if [ -f knoppix/KNOPPIX/KNOPPIX-FAQ-ES.txt ]; then rm /knoppix/KNOPPIX/KNOPPIX-FAQ-ES.txt;fi
if [ -f knoppix/KNOPPIX/KNOPPIX-FAQ-FR.txt ]; then rm /knoppix/KNOPPIX/KNOPPIX-FAQ-FR.txt;fi
if [ -f knoppix/KNOPPIX/KNOPPIX-FAQ-IT.txt ]; then rm /knoppix/KNOPPIX/KNOPPIX-FAQ-IT.txt;fi
if [ -f knoppix/KNOPPIX/KNOPPIX-FAQ-NL.txt ]; then rm /knoppix/KNOPPIX/KNOPPIX-FAQ-NL.txt;fi
if [ -f knoppix/KNOPPIX/KNOPPIX-FAQ.txt ]; then rm /knoppix/KNOPPIX/KNOPPIX-FAQ.txt;fi
echo "Updating files...."
\cp /media/${extfilepath}/EafBuildImages/background.jpg knoppix/KNOPPIX
\cp /media/${extfilepath}/EafBuildImages/knoppix-header.jpg knoppix/KNOPPIX/images
if [ -f /media/${extfilepath}/EafBuildFiles/V6.2.1/boot.msg ]; then
\cp /media/${extfilepath}/EafBuildFiles/V6.2.1/boot.msg knoppix/boot/isolinux
fi
if [ -f /media/${extfilepath}/EafBuildFiles/V6.2.1/isolinux.cfg ]; then
\cp /media/${extfilepath}/EafBuildFiles/V6.2.1/isolinux.cfg knoppix/boot/isolinux
fi
cd knoppix
}
###
bldiso()
{
# Regen md5sums:
echo "Pleae wait regenerating the md5sums"
find -type f -not -name md5sums -not -name boot.cat -not -name isolinux.bin -exec md5sum '{}' \; > KNOPPIX/md5sums
cd ..
# Make ISO
echo "Pleae wait making the iso image"
genisoimage -pad -l -r -J -v -V "KNOPPIX" -no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -hide-rr-moved -o knoppix.iso knoppix
echo
echo Size of finished iso is:
ls -lh knoppix.iso
echo
echo Script finished,the ISO is stored in ${targetpath}knoppix.iso
read -p "Press any key to end"
}
####
setuser()
{
while :
do
echo "------------------------------------------------"
echo "Select user"
echo "------------------------------------------------"
echo "1 - knoppix"
echo "2 - root"
echo "3 - Return to main menu"
echo "------------------------------------------------"
read confirm
case $confirm in
1) user="knoppix"; break;;
2) user="root"; break;;
3) unset confirm; return;;
*) read -p "Invalid selection, try again"; continue;;
esac
unset confirm
done
}
###
basebld()
{
clear
while :
do
echo "You selected option ${1}, do you want to continue ?"
echo "(Y)es or (N)o"
read confirm
case $confirm in
[Yy]) break;;
[Nn]) unset confirm; return;;
*) read -p "Invalid selection, try again"; continue;;
esac
unset confirm
done
if [ "${1}" != "5" ]; then
#Chose format or delete
format
#delknx
cp -ar /mnt-system/boot ${targetpath}/knx/master/boot
# /cdrom directory does NOT exist in V6
cd /mnt-system && find . -size -10000k -type f -exec cp -p --parents '{}' ${targetpath}/knx/master/ \;
# Very clever, merely copies into master/KNOPPIX the directories, images & modules (including their files) and the correct file under the KNOPPIX directly. It ignores everything else!
# Update original CD boot menu
\cp /media/${extfilepath}/EafBuildFiles/V6.2.1/boot.msg ${targetpath}/knx/master/boot/isolinux
\cp /media/${extfilepath}/EafBuildFiles/V6.2.1/isolinux.cfg ${targetpath}/knx/master/boot/isolinux
fi
# Update modprobe.d
#\cp -Rp /media/${extfilepath}/EafBuildFiles/V6.2.1/etc/* ${targetpath}/knx/source/KNOPPIX/etc
if [ "${1}" = "2" ]; then
rm -f ${targetpath}/knx/source/KNOPPIX/var/cache/apt/archives/*.deb
\rm ${targetpath}/knx/source/KNOPPIX/var/lib/apt/lists/* >/dev/null 2>&1
#\cp /media/${extfilepath}/EafBuildFiles/V6.2.1/sources.list ${targetpath}/knx/source/KNOPPIX/etc/apt/sources.list
\cp ${targetpath}/knx/source/KNOPPIX/etc/apt/sources.list ${targetpath}/knx/source/KNOPPIX/etc/apt/sourcesORG.list
echo "deb http://www.backports.org/debian lenny-backports main contrib non-free" > ${targetpath}/knx/source/KNOPPIX/etc/apt/sources.list
echo "# Debian/Lenny is the stable base for this installation" >> ${targetpath}/knx/source/KNOPPIX/etc/apt/sources.list
echo "deb http://ftp.de.debian.org/debian stable main contrib non-free" >> ${targetpath}/knx/source/KNOPPIX/etc/apt/sources.list
echo "deb http://security.debian.org stable/updates main contrib non-free" >> ${targetpath}/knx/source/KNOPPIX/etc/apt/sources.list
#\cp /media/${extfilepath}/EafBuildFiles/V6.2.1/45knoppix ${targetpath}/knx/source/KNOPPIX/etc/X11/Xsession.d/45knoppix
\cp /media/${extfilepath}/EafBuildFiles/V6.2.1/startx* ${targetpath}/knx/source/KNOPPIX/etc/bin/
#startx-startkde-start_kdeinit-start_kdeinit_wrapper from v5.3
sed 's/lxde/kde/;s/LXDE/KDE/' -i ${targetpath}/knx/source/KNOPPIX/etc/X11/Xsession.d/45knoppix #Just the first match
# \cp /media/${extfilepath}/EafBuildFiles/V6.2.1/knoppix-startx ${targetpath}/knx/source/KNOPPIX/etc/init.d/knoppix-startx
sed 's/lxde/kde/g' -i ${targetpath}/knx/source/KNOPPIX/etc/init.d/knoppix-startx # all instances (2)
\cp /media/${extfilepath}/EafBuildFiles/V6.2.1/dpkg.deb ${targetpath}/knx/source/KNOPPIX/
# Stops rebooting when finished kde in chroot by replacing init 0
sed 's@/sbin/init 0@echo "/sbin/init 0"@' -i ${targetpath}/knx/source/KNOPPIX/etc/init.d/knoppix-startx
if [ -z "${user}" ]; then
grep 'USER="root"' <${targetpath}/knx/source/KNOPPIX/etc/init.d/knoppix-startx
if [ "${?}" -eq 0 ]; then
user=root
else
user=knoppix
fi
else
case "${user}" in
"knoppix")
sed 's/USER="root"/USER="knoppix"/;s/GROUP="root"/GROUP="knoppix"/' -i ${targetpath}/knx/source/KNOPPIX/etc/init.d/knoppix-startx;;
"root")
sed 's/USER="knoppix"/USER="root"/;s/GROUP="knoppix"/GROUP="root"/' -i ${targetpath}/knx/source/KNOPPIX/etc/init.d/knoppix-startx;;
esac
fi
cd ${targetpath}/knx
# NOTE: /dev gives error - wronmg fs type, bad option
mount --bind /dev ${targetpath}/knx/source/KNOPPIX/dev
mount --bind /proc ${targetpath}/knx/source/KNOPPIX/proc
mount --bind /sys ${targetpath}/knx/source/KNOPPIX/sys
DATE=`date`
echo
echo About to change root to KNOPPIX
echo chroot prompt will change to sh-3.1
echo
echo Finish time $DATE
echo
################################################## ################################################## #####
format()
{
umount -l /dev/${target} >/dev/null 2>&1
echo When in cfdisk do NOT make ${targetpath} bootable, otherwise a re-boot will be required.
echo
if [ "${1}" = "F" -o "${1}" = "f" ]; then
read -p "Partition drive prior to format? (Y)es,(N)o or (C)ancel " NEW_MASTER
case ${NEW_MASTER} in
[Yy]) cfdisk;; #echo>//dev/null
[Nn]) ;;
*) echo; echo "Test Cancelled"; exit;;
esac
fi
unset NEW_MASTER
echo Formatting /dev/${target}, please wait...
mkfs.ext3 /dev/${target}
#mount -t ext3 -rw /dev/${target} ${targetpath}
mount /dev/${target} ${targetpath}
}
################################################## ################################################## #####
delknx()
{
if [ -d ${targetpath}/knx ]; then
echo "Please wait deleting old build"
rm -rf ${targetpath}/knx/
fi
}
################################################## ################################################## #####
update()
{
echo "Current target path is ${targetpath}"
echo "Enter new path or just press return"
read temp1
if [ -n "${temp1}" ]; then
targetpath=${temp1}
mount ${targetpath}
fi
unset temp1
echo "Current external file path is ${extfilepath} - Do NOT enter the /media/"
echo "Enter new path or just press return"
read temp1
if [ -n "${temp1}" ]; then
extfilepath=${temp1}
mount /media/${extfilepath}
fi
unset temp1
# Should help if home directories nor saved in re-mastered versions
# rsync -a ${targetpath}/knx/source/KNOPPIX/home/knoppix/ ${targetpath}/knx/source/KNOPPIX/etc/skel/
# chown root:root -R ${targetpath}/knx/source/KNOPPIX/etc/skel/
# rm -rf ${targetpath}/knx/source/KNOPPIX/home/knoppix
clear
echo Now install1.sh active again
echo
echo Prompt should be back to 'root!tty1:/#'
echo Only run after install3.sh and exit to CHROOT
echo
# Put startx back to orig again by re-instating text init 0 etc.
sed 's@echo "/sbin/init 0"@/sbin/init 0@' -i ${targetpath}/knx/source/KNOPPIX/etc/init.d/knoppix-startx
rm -f ${targetpath}/knx/source/KNOPPIX/etc/X11/xorg.conf
rm -f ${targetpath}/knx/source/KNOPPIX/install2.sh
rm -f ${targetpath}/knx/source/KNOPPIX/install3.sh
rm -f ${targetpath}/knx/source/KNOPPIX/dpkg.deb
# read -p "pause"
if [ "${1}" = "2" ]; then
#Remove some files
\rm ${targetpath}/knx/master/KNOPPIX/index*.html 2>/dev/null
\rm ${targetpath}/knx/master/KNOPPIX/KNOPPIX-FAQ-*.txt 2>/dev/null
\rm ${targetpath}/knx/master/boot/isolinux/german.kbd 2>/dev/null
# Update kde splash screen
\cp /media/${extfilepath}/EafBuildImages/splash_top.png ${targetpath}/knx/source/KNOPPIX/usr/share/apps/ksplash/Themes/Knoppix
\cp /media/${extfilepath}/EafBuildImages/splash_top.png ${targetpath}/knx/source/KNOPPIX/usr/share/apps/ksplash/Themes/Default
fi
echo
echo Size of finished iso is:
ls -lh ${targetpath}/knx/knoppix.iso
echo
echo Script finished,the ISO is stored in ${targetpath}/knx/knoppix.iso
read -p "Press any key to end"
}
################################################## ################################################## #####
#Main body of script
################################################## ################################################## #####
targetpath=/media/sda4
target=sda4
extfilepath=sda3
TMP=${targetpath}/knx/tmp
swapon -s | grep "/dev" >/dev/null 2>&1
if [ "${?}" -gt "0" ]; then
mkswap /dev/sda1
swapon /dev/sda1
fi
for i in ${target} ${extfilepath}; do
mount | grep "/dev/${i}" 1>/dev/null 2>&1
if [ "${?}" -eq 0 ]; then
echo "/dev/${i} is already mounted"
else
if [ ! -d /media/${i} ];then
sudo mkdir /media/${i} >/dev/null
fi
echo "Mounting /dev/${i} /media/${i}"
mount /dev/${i} /media/${i}
fi
done
echo
echo --------------------------------------------
#rm -rfv /etc/skel #2.6.28 work - Removed
#mv /home/knoppix /etc/skel #2.6.28 work - Removed
#chown -R root:root /etc/skel #2.6.28 work - Removed
#chown -R root:root /ramdisk || error "Unable to chown root:root -ramdisk"
echo
echo About to change user to knoppix: su knoppix
echo Prompt will change to 'knoppix1tty1:#'
echo
echo KDE will start via next script - install3.sh
echo
# chmod -Rv ugo+rw /tmp
chmod 777 /tmp
echo
#umount /media/${2}
# rmdir /media/${2}
X -configure > /dev/null 2>&1
\mv xorg.conf.new /etc/X11/xorg.conf
if [ "${1}" = "2" ] ; then
dpkg-reconfigure console-data
dpkg-reconfigure xserver-xorg
else
#su - knoppix -c "/install3.sh ${2}"
su - ${4} -c "/install3.sh ${2} ${4}"
fi
## KEYBOARD & MOUSE NOT working in KDE
# echo 'hald_enable="YES"' >> /etc/rc.conf
# echo 'dbus_enable="YES"' >> /etc/rc.conf
# /usr/local/etc/rc.d/hald onestart
# /usr/local/etc/rc.d/dbus onestart
# if [ -d /media/sda2 ]; then sudo rm -rf /media/sda2; fi
# if [ -d /media/sda3 ]; then sudo rm -rf /media/sda3; fi
# if [ -d /media/sda4 ]; then sudo rm -rf /media/sda4; fi
# if [ -d /media/${1} ]; then sudo rm -rf /media/${1}; fi
# if [ -d /media/share1 ]; then sudo rm -rf /media/share1; fi
# if [ -d /media/nfs1 ]; then sudo rm -rf /media/nfs1; fi
##new end###
####
# start of script part b
####
echo
echo install2 active again
echo Make sure you have su root, make sure prompt is sh-3:
# Installing packages many logs and docs are created, If we need the space,
#rm -f /var/lib/apt/lists/*Packages
#rm -f /var/lib/apt/lists/*Release
#rm -f /var/lib/apt/lists/*Release.gpg
cp /var/lib/apt/lists/lock /
rm -f /var/lib/apt/lists/* 2>/dev/null
mv /lock /var/lib/apt/lists/
if [ -d /media/sda2 ]; then sudo rm -rf /media/sda2; fi
if [ -d /media/sda3 ]; then sudo rm -rf /media/sda3; fi
if [ -d /media/sda4 ]; then sudo rm -rf /media/sda4; fi
if [ -d /media/${1} ]; then sudo rm -rf /media/${1}; fi
if [ -d /media/share1 ]; then sudo rm -rf /media/share1; fi
if [ -d /media/nfs1 ]; then sudo rm -rf /media/nfs1; fi
exit