wok-4.x rev 2650

mirror-tools: update pxe for 2.0
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Apr 18 12:53:55 2009 +0200 (2009-04-18)
parents 9c3d6a557b06
children 8299a5a88c0f
files mirror-tools/stuff/var/www/slitaz/mirror/pxe/mkcfg.sh
line diff
     1.1 --- a/mirror-tools/stuff/var/www/slitaz/mirror/pxe/mkcfg.sh	Sat Apr 18 00:21:48 2009 +0200
     1.2 +++ b/mirror-tools/stuff/var/www/slitaz/mirror/pxe/mkcfg.sh	Sat Apr 18 12:53:55 2009 +0200
     1.3 @@ -15,46 +15,63 @@
     1.4          echo -e "\\033[0;39m ]"
     1.5  }
     1.6  
     1.7 -echo -n "Building cooking"
     1.8 -rm -f cooking/*-*.cfg
     1.9 -( cd ../boot/cooking ; ls rootfs-*.gz 2> /dev/null ) | \
    1.10 +for version in cooking $(ls ../boot | grep 0$) ; do
    1.11 +
    1.12 +[ "$version" = "1.0" ] && continue
    1.13 +echo -n "Building $version"
    1.14 +if ! grep -q $version/splash.lss $version/isolinux.msg ; then
    1.15 +	echo "WARNING: please update $version/isolinux.msg with $version/splash.lss"
    1.16 +fi
    1.17 +rm -f $version/*-*.cfg
    1.18 +( cd ../boot/$version ; ls rootfs-*.gz 2> /dev/null ) | \
    1.19  sed 's/rootfs-\(.*\).gz/\1/' | while read flavor; do
    1.20 -    	[ -f cooking/$flavor.cfg ] && continue
    1.21 -        cp cooking/core.cfg cooking/$flavor.cfg
    1.22 +	lowcased=$(echo $flavor | tr [A-Z] [a-z])
    1.23 +	if [ "$lowcased" != "$flavor" ]; then
    1.24 +		echo ""
    1.25 +		echo "Warning : renaming ../boot/$version/rootfs-$flavor.gz to ../boot/$version/rootfs-$lowcased.gz"
    1.26 +		mv ../boot/$version/rootfs-$flavor.gz ../boot/$version/rootfs-$lowcased.gz
    1.27 +		flavor=$lowcased
    1.28 +	fi
    1.29 +    	[ -f $version/$flavor.cfg ] && continue
    1.30 +        cp $version/core.cfg $version/$flavor.cfg
    1.31  	sed -i -e "s/core-common/$flavor-common/" \
    1.32 -	       -e "s/rootfs.gz/rootfs-$flavor.gz/" cooking/$flavor.cfg
    1.33 +	       -e "s/rootfs.gz/rootfs-$flavor.gz/" $version/$flavor.cfg
    1.34  done
    1.35 -for flavor in $(cd cooking ; ls *.cfg | sed 's/.cfg//') ; do
    1.36 +for flavor in $(cd $version ; ls *.cfg | sed 's/.cfg//') ; do
    1.37    echo -n " $flavor"
    1.38 -  cat > cooking/$flavor-common.cfg <<EOT
    1.39 +  cat > $version/$flavor-common.cfg <<EOT
    1.40  default slitaz
    1.41  label deCH
    1.42 -	config cooking/$flavor-de_CH.cfg
    1.43 +	config $version/$flavor-de_CH.cfg
    1.44  label frCH
    1.45 -	config cooking/$flavor-fr_CH.cfg
    1.46 +	config $version/$flavor-fr_CH.cfg
    1.47  label reboot
    1.48  	com32 reboot.c32
    1.49  
    1.50  implicit 0	
    1.51  prompt 1	
    1.52  timeout 80
    1.53 -F1 cooking/help.txt
    1.54 -F2 cooking/options.txt
    1.55 -F3 cooking/isolinux.msg
    1.56 -F4 cooking/display.txt
    1.57 -F5 cooking/enhelp.txt
    1.58 -F6 cooking/enopts.txt
    1.59 +F1 $version/help.txt
    1.60 +F2 $version/options.txt
    1.61 +F3 $version/isolinux.msg
    1.62 +F4 $version/display.txt
    1.63 +F5 $version/enhelp.txt
    1.64 +F6 $version/enopts.txt
    1.65  
    1.66  EOT
    1.67    while read cfg kbd loc ; do
    1.68 +    if [ ! -f $version/$cfg.kbd ]; then
    1.69 +    	echo ""
    1.70 +	echo "Not found: $version/$cfg.kbd"
    1.71 +    fi
    1.72      info="Now using $kbd keyboard and $loc locale."
    1.73 -    sed -e "s/^display/kbdmap cooking\/$cfg.kbd\ndisplay/" \
    1.74 +    sed -e "s/^display/kbdmap $version\/$cfg.kbd\ndisplay/" \
    1.75          -e "s/^label slitaz$/say $info\nlabel slitaz/" \
    1.76          -e "s/gz/gz lang=$loc kmap=$kbd/" \
    1.77 -        < cooking/$flavor.cfg > cooking/$flavor-$cfg.cfg
    1.78 -    cat >> cooking/$flavor-common.cfg <<EOT
    1.79 +        < $version/$flavor.cfg > $version/$flavor-$cfg.cfg
    1.80 +    cat >> $version/$flavor-common.cfg <<EOT
    1.81  label $cfg
    1.82 -	config cooking/$flavor-$cfg.cfg
    1.83 +	config $version/$flavor-$cfg.cfg
    1.84  EOT
    1.85    done <<EOT
    1.86  be    be-latin1    fr_FR
    1.87 @@ -77,6 +94,8 @@
    1.88  done
    1.89  status
    1.90  
    1.91 +done
    1.92 +
    1.93  echo -n "Building 1.0"
    1.94  rm -f 1.0/*-*.cfg
    1.95  ( cd ../boot/1.0 ; ls rootfs-*.gz 2> /dev/null ) | \
    1.96 @@ -106,6 +125,10 @@
    1.97  F4 1.0/display.txt
    1.98  EOT
    1.99    while read cfg kbd loc ; do
   1.100 +    if [ ! -f 1.0/$cfg.kbd ]; then
   1.101 +    	echo ""
   1.102 +	echo "Not found: 1.0/$cfg.kbd"
   1.103 +    fi
   1.104      sed -e "s/^display/KBDMAP 1.0\/$cfg.kbd\ndisplay/" \
   1.105          -e "s/gz/gz lang=$loc kmap=$kbd/" \
   1.106          < 1.0/$flavor.cfg > 1.0/$flavor-$cfg.cfg