-
Senior Member
registered user
Re: file ordering with KNOPPIX.build
Originally Posted by
blivius
I use Klaus's KNOPPIX.build scripts to do my remastering with great success.
But the one thing I have yet to figure out is how to order files on the CD
when making the iso.
Unless I'm missing something his script looks for a file "/KNOPPIX.build/mkisofs.sort"
and if it exists it sorts per the way files are arranged in that file. How Klaus creates
"/KNOPPIX.build/mkisofs.sort" remains a mystery to me.
eadz, if you like I can provide you with the slightly modified KNOPPIX.build
scripts I use plus a small how-to that explains their usage. Do you have a download area?
This is how the sort file is created. ( unless there are 2 knoppix.sort files.. )
Code:
# 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
and Yes, you could always post the scripts in the forum?
-
sort files + build scripts
Well there are two sort files, /tmp/knoppix.sort controls
the ordering of the boot.img etc. It does not handle
the ordering of files on the compressed filesystem (/cdrom/KNOPPIX/KNOPPIX)
Here's the scripts I use and a readme. I hope line wrapping
doesn't mess them up. -blivius
$ cat Knoppix.blivius.readme
How to remaster knoppix from inside chroot using Klaus's build tools [1] [2]
================================================== ==================
In your chroot jail make these 2 directories from the root level
mkdir /KNOPPIX.build
mkdir /KNOPPIX.build/cdrom
copy Knoppix.clean to /KNOPPIX.build
copy Knoppix.mkcompressed to /KNOPPIX.build
copy Knoppix.postupgrade to /KNOPPIX.build
and make sure they have execute permissions
Inside /KNOPPIX.build/cdrom you need to copy over
all the files and dirs that were on the original knoppix cdrom
(along with your changes, if any, perhaps you changed the boot.img for example).
Ofcourse one exception is the original /KNOPPIX/KNOPPIX compressed filesystem
which is not needed naturally as we are making a new one.
Now cd to /KNOPPIX.build
Run the following and watch the magic.
It will ask you a few questions.
./Knoppix.mkcompressed /KNOPPIX.build/cdrom
Once it finishes ( it can take an hour or so) you will
whave a finished iso suitable for burining as
/KNOPPIX.build/cdrom-EN.iso
Regards,
blivius
[1] Note I made some small changes to Klaus's build scripts to suit my needs
[2] One non-essential piece is missing and that is /KNOPPIX.build/mkisofs.sort
this is a file the determines in what order things get placed on
the CD. I believe Klaus has some way of generating this file.
But it is not clear to me how he did it. Feed back is welcome on this point.
$ cat Knoppix.postupgrade
#!/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 autofs autofs4"; 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
#blivius# # Euro font stuff
#blivius# 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
$ cat Knoppix.clean
#!/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/ifstate /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
# umask=000 only works for msdos/vfat floppies, but otherwise the floppy is read-only.
floppy -fstype=auto,user,exec,umask=000 :/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
$ cat Knoppix.mkcompressed
#!/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
#blivius# # Mount root read-only, so no files change while generating image
#blivius# 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/cups/certs/\* -m /etc/cups/\*.O -m /etc/cups/ppd/\* \
-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"
}
#blivius# echo -n "Recreate KNOPPIX-DE isofile '$DEST.iso'? "
echo -n "Skipping over german version"
#blivius# read answer
answer=y
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
## echo mkfinal "$DEST" ## echo added by blivius to disable
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
echo disabled by blivius, it wants to do...
echo cdrecord -v -pad -eject dev=0,1,0 speed=16 fs=24M "$DEST.iso"
fi
-
Senior Member
registered user
Remastering
Thanks for sharing that info blivius
I thinks its wonderful to have both eadz manual remaster howto and your knoppix.build howto all on one page.This site rox!
-
Senior Member
registered user
Helpful site
I stumbled upon this site http://savannah.gnu.org/cgi-bin/view...ix/readme.html which has a bit of info on remastering. He has some helpful scripts which consolidates some of the steps in eadz's howto.
As more and more info is gathered on remastering, it would be really cool to have these things consolidated into a single (or series) customization script(s) that would walk one through the whole remastering process.
-
Desktop Wallpaper Change?
Hi, I've been trying to remaster the KNOPPIX CD and even though I change the desktop wallpaper it always changes back to the knoppix.gif. It manages to save the other wallpaper fine when I use floppyconfig.
Does anyone have a solution to this?
-
Senior Member
registered user
Re: Desktop Wallpaper Change?
Originally Posted by
Jamie Nelson
Hi, I've been trying to remaster the KNOPPIX CD and even though I change the desktop wallpaper it always changes back to the knoppix.gif. It manages to save the other wallpaper fine when I use floppyconfig.
Does anyone have a solution to this?
The desktop file is stored in mutiple locations, you'll have to replace them all.
type :
locate knoppix.gif
-
knoppix.gif
The desktop file is stored in mutiple locations, you'll have to replace them all.
type :
locate knoppix.gif
Does this mean that the new wallpaper has to be saved as knoppix.gif in all those places or can all the knoppix.gifs be just deleted?
-
Senior Member
registered user
you have to save it in all the places
-
Re: Desktop Wallpaper Change?
Originally Posted by
Jamie Nelson
Hi, I've been trying to remaster the KNOPPIX CD and even though I change the desktop wallpaper it always changes back to the knoppix.gif. It manages to save the other wallpaper fine when I use floppyconfig.
Does anyone have a solution to this?
knoppix stores its default wallpaper at two places: /usr/local/lib/knoppix.gif, but modifying this is not enough, as you pointed. try to change KNOPPIX/knoppix.gif , directly on the cdrom.
(right besides boot.img, etc.)
linuxfan
-
Senior Member
registered user
Re: sort files + build scripts
Originally Posted by
blivius
One non-essential piece is missing and that is /KNOPPIX.build/mkisofs.sort
this is a file the determines in what order things get placed on
the CD. I believe Klaus has some way of generating this file.
But it is not clear to me how he did it. Feed back is welcome on this point.
found how to make it :
from http://mailman.linuxtag.org/pipermai...ay/000400.html
someone asked about the file :
> -------------
> 4. mkisofs.sort
> Where can I get this file? (it is needed by knoppix.mkcompressed) I
> didn't find it on the CD. And are there other scripts/tools necessary or
> recommended for building the KNOPPIX CD?
Klaus replied :
I use the atime timestamp from the files on the master system to
generate the sortlist, but there are probably better ways. The results
may vary, so you may just leave out the -sort option at all and get
an even faster CD.
Similar Threads
-
By PrOCesSkIlL in forum Customising & Remastering
Replies: 29
Last Post: 04-02-2004, 01:32 AM
-
By Alexxx in forum Customising & Remastering
Replies: 3
Last Post: 02-24-2004, 08:02 PM
-
By hanx in forum Customising & Remastering
Replies: 1
Last Post: 09-02-2003, 05:31 AM
-
By MichielioZ in forum Customising & Remastering
Replies: 11
Last Post: 04-15-2003, 12:13 AM
-
By Robert Michel in forum Ideas
Replies: 7
Last Post: 03-06-2003, 11:33 PM
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
Juniper Networks EX3300-48P 48-Port PoE+ 4x SFP+ Network Switch w/ Power Cord
$43.95
Juniper EX2300-C-12P 12 Port Gigabit PoE 2 SFP 1/10G Network Switch
$359.00
Juniper Networks EX2300-24P 24 Port Gigabit PoE 4 SFP 1/10G Network Switch
$115.00
Juniper EX3300-48P, 48 Port PoE+ Gigabit Network Switch w/ Power cord
$54.99
Juniper Gigabit Ethernet MIC with SFP
$125.00
EX2300-24P Juniper 24-port 10/100/1000BASE-T PoE+ 4 x 1/10GbE SFP/SFP+ UNCLAIMED
$450.00
JUNIPER EX3400-48P 48x 1GB PoE+ RJ-45 4x 10GB SFP+ 2x 40GB QSFP+, DUAL AC POWER
$210.00
Juniper Networks EX3300 EX3300-48P 48-Port Gigabit PoE+ Switch
$41.21
Juniper Networks EX3300-24P 24-Port PoE+ 4x SFP+ Network Switch TESTED
$79.99