tazlito rev 388

tazlito-wiz(yad): correctly get versions in 'Additional packages' dialog.

writeiso: restore align for lzma, exclude ~/.cache (boot failed after using palemoon), misc fixes
author Xander Ziiryanoff <psychomaniak@xakep.ru>
date Thu Nov 05 21:48:22 2015 +0100 (2015-11-05)
parents 2687e9f01abc
children 6e2c8b742f47
files live.cgi tazlito tazlito-wiz
line diff
     1.1 --- a/live.cgi	Sun Jul 05 11:26:08 2015 +0200
     1.2 +++ b/live.cgi	Thu Nov 05 21:48:22 2015 +0100
     1.3 @@ -177,6 +177,7 @@
     1.4  /home/slitaz/distro/rootcd/boot/rootfs.gz
     1.5  </fieldset>
     1.6  EOT
     1.7 +		ls -l /home/slitaz/distro/rootcd/boot/rootfs.gz
     1.8  		until [ -f /tmp/.write-iso* ]; do
     1.9  			sleep 1
    1.10  		done
    1.11 @@ -189,6 +190,7 @@
    1.12  			tail -n8 /tmp/tazlitowriteiso | grep -vE 'ENTER|----'
    1.13  		fi
    1.14  		tail -n5 /tmp/tazlitowriteiso | sed "s|$|<p></p>|g"
    1.15 +		ls -l /home/slitaz/distro
    1.16  		echo "</fieldset>"
    1.17  		echo "Use ' <code>tazlito emu-iso</code> ' to check it" ;;
    1.18  	*)
    1.19 @@ -222,7 +224,9 @@
    1.20  <form method="get" action="$SCRIPT_NAME">
    1.21  	$(gettext 'Compression type:')
    1.22  	<select name="write_iso">
    1.23 +<!--
    1.24  		<option value="gzip">gzip</option>
    1.25 +-->
    1.26  		<option value="lzma">lzma</option>
    1.27  		<option value="none">$(gettext 'none')</option>
    1.28  	</select>
     2.1 --- a/tazlito	Sun Jul 05 11:26:08 2015 +0200
     2.2 +++ b/tazlito	Thu Nov 05 21:48:22 2015 +0100
     2.3 @@ -365,7 +365,8 @@
     2.4  {
     2.5  	if [ "$COMPRESSION" = "lzma" ]; then
     2.6  		echo -n "Creating rootfs.gz with lzma compression... "
     2.7 -		cpio -o -H newc | lzma e -si -so > /rootfs.gz
     2.8 +		cpio -o -H newc | lzma e -si -so $(lzma_switches) > /rootfs.gz
     2.9 +		align='y'
    2.10  		lzma_set_size /rootfs.gz
    2.11  	elif [ "$COMPRESSION" = "gzip" ]; then
    2.12  		echo "Creating rootfs.gz with gzip compression... "
    2.13 @@ -375,8 +376,7 @@
    2.14  		echo "Creating rootfs.gz without compression... "
    2.15  		cpio -o -H newc > /rootfs.gz
    2.16  	fi < /tmp/list
    2.17 -	# [ $align == 'y' ] && align_to_32bits /rootfs.gz
    2.18 -	# align_to_32bits /rootfs.gz
    2.19 +	[ $align == 'y' -a -z "$noalign" ] && align_to_32bits /rootfs.gz
    2.20  	echo 1 > /tmp/rootfs
    2.21  }
    2.22  
    2.23 @@ -2298,10 +2298,11 @@
    2.24  $(boldify "Archive compression:") $(colorize 36 "$COMPRESSION")
    2.25  
    2.26  EOT
    2.27 +		[ $COMPRESSION == "gzip" ] && colorize 31 "gzip-compressed rootfs unsupported and may fail to boot"
    2.28  		# Save some space
    2.29  		rm /var/cache/tazpkg/* -r -f
    2.30  		rm /var/lib/tazpkg/*.bak -f
    2.31 -		rm -rf /home/slitaz/distro
    2.32 +		rm -rf $DISTRO
    2.33  
    2.34  		# Optionally remove sound card selection and screen resolution.
    2.35  		if [ -z $LaunchedByTazpanel ]; then
    2.36 @@ -2357,11 +2358,11 @@
    2.37  			[ -d $dir ] && echo $dir
    2.38  		done >>/tmp/list
    2.39  
    2.40 -		sed '/var\/run\/.*pid$/d ; /var\/run\/utmp/d ; /.*\/.gvfs/d' -i /tmp/list
    2.41 +		sed '/var\/run\/.*pid$/d ; /var\/run\/utmp/d ; /.*\/.gvfs/d ; /home\/.*\/.cache\/.*/d' -i /tmp/list
    2.42  		
    2.43 -		if [ ! $(find /var/log/slitaz/tazpkg.log -size +4k) = "" ]; then
    2.44 -			sed -i "/var\/log\/slitaz\/tazpkg.log/d" /tmp/list
    2.45 -		fi
    2.46 +		#if [ ! $(find /var/log/slitaz/tazpkg.log -size +4k) = "" ]; then
    2.47 +		#	sed -i "/var\/log\/slitaz\/tazpkg.log/d" /tmp/list
    2.48 +		#fi
    2.49  		mv -f /var/log/wtmp /tmp/tazlito-wtmp
    2.50  		touch /var/log/wtmp
    2.51  		
    2.52 @@ -2420,7 +2421,7 @@
    2.53  When SliTaz is running in RAM the kernel and bootloader files are kept
    2.54  on the cdrom. Please insert a LiveCD or loop mount the slitaz.iso to
    2.55  /media/cdrom (run # mount -o loop slitaz-rolling.iso /media/cdrom )
    2.56 -to let Tazlito copy the files.\n"
    2.57 +or # (tazpkg -gi linux --forced) to let Tazlito copy the files.\n"
    2.58  			echo -en "----\nENTER to continue..."; read i
    2.59  			[ ! -d /media/cdrom/boot/isolinux ] && exit 1
    2.60  			copy_from_cd
    2.61 @@ -2445,7 +2446,7 @@
    2.62  		status
    2.63  
    2.64  		separator
    2.65 -		echo "ISO image: $(du -sh /home/slitaz/distro/$ISO_NAME.iso)"
    2.66 +		echo "ISO image: $(du -sh $DISTRO/$ISO_NAME.iso)"
    2.67  		rm -f /tmp/.write-iso
    2.68  		newline
    2.69  		if [ -z $LaunchedByTazpanel ]; then
    2.70 @@ -2456,7 +2457,7 @@
    2.71  				eject
    2.72  				echo -n "Please insert a blank cdrom and press ENTER..."
    2.73  				read i && sleep 2
    2.74 -				tazlito burn-iso /home/slitaz/distro/$ISO_NAME.iso
    2.75 +				tazlito burn-iso $DISTRO/$ISO_NAME.iso
    2.76  				echo -en "----\nENTER to continue..."; read i ;;
    2.77  			*)
    2.78  				exit 0 ;;
     3.1 --- a/tazlito-wiz	Sun Jul 05 11:26:08 2015 +0200
     3.2 +++ b/tazlito-wiz	Thu Nov 05 21:48:22 2015 +0100
     3.3 @@ -14,7 +14,7 @@
     3.4  #[ "$rel" != "cooking" ] && rel=stable
     3.5  live=/home/slitaz/$rel/live
     3.6  db="/var/lib/tazpkg"
     3.7 -list="distro-packages.list"
     3.8 +list="$live/distro-packages.list"
     3.9  distro="/home/slitaz/$rel/distro"
    3.10  addfiles="$distro/addfiles"
    3.11  
    3.12 @@ -45,10 +45,10 @@
    3.13  
    3.14  edit_list() {
    3.15  	text=$(gettext "Edit the distro packages list")
    3.16 -	cat $live/$list | yad --list $opts --text="$text" \
    3.17 +	cat $list | yad --list $opts --text="$text" \
    3.18  		--no-headers --print-all --separator="" \
    3.19  		--editable --column=0:TEXT > $live/list
    3.20 -		mv -f $live/list $live/$list
    3.21 +		mv -f $live/list $list
    3.22  }
    3.23  
    3.24  # Start page GUI
    3.25 @@ -61,7 +61,7 @@
    3.26  		--button="TazPanel Live:2" \
    3.27  		--button="gtk-cancel:1" \
    3.28  		--button="gtk-ok:0" \
    3.29 -		" " "core!gtkonly!justx!base"
    3.30 +		" " "core!core64!gtkonly!justx!base"
    3.31  }
    3.32  
    3.33  # Start page handler
    3.34 @@ -77,7 +77,9 @@
    3.35  	esac
    3.36  	# Deal with $main values
    3.37  	text=$(gettext "Getting flavor file and packages list...")
    3.38 -	(echo "30" && sleep 1
    3.39 +	(echo "30" && xterm='xterm -fa fixed-8 '
    3.40 +	[ -z $(which xterm) ] && xterm='terminal'
    3.41 +	$xterm -geometry 80x10-0-0 -e tazpkg recharge
    3.42  	name=$(echo $main | cut -d "|" -f 1)
    3.43  	skel=$(echo $main | cut -d "|" -f 2)
    3.44  	echo "$skel" > $live/skel
    3.45 @@ -96,9 +98,9 @@
    3.46  	skel=$(cat $live/skel)
    3.47  	text=$(eval_gettext "Packages - The \$skel has \$pkgs packages")
    3.48  	yad --form $opts --text="<b>$text</b>" --separator=" " \
    3.49 -		--field="$(gettext "Additional packages separated by space or by line:")":TXT \
    3.50 +		--field="$(gettext "Additional packages separated by space or by line:")\\n\(will be auto added to \'Edit packages list\'\)":TXT \
    3.51  		--button="$(gettext "Edit packages list"):2" \
    3.52 -		--button="gtk-cancel:1" --button="gtk-ok:0"
    3.53 +		--button="gtk-cancel:1" --button="gtk-ok:0" --image=tazpkg
    3.54  }
    3.55  
    3.56  # Packages page handler
    3.57 @@ -108,16 +110,21 @@
    3.58  	# Deal with --button values
    3.59  	case $? in
    3.60  		1) exit 0 ;;
    3.61 -		2) edit_list ;;
    3.62 -		*) continue ;;
    3.63 +		2) add_to_list  ; edit_list ;;
    3.64 +		*) add_to_list ;;
    3.65  	esac
    3.66 -	# Deal with $main values
    3.67 -	for pkg in $(echo $main | sed s'/\\n//'g)
    3.68 +}
    3.69 +
    3.70 +add_to_list()
    3.71 +{
    3.72 +	for pkg in $(echo $main | sed s'/\\n/ /'g)
    3.73  	do
    3.74 -		vers=$(fgrep "$pkg |" $db/packages.desc | awk '{print $3}')
    3.75 -		if ! grep "^${pkg}$" $list; then
    3.76 +		vers=$(grep -E "^$pkg \|" $db/packages.desc | awk '{print $3}')
    3.77 +		[ -z $vers ] || \
    3.78 +		(grep -v -q "^$pkg-$vers" $list && \
    3.79  			echo "$pkg-$vers" >> $list
    3.80 -		fi
    3.81 +		)
    3.82 +		unset vers
    3.83  	done
    3.84  }
    3.85  
    3.86 @@ -149,7 +156,8 @@
    3.87  Now it's time to generate the distro. Last chance to start over or stop. \
    3.88  Creating a Live system uses quite a lot of resources and takes some time.
    3.89  Note you can still add some files to the SliTaz root filesystem or on the \
    3.90 -cdrom.")
    3.91 +cdrom.";echo
    3.92 +	echo $addfiles )
    3.93  	text=$(gettext "<b>Generate the distribution</b>")
    3.94  	echo "$info" | yad --text-info $opts --text="$text" \
    3.95  		--wrap --margins=20