tasyagle script more functional
authorAndrey Miroshnikov <andrey@technepisteme.xyz>
Tue, 12 Jul 2022 14:07:14 +0000 (15:07 +0100)
committerAndrey Miroshnikov <andrey@technepisteme.xyz>
Tue, 12 Jul 2022 14:07:14 +0000 (15:07 +0100)
tasyagle-install

index cf18d2c9d13321787310e5836e24216acbb11a83..e171330978cb4533960785f6f66ad83632b793e3 100755 (executable)
@@ -1,9 +1,21 @@
 #!/bin/sh
 
-# DON'T USE YET, DRAFT
+# Ensure common schroot packages have been installed
+#   ./install-hdl-apt-reqs
 
-mkdir -p /home/$USER/src
-cd /home/$USER/src
+if [ "$EUID" -ne 0 ]
+  then echo "Please run as root"
+  exit
+fi
+
+apt-get install -y default-jre-headless libncurses5 #libedit-dev
+
+mkdir -p /home/$SUDO_USER/src
+cd /home/$SUDO_USER/src
 git clone https://gitlab.lip6.fr/vlsi-eda/tas-yagle.git
 cd tas-yagle
 ./build.sh
+
+cd /home/$SUDO_USER/src
+chown -R $SUDO_USER .
+chgrp -R $SUDO_USER .