diff --git a/scripts/upload.py b/scripts/upload.py index 14117bd..fb1f1f4 100755 --- a/scripts/upload.py +++ b/scripts/upload.py @@ -84,16 +84,11 @@ def upload_bload(filename): print("Failed to open serial port") def upload_sd(filename): - if os.geteuid() == 0: - print("Running as root") - file_in = open(filename, "rb") - file_out = open("/dev/sdb", "wb") + # @todo This does require /dev/sdb to be accessible without root + file_in = open(filename, "rb") + file_out = open("/dev/sdb", "wb") - file_out.write(file_in.read()) - else: - print("Reqeusting root permission") - subprocess.call(["sudo", "python3", *sys.argv]) - sys.exit() + file_out.write(file_in.read()) # @todo For now we just wrap the existing mojo.py tool diff --git a/source.sh b/source.sh index 0af5962..1c21fd1 100644 --- a/source.sh +++ b/source.sh @@ -1,3 +1,4 @@ # This order makes it so we can use deactive to also deactive the other additions to the path +sudo chown tim:tim /dev/sdb source $(dirname $(readlink -f $0))/env/bin/activate PATH=$(dirname $(readlink -f $0))/arm-none-eabi/bin:$(dirname $(readlink -f $0))/microblazeel-xilinx-elf/bin:$(dirname $(readlink -f $0))/bin:/opt/Xilinx/14.7/ISE_DS/EDK/bin/lin64:$PATH