From 0a6d53e1e9aa4e508a53cc0b4de981a012635f44 Mon Sep 17 00:00:00 2001 From: Ka Ru Date: Sun, 29 Oct 2023 07:24:22 +0100 Subject: [PATCH 1/7] add docker --- Dockerfile | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..080c93966 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,77 @@ +ARG BASE_IMAGE="ubuntu" +# ARG TAG="18.04" +ARG TAG="22.04" +FROM ${BASE_IMAGE}:${TAG} +WORKDIR /vesc_tool + +ARG DEBIAN_FRONTEND=noninteractive +ARG USER_NAME=vesc_tool +ARG USER_UID=1000 +ARG USER_GID=1000 + +RUN groupadd ${USER_NAME} --gid ${USER_GID}\ + && useradd -l -m ${USER_NAME} -u ${USER_UID} -g ${USER_GID} -s /bin/bash + +RUN apt-get update && apt-get install --no-install-recommends -y \ + sudo \ + bash-completion \ + python3 python-is-python3 perl git openssl libssl-dev\ + wget curl iputils-ping build-essential \ + make ca-certificates xz-utils bzip2 zip \ + # libqt5printsupport5 libqt5quickwidgets5 libqt5gamepad5 libqt5serialport5 \ + # libqt5bluetooth5 libqt5positioning5 libqt5bluetooth5 libqt5widgets5 qml-module-qtquick-controls \ + # qml-module-qtquick-controls2 qml-module-qtquick-extras qml-module-qt-labs-settings \ + # qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools \ + # libdrm-dev libgles2-mesa-dev \ + # libxcb-xinerama0-dev "^libxcb.*" \ + # libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev \ + # flex bison gperf libicu-dev libxslt-dev ruby libssl-dev \ + # libxcursor-dev libxcomposite-dev libxdamage-dev libxrandr-dev \ + # libfontconfig1-dev libcap-dev libxtst-dev libpulse-dev libudev-dev \ + # libpci-dev libnss3-dev libasound2-dev libxss-dev libegl1-mesa-dev \ + # gperf bison libbz2-dev libgcrypt20-dev libdrm-dev libcups2-dev \ + # libatkmm-1.6-dev libasound2-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ + # libbluetooth-dev bluetooth blueman bluez libusb-dev libdbus-1-dev bluez-hcidump \ + # bluez-tools + + qtbase5-private-dev qtscript5-dev \ + qml-module-qt-labs-folderlistmodel qml-module-qtquick-extras \ + qml-module-qtquick-controls2 qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5quickcontrols2-5 qtquickcontrols2-5-dev \ + qtcreator qtcreator-doc libqt5serialport5-dev qml-module-qt3d qt3d5-dev \ + qtdeclarative5-dev qtconnectivity5-dev qtmultimedia5-dev qtpositioning5-dev \ + libqt5gamepad5-dev qml-module-qt-labs-settings qml-module-qt-labs-platform libqt5svg5-dev + + + +ENV USER=${USER_NAME} + +RUN echo "vesc_tool ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/${USER_NAME} +RUN chmod 0440 /etc/sudoers.d/${USER_NAME} + +RUN chown -R ${USER_NAME}:${USER_NAME} /${USER_NAME} + +USER ${USER_NAME} + +# RUN cd /opt \ +# && sudo mkdir qt5 \ +# && sudo chown $USER qt5 \ +# && git clone https://code.qt.io/qt/qt5.git \ +# && cd qt5 \ +# && git checkout 5.15 \ +# && perl init-repository --module-subset=default,-qtwebkit,-qtwebkit-examples,-qtwebengine + +# RUN sudo mkdir /opt/qt5/build \ +# && cd /opt/qt5/build \ +# && sudo chown $USER /opt/qt5/build \ +# && ../configure -prefix /opt/Qt/5.15-static/ -release -opensource -confirm-license \ +# -static -no-sql-mysql -no-sql-psql -no-sql-sqlite -no-journald -qt-zlib -no-mtdev \ +# -no-gif -qt-libpng -qt-libjpeg -qt-harfbuzz -qt-pcre -no-glib -no-compile-examples \ +# -no-cups -no-iconv -no-tslib -dbus-linked \ +# -no-xcb-xlib -no-eglfs -no-directfb -no-linuxfb -no-kms \ +# -nomake examples -nomake tests -skip qtwebsockets -skip qtwebchannel \ +# -skip qtwebengine -skip qtwayland -skip qtwinextras -skip qtsensors -skip multimedia \ +# -no-libproxy -no-icu -qt-freetype -skip qtimageformats -opengl es2 \ +# && make -j$(nproc) \ +# && sudo make install + +CMD ["bash"] \ No newline at end of file From a45b6d3302c2e8c531f1c59244825cf7e19d2fd3 Mon Sep 17 00:00:00 2001 From: Ka Ru Date: Sun, 29 Oct 2023 08:54:11 +0100 Subject: [PATCH 2/7] edit build_linX --- build_lin | 12 ++++++------ build_lin_original_only | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build_lin b/build_lin index 0d61474b6..0749b0218 100755 --- a/build_lin +++ b/build_lin @@ -56,7 +56,7 @@ rm -rf build/lin/* # Original qmake -config release "CONFIG += release_lin build_original" make clean -make -j8 +make -j$(nproc) rm -rf build/lin/obj cd build/lin zip vesc_tool_original_linux.zip `ls | grep -v '\.zip$'` @@ -66,7 +66,7 @@ cd ../.. # Platinum qmake -config release "CONFIG += release_lin build_platinum" make clean -make -j8 +make -j$(nproc) rm -rf build/lin/obj cd build/lin zip vesc_tool_platinum_linux.zip `ls | grep -v '\.zip$'` @@ -76,7 +76,7 @@ cd ../.. # Gold qmake -config release "CONFIG += release_lin build_gold" make clean -make -j8 +make -j$(nproc) rm -rf build/lin/obj cd build/lin zip vesc_tool_gold_linux.zip `ls | grep -v '\.zip$'` @@ -86,7 +86,7 @@ cd ../.. # Silver qmake -config release "CONFIG += release_lin build_silver" make clean -make -j8 +make -j$(nproc) rm -rf build/lin/obj cd build/lin zip vesc_tool_silver_linux.zip `ls | grep -v '\.zip$'` @@ -96,7 +96,7 @@ cd ../.. # Bronze qmake -config release "CONFIG += release_lin build_bronze" make clean -make -j8 +make -j$(nproc) rm -rf build/lin/obj cd build/lin zip vesc_tool_bronze_linux.zip `ls | grep -v '\.zip$'` @@ -106,7 +106,7 @@ cd ../.. # Free of charge qmake -config release "CONFIG += release_lin build_free" make clean -make -j8 +make -j$(nproc) rm -rf build/lin/obj cd build/lin zip vesc_tool_free_linux.zip `ls | grep -v '\.zip$'` diff --git a/build_lin_original_only b/build_lin_original_only index 5759b5cff..b30bc0c82 100755 --- a/build_lin_original_only +++ b/build_lin_original_only @@ -8,6 +8,6 @@ rm -rf build/lin/* # Original qmake -config release "CONFIG += release_lin build_original" make clean -make -j8 +make -j$(nproc) rm -rf build/lin/obj From cb4f154440618585ed78645c4c333ba7a9a181f4 Mon Sep 17 00:00:00 2001 From: karu2003 Date: Mon, 30 Oct 2023 07:28:55 +0100 Subject: [PATCH 3/7] fix Empty line --- Dockerfile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 080c93966..69931e0f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,8 +32,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ # gperf bison libbz2-dev libgcrypt20-dev libdrm-dev libcups2-dev \ # libatkmm-1.6-dev libasound2-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ # libbluetooth-dev bluetooth blueman bluez libusb-dev libdbus-1-dev bluez-hcidump \ - # bluez-tools - + # bluez-tools qtbase5-private-dev qtscript5-dev \ qml-module-qt-labs-folderlistmodel qml-module-qtquick-extras \ qml-module-qtquick-controls2 qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5quickcontrols2-5 qtquickcontrols2-5-dev \ @@ -41,8 +40,6 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ qtdeclarative5-dev qtconnectivity5-dev qtmultimedia5-dev qtpositioning5-dev \ libqt5gamepad5-dev qml-module-qt-labs-settings qml-module-qt-labs-platform libqt5svg5-dev - - ENV USER=${USER_NAME} RUN echo "vesc_tool ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/${USER_NAME} From a0ffb1b1656ae58e3c7de13feac0cd391d7496c0 Mon Sep 17 00:00:00 2001 From: karu2003 Date: Mon, 30 Oct 2023 08:15:31 +0100 Subject: [PATCH 4/7] add Docker in README.md --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index fa1d3178c..f3b6e4342 100644 --- a/README.md +++ b/README.md @@ -31,3 +31,17 @@ If you have custom hardware and you want to add support for it in the official r 1) Go to https://github.com/vedderb/bldc and use the github fork function. 2) Make your changes, test them and make a pull request to the main repository. 3) If the pull request gets accepted your hardware will become part of the next official release. It will show up in the binary beta typically after a few days and in the stable version the next time a stable release is made. + +## How to Build the Docker Image + +# tested only Linux + +docker build . -t vesc_tool + +# run bach + +docker run --rm -it -v `pwd`:/vesc_tool vesc_tool:latest bash + +# or build in docker + +docker run --rm -it -v `pwd`:/vesc_tool vesc_tool:latest /vesc_tool/build_lin \ No newline at end of file From 233b3cebbb8a1e554aee230c3e3f1f536b992eb1 Mon Sep 17 00:00:00 2001 From: karu2003 Date: Mon, 30 Oct 2023 08:17:16 +0100 Subject: [PATCH 5/7] add Docker in README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f3b6e4342..2cf1ff0c1 100644 --- a/README.md +++ b/README.md @@ -34,14 +34,14 @@ If you have custom hardware and you want to add support for it in the official r ## How to Build the Docker Image -# tested only Linux +### tested only Linux docker build . -t vesc_tool -# run bach +### run bach docker run --rm -it -v `pwd`:/vesc_tool vesc_tool:latest bash -# or build in docker +### or build in docker docker run --rm -it -v `pwd`:/vesc_tool vesc_tool:latest /vesc_tool/build_lin \ No newline at end of file From d45655fd86595123c574b397d326ccdff678d389 Mon Sep 17 00:00:00 2001 From: Ka Ru Date: Sat, 18 May 2024 20:10:18 +0200 Subject: [PATCH 6/7] build res_fw.qrc --- vesc_tool.pro | 1 + 1 file changed, 1 insertion(+) diff --git a/vesc_tool.pro b/vesc_tool.pro index 57e1960e5..051e1a205 100644 --- a/vesc_tool.pro +++ b/vesc_tool.pro @@ -176,6 +176,7 @@ release_win { release_lin { # http://micro.nicholaswilson.me.uk/post/31855915892/rules-of-static-linking-libstdc-libc-libgcc # http://insanecoding.blogspot.se/2012/07/creating-portable-linux-binaries.html + CONFIG += exclude_fw QMAKE_LFLAGS += -static-libstdc++ -static-libgcc DESTDIR = build/lin OBJECTS_DIR = build/lin/obj From e11b946411aa5305605ad5e940a68f44e7ea2453 Mon Sep 17 00:00:00 2001 From: karu2003 Date: Wed, 1 Jan 2025 12:11:22 +0100 Subject: [PATCH 7/7] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2cf1ff0c1..f7fe3eba7 100644 --- a/README.md +++ b/README.md @@ -36,12 +36,12 @@ If you have custom hardware and you want to add support for it in the official r ### tested only Linux -docker build . -t vesc_tool + docker build . -t vesc_tool ### run bach -docker run --rm -it -v `pwd`:/vesc_tool vesc_tool:latest bash + docker run --rm -it -v `pwd`:/vesc_tool vesc_tool:latest bash ### or build in docker -docker run --rm -it -v `pwd`:/vesc_tool vesc_tool:latest /vesc_tool/build_lin \ No newline at end of file + docker run --rm -it -v `pwd`:/vesc_tool vesc_tool:latest /vesc_tool/build_lin