PDA

View Full Version : mmkcdrom - the easy KNOPPIX-CD-creation tool out now



holzhey
04-22-2003, 12:56 PM
Hello KNOPPIX tweakers,
*
I recently published the new version of my recording tool 'mmkcdrom', which
seems to become one of the easiest and most powerful tools for creating
remastering and tweaking KNOPPIX CD-Roms.
In the current release, 'mmkcdrom' can:
*
- Remaster KNOPPIX
- Edit the default boot prompt
- add knoppix.sh tweak files and record the current configuration
- The user will be supported while mounting partitions for temporary files
**as well as creating and activating the swapspace.
...
*
Please try it out and give comments and suggestions, report bugs or
hardly understandable messages and options. If you know English,
you will find a lot of misspelled words and strange constructions
in the program as well as in its documentation. Please report this too.
*
The CD-Recording tool 'mmkcdrom' is part of the plugscript configuration
system (if you unpack the plugscript package, you will find it in the
folder 'knoppix.d/important/tools'.)
*
Plugscript home page:
http://rcswww.urz.tu-dresden.de/~holzhey/plugscript
*
Download directory:
http://rcswww.urz.tu-dresden.de/~holzhey/plugscript/download
(All archives here also contain the recording tool,
if you don't know, which one to choose, take
file 'ps_knx_..._empty.tar.bz2' ).
*
Have fun.
*
Andre' Holzhey

robk
05-03-2003, 08:47 PM
hi holzhey,

I'm sure your system works perfectly, but sounds very comlicated to me at the moment. In my configuration I simply enabled the "knoppix myconf=scan" or "knoppix floppyconfig" in the boot.img file. So knoppix.sh is found automatically and I can put all stuff into it.

bye and keep on tweaking

:wink:

escherian
05-17-2003, 11:45 PM
May you please explain how deep you wish what is the use of knoppix.sh and some example of configuration ?
I ask you because I already read about this in many post , but I didn't understand it.

Thanks, m. ;-)

gloin
05-20-2003, 08:12 PM
I've been kicking around trying to figure out a way to customize a bootable CD for about a week now, and knoppix plus your script has finally made it possible. Thanks!

bongski55
06-01-2003, 05:28 AM
Why am I getting a "site forbidden" error when I try to access the site to download the scripts?

spoetnik
07-03-2003, 09:42 AM
Is it possible to burn an bootable CD from a HD-installed knoppix??

Just removed/added some packages, customized the kernel, and made some configuration changes.

Now i think it would be nice to burn this to a bootable cd.

Possible, or a dream?

SillyFly
07-03-2003, 10:57 PM
well, every knoppix was once a regular gnu/linux HD installation.

check out the following link that contains the script Klaus Knopper wrote and uses to transform his system into Knoppix :
http://listas.hispalinux.es/pipermail/meta-distros/2002-September/000046.html

spoetnik
07-04-2003, 09:38 AM
Thanks for the reply. I am glad there is way to make a bootable cd off a hd-installed knoppix.

spoetnik
07-08-2003, 10:03 PM
Is this it???


1. Install ONE PC with a distribution and configuration that you like,
and work all the details out there.

2. Create a TAR.BZ2 archive of this master system.

3. Create a very small KNOPPIX system (50MB should be sufficient)
that just boots, partitions the harddrive and installs the TAR.BZ2
archive from CD to disk.



#!/bin/sh
umask 022

/etc/init.d/autofs stop

# remove only "temporary" or saved files in the given directories
nuke(){
for i in `find "$@" -name \*.gz -o -name \*.bz2 -o -name \*.0 -o -name \*.0.log -o -name browse.dat 2>/dev/null`; do
rm -f "$i"
done
}

# set all files in the given directories to a length of zero
zero(){
for i in `find "$@" -type f -size +0 -not -name \*.ini 2>/dev/null`; do
:> "$i"
done
}

