[cooking] various boot modes, successes and failures

[ Thread Index | Date Index | More lists.tuxfamily.org/slitaz Archives ]


Hello,

Here some results of many tests about various modes for booting cooking Slitaz, mainly with packages I added for my use, which make up a 384 M system (when decompressed)

Normal: initramfs is lzma-ed and contains the whole OS. Loading is done by bootloader and unlzma is done by Linux kernel. PRO: netbooting made simple. CON: when starting on a machine with 512M of RAM, the system uses 433M there doesn't remain enough memory to runs programs. They are killed par the OOM killer.

LORAM-RAM: intiramfs contains 2 parts, a minimal system, the second part being the whole OS compressed with squashfs+lzma. The first part is used to setup a layered FS using aufs, with a top layer rw and a background ro layer which is the squashfs+lzma which is only uncompressed on demand. PRO: same simplicity for netboot, uses less RAM. In my case, after booting 224M are used much more better than normal mode.

LORAM-CDROM booted with enough RAM: the whole OS compressed with squashfs+lzma is a separate file on CDROM (or USB key), but is loaded in RAM, and works exactly like LORAM-RAM. However, netboot is more complicated, you need LORAM-HTTP.

LORAM-CDROM booted with very limited RAM (128 M for instance). The compressed OS compressed is not copyed in RAM, and is not used at all. Instead the uncompressed OS, on the CDROM, is used to provide the background ro layer.

LORAM-CDROM booted with very limited RAM and *my patch*. The compressed OS compressed is not copyed in RAM, but is used to provide the background ro layer. PRO: no need for a fat CDROM.

---- WHAT DOES WORK, WHAT DOES NOT WORK ---

Normal: cooking from the mirror, and with some additional packages: OK
But with some more packages: Kernel crashes while unlzma-ing the initramfs, but only on machine with more than 512 M.
By-pass: COMPRESSION="gzip" in tazlito.conf.
PRO: boot is faster with gzip (23 s on VirtualBox) than with lzma, because the loading of the initramfs is longer but the uncompressing is much more faster. For me, short boot-time is much more valuable than saving some Megabytes on USB (so cheap these days).

the 2 LORAMs cooking from the mirror: the kernel crashes. I was unable to rebuild (tazlito build-loram) because now kernel is 2.6.36 and cooking from the mirror is 2.6.34, and linux-aufs is no more available for 2.6.34. Solution: squashfs in 2.6.36 doesn't support LZMA compression, so patch tazlito.

NOW, my quite big Slitaz system boots fine in any of the 3 different iso variants, Normal, LORAM-RAM, and LORAM-CDROM (both with RAM or CDROM mode, depending on the RAM available.

--- tazlito
+++ /usr/bin/tazlito
@@ -305,7 +305,7 @@

 lzma_switches()
 {
- echo "-d$(lzma_history_bits $1) -mt$(grep '^processor' < /proc/cpuinfo | wc -l)" + echo "-d$(lzma_history_bits $1) -mt$(grep ^processor < /proc/cpuinfo | wc -l)"
 }

 # Pack rootfs
@@ -722,7 +722,6 @@
     [ \$(( \$total / \$need )) -gt 1 ] || return 1
if ! grep -q " keep-loram" /proc/cmdline && cp \${path}rootfs* /mnt; then
         path=/mnt/
-        umount -d /mnt/.cdrom
         return 0
     else
         rm -f /mnt/rootfs*
@@ -821,15 +820,14 @@
     i=\$((i+1))
 done
 path=/mnt/.cdrom/
-#copy_rootfs && insmod /lib/squashfs.ko.gz && umount -d /mnt/.cdrom
-copy_rootfs ; insmod /lib/squashfs.ko.gz
+copy_rootfs && insmod /lib/squashfs.ko.gz && umount -d /mnt/.cdrom

 fi

 memfree=\$(grep MemFree /proc/meminfo | sed 's/[^0-9]//g')
 umount /proc
-#branch=br=/mnt/.rw:/mnt/.cdrom/\$DIR
-#if [ ! -d /mnt/.cdrom/fs/etc ]; then
+branch=br=/mnt/.rw:/mnt/.cdrom/\$DIR
+if [ ! -d /mnt/.cdrom/fs/etc ]; then
 branch=br=/mnt/.rw
 for i in \${path}rootfs* ; do
     fs=\${i#*root}
@@ -841,7 +839,7 @@
         mount -o loop,ro -t squashfs \${path}root\$fs /mnt/.\$fs
     fi
 done
-#fi
+fi
 insmod /lib/aufs.ko.gz
 mount -t aufs -o \$branch none /mnt
 [ \$memfree -lt 30000 ] && sed -i 's/ slim//' /mnt/etc/rcS.conf
@@ -870,7 +868,7 @@
         if [ -x /usr/bin/mkcromfs ]; then
             /usr/bin/mkcromfs -qq -f 262144 -b 16384 $TMP_DIR/fs $rootfs
         else
-            /usr/sbin/mksquashfs $TMP_DIR/fs $rootfs -comp gzip
+            /usr/sbin/mksquashfs $TMP_DIR/fs $rootfs -comp lzma
         fi
         cd $TMP_DIR
rootfs_sizes="$rootfs_sizes $(( $(du -s $TMP_DIR/fs | cut -f1) - $(du -s $rootfs | cut -f1) ))"
@@ -909,6 +907,13 @@
     build_initfs cdrom || return 1
     build_loram_rootfs cdrom
     cp -a $TMP_DIR/iso $TMP_DIR/loramiso
+    mkdir $TMP_DIR/loramiso/fs
+    cd $TMP_DIR/loramiso/fs
+    for i in $( ls ../boot/root* | sort -r ) ; do
+        ( zcat $i 2> /dev/null || unlzma -c $i ) | cpio -idmu
+        rm -f $i
+    done
+    cd - > /dev/null
     mv $TMP_DIR/initfs.gz $TMP_DIR/loramiso/boot/rootfs.gz
     mv $TMP_DIR/rootfs*.gz $TMP_DIR/loramiso
     mkdir -p $TMP_DIR/loramiso/fs/mnt/.cdrom


Ph. Lelédy






---
SliTaz GNU/Linux Mailing list - http://www.slitaz.org/


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/