-
Junior Member
registered user
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules

Kingston 32GB 64GB 128GB 256GB USB 3.0 Flash Drive Thumb Memory Stick Pen lot
$285.90

24x Micron MT40A512M16LY-062E IT:E 8Gb DDR4-3200 96-FBGA Memory IC
$349.99

Microsoft Office 2021 Pro Plus USB for 1PC Windows 10 & 11
$62.55

Dell 16GB PC4-21300 (DDR4-2666) Memory (SNPPWR5TC16G)
$89.99

USB 3.0 Flash Drive 32GB 64GB 128GB Memory Stick Thumb Stick Lot Pack
$826.09

Lot of (5) Samsung 32GB 2RX4 DDR4-2133 ECC REG RAM M393A4K40BB0-CPB
$875.00

Samsung 32GB DDR4-2666V-2Rx4-RB2-12 RAM M393A4K40CB2-CTD6Q
$169.00

A-Tech 8GB DDR3 1600 PC3-12800 Laptop SODIMM 204-Pin Memory RAM PC3L DDR3L 1x 8G
$21.68

Wholesale 5/10/100PCS 1GB 2GB 4GB 8GB 16GB 32GB USB 2.0 Flash Drive Memory Stick
$489.96

Lot of 4 8GB DDR4 PC4-2400T ECC Registered Server RAM 32GB 1Rx8 RDIMM MICRON
$149.99