summaryrefslogblamecommitdiffstats
path: root/bin/env.setup-syslinux.sh
blob: 13f9baf49888e0c4ee9d8db2cc698ca9077efbab (plain) (tree)
1
           





























                                                                              
                                                                                           
            
                                                                                                                                                


                             
                                                                





                     
#!/bin/bash

ROOT_DIR=$(readlink -f $(dirname $(readlink -f $0))/..)

. $ROOT_DIR/config/setup.conf

if [ "$syslinux_use_testing" = "1" ]; then
  SYSLINUX_URL=$syslinux_testing_url
  SYSLINUX_VERSION=$syslinux_testing_version
  SYSLINUX_TESTING="x"
else
  SYSLINUX_URL=$syslinux_stable_url
  SYSLINUX_VERSION=$syslinux_stable_version
  SYSLINUX_STABLE="x"
fi


get_syslinux ()
{
	wget -q $SYSLINUX_URL
	tar xjf $SYSLINUX_VERSION.tar.bz2
	rm $SYSLINUX_VERSION.tar.bz2
	rm latest
	ln -sf $SYSLINUX_VERSION/ latest
}


cd $ROOT_DIR/contrib/syslinux

if [ "x$(readlink -e latest)" != "x" ]; then
	if [ "$(basename $(readlink -e latest))" = "$SYSLINUX_VERSION" ]; then
		echo -e "[setup-syslinux] \t Found up-to-date syslinux ($SYSLINUX_VERSION)"
	else
		echo -e "[setup-syslinux] \t Found different syslinux version ($(basename $(readlink -e latest))). Switch to $SYSLINUX_VERSION."
		get_syslinux 
	fi
else 
	echo -e "[setup-syslinux] \t Install $SYSLINUX_VERSION."
	get_syslinux
fi

cd - 2>&1 > /dev/null