coriolis-install, cp-scripts-to-chroot: adjusted names to align with the rest of...
[dev-env-setup.git] / hdl-tools-yosys
index 23cbd93304876fa421e537ac7f7d674827c625e5..086bda8728a1c2f3b71baf2208c584993ed2febc 100755 (executable)
@@ -1,15 +1,19 @@
 #!/bin/bash
 if [ "$EUID" -ne 0 ]
-  then echo "Please run as root"
+  then echo "Please run as root using 'sudo bash'"
   exit
 fi
 
+# this is a bit of a cheat, by relying on debian to pull in all the
+# build dependencies.  saves time researching how to get and list them
+# by hand.
 apt-get update -y 
 apt-get build-dep yosys -y
 apt-get remove yosys -y
 
-cd $SUDO_USER/home
-mkdir hdl_tools
+mkdir -p /home/$SUDO_USER/src
+cd /home/$SUDO_USER/src
+mkdir -p hdl_tools
 cd hdl_tools
 
 git clone https://github.com/cliffordwolf/yosys.git
@@ -37,6 +41,6 @@ cd build
 make -j$(nproc)
 make install
 
-cd $SUDO_USER/home/hdl_tools
-chown -R $SUDO_USER hdl_tools
-chgrp -R $SUDO_USER hdl_tools
+cd /home/$SUDO_USER/src/hdl_tools
+chown -R $SUDO_USER .
+chgrp -R $SUDO_USER .