Results 1 to 6 of 6

Thread: Remaster knoppix V6.2.1 - Remove LXDE install KDE

  1. #1
    Junior Member registered user
    Join Date
    Oct 2007
    Posts
    29

    Remaster knoppix V6.2.1 - Remove LXDE install KDE

    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

  2. #2
    Junior Member registered user
    Join Date
    Oct 2007
    Posts
    29

    Remaster knoppix V6.2.1 - Remove LXDE install KDE - install1.sh part1

    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

    cd ${targetpath}
    echo "Please wait coping files...."
    cp -Rp /cdrom knoppix
    chmod +w -R knoppix

    # 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

    mkdir -p ${targetpath}/knx/tmp
    mkdir -p ${targetpath}/knx/master/KNOPPIX
    mkdir -p ${targetpath}/knx/source/KNOPPIX
    cd ${targetpath}/knx

    DATE=`date`
    echo Copying files, please wait...
    echo Start time $DATE, 1.8Ghz P4 this takes approx 8 minutes.
    cp -Rp /KNOPPIX/* ${targetpath}/knx/source/KNOPPIX

    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/


    #\cp -v /etc/resolv.conf ${targetpath}/knx/source/KNOPPIX/etc/resolv.conf

    # Update wallpaper

    \cp /media/${extfilepath}/EafBuildImages/knoppix.jpg ${targetpath}/knx/source/KNOPPIX/usr/local/lib
    \cp /media/${extfilepath}/EafBuildImages/background.jpg ${targetpath}/knx/master/KNOPPIX/

    # Update boot graphics
    \cp /media/${extfilepath}/EafBuildImages/knoppix-24-1.jpg ${targetpath}/knx/master/KNOPPIX/images
    \cp /media/${extfilepath}/EafBuildImages/knoppix-header.jpg ${targetpath}/knx/master/KNOPPIX/images

    # Update previously saved config files
    #\cp /media/${extfilepath}/EafBuildFiles/V6.2.1/45xsession* ${targetpath}/knx/source/KNOPPIX/etc/X11/Xsession.d
    #\cp /media/${extfilepath}/EafBuildFiles/V6.2.1/knoppix-autoconfig ${targetpath}/knx/source/KNOPPIX/etc/init.d
    #\cp /media/${extfilepath}/EafBuildFiles/V6.2.1/locale ${targetpath}/knx/source/KNOPPIX/etc/default

    echo "b44" >> /etc/modules # WHY????
    fi

    \cp /media/${extfilepath}/EafBuildFiles/V6.2.1/xorg.conf ${targetpath}/knx/source/KNOPPIX/etc/X11/

    # 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

    chmod 777 /install2.sh /install3.sh
    \cp /install2.sh /install3.sh ${targetpath}/knx/source/KNOPPIX
    echo
    echo "About to chroot"
    echo
    chroot ${targetpath}/knx/source/KNOPPIX ./install2.sh ${1} ${extfilepath} ${targetpath} ${user}
    echo

    }

  3. #3
    Junior Member registered user
    Join Date
    Oct 2007
    Posts
    29

    Remaster knoppix V6.2.1 - Remove LXDE install KDE - install1.sh part2

    ################################################## ################################################## #####
    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

    }
    ################################################## ######################################
    chroot2()
    {

    #Return back from CHROOT environment

    # 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

    #Blanket umount
    umount -l /media/${extfilepath} >/dev/null 2>&1
    umount -l /media/fd0 >/dev/null 2>&1
    umount -l /share1 >/dev/null 2>&1

    apt-get clean

    rm -rf ${targetpath}/knx/source/KNOPPIX/.rr_moved

    clear
    echo
    echo Making the big compressed KNOPPIX ISO 9660 filesystem - used by the cloop driver:

    # Get documented error with above, try -m -B
    mkisofs -R -U -V "Knoppixfilesystem" -publisher "Knoppix" -input-charset ISO-8859-15 -allow-leading-dots -hide-rr-moved -cache-inodes -no-bak -pad ${targetpath}/knx/source/KNOPPIX | nice -5 /usr/bin/create_compressed_fs - 131072 > ${targetpath}/knx/master/KNOPPIX/KNOPPIX
    # NOTE: can add --best for higher compression ie: /usr/bin/create_compressed_fs --best - 65536
    cd ${targetpath}/knx/master

    echo
    echo Updating the md5 hashes of the files included in the ISO, used for integrity checking
    echo

    find -type f -not -name md5sums -not -name boot.cat -not -name isolinux.bin -exec md5sum '{}' \; > KNOPPIX/md5sums

    #v6 required?
    #find -type f -not -name sha1sums -not -name boot.cat -not -name isolinux.bin \
    #-exec sha1sum '{}' \; > KNOPPIX/sha1sums

    echo
    echo "Pleae wait making the iso image"

    #mkisofs -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 ${targetpath}/knx/knoppix.iso ${targetpath}/knx/master


    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 ${targetpath}/knx/knoppix.iso ${targetpath}/knx/master

    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

    mainmenu

  4. #4
    Junior Member registered user
    Join Date
    Oct 2007
    Posts
    29

    Remaster knoppix V6.2.1 - Remove LXDE install KDE - install2.sh

    #!/bin/bash
    #Functions
    build2()
    {
    apt-get remove -y --purge openoffice.* #335M of disk space will be freed
    apt-get autoremove -y
    apt-get remove -y lxde*
    apt-get remove -y lxappearance
    apt-get remove -y lxpanel
    apt-get remove -y lxsession-edit
    apt-get remove -y lxshortcut
    apt-get remove -y pcmanfm
    apt-get remove -y compiz*
    apt-get remove -y adriane*
    apt-get remove -y gimp*
    apt-get remove -y gpicview
    apt-get remove -y synaptic
    apt-get remove -y espeak*
    apt-get remove -y libflite1*
    apt-get remove -y leafpad*
    apt-get remove -y vim-runtime*
    apt-get remove -y ocropus*
    apt-get remove -y icedove-l10n-de
    apt-get remove -y iceweasel-l10n-de
    apt-get remove -y virtualbox*
    apt-get remove -y geoip-database
    apt-get remove -y irssi
    apt-get remove -y ncftp
    apt-get remove -y rtorrent
    apt-get remove -y gconf-editor
    apt-get remove -y hplip*
    apt-get remove -y mc
    apt-get remove -y man-db
    apt-get autoremove -y
    clean1
    dpkg -i --force-all /dpkg.deb
    wget -O - http://backports.org/debian/archive.key | apt-key add -
    apt-get update
    aptitude -t lenny-backports install kde-core kdm
    aptitude -t lenny-backports install kpackage
    # apt-get remove -y `dpkg-query -l | grep i18n | grep kde | cut -d' ' -f3`
    apt-get remove -y frozen-bubble*
    apt-get remove -y gnome-utils*
    apt-get remove -y smail
    apt-get remove -y openbox-themes
    apt-get autoremove -y
    }
    ##
    build3()
    {
    apt-get remove -y emacs21 emacs21-bin-common emacs21-common emacsen-common gettext-el zile
    apt-get remove -y `dpkg-query -l | grep i18n | grep kde | cut -d' ' -f3`
    apt-get remove -y --purge openoffice.* #298M of disk space will be freed
    apt-get autoremove -y
    clean1

    }
    ####
    clean1()
    {
    deborphan | xargs apt-get -y remove

    # May need to run next line three times due to stab source package list errors
    # deborphan | xargs apt-get -y remove
    # deborphan --find-config | xargs dpkg --purge remove
    # deborphan | xargs apt-get -y remove
    # deborphan --find-config | xargs dpkg --purge remove
    # deborphan | xargs apt-get -y remove
    # deborphan --find-config | xargs dpkg --purge remove

    COLUMNS=200 dpkg -l | grep ^rc | awk '{print $2} ' | xargs dpkg -P
    apt-get autoremove -y
    apt-get autoclean
    apt-get clean
    }

    #Main#####
    echo "Var1=${1} var2=${2} var3=${3} var4=${4} "
    # ${1} ${extfilepath} ${targetpath} ${user}

    echo "nameserver xxx.xxx.xxx.xx" >/etc/resolv.conf
    route add default gw 192.168.1.254 eth0
    route del default gw 192.168.1.1 eth0

    lang=en
    echo
    echo prompt should be sh-3.1
    echo
    #read -p "in chroot passed var ${*} "

    # Already mounted
    mount -t proc /proc proc >/dev/null 2>&1
    /etc/init.d/dbus start
    /etc/init.d/acpid start
    read -p "wip"
    echo "Un-installing some packages , please wait..."

    case ${1} in
    2) build2;;
    3) ;;
    4) ;;
    5) ;;
    *) echo; read -p "Passed varibale ${1} Invailid Option"; exit;;
    esac

    # Installed packages
    # http://wiki.linuxhelp.net/index.php/...t_Guide#Remove
    # To provide list of all installed packages:
    # dpkg-query -W --showformat='${Installed-Size} ${Package} ${Status}\n' | grep -v deinstall | sort -n | awk '{print $1" "$2}'
    # apt-get remove openoffice-de-en manpages-de trans-de-en

    # Starting X-based programs
    export DISPLAY=localhost:0.0
    export LANGUAGE=en

    # \cp /usr/share/apps/ksplash/Themes/Default/locolor/* /usr/share/apps/ksplash/Themes/Default/
    chown knoppix:knoppix -R /home/knoppix

    #read -p "Pause"

    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





    # sudo umount -l /media/fd0 >/dev/null 2>&1
    # sudo umount -l /mnt/fd0 >/dev/null 2>&1
    # sudo umount -l /share1 >/dev/null 2>&1
    # sudo umount -l /nfs1 >/dev/null 2>&1
    # sudo umount -l /media/sda2 >/dev/null 2>&1
    # sudo umount -l /media/sda3 >/dev/null 2>&1
    # sudo umount -l /media/sda4 >/dev/null 2>&1
    # sudo umount -l /media/${1} >/dev/null 2>&1

    # 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:

    sudo umount -l /share1 >/dev/null 2>&1

    sudo umount -l /nfs1 >/dev/null 2>&1
    # rm /home/knoppix/.bash_history
    rm -rf /tmp/*
    rm -rf /.rr_moved

    # 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/

    rm -f /var/lib/dpkg/*old
    rm -f /var/cache/debconf/*old
    rm -f /var/cache/apt/*bin
    rm -f /var/cache/apt/archives/*.deb
    # Optional
    rm -rf /usr/share/doc/*

    #clean1 #NEEDS ATTENTION, IF DO AUTOREMOVE AFTER INSTALLING NEW PACKAGES THEN THEY WILL BE REMOVED!!!
    apt-get autoclean

    apt-get clean

    #read -p "Run only after install3.sh and changes have been made to the KDE"


    # rm /etc/X11/xorg.conf
    chmod 555 /tmp


    umount /proc
    umount /sys >/dev/null 2>&1
    umount /dev >/dev/null 2>&1
    # umount /mediasda4/knx/source/KNOPPIX/dev

    exit

  5. #5
    Junior Member registered user
    Join Date
    Oct 2007
    Posts
    29

    Remaster knoppix V6.2.1 - Remove LXDE install KDE - install3.sh

    #!/bin/bash
    echo "Passed variable = DataDrive:${1} User:${2}"
    if [ ! -d /media/${1} ]; then
    sudo mkdir /media/${1}
    fi
    sudo mount /dev/${1} /media/${1}


    #sudo dpkg-reconfigure xserver-xorg #Must run every time!!!
    lang=en
    # startx /usr/bin/startkde -- :1
    sudo /etc/init.d/knoppix-startx start
    #startx

    sudo chmod -R 777 /home/${2}/.config/
    sudo chmod -R 777 /home/${2}/.local/

    #sudo chmod -R 777 /home/knoppix/.*/
    # find how to make all the contained files 644

    #Blanket umount

    sudo umount -l /media/fd0 >/dev/null 2>&1
    sudo umount -l /mnt/fd0 >/dev/null 2>&1
    sudo umount -l /share1 >/dev/null 2>&1
    sudo umount -l /nfs1 >/dev/null 2>&1
    sudo umount -l /media/sda2 >/dev/null 2>&1
    sudo umount -l /media/sda3 >/dev/null 2>&1
    sudo umount -l /media/sda4 >/dev/null 2>&1
    sudo umount -l /media/${1} >/dev/null 2>&1

    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

  6. #6
    Junior Member registered user
    Join Date
    Oct 2007
    Posts
    29

    Remaster knoppix V6.2.1 - Remove LXDE install KDE - attarch scripts

    Test if this works.
    I have uploaded the scripts renamed from .sh to .txt as attachments.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


