tazwok annotate chroot-scripts/gen-iso @ rev 474

gen-iso: make it compatible with tazlito 4.0
author Antoine Bodin <gokhlayeh@slitaz.org>
date Mon Apr 04 02:55:10 2011 +0200 (2011-04-04)
parents 6d514a2cd9ef
children
rev   line source
gokhlayeh@315 1 #!/bin/sh
gokhlayeh@334 2 # Little script to cook flavor in tazwok chroot waiting
paul@427 3 # for something more consistent in tazlito.
gokhlayeh@315 4
gokhlayeh@315 5 [ "$1" ] || { echo "Usage: gen-iso flavorname [gzip]" >&2; exit 1; }
gokhlayeh@315 6 source /usr/lib/slitaz/libtaz
gokhlayeh@315 7
gokhlayeh@352 8 # Report progress on webserver.
gokhlayeh@352 9 log_step="$LOCAL_REPOSITORY/log/step"
gokhlayeh@352 10 run_on_exit="$run_on_exit
gokhlayeh@352 11 rm -f $LOCAL_REPOSITORY/log/step
gokhlayeh@352 12 rm -f $LOCAL_REPOSITORY/log/package"
gokhlayeh@352 13
gokhlayeh@315 14 [ -d "$SLITAZ_DIR/flavors" ] || ln -s $LOCAL_REPOSITORY/flavors $SLITAZ_DIR
gokhlayeh@315 15 if [ -d "$SLITAZ_DIR/flavors/$1" ]; then
gokhlayeh@315 16 source_lib report
gokhlayeh@315 17 export log_opt=$LOCAL_REPOSITORY/log/iso-$1.html
gokhlayeh@315 18 rm -f $log_opt
gokhlayeh@352 19 echo "iso-$1" > $LOCAL_REPOSITORY/log/package
gokhlayeh@315 20 report start
gokhlayeh@315 21 if ! [ -x /usr/bin/tazlito ]; then
gokhlayeh@315 22 report step "Installing tazlito"
gokhlayeh@315 23 tazpkg get-install tazlito || report exit "Installation of tazlito failed."
gokhlayeh@315 24 fi
gokhlayeh@315 25 [ -d "$SLITAZ_DIR/distro" ] && rm -r $SLITAZ_DIR/distro
gokhlayeh@315 26 report step "Generating ISO $1"
gokhlayeh@315 27 cd $tmp
gokhlayeh@315 28 tazlito get-flavor $1 || report exit "Get flavor failed"
gokhlayeh@315 29 sed "/^ISO_NAME/ s/$1/$SLITAZ_VERSION-$1/" -i tazlito.conf
gokhlayeh@315 30 [ "$2" = gzip ] && echo "COMPRESSION=gzip" >> tazlito.conf
gokhlayeh@315 31 echo -e "\n" | tazlito gen-distro || report exit "Generation of iso failed"
gokhlayeh@474 32 cp $LOCAL_REPOSITORY/distro/*.iso $LOCAL_REPOSITORY/distro/*.md5 $LOCAL_REPOSITORY/iso
gokhlayeh@315 33 clean-chroot
gokhlayeh@315 34 report stop
gokhlayeh@315 35 else
paul@427 36 echo "$SLITAZ_DIR/flavors/$1 doesn't exist." >&2
gokhlayeh@315 37 exit 1
gokhlayeh@315 38 fi