wangji
06-28-2004, 11:38 PM
KnoppixRemastering-with-squashfs-guidance.
Foreword.
This is not a howto ;there are so many good knoppixremasteringhowto around ,so I only discuss the main points with enough details so anyone could
switch from cloop-to-squashfs remastering.
Introduction.
Let me put aside zisofs,zftree ,but only give here a comparison of cloop and squashfs :compression ratio and runtime .Let me call
knoppix.clp the usual knoppix image obtained with cloopcompress the isofile (or mkiso piped thru createcompressfs )
knoppix.sqf the knoppix image of the same structure using mksquashfs.
compression ratio sqfs 689655Kb in 34 minutes
cloop 729163Kb in 43.7minutes (a small gain of 5% and 10 min in favor of sqfs ) Source=2082Mb
runtime
In order to avoid errors induced by bad behaviour of cdrom-reading (aleas due to dust ,mechanics & feedback-control )the runtime measures are
done directly on running knoppix-image sitting on hard drive in both compression cases .In both cases mkzftree of a huge /usr is measured.
runtime-sqfs 27min25s (985.3Mb/1769Mb)
runtime-cloop 27min59s (985Mb/1785Mb)
Almost no difference in runtime.So we must consider other factors to favor the one or the other.
The cloop are compiled in modules ,so don't touch the kernel ;but in fact it is almost impossible -without too much contorsion if ever possible-to mount
the clooped image with another-version-kernel.One needs to boot with the same-version-numbered-kernel to be able to insmod cloop !
The squashfs has to be compiled with patched kernel ;but any other-version-patched-kernel can "mount loopback" the image.Now,each time one changes
the kernel,one needs at least patch modifying the cmdline-length from 256 to 512 characters (a line in /linux/include/asm-i386/setup.h ) to keep
Klaus'idea of having a flexible command line .For amateur-developer-remastering the last solution makes life easy !
Philosophy
To switch from cloop to squashfs just replace the make-image. and of course the loopback mount the image during booting phase
Requirements
1 Get the kernel and the squashfs patch (squashfs.sourcefore.net ; latest version 2.0-alpha) .Modify setup.h as said ,patch with squashfs,compile.
compile the "mksquashs-tools" directory to get the binary "mksquashfs" and put in /usr/bin .
2 Get a copy of /KNOPPIX to some /remaster ;replace in /remaster the following directories to reflect the new kernel
/boot /lib/modules/2.6.x /usr/src/linux-2.6.x (this is standard kernel playing game ) and any eventual add/remove apps !
3 create the image: mksquashfs /remaster /outside-remaster-dir/knoppix
This line replaces the mkisofs ...| create_compressed_fs ...>knoppix.
4 modify linuxrc (from miniroot.gz or initrd.gz ) by commenting out the lines
(after scsi driver,at the paragraph "try to find cdrom" )
#insmod -f /modules/cloop.*o file=/cdrom/KNOPPIX/KNOPPIX
#mountit /dev/cloop /KNOPPIX "-o ro" || FOUND_KNOPPIX=""
insert there a line
mount /cdrom/KNOPPIX/KNOPPIX /KNOPPIX -o loop ,ro || FOUND_KNOPPIX=""
This mounts the image as squashfs tree.The rest is independant of compression mechanism.
Do not forget to change vmlinuz (new) when building the isocd.Some other version uses insmod cloop and losetup the loopback file ,it 's quite similar.
The Fun
By remaking the sqfs images of diferents knoppix-like-distro (cebit-3.4,quantian-openmosix,pollix,kurumin,physicstools...) with kernel-2.6.6 and put them
all in a /KNOPPIX ext2-directory ,I am able to boot any of them with just a boot-cd-15Mb and typing ...a label !
Have fun,
Foreword.
This is not a howto ;there are so many good knoppixremasteringhowto around ,so I only discuss the main points with enough details so anyone could
switch from cloop-to-squashfs remastering.
Introduction.
Let me put aside zisofs,zftree ,but only give here a comparison of cloop and squashfs :compression ratio and runtime .Let me call
knoppix.clp the usual knoppix image obtained with cloopcompress the isofile (or mkiso piped thru createcompressfs )
knoppix.sqf the knoppix image of the same structure using mksquashfs.
compression ratio sqfs 689655Kb in 34 minutes
cloop 729163Kb in 43.7minutes (a small gain of 5% and 10 min in favor of sqfs ) Source=2082Mb
runtime
In order to avoid errors induced by bad behaviour of cdrom-reading (aleas due to dust ,mechanics & feedback-control )the runtime measures are
done directly on running knoppix-image sitting on hard drive in both compression cases .In both cases mkzftree of a huge /usr is measured.
runtime-sqfs 27min25s (985.3Mb/1769Mb)
runtime-cloop 27min59s (985Mb/1785Mb)
Almost no difference in runtime.So we must consider other factors to favor the one or the other.
The cloop are compiled in modules ,so don't touch the kernel ;but in fact it is almost impossible -without too much contorsion if ever possible-to mount
the clooped image with another-version-kernel.One needs to boot with the same-version-numbered-kernel to be able to insmod cloop !
The squashfs has to be compiled with patched kernel ;but any other-version-patched-kernel can "mount loopback" the image.Now,each time one changes
the kernel,one needs at least patch modifying the cmdline-length from 256 to 512 characters (a line in /linux/include/asm-i386/setup.h ) to keep
Klaus'idea of having a flexible command line .For amateur-developer-remastering the last solution makes life easy !
Philosophy
To switch from cloop to squashfs just replace the make-image. and of course the loopback mount the image during booting phase
Requirements
1 Get the kernel and the squashfs patch (squashfs.sourcefore.net ; latest version 2.0-alpha) .Modify setup.h as said ,patch with squashfs,compile.
compile the "mksquashs-tools" directory to get the binary "mksquashfs" and put in /usr/bin .
2 Get a copy of /KNOPPIX to some /remaster ;replace in /remaster the following directories to reflect the new kernel
/boot /lib/modules/2.6.x /usr/src/linux-2.6.x (this is standard kernel playing game ) and any eventual add/remove apps !
3 create the image: mksquashfs /remaster /outside-remaster-dir/knoppix
This line replaces the mkisofs ...| create_compressed_fs ...>knoppix.
4 modify linuxrc (from miniroot.gz or initrd.gz ) by commenting out the lines
(after scsi driver,at the paragraph "try to find cdrom" )
#insmod -f /modules/cloop.*o file=/cdrom/KNOPPIX/KNOPPIX
#mountit /dev/cloop /KNOPPIX "-o ro" || FOUND_KNOPPIX=""
insert there a line
mount /cdrom/KNOPPIX/KNOPPIX /KNOPPIX -o loop ,ro || FOUND_KNOPPIX=""
This mounts the image as squashfs tree.The rest is independant of compression mechanism.
Do not forget to change vmlinuz (new) when building the isocd.Some other version uses insmod cloop and losetup the loopback file ,it 's quite similar.
The Fun
By remaking the sqfs images of diferents knoppix-like-distro (cebit-3.4,quantian-openmosix,pollix,kurumin,physicstools...) with kernel-2.6.6 and put them
all in a /KNOPPIX ext2-directory ,I am able to boot any of them with just a boot-cd-15Mb and typing ...a label !
Have fun,