AlmightyFrog / BuildEnvironmentATCMiThermometer

Build environment setup for ATC_MiThermometer
19 stars 9 forks source link

Issues running 01_make.sh #2

Closed jesusgt closed 3 years ago

jesusgt commented 3 years ago

Hi there; I am trying to follow your instructions to compile the firmware in my linux machine, and I am encountering the following. I run 00_bootstrap.sh without issues; but when I try to run the 01_make.sh script I get the following:

_precious@BaCKuPS:/tmp/BuildEnvironmentATCMiThermometer$ ./01_make.sh docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/create: dial unix /var/run/docker.sock: connect: permission denied. See 'docker run --help'. precious@BaCKuPS:/tmp/BuildEnvironmentATCMiThermometer$ sudo !! sudo ./01make.sh Unable to find image 'tc32:latest' locally docker: Error response from daemon: pull access denied for tc32, repository does not exist or may require 'docker login': denied: requested access to the resource is denied. See 'docker run --help'. precious@BaCKuPS:/tmp/BuildEnvironmentATCMiThermometer$ docker --version Docker version 19.03.13, build 4484c46d9d

I am running a headless Ubuntu server with Docker freshly installed. Distributor ID: Ubuntu Description: Ubuntu 16.04.6 LTS Release: 16.04 Codename: xenial

I am quite new to docker, so perhaps that it the problem and I am missing something obvious. Any help will be much appreciated :)

AlmightyFrog commented 3 years ago

Please excuse my late response. On your system, could you please check if your user has permissions to use docker or do you e.g. always use sudo?

Not sure about ubuntu, but maybe first try command $ id to see if you're in the group "docker".

jesusgt commented 3 years ago

Many thanks for your response. My user was not part of the group docker, so I added it; nonetheless, it still does not work for me.

_precious@BaCKuPS:~/tmp/BuildEnvironmentATCMiThermometer$ ./01_make.sh Unable to find image 'tc32:latest' locally docker: Error response from daemon: pull access denied for tc32, repository does not exist or may require 'docker login': denied: requested access to the resource is denied. See 'docker run --help'. precious@BaCKuPS:/tmp/BuildEnvironmentATCMiThermometer$ sudo !! sudo ./01make.sh [sudo] password for precious: Unable to find image 'tc32:latest' locally docker: Error response from daemon: pull access denied for tc32, repository does not exist or may require 'docker login': denied: requested access to the resource is denied. See 'docker run --help'. precious@BaCKuPS:/tmp/BuildEnvironmentATCMiThermometer$ id uid=1003(precious) gid=1003(precious) groups=1003(precious),27(sudo),999(docker),1002(xuxo)

@AlmightyFrog You were right, the issue was with not belonging to the docker group. Thanks very much. I needed to redo the whole process from scratch. After removing the folder, git cloned, executed 00_bootstrap.sh followed by 01_make.sh and voila the above error message was gone, however now 01_make.sh seems to have an issue with the SDK path :-/ Any pointers will be much appreciated.

_precious@BaCKuPS:~/tmp/BuildEnvironmentATCMiThermometer$ ./01_make.sh makefile:13: *** "Please check SDKPath". Stop.

AlmightyFrog commented 3 years ago

Hmm i can just make a wild guess, but just two days ago i merged a PR from @martonmiklos. There he adapted the removal for need of patching makefile also updating the original repo with ATCWatch code.

So to spare the guessing i'd kindly ask you to just redo the whole process once. Best checkout this repo at another location on your PC and then execute 00_bootstrap.sh and 01_make.sh. Best copy that whole log into this ticket here if it fails so I can give a better educated guess what is going wrong.

jesusgt commented 3 years ago

No problems.

Output from 00_bootstrap.sh _## First prepare build environment % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 22.9M 0 14036 0 0 17664 0 0:22:39 --:--:-- 0:22:39 17655 0 22.9M 0 227k 0 0 140k 0 0:02:46 0:00:01 0:02:45 140k 10 22.9M 10 2379k 0 0 902k 0 0:00:25 0:00:02 0:00:23 902k 18 22.9M 18 4380k 0 0 1196k 0 0:00:19 0:00:03 0:00:16 1196k 26 22.9M 26 6316k 0 0 1410k 0 0:00:16 0:00:04 0:00:12 1409k 39 22.9M 39 9318k 0 0 1693k 0 0:00:13 0:00:05 0:00:08 1976k 53 22.9M 53 12.1M 0 0 1908k 0 0:00:12 0:00:06 0:00:06 2488k 64 22.9M 64 14.7M 0 0 2002k 0 0:00:11 0:00:07 0:00:04 2592k 76 22.9M 76 17.5M 0 0 2095k 0 0:00:11 0:00:08 0:00:03 2767k 89 22.9M 89 20.4M 0 0 2182k 0 0:00:10 0:00:09 0:00:01 2859k 100 22.9M 100 22.9M 0 0 2251k 0 0:00:10 0:00:10 --:--:-- 2876k Sending build context to Docker daemon 24.02MB