AMD EPYC 7282 CPU Processor 16 Cores 32 Threads 2.8GHZ up to 3.2GHZ 120W no lock picture

AMD EPYC 7282 CPU Processor 16 Cores 32 Threads 2.8GHZ up to 3.2GHZ 120W no lock

$76.00



Intel - Core i7-12700K Desktop Processor 12 (8P+4E) Cores up to 5.0 GHz Unloc... picture

Intel - Core i7-12700K Desktop Processor 12 (8P+4E) Cores up to 5.0 GHz Unloc...

$419.99



AMD Ryzen 9 5950X 16-core 32-thread Desktop Processor picture

AMD Ryzen 9 5950X 16-core 32-thread Desktop Processor

$319.99



Intel - Core i9-12900K Desktop Processor 16 (8P+8E) Cores up to 5.2 GHz Unloc... picture

Intel - Core i9-12900K Desktop Processor 16 (8P+8E) Cores up to 5.2 GHz Unloc...

$619.99



Intel Xeon E5-2697A V4 2.6GHz CPU Processor 16-Core Socket LGA2011 SR2K1 picture

Intel Xeon E5-2697A V4 2.6GHz CPU Processor 16-Core Socket LGA2011 SR2K1

$39.99



Intel Core i7-14700K Unlocked Desktop Processor picture

Intel Core i7-14700K Unlocked Desktop Processor

$409.99



Intel Quad Core i3-12100 3.3GHz 12MB LGA1700 12th Gen. CPU Processor SRL62 picture

Intel Quad Core i3-12100 3.3GHz 12MB LGA1700 12th Gen. CPU Processor SRL62

$46.08



Intel Core i5-12600KF Desktop Processor 10 (6P+4E) Cores up to 4.9 GHz Unlocked. picture

Intel Core i5-12600KF Desktop Processor 10 (6P+4E) Cores up to 4.9 GHz Unlocked.

$139.59



Intel 16 Core i7-13700T DESKTOP processor TURBO Boost 4.90Ghz CM8071504820903 picture

Intel 16 Core i7-13700T DESKTOP processor TURBO Boost 4.90Ghz CM8071504820903

$269.00



9th Gen Intel Core i5-9500 CPU 3.0 GHz, (Turbo 4.4GHz)  LGA-1151 SRF4B #95 picture

9th Gen Intel Core i5-9500 CPU 3.0 GHz, (Turbo 4.4GHz) LGA-1151 SRF4B #95

$64.99