summaryrefslogblamecommitdiffstats
path: root/inc/env.setup-syslinux.sh
blob: 9c3989f8aa12d24bf78afa174c7df632c95d9c95 (plain) (tree)










































                                                                                                                                        
#!/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/share/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