tazlito rev 398
tazlito: use local packages
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Wed Nov 18 03:51:13 2015 +0200 (2015-11-18) |
parents | dac36320ab07 |
children | d7aa98b45a0f |
files | tazlito |
line diff
1.1 --- a/tazlito Tue Nov 17 18:54:57 2015 +0200 1.2 +++ b/tazlito Wed Nov 18 03:51:13 2015 +0200 1.3 @@ -7,7 +7,7 @@ 1.4 # and/or a new ISO. Most commands must be run by root, except the stats 1.5 # and the configuration file manipulation. 1.6 # 1.7 -# (C) 2007-2014 SliTaz - GNU General Public License. 1.8 +# (C) 2007-2015 SliTaz - GNU General Public License. 1.9 # 1.10 # Authors : Christophe Lincoln <pankso@slitaz.org> 1.11 # Pascal Bellard <pascal.bellard@slitaz.org> 1.12 @@ -466,7 +466,7 @@ 1.13 [ "$div" != 0 ] && min="~ ${div}m" 1.14 echo "Build time : ${sec}s $min" 1.15 fi 1.16 - cat << EOT 1.17 + cat <<EOT 1.18 Build date : $(date +%Y%m%d) 1.19 Packages : $(ls -1 $ROOTFS*$INSTALLED/*/receipt | wc -l) 1.20 Rootfs size : $(du -csh $ROOTFS*/ | awk '{ s=$1 } END { print s }') 1.21 @@ -489,7 +489,7 @@ 1.22 # Create an empty configuration file. 1.23 empty_config_file() 1.24 { 1.25 - cat >> tazlito.conf << "EOF" 1.26 + cat >> tazlito.conf <<"EOF" 1.27 # tazlito.conf: Tazlito (SliTaz Live Tool) configuration file. 1.28 # 1.29 1.30 @@ -1640,6 +1640,11 @@ 1.31 if [ -s $FLAVORS_REPOSITORY/$FLAVOR/receipt ]; then 1.32 mkdir $TMP_DIR 1.33 echo -n "Creating flavor $FLAVOR..." 1.34 + 1.35 + # Use latest local packages if possible (don't download from unsynced mirror) 1.36 + [ -s /home/slitaz/packages/packages.list -a -z $systemrepos ] && \ 1.37 + LOCALSTATE='/home/slitaz/packages' 1.38 + 1.39 [ -s $LOCALSTATE/packages.list ] || tazpkg recharge 1.40 if [ -s $FLAVORS_REPOSITORY/$FLAVOR/mirrors ]; then 1.41 cp $FLAVORS_REPOSITORY/$FLAVOR/mirrors \ 1.42 @@ -2155,23 +2160,29 @@ 1.43 1.44 # Multi-rootfs 1.45 if [ -s /etc/tazlito/rootfs.list ]; then 1.46 + 1.47 FLAVOR_LIST="$(awk '{ for (i = 2; i <= NF; i+=2) \ 1.48 printf("%s ",$i) }' < /etc/tazlito/rootfs.list)" 1.49 + 1.50 [ -s $ROOTCD/boot/isolinux/isolinux.msg ] && 1.51 sed -i "s/ *//;s/)/), flavors $FLAVOR_LIST/" \ 1.52 $ROOTCD/boot/isolinux/isolinux.msg 2> /dev/null 1.53 + 1.54 [ -f $ROOTCD/boot/isolinux/ifmem.c32 -o \ 1.55 -f $ROOTCD/boot/isolinux/c32box.c32 ] || 1.56 cp /boot/isolinux/c32box.c32 $ROOTCD/boot/isolinux 2> /dev/null || 1.57 cp /boot/isolinux/ifmem.c32 $ROOTCD/boot/isolinux 1.58 + 1.59 n=0 1.60 last=$ROOTFS 1.61 while read flavor; do 1.62 n=$(($n+1)) 1.63 newline 1.64 boldify "Building $flavor rootfs..." 1.65 + 1.66 [ -s $TOP_DIR/$flavor.flavor ] && 1.67 cp $TOP_DIR/$flavor.flavor . 1.68 + 1.69 if [ ! -s $flavor.flavor ]; then 1.70 # We may have it in $FLAVORS_REPOSITORY 1.71 if [ -d "$FLAVORS_REPOSITORY/$flavor" ]; then 1.72 @@ -2180,12 +2191,14 @@ 1.73 download $flavor.flavor 1.74 fi 1.75 fi 1.76 + 1.77 echo -n "Extracting $flavor.pkglist and $flavor.rootfs..." 1.78 zcat < $flavor.flavor | cpio -i --quiet \ 1.79 $flavor.pkglist $flavor.rootfs 1.80 sed 's/.*/&.tazpkg/' < $flavor.pkglist \ 1.81 > $DISTRO/list-packages0$n 1.82 status 1.83 + 1.84 mkdir ${ROOTFS}0$n 1.85 # Install packages 1.86 cd ${PACKAGES_REPOSITORY} 1.87 @@ -2332,7 +2345,7 @@ 1.88 newline 1.89 boldify "Write filesystem to ISO" 1.90 separator 1.91 - cat << EOT 1.92 + cat <<EOT 1.93 The command writeiso will write the current filesystem into a suitable cpio 1.94 archive (rootfs.gz) and generate a bootable ISO image (slitaz.iso). 1.95 1.96 @@ -2546,7 +2559,7 @@ 1.97 # Merge multiple rootfs into one iso. 1.98 # 1.99 if [ -z "$2" ]; then 1.100 - cat << EOT 1.101 + cat <<EOT 1.102 Usage: tazlito merge size1 iso size2 rootfs2 [sizeN rootfsN]... 1.103 1.104 Merge multiple rootfs into one iso. Rootfs are like russian dolls