rmdir /mnt/cdrom?* /mnt/hd?* 2>/dev/null
rm -f /etc/X11/XF86Config /etc/X11/XF86Config-4 \
/etc/XF86Config /etc/XF86Config-4 /etc/sysconfig/* \
/etc/ssh/*key* \
/etc/samba/*.SID /var/lib/samba/* /var/cache/samba/* /etc/samba/*.tdb \
/dev/mouse* /dev/cdrom* /dev/cdwriter* \
/var/run/*/* /var/run/* /var/log/ksymoops/* /var/lock/*/* /var/lock/* \
/var/state/*/* /var/state/* /var/log/nessus/* /var/lib/nessus/* \
/halt /reboot /ash.static /etc/dhcpc/*.info /etc/dhcpc/resolv* \
/etc/resolv.conf /etc/*passwd- /etc/*shadow- /etc/*group- 2>/dev/null
mkdir -p /etc/sysconfig/network-scripts /etc/sysconfig/provider
cat >/etc/dhcpc/resolv.conf <<EOT
# insert nameservers here
# nameserver 127.0.0.1
EOT
chmod 644 /etc/dhcpc/resolv.conf
ln -s /etc/dhcpc/resolv.conf /etc/
rm -rf /tmp/* /var/tmp/* /var/backups/* /.ssh /root/.ssh /home/*/.ssh \
/root/.bash_history /home/*/.bash_history \
/home/knoppix/* /home/knoppix/.??* /var/lib/texmf/ls-R \
/var/spool/texmf/ls-R /var/run/screen/*
nuke /var/log /var/cache
zero /var/local /var/log /var/spool /var/mail \
/var/lib/games /var/cache/man /var/lib/wine \
/var/lib/nfs /var/lib/xkb

for i in `find /usr/*/man -name \*.\[0-9ln\]` ; do
[ -f "$i".gz -o -f "$i".bz2 ] && rm -f "$i"
done

# delete old dowloaded packages
apt-get clean

# Recreate empty utmp and wtmp
:>/var/run/utmp
:>/var/run/wtmp
# regenerate module dependencies and ls.so.cache
echo -n "Updating ld.so.cache..."
ldconfig
echo " Done."
echo -n "Updating modules.dep..."
depmod -a 2>/dev/null
echo " Done."
echo -n "Updating texhash..."
mktexlsr
echo " Done."
echo -n "Updating mandb..."
mandb -c
man doesnotexist >/dev/null 2>&1
echo " Done."
echo -n "Updating menus..."
/usr/sbin/mkmenusfromkde
echo " Done."
echo -n "Updating locate-database..."
updatedb --prunepaths="/KNOPPIX.build /mnt/hd /mnt/cdrom /tmp /usr/tmp /var/tmp"
echo " Done."

echo -n "Fixing permissions in /dev/..."
chown root.root /dev/ttyp*
chmod 666 /dev/ttyp* /dev/sg* /dev/audio* /dev/dsp* /dev/mixer* /dev/sequencer*
echo " Done".

echo -n "Removing unused architecture Kernel sources: "
for i in `ls -1 /usr/src/linux/arch/ | grep -v i386`; do
echo -n "$i "; rm -rf /usr/src/linux/arch/"$i" /usr/src/linux/include/asm-"$i"
done
echo " Done."

echo -n "Creating auto.mnt..."
cat >/etc/auto.mnt <<EOT
# Knoppix automounter file for Directory /mnt/auto
floppy -fstype=auto,user,exec :/dev/fd0
cdrom -fstype=auto,user,exec,ro :/dev/cdrom
# The following entries (if any) are auto-generated by knoppix-autoconfig
EOT
echo " Done".
echo "Setting OpenOffice Link to default EN"
rm -f /etc/alternatives/soffice.resource ; ln -sf /opt/openoffice/program/resource-en /etc/alternatives/soffice.resource
----
#!/bin/sh
# Remove unwanted init scripts and KDE-autostart files

STOP=""
for i in `ls -d1 /etc/rc?.d/* | egrep -v -e '(README|knoppix|xsession)'`; do
BASE=`basename $i`
BASE=${BASE##[KS]??}
case "$STOP" in *${BASE}*) ;; *) STOP="$STOP $BASE"; ;; esac
rm -vf $i
done

for i in $STOP; do
/etc/init.d/$i stop
done

for i in `ls -d1 /usr/share/autostart/* | egrep -v -e '(panel|kdesktop|khotkeys)\.desktop'`; do
rm -vf $i
done

chmod u+s /usr/bin/cdrecord /usr/bin/cdrdao /usr/bin/cdparanoia

# Some GTK programs HAVE to run as root. :-/
for i in `egrep -q -l -r -e '(xcdroast|ethereal)' /usr/share/applnk/.`; do
perl -pi -e 's|Exec=/|Exec=sudo /|g' "$i"
done

# Replace kdesu (needs password) by sudo (doesn't)
for i in `grep -q -l -r 'Exec=.*kdesu' /usr/share/applnk/.`; do
perl -pi -e 's|Exec=.*kdesu |Exec=sudo -H |g' "$i"
done

# Remove -ncp in xboard startup file
for i in `grep -q -l -r 'Exec=.*xboard.*-ncp' /usr/share/applnk/.`; do
perl -pi -e 's| -ncp||g' "$i"
done

for i in "alias net-pf-17 af_packet" "alias ide_cs ide-cs" "alias usbcore off" "alias autofs4 autofs"; do
grep -q "$i" /etc/modutils/aliases || { echo "$i" >> /etc/modutils/aliases; update-modules; }
done

#for i in "vendor 0x055d product 0x9001 module pwc"; do
#grep -q "$i" /etc/usbmgr/usbmgr.conf || echo "$i" /etc/usbmgr/usbmgr.conf
#done

# Euro font stuff
perl -pi -e 's/iso8859-1( |$)/iso8859-15$1/g' /etc/X11/fonts/misc/xfonts-base.alias && update-fonts-alias /usr/lib/X11/fonts/misc
----
#!/bin/bash

DEST="$1"

[ -z "$DEST" -o ! -d "$DEST" ] && { echo "Usage: $0 DESTINATIONDIR" &2 ; exit 1; }
[ ! -x /usr/bin/create_compressed_fs ] && { echo "Need /usr/bin/create_compressed_fs." ; exit 1; }
# Compression blocksize (must be multiple of 512)
# All block headers must fit into a kmalloc segment (ca. 130000 bytes)
BLOCKSIZE=65536
# BLOCKSIZE=53248
# BLOCKSIZE=102400

echo -n "Update Bootfloppy file(s)? "
read answer
if [ "$answer" = "y" ]; then
cp -uv /KNOPPIX.build/Knoppix.System/bootdisk/Knoppix/boot-*.img "$DEST"/KNOPPIX/
( cd "$DEST"/KNOPPIX && ln -f -v boot-de.img boot.img ) || exit 1
fi

[ ! -f "$DEST"/KNOPPIX/boot.img ] && { echo "Missing required file $DEST/KNOPPIX/boot.img" >&2 ; exit 1; }

echo -n "Recreate KNOPPIX compressed FS? "
read answer
if [ "$answer" = "y" ]
then
rm -f "$DEST"/KNOPPIX/KNOPPIX

# Remove files that need to be autogenerated from source dir!
echo -n "Sweep/Clean system before remastering? "
read answer
[ "$answer" = "y" ] && { . /KNOPPIX.build/Knoppix.postupgrade; . /KNOPPIX.build/Knoppix.clean; }

cat >/etc/network/interfaces <<EOT
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
# automatically added when upgrading
auto lo
iface lo inet loopback

EOT

cat >/etc/dhcpc/resolv.conf <<EOT
# Insert nameservers here
# nameserver 127.0.0.1
EOT

# Mount root read-only, so no files change while generating image
mount -o ro,remount / || { echo "Error: Cannot mount / read-only" >&2 ; exit 0; }

# Hide unwanted LOCALEs.
HIDELOCALE=""
HIDEMAN=""
MYLOCALE=$(awk -F'[="_]' '/^(LANG|LANGUAGE)=/{if(!/[$]/){x=x" "$3}}END{print x}' /etc/init.d/knoppix-autoconfig)
MYLOCALE="$MYLOCALE C en uk fi ja be"
LOCALEDIR=/usr/share/locale
MANPAGEDIR=/usr/share/man
for LOCALE in `/bin/ls -1 $LOCALEDIR`; do
[ -d "$LOCALEDIR/$LOCALE/LC_MESSAGES" ] || continue
FOUND=""
for l in $MYLOCALE; do
case "$LOCALE" in $l*) FOUND="yes" ;; esac
done
if [ -z "$FOUND" ]; then
HIDELOCALE="$HIDELOCALE -m $LOCALEDIR/$LOCALE"
[ -d "$MANPAGEDIR/$LOCALE" ] && HIDELOCALE="$HIDELOCALE -m $MANPAGEDIR/$LOCALE"
fi
done

# -U implies: -d, -l, -L, -N, -relaxed-filenames, -allow-lowercase,
# -allow-multidot and -no-iso-translate
# -iso-level 3 -U -cache-inodes -no-bak -pad \
# -hide-rr-moved \
# -m /var/lib/dpkg/available\* \
SORT=""
[ -e /KNOPPIX.build/mkisofs.sort ] && SORT="-sort /KNOPPIX.build/mkisofs.sort"
# mkisofs -pad -R -l -v $SORT \
mkisofs -R -U -v $SORT \
-V "KNOPPIX ISO9660 Filesystem" \
-P "Knopper.Net http://www.knopper.net/" \
-p "Klaus Knopper <knoppix@knopper.net>" \
-hide-rr-moved -cache-inodes -no-bak -pad \
-m /proc/\* -m /tmp/\* -m /var/tmp/\* -m /home/\* -m /initrd/\* \
-m /KNOPPIX.build -m /mnt/\*/\* -m \*.dpkg-\* \
-m /mnt/hd/\* -m /mnt/hd\* -m /mnt/cdrom\* -m /etc/fstab\* \
-m /etc/sysconfig/\* -m /etc/exports -m /etc/dhcpc/dhcpcd\* \
-m /var/spool/mail/\* -m /var/spool/mqueue/\* \
-m /etc/driveprm -m .ssh -m .bash_history \
-m /etc/printcap\* -m /var/spool/cups/tmp/\* \
-m /etc/gpm.conf -m /etc/isapnp.\* -m /etc/minirc.dfl \
-m /var/cache/debconf/\*-old -m /var/lib/\*/\*- \
-m /var/lib/\*/\*-old -m /var/log/XFree86.\* \
-m /var/samba/\*.pid -m /var/lib/samba/\* -m /var/cache/samba/\* \
-m /var/mail/\* -m /var/apt/cache/archives/lock \
-m /var/log/ksymoops\* -m /var/spool/exim/db/\* -m /etc/\*.old \
-m /etc/\*.save -m /etc/ssl/certs/\* -m \*.preserved \
-m .viminfo -m .\*.swp -m lost+found \
-m /.\?\?\* -m /root/.\?\?\* -m /etc/.\?\?\* \
-m /boot/map -m /boot/boot.0\* \
-m /usr/src/kernel\*.deb -m /usr/src/kernel\*.dsc -m /usr/src/kernel\*.changes -m /usr/src/kernel\*.tar.gz \
-m /usr/src/modules/pcmcia\* \
-m /usr/src/linux\*/drivers \
-m /usr/src/linux\*/fs \
-m /usr/src/linux\*/init \
-m /usr/src/linux\*/mm \
-m /usr/src/linux\*/net \
-m /usr/src/linux\*/vmlinu\* \
-m /usr/src/linux\*/System.map \
-m /usr/src/linux\*/ipc \
-m /usr/src/linux\*/kernel \
-m /usr/src/linux\*/lib \
-m /usr/src/linux\*/Rules.make \
-m /usr/src/linux\*/scripts \
$HIDELOCALE \
/ \
| nice -5 /usr/bin/create_compressed_fs - $BLOCKSIZE \
>"$DEST"/KNOPPIX/KNOPPIX || exit 1
mount -o rw,remount /
chmod 444 "$DEST"/KNOPPIX/KNOPPIX
# swapoff /dev/hdc2 2>/dev/null
fi

