tazlito rev 201
No meta flavors with loram_cdrom
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Dec 22 20:32:27 2010 +0100 (2010-12-22) |
parents | ecc2e5e823f7 |
children | e5f6c7526cf2 |
files | tazlito |
line diff
1.1 --- a/tazlito Wed Dec 22 13:32:00 2010 +0100 1.2 +++ b/tazlito Wed Dec 22 20:32:27 2010 +0100 1.3 @@ -902,17 +902,33 @@ 1.4 fi 1.5 cd $TMP_DIR 1.6 rootfs_sizes="$rootfs_sizes $(( $(du -s $TMP_DIR/fs | cut -f1) - $(du -s $rootfs | cut -f1) ))" 1.7 - if [ "$1" != "cdrom" ]; then 1.8 - ( cd $(dirname $rootfs); echo $(basename $rootfs) | \ 1.9 + ( cd $(dirname $rootfs); echo $(basename $rootfs) | \ 1.10 cpio -o -H newc ) > $rootfs.cpio 1.11 - rm -f $rootfs 1.12 - mv $rootfs.cpio $rootfs 1.13 - fi 1.14 + rm -f $rootfs 1.15 + mv $rootfs.cpio $rootfs 1.16 cd - > /dev/null 1.17 rm -rf $TMP_DIR/fs 1.18 done 1.19 } 1.20 1.21 +# Move each initramfs to squashfs (or cromfs) 1.22 +build_loram_rootfs_cdrom() 1.23 +{ 1.24 + mkdir -p $TMP_DIR/fs 1.25 + cd $TMP_DIR/fs 1.26 + for i in $TMP_DIR/iso/boot/rootfs*.gz; do 1.27 + ( zcat $i 2> /dev/null || unlzma -c $i) | cpio -idm 1.28 + done 1.29 + rootfs=$TMP_DIR/rootfs.gz 1.30 + if [ -x /usr/bin/mkcromfs ]; then 1.31 + /usr/bin/mkcromfs -qq -f 262144 -b 16384 $TMP_DIR/fs $rootfs 1.32 + else 1.33 + /usr/sbin/mksquashfs $TMP_DIR/fs $rootfs -comp xz -Xbcj x86 1.34 + fi 1.35 + rm -rf $TMP_DIR/fs 1.36 + cd $TMP_DIR 1.37 +} 1.38 + 1.39 # Move meta boot configuration files to basic configuration files 1.40 # because meta loram flavor is useless when rootfs is not loaded in ram 1.41 unmeta_boot() 1.42 @@ -935,7 +951,7 @@ 1.43 build_loram_cdrom() 1.44 { 1.45 build_initfs cdrom || return 1 1.46 - build_loram_rootfs cdrom 1.47 + build_loram_rootfs_cdrom 1.48 cp -a $TMP_DIR/iso $TMP_DIR/loramiso 1.49 if [ "$1" == "small" ]; then 1.50 rm -f $TMP_DIR/loramiso/boot/root*