OpenCores
URL https://opencores.org/ocsvn/minsoc/minsoc/trunk

Subversion Repositories minsoc

[/] [minsoc/] [trunk/] [utils/] [setup/] [minsoc-install.sh] - Diff between revs 167 and 168

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 167 Rev 168
Line 48... Line 48...
then
then
    errormsg "You shouldn't be root for this script to run.";
    errormsg "You shouldn't be root for this script to run.";
fi;
fi;
 
 
 
 
 
# Selecting automated or advanced intallation modes
 
# Wizard
 
if [ -z "${AUTO}" ]
 
then
 
        while [ "${AUTO}" != "R" ] &&  [ "${AUTO}" != "A" ]
 
        do
 
            cecho "Select installation mode.";
 
                cnecho "        Enter R for Resumed or A for Advanced mode or H for Help: "
 
            read AUTO;
 
                if [ ${AUTO} == "H" ]
 
                then
 
                        cecho "Advanced mode:"
 
                        cecho "         the script only downloads and installs the required tools. Dependency libraries and tools are checked during individual tool compilation. Furthermore, the install directory is not added to the system PATH. You have to do it yourself. Libusb, libftdi and Icarus Verilog are supposed to be installed by the user.\n"
 
                        cecho "Resumed mode:"
 
                        cecho "         the script checks if the dependency libraries and tools are installed before doing anything. It also adds the installation directory to the system PATH variable for bash shells on HOME/.bashrc. Libusb, libftdi and Icarus Verilog are automatically installed for you.\n"
 
                fi
 
        done
 
    if [ "${AUTO}" == "R" ]
 
    then
 
        cecho "Resumed mode selected";
 
        else
 
                cecho "Advanced mode selected";
 
    fi
 
fi
 
 
 
 
# Testing necessary tools
# Testing necessary tools
 
if [ "${AUTO}" == "R" ]
 
then
cecho "Testing if necessary tools are installed, program "whereis" is required."
cecho "Testing if necessary tools are installed, program "whereis" is required."
testtool wget
testtool wget
testtool svn
testtool svn
testtool bzip2
testtool bzip2
testtool tar
testtool tar
Line 68... Line 96...
if [ "$ENV" == "Cygwin" ]
if [ "$ENV" == "Cygwin" ]
then
then
    testtool ioperm
    testtool ioperm
    testtool libusb
    testtool libusb
fi
fi
 
fi
 
 
# Wizard
# Wizard
if [ -z "${ALTDIR}" ]
if [ -z "${ALTDIR}" ]
then
then
    cnecho "Give full path (ex. /home/foo/) for installation directory or leave empty for "${DIR_TO_INSTALL}": ";
    cnecho "Give full path (ex. /home/foo/) for installation directory or leave empty for "${DIR_TO_INSTALL}": ";
Line 121... Line 149...
    fi
    fi
fi
fi
execcmd "Downloading GDB" "wget ftp://anonymous:anonymous@ftp.gnu.org/gnu/gdb/gdb-6.8a.tar.bz2"
execcmd "Downloading GDB" "wget ftp://anonymous:anonymous@ftp.gnu.org/gnu/gdb/gdb-6.8a.tar.bz2"
execcmd "wget ftp://ocuser:ocuser@openrisc.opencores.org/toolchain/or32-gdb-6.8-patch-2.4.bz2"
execcmd "wget ftp://ocuser:ocuser@openrisc.opencores.org/toolchain/or32-gdb-6.8-patch-2.4.bz2"
execcmd "svn export -q http://opencores.org/ocsvn/adv_debug_sys/adv_debug_sys/trunk/Patches/GDB6.8/gdb-6.8-bz436037-reg-no-longer-active.patch"
execcmd "svn export -q http://opencores.org/ocsvn/adv_debug_sys/adv_debug_sys/trunk/Patches/GDB6.8/gdb-6.8-bz436037-reg-no-longer-active.patch"
 
if [ "${AUTO}" == "R" ]
 
