tazlito rev 35

Sed isolinux.msg date, nice gen-flavor output, addhacher files
author Christophe Lincoln <pankso@slitaz.org>
date Sat Feb 16 00:34:39 2008 +0100 (2008-02-16)
parents 2ab6a01ccd99
children e0cf5c5780c0
files tazlito
line diff
     1.1 --- a/tazlito	Thu Feb 14 18:43:29 2008 +0100
     1.2 +++ b/tazlito	Sat Feb 16 00:34:39 2008 +0100
     1.3 @@ -202,11 +202,18 @@
     1.4  {
     1.5  	# Some packages may want to alter iso
     1.6  	genisohooks iso
     1.7 -	if [ ! -f "$ROOTCD/boot/isolinux/isolinux.bin" ] ; then
     1.8 +	if [ ! -f "$ROOTCD/boot/isolinux/isolinux.bin" ]; then
     1.9  		echo -e "\nUnable to find isolinux binary.\n"
    1.10  		cleanup
    1.11  		exit 0
    1.12  	fi
    1.13 +	# Set date for boot msg.
    1.14 +	if grep -q 'XXXXXXXX' $ROOTCD/boot/isolinux/isolinux.msg; then
    1.15 +		DATE=`date +%Y%m%d`
    1.16 +		echo -n "Setting build date to: $dATE..."
    1.17 +		sed -i s/'XXXXXXXX'/"$DATE"/ $ROOTCD/boot/isolinux/isolinux.msg
    1.18 +		status
    1.19 +	fi
    1.20  	cd $DISTRO
    1.21  	echo ""
    1.22  	echo -e "\033[1mGenerating ISO image\033[0m"
    1.23 @@ -509,6 +516,9 @@
    1.24  	gen-flavor)
    1.25  		# Generate a new flavor form then last iso image generation.
    1.26  		FLAVOR=$2
    1.27 +		echo ""
    1.28 +		echo -e "\033[1mFlavor generation\033[0m"
    1.29 +		echo "================================================================================"
    1.30  		if [ -z "$FLAVOR" ]; then
    1.31  			echo -n "Flavor name : "
    1.32  			read FLAVOR
    1.33 @@ -524,12 +534,14 @@
    1.34  				  cpio -o -H newc 2> /dev/null | gzip -9 ) > $FLAVOR.$i
    1.35  			fi
    1.36  		done
    1.37 +		status
    1.38  		answer=`grep -s ^Description $FLAVOR.desc`
    1.39  		answer=${answer#Description     : }
    1.40  		if [ -z "$answer" ]; then
    1.41 -			echo -en "\nDescription : "
    1.42 +			echo -n "Description : "
    1.43  			read answer
    1.44  		fi
    1.45 +		echo -n "Compressing flavor $FLAVOR..."
    1.46  		echo "Flavor          : $FLAVOR" > $FLAVOR.desc
    1.47  		echo "Description     : $answer" >> $FLAVOR.desc
    1.48  		( cd $DISTRO; distro_sizes) >> $FLAVOR.desc
    1.49 @@ -542,6 +554,9 @@
    1.50  			gzip -9 > $FLAVOR.flavor
    1.51  		rm `echo -e $FILES`
    1.52  		status
    1.53 +		echo "================================================================================"
    1.54 +		echo "Flavor size : `du -sh $FLAVOR.flavor`"
    1.55 +		echo ""
    1.56  		;;
    1.57  	get-flavor)
    1.58  		# Get a flavor's files and prepare for gen-distro.
    1.59 @@ -782,7 +797,7 @@
    1.60  		fi
    1.61  		# Go for echoing on configuration files if any hacker was found.
    1.62  		#
    1.63 -		if [ ! "`cat $ROOTFS/etc/passwd | grep hacker`" ] ; then
    1.64 +		if ! grep -q hacker $root/etc/passwd; then
    1.65  			echo -n "Configuring $ROOTFS/etc..."
    1.66  			echo 'hacker:x:500:500:Linux User,,,:/home/hacker:/bin/ash' >> $ROOTFS/etc/passwd
    1.67  			echo 'hacker::13646:0:99999:7:::' >> $ROOTFS/etc/shadow
    1.68 @@ -794,17 +809,19 @@
    1.69  		fi
    1.70  		# Hacker can listen to music
    1.71  		#
    1.72 -		if grep -q audio $ROOTFS/etc/group; then
    1.73 -			sed -i s/'audio:x:20:'/'audio:x:20:hacker'/ $ROOTFS/etc/group
    1.74 +		if grep -q audio $root/etc/group; then
    1.75 +			if ! grep -q "audio:x:20:hacker" $root/etc/group; then
    1.76 +				sed -i s/'audio:x:20:'/'audio:x:20:hacker'/ $root/etc/group
    1.77 +			fi
    1.78  		fi
    1.79 -		# /home/hacker files.
    1.80 +		# /home/hacker directories.
    1.81  		#
    1.82  		echo -n "Creating default directories... "
    1.83 -		mkdir -p $ROOTFS/home/hacker/Documents \
    1.84 -		$ROOTFS/home/hacker/Downloads \
    1.85 -		$ROOTFS/home/hacker/Images \
    1.86 -		$ROOTFS/home/hacker/Public \
    1.87 -		$ROOTFS/home/hacker/Templates
    1.88 +		mkdir -p $fs/home/hacker/Documents \
    1.89 +			$fs/home/hacker/Downloads \
    1.90 +			$fs/home/hacker/Templates \
    1.91 +			$fs/home/hacker/.local/bin \
    1.92 +			$fs/home/hacker/.local/share
    1.93  		status
    1.94  		# Change permissions.
    1.95  		#