Step 1/14 : FROM debian:stable-slim ---> 17c47e78a3f8 Step 2/14 : ARG USER=user ---> Using cache ---> 9b20569d6ce2 Step 3/14 : ARG UID=1000 ---> Using cache ---> 2f44e1934298 Step 4/14 : ARG GID=1000 ---> Using cache ---> 8401f9df328b Step 5/14 : ENV PATH $PATH:/opt/tc32/bin ---> Using cache ---> 4fa7053e9f99 Step 6/14 : RUN groupadd -g $GID -o $USER ---> Using cache ---> 49f1554392a9 Step 7/14 : RUN useradd -m -u $UID -g $GID -o -s /bin/bash $USER ---> Using cache ---> 08d5e4a4efb4 Step 8/14 : RUN mkdir /app ---> Using cache ---> 859f10e4e4dc Step 9/14 : RUN chown $UID:$GID /app ---> Using cache ---> 94a574515db6 Step 10/14 : RUN apt-get update && apt-get -y install --no-install-recommends python3 python3-serial make && rm -rf /var/lib/apt/lists/* ---> Using cache ---> 903e7335c86d Step 11/14 : USER $USER ---> Using cache ---> 4ce45a01c9fd Step 12/14 : ADD tc32_gcc.tar.bz2 /opt/ ---> Using cache ---> d9501b90b8a7 Step 13/14 : WORKDIR /app ---> Using cache ---> feb6803b8c4d Step 14/14 : ENTRYPOINT ["bash"] ---> Using cache ---> 2b892a9b7a19 Successfully built 2b892a9b7a19 Successfully tagged tc32:latest Now download Telink 825X SDK Cloning into 'SDK'... Download ATC_MiThermometer project Cloning into 'ATCMiThermometer'...

And output from 01_make.sh (It throws away a new error now, related to the creation of the ./out/ directory ) _rm -f ./out/application/app/usbaud.o ./out/application/app/usbcdc.o ./out/application/app/usbkb.o ./out/application/app/usbmouse.o ./out/application/keyboard/keyboard.o ./out/application/print/putchar.o ./out/application/print/u_printf.o ./out/application/usbstd/usb.o ./out/application/usbstd/usbdesc.o ./out/application/usbstd/usbhw.o ./out/boot/8258/cstartup_8258.o ./out/boot/8258/cstartup_8258_RET_16K.o ./out/boot/8258/cstartup_8258_RET_32K.o ./out/boot/div_mod.o ./out/common/breakpoint.o ./out/common/log.o ./out/common/selection_sort.o ./out/common/string.o ./out/common/utility.o ./out/drivers/8258/adc.o ./out/drivers/8258/aes.o ./out/drivers/8258/analog.o ./out/drivers/8258/audio.o ./out/drivers/8258/bsp.o ./out/drivers/8258/clock.o ./out/drivers/8258/emi.o ./out/drivers/8258/flash.o ./out/drivers/8258/gpio_8258.o ./out/drivers/8258/i2c.o ./out/drivers/8258/lpc.o ./out/drivers/8258/qdec.o ./out/drivers/8258/rf_pa.o ./out/drivers/8258/s7816.o ./out/drivers/8258/spi.o ./out/drivers/8258/timer.o ./out/drivers/8258/uart.o ./out/drivers/8258/watchdog.o ./out/vendor/common/blt_common.o ./out/vendor/common/blt_fw_sign.o ./out/vendor/common/blt_led.o ./out/vendor/common/blt_soft_timer.o ./out/vendor/common/tl_audio.o ./out/tinyFlash/tinyFlash.o ./out/app.o ./out/app_att.o ./out/battery.o ./out/ble.o ./out/i2c.o ./out/lcd.o ./out/sensor.o ./out/cmd_parser.o ./out/flash.o ./out/main.o sizedummy ./out/ATC_Thermometer.elf ./out/../ATC_Thermometer.bin ./out/ATC_Thermometer.lst

mkdir -p ./out/application/app ./out/application/keyboard ./out/application/print ./out/application/usbstd ./out/application/TLVFlash ./out/boot/8251 ./out/boot/8253 ./out/boot/8258 ./out/common ./out/drivers/8258 ./out/vendor/common ./out/tinyFlash mkdir: cannot create directory './out': Permission denied mkdir: cannot create directory './out': Permission denied mkdir: cannot create directory './out': Permission denied mkdir: cannot create directory './out': Permission denied mkdir: cannot create directory './out': Permission denied mkdir: cannot create directory './out': Permission denied mkdir: cannot create directory './out': Permission denied mkdir: cannot create directory './out': Permission denied mkdir: cannot create directory './out': Permission denied mkdir: cannot create directory './out': Permission denied mkdir: cannot create directory './out': Permission denied mkdir: cannot create directory './out': Permission denied make: *** [makefile:112: pre-build] Error 1

AlmightyFrog commented 3 years ago

Seems like an UID/GID problem. Seems like yours is 1003 and what i configured in Dockerfile is 1000. You have two easy choices: a) rebuild the docker image with ARG UID=1003 and GID=1003 (e.g. by changing those numbers in Dockerfile itself) and then 00_bootstrap.sh again or b) manually set permission of your currently folder by chmod o+rwx for everyone so out folder can be created.

Not sure if only in out folder files are touched, but i guess. You then can also just do it like

mkdir out chmod o+rwx out ./01_make.sh

jesusgt commented 3 years ago

Perfect. Many thanks for your explanation. It all makes sense now. I have followed the steps and the firmware compiles now. Many thanks for your help with this :) 👍 (and my apologies for not having realised about it when it is clearly stated in the Readme file)

AlmightyFrog commented 3 years ago

I guess as problem is solved and no further points came up last few weeks it is fine to close this issue.