then
if [ "$ENV" != "Cygwin" ]
if [ "$ENV" != "Cygwin" ]
then
then
    execcmd "Downloading libusb-0.1 for Advanced Debug System" "wget http://sourceforge.net/projects/libusb/files/libusb-0.1%20%28LEGACY%29/0.1.12/libusb-0.1.12.tar.gz"
    execcmd "Downloading libusb-0.1 for Advanced Debug System" "wget http://sourceforge.net/projects/libusb/files/libusb-0.1%20%28LEGACY%29/0.1.12/libusb-0.1.12.tar.gz"
fi
fi
execcmd "Downloading libftdi for Advanced Debug System" "wget http://www.intra2net.com/en/developer/libftdi/download/libftdi-0.19.tar.gz"
execcmd "Downloading libftdi for Advanced Debug System" "wget http://www.intra2net.com/en/developer/libftdi/download/libftdi-0.19.tar.gz"
execcmd "Downloading Icarus Verilog" "wget ftp://icarus.com/pub/eda/verilog/v0.9/verilog-0.9.4.tar.gz"
execcmd "Downloading Icarus Verilog" "wget ftp://icarus.com/pub/eda/verilog/v0.9/verilog-0.9.4.tar.gz"
 
fi
 
 
 
 
#Uncompressing everything
#Uncompressing everything
cecho "\nUncompressing packages"
cecho "\nUncompressing packages"
if [ "$ENV" == "Cygwin" ]
if [ "$ENV" == "Cygwin" ]
Line 145... Line 176...
        execcmd "tar xf or32-elf-linux-x86_64.tar.bz2";
        execcmd "tar xf or32-elf-linux-x86_64.tar.bz2";
    fi
    fi
fi
fi
execcmd "tar -jxf gdb-6.8a.tar.bz2"
execcmd "tar -jxf gdb-6.8a.tar.bz2"
execcmd "bzip2 -d or32-gdb-6.8-patch-2.4.bz2"
execcmd "bzip2 -d or32-gdb-6.8-patch-2.4.bz2"
 
if [ "${AUTO}" == "R" ]
 
then
if [ "$ENV" != "Cygwin" ]
if [ "$ENV" != "Cygwin" ]
then
then
    execcmd "tar zxf libusb-0.1.12.tar.gz"
    execcmd "tar zxf libusb-0.1.12.tar.gz"
fi
fi
execcmd "tar zxf libftdi-0.19.tar.gz"
execcmd "tar zxf libftdi-0.19.tar.gz"
execcmd "tar zxf verilog-0.9.4.tar.gz"
execcmd "tar zxf verilog-0.9.4.tar.gz"
 
fi
 
 
 
 
#Compiling and Installing all packages
#Compiling and Installing all packages
cecho "\nCompiling and installing packages"
cecho "\nCompiling and installing packages"
# Installing the GNU Toolchain
# Installing the GNU Toolchain
Line 185... Line 219...
make install 1>>${SCRIPT_DIR}/progress.log 2>>${SCRIPT_DIR}/error.log   #avoid Fedora failing due to missing Makeinfo
make install 1>>${SCRIPT_DIR}/progress.log 2>>${SCRIPT_DIR}/error.log   #avoid Fedora failing due to missing Makeinfo
PATH="$PATH:${DIR_TO_INSTALL}/tools/bin"
PATH="$PATH:${DIR_TO_INSTALL}/tools/bin"
 
 
 
 
#Installing Advanced JTAG Bridge support libraries
#Installing Advanced JTAG Bridge support libraries
 
if [ "${AUTO}" == "R" ]
 
then
if [ "$ENV" != "Cygwin" ]
if [ "$ENV" != "Cygwin" ]
then
then
    execcmd "cd ${DIR_TO_INSTALL}/download/libusb-0.1.12"
    execcmd "cd ${DIR_TO_INSTALL}/download/libusb-0.1.12"
    execcmd "./configure --prefix=${DIR_TO_INSTALL}/tools"
    execcmd "./configure --prefix=${DIR_TO_INSTALL}/tools"
    execcmd "Installing libusb-0.1" "make"
    execcmd "Installing libusb-0.1" "make"
