IEEE.org     |     IEEE Xplore Digital Library     |     IEEE Standards     |     IEEE Spectrum     |     More Sites

Commit 27b0b573 authored by Alfredo Herrera's avatar Alfredo Herrera
Browse files

using variable for username

parent 5fdba704
......@@ -36,7 +36,7 @@ fi
set -eux
echo "Installing Eclipse-IDE and MCU plugins"; echo""
cd /home/user
cd /home/$USERNAME
curl -L https://github.com/gnu-mcu-eclipse/org.eclipse.epp.packages/releases/download/v4.5.1-20190101-2018-12/20190101-2023-gnumcueclipse-4.5.1-2018-12-R-linux.gtk.x86_64.tar.gz > 20190101-2023-gnumcueclipse-4.5.1-2018-12-R-linux.gtk.x86_64.tar.gz
curl -L https://github.com/riscv/riscv-ovpsim/archive/master.zip > riscv-ovpsim-master.zip
# Extract eclipse that includes GNU MCU plugins, eclipse executable will be ./eclipse/eclipse
......@@ -46,6 +46,6 @@ tar xf 20190101-2023-gnumcueclipse-4.5.1-2018-12-R-linux.gtk.x86_64.tar.gz
unzip riscv-ovpsim-master.zip
mv riscv-ovpsim-master riscv-ovpsim
cd /home/user
cd /home/$USERNAME
rm 20190101-2023-gnumcueclipse-4.5.1-2018-12-R-linux.gtk.x86_64.tar.gz riscv-ovpsim-master.zip
......@@ -37,11 +37,11 @@ set -eux
# Install PULP-platform GNU toolchain
#---
echo "Installing PULP GNU toolchain"; echo""
cd /home/user
cd /home/$USERNAME
git clone --recursive https://github.com/pulp-platform/pulp-riscv-gnu-toolchain
cd pulp-riscv-gnu-toolchain
./configure --prefix=/home/user/pulp --with-arch=rv32imc --with-cmodel=medlow --enable-multilib
make
cd /home/user
cd /home/$USERNAME
rm -rf pulp-riscv-gnu-toolchain
......@@ -38,21 +38,21 @@ set -eux
#---
# Install rv32m1 SDK tools
echo "Installing rv32m1 tools"; echo""
cd /home/user
cd /home/$USERNAME
cd /home/user
cd /home/$USERNAME
# Extract toolchain, takes two steps as there are archives in Toolchain_Linux.tar.gz)
mkdir toolchain
# Set the toolchain defaults for GNU MCU plug-ins to what we just "installed"
mkdir -p /home/user/eclipse/configuration/.settings/
mkdir -p /home/$USERNAME/eclipse/configuration/.settings/
# openocd location
echo "eclipse.preferences.version=1" > /home/user/eclipse/configuration/.settings/ilg.gnumcueclipse.debug.gdbjtag.openocd.prefs
echo "install.folder=/home/user/toolchain" >> /home/user/eclipse/configuration/.settings/ilg.gnumcueclipse.debug.gdbjtag.openocd.prefs
echo "eclipse.preferences.version=1" > /home/$USERNAME/eclipse/configuration/.settings/ilg.gnumcueclipse.debug.gdbjtag.openocd.prefs
echo "install.folder=/home/$USERNAME/toolchain" >> /home/$USERNAME/eclipse/configuration/.settings/ilg.gnumcueclipse.debug.gdbjtag.openocd.prefs
# gcc & friends location
echo "eclipse.preferences.version=1" > /home/user/eclipse/configuration/.settings/ilg.gnumcueclipse.managedbuild.cross.riscv.prefs
echo "eclipse.preferences.version=1" > /home/$USERNAME/eclipse/configuration/.settings/ilg.gnumcueclipse.managedbuild.cross.riscv.prefs
# (magic number comes from https://github.com/gnu-mcu-eclipse/eclipse-plugins/blob/ce601cf2ec20cba90d9f2c2fbdb236b5fd7a6385/bundles/ilg.gnumcueclipse.managedbuild.cross.riscv/src/ilg/gnumcueclipse/managedbuild/cross/riscv/ToolchainDefinition.java#L30)
# Modified for pre-release version
echo "toolchain.path.512258282=/home/user/pulp/riscv32-unknown-elf/bin" >> /home/user/eclipse/configuration/.settings/ilg.gnumcueclipse.managedbuild.cross.riscv.prefs
echo "toolchain.path.512258282=/home/$USERNAME/pulp/riscv32-unknown-elf/bin" >> /home/$USERNAME/eclipse/configuration/.settings/ilg.gnumcueclipse.managedbuild.cross.riscv.prefs
......@@ -40,6 +40,7 @@ fi
# Show commands being used and error out on unexpected situations
set -eux
export USERNAME=$(logname)
#---
# libudev package not available
echo "Updating Ubuntu"; echo""
......@@ -54,7 +55,7 @@ cd "$(dirname "$0")"
#---
# Install PULP-Platform GNU toolchain
#---
sudo -u user pulp_install.sh
sudo -u $USERNAME pulp_install.sh
#---
# Install Verilator tool
......@@ -63,7 +64,7 @@ verilator_install.sh
#---
# Install Elipse-IDE and MCU plugins
sudo -u user eclipse-mcu_install.sh
sudo -u $USERNAME eclipse-mcu_install.sh
#---
# Install SEGGER J-Link drivers
......@@ -75,16 +76,12 @@ apt-get install -f ./JLink_Linux_V650a_x86_64.deb
#---
# append to ~/.bashrc
#---
cat > $HOME/.editor <<EOF
vim
EOF
if [ -f ../LICENSE ]
if [ -f /home/$USERNAME/LICENSE ]
then
cp ../LICENSE $HOME/Apache_license_v2.0.txt
cp ../LICENSE /home/$USERNAME/Apache_license_v2.0.txt
fi
cat > $HOME/.BTADS_welcom.txt <<EOF
cat > /home/$USERNAME/.BTADS_welcom.txt <<EOF
#-----------------------------------------------------------------------------
# Copyright (c) 2019 BTA Design Services Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
......@@ -103,14 +100,14 @@ cat > $HOME/.BTADS_welcom.txt <<EOF
#------------------------------------------------------------------------------
EOF
cat >> $HOME/.bashrc <<EOF
cat >> /home/$USERNAME/.bashrc <<EOF
#------------------------------------------------------------------------------
# Additional settings
#------------------------------------------------------------------------------
if [ -f $HOME/.editor ]
if [ -f /home/$USERNAME/.editor ]
then
EDITOR=`cat $HOME/.editor`
EDITOR=`cat /home/$USERNAME/.editor`
fi
export LD_LIBRARY_PATH=/usr/local/lib
......@@ -119,7 +116,7 @@ export PATH=$PATH:$JAVA_HOME/bin:/home/user/eclipse:/home/user/riscv-ovpsim/bin
export RISCV32GCC_DIR="/home/user/pulp"
#export PULP_RISCV_GCC_TOOLCHAIN="/home/user/pulp"
cat $HOME/.BTADS_welcome.txt
cat /home/$USERNAME/.BTADS_welcome.txt
EOF
echo "The installation is done"
......
......@@ -35,7 +35,7 @@ fi
set -eux
echo "Installing Verilator tool"; echo""
cd /home/user
cd /home/$USERNAME
git clone http://git.veripool.org/git/verilator
pushd verilator
......@@ -47,5 +47,5 @@ make
make install
popd
rm -rf /home/user/verilator
rm -rf /home/$USERNAME/verilator
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment