cookutils rev 544 slitaz-tank

libcookiso.sh: Added some more comments.
author Christopher Rogers <slaxemulator@gmail.com>
date Mon Oct 15 17:39:00 2012 +0000 (2012-10-15)
parents daf103b96ed1
children 6ff62c90dd29
files lib/libcookiso.sh
line diff
     1.1 --- a/lib/libcookiso.sh	Mon Oct 15 16:28:45 2012 +0000
     1.2 +++ b/lib/libcookiso.sh	Mon Oct 15 17:39:00 2012 +0000
     1.3 @@ -39,7 +39,7 @@
     1.4  	fi
     1.5  fi
     1.6  
     1.7 -
     1.8 +# yes or no cmdline option
     1.9  yesorno()
    1.10  {
    1.11  	echo -n "$1"
    1.12 @@ -50,11 +50,13 @@
    1.13  	esac
    1.14  }
    1.15  
    1.16 +# help print .desc files
    1.17  field()
    1.18  {
    1.19  	grep "^$1" "$2" | sed 's/.*: \([0-9KMG\.]*\).*/\1/'
    1.20  }
    1.21  
    1.22 +# todo message
    1.23  todomsg()
    1.24  {
    1.25  	echo -e "\\033[70G[ \\033[1;31mTODO\\033[0;39m ]"
    1.26 @@ -154,6 +156,9 @@
    1.27  	fi
    1.28  }
    1.29  
    1.30 +# create iso
    1.31 +# $1 = iso name
    1.32 +# $2 = rootcd path
    1.33  create_iso()
    1.34  {
    1.35  	cd $2
    1.36 @@ -182,10 +187,10 @@
    1.37  		/usr/bin/isohybrid $1 -entry 2 2> /dev/null
    1.38  		status
    1.39  	fi
    1.40 -	if [ -s /etc/slitaz/info ]; then
    1.41 -		if [ $(stat -c %s /etc/slitaz/info) -lt $(( 31*1024 )) ]; then
    1.42 +	if [ -s /tmp/info ]; then
    1.43 +		if [ $(stat -c %s /tmp/info) -lt $(( 31*1024 )) ]; then
    1.44  			echo -n "Storing ISO info..."
    1.45 -			dd if=/etc/slitaz/info bs=1k seek=1 of=$1 \
    1.46 +			dd if=/tmp/info bs=1k seek=1 of=$1 \
    1.47  				conv=notrunc 2> /dev/null
    1.48  			status
    1.49  		fi
    1.50 @@ -890,6 +895,7 @@
    1.51  }
    1.52  
    1.53  # tazlito get-flavor
    1.54 +# $1 = flavor file
    1.55  get_flavor()
    1.56  {
    1.57  	# Get a flavor's files and prepare for gen-distro.
    1.58 @@ -949,7 +955,7 @@
    1.59  		sed -i "s/ISO_NAME=.*/ISO_NAME=\"slitaz-$FLAVOR\"/" cookiso.conf
    1.60  		status
    1.61  		( cd $TMP_DIR ; echo -e $infos | cpio -o -H newc ) | \
    1.62 -			gzip -9 > /etc/slitaz/info
    1.63 +			gzip -9 > /tmp/info
    1.64  		rm -Rf $TMP_DIR
    1.65  	fi
    1.66  	separator
    1.67 @@ -987,6 +993,7 @@
    1.68  }
    1.69  
    1.70  # tazlito pack-flavor
    1.71 +# $1 = flavor file
    1.72  pack_flavor()
    1.73  {
    1.74  	# Create a flavor from $FLAVORS_REPOSITORY.
    1.75 @@ -1094,6 +1101,7 @@
    1.76  }
    1.77  
    1.78  # tazlito extract-flavor
    1.79 +# $1 = flavor file
    1.80  extract_flavor()
    1.81  {
    1.82  	# Extract a flavor into $FLAVORS_REPOSITORY.
    1.83 @@ -1155,6 +1163,7 @@
    1.84  }
    1.85  
    1.86  # tazlito show-flavor
    1.87 +# $1 = flavor file
    1.88  show_flavor()
    1.89  {
    1.90  	# Show flavor description.
    1.91 @@ -1196,6 +1205,8 @@
    1.92  }
    1.93  
    1.94  # tazlito extract-distro
    1.95 +# $1 = iso image name
    1.96 +# $2 = target folder of distro
    1.97  extract_distro()
    1.98  {
    1.99  	# Extract an ISO image to a directory and rebuild the LiveCD tree.
   1.100 @@ -1379,13 +1390,15 @@
   1.101  }
   1.102  
   1.103  # tazlito writeiso
   1.104 +# $1 = compression type
   1.105 +# $2 = iso name
   1.106  writeiso()
   1.107  {
   1.108  	# Writefs to ISO image including /home unlike gen-distro we dont use
   1.109  	# packages to generate a rootfs, we build a compressed rootfs with all
   1.110  	# the current filesystem similar to 'tazusb writefs'.
   1.111  	#
   1.112 -	DISTRO="/home/slitaz/$SLITAZ_VERSION/distro"
   1.113 +	DISTRO="$SLITAZ/distro"
   1.114  	ROOTCD="$DISTRO/rootcd"
   1.115  	if [ -z $1 ]; then
   1.116  		COMPRESSION=none