Line 197... Line 233...
 
 
execcmd "cd ${DIR_TO_INSTALL}/download/libftdi-0.19"
execcmd "cd ${DIR_TO_INSTALL}/download/libftdi-0.19"
execcmd "PATH=\"$PATH:${DIR_TO_INSTALL}/tools/bin\" ./configure --prefix=${DIR_TO_INSTALL}/tools CPPFLAGS=-I${DIR_TO_INSTALL}/tools/include"
execcmd "PATH=\"$PATH:${DIR_TO_INSTALL}/tools/bin\" ./configure --prefix=${DIR_TO_INSTALL}/tools CPPFLAGS=-I${DIR_TO_INSTALL}/tools/include"
execcmd "Compiling libftdi" "make"
execcmd "Compiling libftdi" "make"
execcmd "make install"
execcmd "make install"
 
fi
 
 
 
 
#Installing Advanced JTAG Bridge
#Installing Advanced JTAG Bridge
execcmd "cd ${DIR_TO_INSTALL}/minsoc/rtl/verilog/adv_debug_sys/Software/adv_jtag_bridge"
execcmd "cd ${DIR_TO_INSTALL}/minsoc/rtl/verilog/adv_debug_sys/Software/adv_jtag_bridge"
execcmd "./autogen.sh"
execcmd "./autogen.sh"
Line 208... Line 245...
execcmd "Compiling Advanced JTAG Bridge" "make"
execcmd "Compiling Advanced JTAG Bridge" "make"
execcmd "make install"
execcmd "make install"
 
 
 
 
#Installing Icarus Verilog
#Installing Icarus Verilog
 
if [ "${AUTO}" == "R" ]
 
then
execcmd "cd ${DIR_TO_INSTALL}/download/verilog-0.9.4"
execcmd "cd ${DIR_TO_INSTALL}/download/verilog-0.9.4"
execcmd "./configure --prefix=${DIR_TO_INSTALL}/tools"
execcmd "./configure --prefix=${DIR_TO_INSTALL}/tools"
execcmd "Compiling Icarus Verilog" "make"
execcmd "Compiling Icarus Verilog" "make"
execcmd "make install"
execcmd "make install"
 
fi
 
 
 
 
#Configuring MinSoC, Advanced Debug System and patching OpenRISC
#Configuring MinSoC, Advanced Debug System and patching OpenRISC
bash ${SCRIPT_DIR}/configure.sh
bash ${SCRIPT_DIR}/configure.sh
 
 
 
 
#Setting-up new variables
#Setting-up new variables
 
if [ "${AUTO}" == "R" ]
 
then
cecho "\nSystem configurations"
cecho "\nSystem configurations"
execcmd "Adding MinSoC tools to PATH" "echo \"PATH=\\\"\\\$PATH:$DIR_TO_INSTALL/tools/bin\\\"\" >> /home/$(whoami)/.bashrc;";
execcmd "Adding MinSoC tools to PATH" "echo \"PATH=\\\"\\\$PATH:$DIR_TO_INSTALL/tools/bin\\\"\" >> /home/$(whoami)/.bashrc;";
execcmd "Adding OpenRISC toolchain to PATH" "echo \"PATH=\\\"\\\$PATH:$DIR_TO_INSTALL/tools/or32-elf/bin/\\\"\" >> /home/$(whoami)/.bashrc;";
execcmd "Adding OpenRISC toolchain to PATH" "echo \"PATH=\\\"\\\$PATH:$DIR_TO_INSTALL/tools/or32-elf/bin/\\\"\" >> /home/$(whoami)/.bashrc;";
 
 
cecho "\nInstallation Complete!"
cecho "\nInstallation Complete!"
cecho "Before using the system, load the new environment variables doing this: source /home/$(whoami)/.bashrc"
cecho "Before using the system, load the new environment variables doing this: source /home/$(whoami)/.bashrc"
cecho "You may remove the ${DIR_TO_INSTALL}/download directory if you wish."
cecho "You may remove the ${DIR_TO_INSTALL}/download directory if you wish."
 
else
 
        cecho "\nInstallation Complete!\n"
 
        cecho "Remember to add the two following directories in the following order to the PATH system variable."
 
        cecho "1) $DIR_TO_INSTALL/tools/bin "
 
        cecho "2) $DIR_TO_INSTALL/tools/or32-elf/bin "
 
        cecho "You may remove the ${DIR_TO_INSTALL}/download directory if you wish."
 
fi
 
 
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.