mkfinal(){
TARGET="$1.iso"
# Alternate boot record
# -eltorito-alt-boot \
# -b KNOPPIX/boot-en.img -c KNOPPIX/boot.cat \
mkisofs -pad -l -r -J -v \
-sort /tmp/knoppix.sort \
-V 'KNOPPIX' -A 'KNOPPIX CD-ROM' \
-P "KNOPPER.NET http://www.knopper.net/" \
-p "KNOPPIX CD-ROM Taskforce <knoppix@knopper.net>" \
-b KNOPPIX/boot.img -c KNOPPIX/boot.cat \
-hide-rr-moved \
-o "$TARGET" "$DEST"
}

echo -n "Recreate KNOPPIX-DE isofile '$DEST.iso'? "
read answer
if [ "$answer" = "y" ]; then
# Make sure that the boot floppy file is at the beginning of the image.
# Some controllers seem to depend on this.
rm -f /tmp/knoppix.sort
echo "$DEST/KNOPPIX/boot.img 100002" >/tmp/knoppix.sort
echo "$DEST/KNOPPIX/KNOPPIX 100001" >>/tmp/knoppix.sort
echo "$DEST/Demos/Audio/*.mp3 -100000" >>/tmp/knoppix.sort
echo "$DEST/Demos/Audio/*.ogg -100000" >>/tmp/knoppix.sort
# Make final CD Image
mkfinal "$DEST"

echo -n "Recreate KNOPPIX-EN isofile '$DEST-EN.iso'? "
read answer
if [ "$answer" = "y" ]; then
( cd "$DEST"/KNOPPIX && ln -f -v boot-en.img boot.img ) || exit 1
mkfinal "$DEST-EN"
( cd "$DEST"/KNOPPIX && ln -f -v boot-de.img boot.img ) || exit 1
fi
rm -f /tmp/knoppix.sort
fi

echo -n "BURN german CD version? "
read answer
if [ "$answer" = "y" ]; then
cdrecord -v -pad -eject dev=0,1,0 speed=16 fs=24M "$DEST.iso"
fi

pankajgadhari
08-07-2003, 09:31 AM
hi holzhey, i am also one of the knoppix bee in this ocean,
its very wonderful that u have developed mmkcdrom, but plz give me total
instructionsof its working right from the scratch coz i had seen it, but i am feeling little bit confused for that.
so plz give me detailed instruction for using that tool.
its very urgent
thanks

pankaj