Difference between revisions of "Knoppix Remastering Howto Spanish"


From Knoppix Documentation Wiki
Jump to: navigation, search
(Instrucciones:)
(Esta guía le mostrará cómo remasterizar KNOPPIX)
Line 81: Line 81:
 
** Para comprobar paquetes huérfanos, teclee esto:
 
** Para comprobar paquetes huérfanos, teclee esto:
 
'''*''' '''deborphan'''
 
'''*''' '''deborphan'''
** Si desea ahorrar más espacio eliminando esos Want to save more space by getting rid of those pesky orphans (how cruel!), type this ('''Warning''', you won't be prompted yes/no to remove these packagesWhen you press Enter after this command, those packages '''will be gone'''):
+
** Si desea ahorrar más espacio eliminando esos molestos huérfanos(¡Qué cruel!), teclee esto ('''Aviso''', no se le preguntará sí/no para eliminar estos paquetesCuando pulse Intro después de esta orden, los paquetes '''habrán desaparecido'''):
 
'''*''' '''deborphan | xargs apt-get -y remove'''
 
'''*''' '''deborphan | xargs apt-get -y remove'''
** If you're uncertain about the previous command and want to see what will happen without making any changes, just add the '''-s''' option to the apt-get command like this (you can do this with all of the apt-get commands, and it's a good habit to use this option before mass operations like this one):
+
** Si no está seguro acerca del comando anterior y quiere ver qué pasará sin hacer ningún cambio, simplemente añada la opción '''-s''' a la orden apt-get de esta forma (puede hacer esto con todas las órdenes apt-get, y es un buen hábito usar esta opción antes de operaciones masivas como ésta):
 
'''*''' '''deborphan | xargs apt-get -s -y remove'''
 
'''*''' '''deborphan | xargs apt-get -s -y remove'''
** Now the good stuffIf you wish to add a package, type this:
+
** Ahora las buenas obrasSi desea añadir un paquete, teclee esto:
'''*''' '''apt-get install <name-of-package-to-install>'''
+
'''*''' '''apt-get install <nombre-del-paquete-a-instalar>'''
** What, don't know what packages to installType thisWhen the list appears, you can peruse (over 13k lines!) or search for things using '''/<search-term>''':
+
** ¿Que no sabe qué paquetes instalarTeclee estoCuando aparezca la lista, puede examinarla (¡unas 13000 líneas!) o buscar cosas usando '''/<search-term>''':
 
'''*''' '''apt-cache search .* | sort | less'''
 
'''*''' '''apt-cache search .* | sort | less'''
** When you're done removing and adding packages, a good way to clean up is by typing this:
+
** Cuando haya terminado de eliminar y añadir paquetes, una buena forma de hacer limpieza es tecleando los siguiente:
 
'''*''' '''COLUMNS=200 dpkg -l |grep ^rc |awk '{print $2} ' | xargs dpkg -P'''
 
'''*''' '''COLUMNS=200 dpkg -l |grep ^rc |awk '{print $2} ' | xargs dpkg -P'''
** Also, because the Debian package system keeps a cache of downloaded packages, you may want to run the following to clear out those spare files:
+
** También, como el sistema de paquetes Debian guarda en caché los paquetes descargados, querrá ejecutar lo siguiente para eliminar esos ficheros inútiles:
 
'''*''' '''apt-get clean'''
 
'''*''' '''apt-get clean'''
** user settings are in /etc/skel
+
** las configuraciones de usuario están en /etc/skel
** tip: don't put files in /root they will be only available (at runtime) in /KNOPPIX/root
+
** consejo: no cloque ficheros en /root sólo estarán disponibles en tiempo de ejecucuón en /KNOPPIX/root
* Unmount /proc - very important! '''umount /proc'''
+
* Desmonte /proc - ¡muy importante! '''umount /proc'''
* Press '''CTRL+D''' to leave being chrooted.
+
* Pulse '''CTRL+D''' para volve a la raíz original (no chrooted).
  
==== Notes : ====
+
==== Notas : ====
  
When testing X-based programs, you will have to '''export DISPLAY=localhost:0.0'''
+
Cuando compruebe programas gráficos basados en X, tendrá que hacer '''export DISPLAY=localhost:0.0'''
  
When you want to autorun some programs, one can create a script and put it in the directory /etc/rc5.d/ (This only loads items before X loads)
+
Cuando quiera autoejecutar algunos programas, puede crear un script y ponerlo en el directorio /etc/rc5.d/ (Esto sólo carga elementos antes de cargar las X)
  
interesting stuff in /etc/init.d/knoppix-autoconfig :
+
hay material interesante en /etc/init.d/knoppix-autoconfig :
  
* The X background file is /cdrom/KNOPPIX/background.gif '''(in knoppix 3.4: background.jpg)'''
+
* El fichero de fondo X background está en /cdrom/KNOPPIX/background.gif '''(en knoppix 3.4: background.jpg)'''
* As well as floppyconfig, there is cdromconfig which will run cdrom/KNOPPIX/knoppix.sh
+
* Al igual que con floppyconfig, está cdromconfig que ejecutará cdrom/KNOPPIX/knoppix.sh
  
interesting stuff in /etc/init.d/xsession :
+
hay material interesante en /etc/init.d/xsession :
* it ALSO sets background as /usr/local/lib/knoppix.gif
+
* TAMBIÉN establece el fondo /usr/local/lib/knoppix.gif
  
Now, onto creating the ISO file :
+
Ahora la creación del fichero ISO :
  
* we've finished customizing and ready to burn!
+
* ya hemos terminado de personalizarlo y ¡queremos quemar!
* first do some cleanup : ''' remove .bash_history files, tmp files etc '''
+
* primero haga algo de limpieza : ''' elimine los ficheros .bash_history, ficheros temporales etc '''
 
* '''rm -rf /mnt/hda1/knx/source/KNOPPIX/.rr_moved'''
 
* '''rm -rf /mnt/hda1/knx/source/KNOPPIX/.rr_moved'''
* Now we'll make the big KNOPPIX file which is a cloop compressed ISO 9660 filesystem : '''mkisofs -R -U -V "KNOPPIX.net filesystem" -publisher "KNOPPIX www.knoppix.net" -hide-rr-moved -cache-inodes -no-bak -pad /mnt/hda1/knx/source/KNOPPIX | nice -5 /usr/bin/create_compressed_fs - 65536 > /mnt/hda1/knx/master/KNOPPIX/KNOPPIX'''
+
* Ahora crearemos el fichero enorme que es un sistema de ficheros ISO 9660 cloop comprimido : '''mkisofs -R -U -V "KNOPPIX.net filesystem" -publisher "KNOPPIX www.knoppix-es.org" -hide-rr-moved -cache-inodes -no-bak -pad /mnt/hda1/knx/source/KNOPPIX | nice -5 /usr/bin/create_compressed_fs - 65536 > /mnt/hda1/knx/master/KNOPPIX/KNOPPIX'''
  
the "www.knoppix.net" and "Knoppix.net filesystem" can be changed to what you want to call the file. You will get an error that it doesn't conform to ISO standards, you can ignore this.
+
el "www.knoppix-es.org" y "Knoppix.net filesystem" pueden ser modificados a lo que quiera que nombre el fichero. Obtendrá un error diciendo que no cumple los estándars ISO, puede ignorarlo.
  
In Knoppix 3.4 the create_compressed_fs script has been updated so be sure to use it to obtain the best result.
+
En Knoppix 3.4 el scrip create_compressed_fs ha sido actualizado así que asegúrese de usarlo para obtener los mejores resultados.
It has a new option '''-b''' (best), which enables the best compression by using
+
Tiene una nueva opción '''-b''' (best), que activa la mejor compresión usando diferentes esquemas de compresión e intenta optimizarlo de esa forma, pero sea cautao, porque esa opción es ralentiza (10 veces más lento).
different compression schemes and tries to optimize that way, but be careful, because that option is slow (10x slower).
+
  
* if all went well, onto making the final CD-ROM Image :
+
* si todo fue bien, para crear la imagen del CD-ROM final :
 
* '''cd /mnt/hda1/knx/master'''
 
* '''cd /mnt/hda1/knx/master'''
* '''rm -f KNOPPIX/md5sums; find -type f -not -name md5sums -not -name boot.cat -not -name isolinux.bin -exec md5sum {} \; >> KNOPPIX/md5sums''' (this will update the md5 hashes of the files included in the ISO, used for integrity checking)
+
* '''rm -f KNOPPIX/md5sums; find -type f -not -name md5sums -not -name boot.cat -not -name isolinux.bin -exec md5sum {} \; >> KNOPPIX/md5sums''' (esto actualizará las sumas de verificación md5 de los ficheros incluidos, se usa para comprobar la integridad)
* for Knoppix <= 3.3: '''mkisofs -pad -l -r -J -v -V "KNOPPIX" -b KNOPPIX/boot.img -c KNOPPIX/boot.cat -hide-rr-moved -o /mnt/hda1/knx/knoppix.iso /mnt/hda1/knx/master''' (the ISO is stored in /mnt/hda1/knx/knoppix.iso)
+
* para Knoppix <= 3.3: '''mkisofs -pad -l -r -J -v -V "KNOPPIX" -b KNOPPIX/boot.img -c KNOPPIX/boot.cat -hide-rr-moved -o /mnt/hda1/knx/knoppix.iso /mnt/hda1/knx/master''' (la ISO se guardará en /mnt/hda1/knx/knoppix.iso)
* For Knoppix >= 3.4 or other isolinux based distributions do:
+
* Para Knoppix >= 3.4 u otras distribuciones basadas en isolinux haga:
'''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 /mnt/hda1/knx/knoppix.iso /mnt/hda1/knx/master''' (the ISO is stored in /mnt/hda1/knx/knoppix.iso)
+
'''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 /mnt/hda1/knx/knoppix.iso /mnt/hda1/knx/master''' (la ISO se guardará en /mnt/hda1/knx/knoppix.iso)
* all done!
+
* ¡y eso es todo!
  
 
=== Tips ===
 
=== Tips ===

Revision as of 18:14, 10 January 2005

Traducciones:


== Vea también : ==

Esta guía le mostrará cómo remasterizar KNOPPIX

(Notas : las órdenes deberían aparecer en una sóla línea, por favor maximice su ventana del navegador. Si tiene cualquier comentario o sugerencia, por favor envíe el formulario que hay al final.)

Puede que desee personalizar un Knoppix ya adaptado, de forma que no tenga que hacer tanto esfuerzo (tal como eliminar programas). Si es así, vea Knoppix Customizations.

Requisitos del sistema:

  • CD-ISO
    • por lo menos 1 GB de memoria libre total FREE RAM+Swap (ej. 256M ram, y 750M swap DISPONIBLE) (a menos que use un programa de compresión diferente - busque compressloop en esta página)
    • 3 GB libres en una partición de disco formateada con sistema de ficheros Linux (ext2/3, xfs, etc.)
  • DVD-ISO
    • 5 GB libres de RAM + swap (para un DVD de tamaño completo)
    • 15 GB libres en una partición de disco formateada con sistema de ficheros Linux (ext2/3, xfs, etc.)


Instrucciones:

  1. Arranque desde el CD de Knoppix
  2. Bara una consola de root:
    • Menú: Kmenu->Knoppix->Consola de Root
    • Nota: Todas las órdenes a continuación son ejecutadas desde la consola de root.
  1. Configure su conexión a Internet (lo necesitará más adelante). Si usa DHCP, ya debería estar configurada.
    • Nota: Ejecute ifconfig para comprobarlo.
  1. Busque la partición en la que va a trabajar. En este ejemplo será hda1 . La partición debería tenes al menos 3 GB libres
  2. Monte la partición:
    • mount -rw /dev/hda1 /mnt/hda1
    • Nota: Asegúrese que es de lectura/escritura u obtendrá errores más adelante cuando cambie la raíz del sistema. Para comprobarlo, teclee mount
  1. Cree un directorio raíz donde trabajar:
    • mkdir /mnt/hda1/knx
    • Si coloca todos sus ficheros aquí, será fácil borrarlos todos después
  1. Si no tiene 1 GB de RAM (cat /proc/meminfo (physical+swap)) entonces necesitará un fichero de intercambio (swap):
    • cd /mnt/hda1/knx ; dd if=/dev/zero of=swapfile bs=1M count=750 ; mkswap swapfile ; swapon swapfile
  1. Cree 2 directorios, uno para su nuevo CD maestro, y otro para los fuentes, en una partición del disco. También, cree directorios adicionales en ellos llamados KNOPPIX:
    • mkdir -p /mnt/hda1/knx/master/KNOPPIX
    • mkdir -p /mnt/hda1/knx/source/KNOPPIX
  1. Ahora copie los ficheros de KNOPPIX a su directorio fuente:

* cp -Rp /KNOPPIX/ /mnt/hda1/knx/source/KNOPPIX &

    • Nota: Esto tardará unos minutos
  1. Copie la página HTML principal de inicio:
    • cp /cdrom/index.html /mnt/hda1/knx/master/
  1. Copie todos los ficheros necesarios excepto el fichero KNOPPIX, de unos 700 Mb.
    • < 3.4: cd /cdrom/KNOPPIX;find . -size -10000k -type f -exec cp -p --parents {} /mnt/hda1/knx/master/KNOPPIX/ \;
    • 3.4: cd /cdrom;find . -size -10000k -type f -exec cp -p --parents {} /mnt/hda1/knx/master/ \;
  1. Ahora puede cambiar la raíz del sistema "chroot" al KNOPPIX copiado en su partición:
    • chroot /mnt/hda1/knx/source/KNOPPIX

Si obtiene un montón de mensajes de error /dev/null permission denied, debería hacer los siguiente. Esto puede pasar si guarda sus datos de configuración de Knoppix en la misma partición que está usando para la remasterización, Y arranca Knoppix con knoppix home=scan.

Compruebe el estado de montado si obtuvo el problema: mount /dev/hdaX on /mnt/hdaX type ext3 (rw,nosuid,nodev) (reemplace la X con su número de partición ) donde "nodev" significa que no puede acceder al sistema de ficheros montado y que no puede acceder a /dev/null. Y algunos scripts redirigen la salida a /dev/null... Para solventar esto debería montar la partición de destino antes de cambiar la raíz del sistema (chroot) de esta forma:

^d  # control+d saldrá del entorno chroot
mount /dev/hda1 /mnt/hda1

Entonces debería obtener:

mount /dev/hda1 on /mnt/hda1 type ext3 (rw)

Si persisten los avisos de /dev/null entonces, antes de hacer chroot, haga:

mount --bind /dev /mnt/hda1/knx/source/KNOPPIX/dev

¡Tiene que desmontar umount /mnt/hda1/knx/source/KNOPPIX/dev antes de construir la imagen del CD o el directorio /dev del CD se hará un lío!

entonces puede seguir y hacer el chroot.

  • Ahora ha cambiado su direcotio raíz. "/" es en estos en realidad "/mnt/hda1/knx/source/KNOPPIX"
  • Para acceder a Internet necesitará montar proc mount -t proc /proc proc
  • Ahora edite /etc/resolv.conf y añada su servidor de nombres o "salga" del chroot y copie su fichero resolve.conf en el directorio fuente correspondiente: cp /etc/dhcpc/resolv.conf /mnt/hda1/knx/source/KNOPPIX/etc/dhcpc/resolv.conf
  • Cambie también su grupo MS en smb.conf si desea soporte smbd (MSHOME es normalmente Home en XP y WORKGROUP en Windows 9x .
  • Compruebe su conexión a Internet desde la nueva raíz : ping google.com
  • Actualice su lista de paquetes con apt-get update
  • Ahora puede realizar cambios.
  • Aviso: apt-get upgrade es una MALA IDEA. Muy probablemente, hará que su remasterización de KNOPPIX no sea arrancable o se corrompa en alguna forma. Un método más seguro consiste en actualizar sólo los paquetes necesarios
    • Antes de poder añadir programas, probablemente tendrá que eliminar algunos paquetes. Para obtener una lista de los paquetes instalados, teclee esto:

* dpkg-query -l

    • Si quiere tener esa lista ordenada por tamaño (de esta forma podrá eliminar los que más ocupan), teclee esto:

* dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -n

    • Para eliminar un paquete (y todos los paquetes que dependen de él), teclee esto:

* apt-get remove <nombre-del-paquete-a-eliminar>

    • Para comprobar paquetes huérfanos, teclee esto:

* deborphan

    • Si desea ahorrar más espacio eliminando esos molestos huérfanos(¡Qué cruel!), teclee esto (Aviso, no se le preguntará sí/no para eliminar estos paquetes. Cuando pulse Intro después de esta orden, los paquetes habrán desaparecido):

* deborphan | xargs apt-get -y remove

    • Si no está seguro acerca del comando anterior y quiere ver qué pasará sin hacer ningún cambio, simplemente añada la opción -s a la orden apt-get de esta forma (puede hacer esto con todas las órdenes apt-get, y es un buen hábito usar esta opción antes de operaciones masivas como ésta):

* deborphan | xargs apt-get -s -y remove

    • Ahora las buenas obras. Si desea añadir un paquete, teclee esto:

* apt-get install <nombre-del-paquete-a-instalar>

    • ¿Que no sabe qué paquetes instalar? Teclee esto. Cuando aparezca la lista, puede examinarla (¡unas 13000 líneas!) o buscar cosas usando /<search-term>:

* apt-cache search .* | sort | less

    • Cuando haya terminado de eliminar y añadir paquetes, una buena forma de hacer limpieza es tecleando los siguiente:

* COLUMNS=200 dpkg -l |grep ^rc |awk '{print $2} ' | xargs dpkg -P

    • También, como el sistema de paquetes Debian guarda en caché los paquetes descargados, querrá ejecutar lo siguiente para eliminar esos ficheros inútiles:

* apt-get clean

    • las configuraciones de usuario están en /etc/skel
    • consejo: no cloque ficheros en /root sólo estarán disponibles en tiempo de ejecucuón en /KNOPPIX/root
  • Desmonte /proc - ¡muy importante! umount /proc
  • Pulse CTRL+D para volve a la raíz original (no chrooted).

Notas :

Cuando compruebe programas gráficos basados en X, tendrá que hacer export DISPLAY=localhost:0.0

Cuando quiera autoejecutar algunos programas, puede crear un script y ponerlo en el directorio /etc/rc5.d/ (Esto sólo carga elementos antes de cargar las X)

hay material interesante en /etc/init.d/knoppix-autoconfig :

  • El fichero de fondo X background está en /cdrom/KNOPPIX/background.gif (en knoppix 3.4: background.jpg)
  • Al igual que con floppyconfig, está cdromconfig que ejecutará cdrom/KNOPPIX/knoppix.sh

hay material interesante en /etc/init.d/xsession :

  • TAMBIÉN establece el fondo /usr/local/lib/knoppix.gif

Ahora la creación del fichero ISO :

  • ya hemos terminado de personalizarlo y ¡queremos quemar!
  • primero haga algo de limpieza : elimine los ficheros .bash_history, ficheros temporales etc
  • rm -rf /mnt/hda1/knx/source/KNOPPIX/.rr_moved
  • Ahora crearemos el fichero enorme que es un sistema de ficheros ISO 9660 cloop comprimido : mkisofs -R -U -V "KNOPPIX.net filesystem" -publisher "KNOPPIX www.knoppix-es.org" -hide-rr-moved -cache-inodes -no-bak -pad /mnt/hda1/knx/source/KNOPPIX | nice -5 /usr/bin/create_compressed_fs - 65536 > /mnt/hda1/knx/master/KNOPPIX/KNOPPIX

el "www.knoppix-es.org" y "Knoppix.net filesystem" pueden ser modificados a lo que quiera que nombre el fichero. Obtendrá un error diciendo que no cumple los estándars ISO, puede ignorarlo.

En Knoppix 3.4 el scrip create_compressed_fs ha sido actualizado así que asegúrese de usarlo para obtener los mejores resultados. Tiene una nueva opción -b (best), que activa la mejor compresión usando diferentes esquemas de compresión e intenta optimizarlo de esa forma, pero sea cautao, porque esa opción es ralentiza (10 veces más lento).

  • si todo fue bien, para crear la imagen del CD-ROM final :
  • cd /mnt/hda1/knx/master
  • rm -f KNOPPIX/md5sums; find -type f -not -name md5sums -not -name boot.cat -not -name isolinux.bin -exec md5sum {} \; >> KNOPPIX/md5sums (esto actualizará las sumas de verificación md5 de los ficheros incluidos, se usa para comprobar la integridad)
  • para Knoppix <= 3.3: mkisofs -pad -l -r -J -v -V "KNOPPIX" -b KNOPPIX/boot.img -c KNOPPIX/boot.cat -hide-rr-moved -o /mnt/hda1/knx/knoppix.iso /mnt/hda1/knx/master (la ISO se guardará en /mnt/hda1/knx/knoppix.iso)
  • Para Knoppix >= 3.4 u otras distribuciones basadas en isolinux haga:

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 /mnt/hda1/knx/knoppix.iso /mnt/hda1/knx/master (la ISO se guardará en /mnt/hda1/knx/knoppix.iso)

  • ¡y eso es todo!

Tips

If you are looking for big installed packages then the command

dpkg-awk "Status: .* installed$" -- Package Installed-Size | \
awk '{print $2}' | egrep -v '^$' | xargs -n2 echo | \
perl -pe 's/(\S+)\s(\S+)/$2 $1/' | sort -rg

will list the packages with size in descending order. At least ten times faster is the command

dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -n

and you don't need dpkg-awk or awk or perl.

If you have trouble with the above sort command, try using KPackage, expanded all the trees and sorted by the size column to find big packages.

Check out the program "deborphan", it will list orphaned packages that you can remove, these packages were used by packages that are now removed.

I have had good results remastering working from the cd as root working from fluxbox. Just say "knoppix 2" at the boot prompt and it will boot you to a root prompt where you can then say "startx /usr/bin/fluxbox". I like to use the xterm unicode shell.

While working chroot doing the remastering I like to use "apt-get remove --purge pkg-name" to remove packages because before it does anything it will stop and show detials on what it is fixing to remove and let you say "yes or no".

If you don't use the above "apt-get" instructions and have a lot to cleanup and purge, here's the easy way to do it: "COLUMNS=200 dpkg -l |grep ^rc |awk '{print $2} ' >topurge". That will make a list of all removed packages to purge and then you just say "dpkg -P `cat topurge `" and your all done. "COLUMNS=200 dpkg -l |grep ^rc |awk '{print $2} ' | xargs dpkg -P" is a one-line version of this. Also use "deborphan >orphaned" then "dpkg -P `cat orphaned `". "deborphan | xargs dpkg -P " is a one line version for that.


Thats it. This is an updated version of my previous howto. This is not meant for linux beginners, you will need to know your way around linux to get this to work. I'll update this as corrections/improvements/etc come through.

Thanks to aay, charan, Tech2k, and #knoppix for some corrections and tips and ideas. Feel free to edit or add to this howto. Note about swap:
You don't really need 1G swap as there are two new tools to create compressed filesystems. Here are some candidates to makecompressedfs:

  • Valentijn's rewrite [1]
  • Quozl's port of compressloop for Knoppix 3.4 [2]
  • Quozl's distributed compressloop (use more than one processor to speed things up) [3] or [4]
  • Justin's patch [5] (link broken) I also just wrote a distributed cloop compressor(or for smp) It's in that same directory.

Tip, test cd-image without recording cd

If you have a spare partition with at least 700MB free space formatted with ext2, ext3 or Vfat, you can use this for test by booting from a floppy disk. A floppy boot will look for a partiton with /KNOPPIX/ in the root, and the compressed image /KNOPPIX/KNOPPIX. Instead of using the sub-directory /mnt/hda1/knx/master/KNOPPIX/ as described above, it should be called /mnt/hda2/KNOPPIX/ . The root index.html will then be located at /mnt/hda2/index.html and the compressed image will be at /mnt/hda2/KNOPPIX/KNOPPIX . Now you can boot from floppy and use /mnt/hda2 as your image. For further information see Hd BasedHowTo.

If you don't have an extra partition or you don't want to do so much for it, you can use Qemu ( see [6] ) with the ISO image like this: qemu -m 128 -cdrom /temp/knoppix-custom.iso -boot d -user-net You even do not have to build a hard disk image before, just install Qemu and try this. Amazing!

Booting Knoppix images with GRUB

  • First copy /boot of the Knoppix cd to your boot partition (or even your dos partition). I named mine boot.knoppix

Copy the /KNOPPIX directory to your root directory* of any hard disk. You may place it somewhere other than the boot partition. (ext2/3, reiserfs, vfat are supported)

  • put the following in your /boot/grub/menu.lst:
title           KNOPPIX
root            (hd0,0)
kernel  /boot.knoppix/vmlinuz 2 fromhd=/dev/hda4 lang=us
initrd  /boot.knoppix/miniroot.gz
  • notice the fromhd parameter: it's the location of the /KNOPPIX directory
  • reboot and have fun.

If my howto is too confusing, or you'd like a second opinion, check out charan's very nice remastering howto : http://gnubox.dyndns.org:8080/~sunil/knoppix.php . Another Howto is at http://www.stirnimann.com/mystuff/doc/knoppix.txt

There is a wizard, which knows all the unpacking, compressing and CD-recording steps mentioned here. It also shows a shell where you can update the uncompressed KNOPPIX system using debian's standard software installation tools. It is called mmkcdrom and part of the plugscript package: [7]

Yet another HOWTO, for shell freaks, is at http://quozl.linux.org.au/knoppix/

Be sure to check out the Knoppix Customization Forum for ideas and help with remastering.


This is the recommended directory layout for remastering KNOPPIX:

. (invoke ../remaster from here)
|-- master (invoke ../../umountbootimage from here)
|   |-- KNOPPIX
|   |   |-- KNOPPIX (compressed image)
|   |   |-- boot.img (boot floppy image)
|   |   `-- (other files snipped)
|   `-- index.html
`-- source
`-- KNOPPIX (this directory can be chrooted into)
|-- bin
|-- boot
|-- cdrom
|-- dev
|-- etc
|-- floppy
|-- home
|-- initrd
|-- lib
|-- mnt
|-- none
|-- opt
|-- proc
|-- root
|-- sbin
|-- tmp -> /var/tmp
|-- usr
|-- var
`-- vmlinuz -> boot/vmlinuz-2.4.22-xfs

the following script "remaster" will do the remaster process for you. Use as root, or you will end up with wrong access rights in the image.

The script has last been tried out on Debian sid on 2004-04-02.

#!/bin/bash -x
# This script builds a new KNOPPIX ISO image.
# Copyright (C) 2004 by Marc Haber <mh+knoppix-remaster@zugschlus.de>
# License: GPL V2

ROOT="$PWD"
SOURCE="$ROOT/source/KNOPPIX"
MASTER="$ROOT/master"
CLOOPTARGET="$ROOT/master/KNOPPIX/KNOPPIX"
TARGET="$ROOT"
EXCLUDELIST="$ROOT/source/excludelist"

rm -rf $SOURCE/.rr_moved

cd $SOURCE
mkisofs -R -U -V "KNOPPIX.net filesystem" \
-P "KNOPPIX www.knoppix.net" \
-hide-rr-moved -cache-inodes -no-bak -pad \
-exclude-list $EXCLUDELIST \
. | nice -5 /usr/bin/createcompressedfs - 65536 > $CLOOPTARGET

cd $MASTER
rm -f KNOPPIX/md5sums
find -type f -not -name md5sums -not -name boot.cat -exec md5sum {} \; >> KNOPPIX/md5sums
mkisofs -pad -l -r -J -v -V "KNOPPIX" -b KNOPPIX/boot.img \
-c KNOPPIX/boot.cat -hide-rr-moved -o $TARGET/knoppix.iso $MASTER

The following script will loop-mount boot floppy image and initrd image for modification. The umount function will build a new initrd image and put it back on the boot floppy image.

The script has last been tried out on Debian sid on 2004-01-13.

#!/bin/bash -x
# This script will loop-mount boot floppy and initrd image
# Copyright (C) 2004 by Marc Haber <mh+knoppix-remaster@zugschlus.de>
# License: GPL V2
unset CDPATH || true

# if not root, re-invoke self as root
if  "`id -u`" -ne 0 ; then
export LOCUSER="$USER"
export LOCHOME="$HOME"
if [[ "${SHELLOPTS/xtrace/}" != "$SHELLOPTS" ]]; then
sudo bash -x $0 $@
exit $?
else
sudo $0 $@
exit $?
fi
else
LOCUSER="${LOCUSER:-$USER}"
LOCHOME="${LOCHOME:-$HOME}"
fi
set -e

KNOPPIXDIR="KNOPPIX"
BOOTIMGFILE="$KNOPPIXDIR/boot.img"
BOOTIMGFS="vfat"
BOOTIMGDIR="boot.img"
INITRDGZ="$BOOTIMGDIR/miniroot.gz"
INITRDFILE="$KNOPPIXDIR/miniroot"
INITRDFS="ext2"
INITRDDIR="miniroot"

mountbootimage() {
if ! modprobe loop; then
echo >&2 "ERR: cannot load loop module"
exit 1
fi

if !  -e "$BOOTIMGFILE" ; then
echo >&2 "ERR: no $BOOTIMGFILE found"
exit 1
fi

for nofile in $BOOTIMGDIR $INITRDGZ $INITRDFILE $INITRDDIR; do
if  -e "$nofile" ; then
echo >&2 "ERR: $nofile already exists"
exit 1
fi
done

mkdir -p $BOOTIMGDIR
mount -o loop,uid=$LOCUSER -t $BOOTIMGFS $BOOTIMGFILE $BOOTIMGDIR

< $INITRDGZ gunzip > $INITRDFILE
mkdir -p $INITRDDIR
mount -o loop -t $INITRDFS $INITRDFILE $INITRDDIR
}

umountbootimage() {
dd if=/dev/zero of=$INITRDDIR/nullfile || true
sync
rm $INITRDDIR/nullfile
umount $INITRDDIR
rmdir $INITRDDIR
< $INITRDFILE gzip --best > $INITRDGZ
rm -f $INITRDFILE

umount $BOOTIMGDIR
rmdir $BOOTIMGDIR

syslinux KNOPPIX/boot.img
}

case "`basename $0`" in
mountbootimage)
mountbootimage
;;
umountbootimage)
umountbootimage
;;
*)
echo >&2 "ERR: called with unknown name `basename $0`"
exit 1
;;
esac