From 74ea1ee44652ff790968be5d199135433c39b891 Mon Sep 17 00:00:00 2001 From: avdeevsv91 Date: Wed, 11 Oct 2023 16:36:24 +0300 Subject: [PATCH 01/23] Create watchdog.sh --- firmware/app/bin/watchdog.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 firmware/app/bin/watchdog.sh diff --git a/firmware/app/bin/watchdog.sh b/firmware/app/bin/watchdog.sh new file mode 100644 index 0000000..a3b3eac --- /dev/null +++ b/firmware/app/bin/watchdog.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +GATEWAY=${1:-"192.168.1.1"} + +errors=0 +while true; do + # Network connection + if ! ping -c 1 $GATEWAY &> /dev/null; then + echo "Reconnecting to an Access Point..." + killall udhcpc wpa_supplicant + ifconfig wlan0 down + ifconfig wlan0 up + wpa_supplicant -B -D nl80211 -i wlan0 -c /etc/wpa_supplicant.conf + udhcpc -b -i wlan0 + errors=$((errors+1)) + else + errors=0 + fi + # Main application + if ! killall -0 mjsxj02hl &> /dev/null; then + echo "Restarting main application..." + mjsxj02hl & + errors=$((errors+1)) + else + errors=0 + fi + # Reboot if there are many errors + if [ $errors -ge 5 ]; then + echo "Too many errors! Rebooting the device..." + reboot + fi + sleep 10 +done From e8bdffbb891b664feff978d479d089a4d5b2d07e Mon Sep 17 00:00:00 2001 From: avdeevsv91 Date: Wed, 11 Oct 2023 16:39:56 +0300 Subject: [PATCH 02/23] Execute /mnt/mmc/run.sh in the background --- firmware/app/bin/init_app.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/firmware/app/bin/init_app.sh b/firmware/app/bin/init_app.sh index 1d4bf23..320dc08 100755 --- a/firmware/app/bin/init_app.sh +++ b/firmware/app/bin/init_app.sh @@ -79,6 +79,5 @@ mjsxj02hl & # Execute run.sh from sd-card if [ -f /mnt/mmc/run.sh ]; then echo "Execute /mnt/mmc/run.sh script..." - /mnt/mmc/run.sh + /mnt/mmc/run.sh & fi - From c4d631ed9415adcc1f658968cb8697a8d4b09f5d Mon Sep 17 00:00:00 2001 From: avdeevsv91 Date: Wed, 11 Oct 2023 16:40:25 +0300 Subject: [PATCH 03/23] Execute run.sh from configs --- firmware/app/bin/init_app.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/firmware/app/bin/init_app.sh b/firmware/app/bin/init_app.sh index 320dc08..d470f63 100755 --- a/firmware/app/bin/init_app.sh +++ b/firmware/app/bin/init_app.sh @@ -76,6 +76,12 @@ tcpsvd -vE 0.0.0.0 21 ftpd -w / & echo "Starting main application..." mjsxj02hl & +# Execute run.sh from configs +if [ -f /configs/run.sh ]; then + echo "Execute /configs/run.sh script..." + /configs/run.sh & +fi + # Execute run.sh from sd-card if [ -f /mnt/mmc/run.sh ]; then echo "Execute /mnt/mmc/run.sh script..." From 49260573499784ade03b8b7016b9134f7503c915 Mon Sep 17 00:00:00 2001 From: avdeevsv91 Date: Fri, 13 Oct 2023 13:33:30 +0300 Subject: [PATCH 04/23] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8df8925..e31b8f1 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Build tools for mjsxj02hl firmware ## Dependencies ```bash -sudo apt install u-boot-tools dbus +sudo apt install u-boot-tools dbus python3-pip pip install click ``` From ce81ac58e83de9ffc213b8da2207cde5691577ab Mon Sep 17 00:00:00 2001 From: Sergey Avdeev Date: Sun, 22 Oct 2023 20:54:11 +0300 Subject: [PATCH 05/23] Update init_app.sh --- firmware/app/bin/init_app.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/firmware/app/bin/init_app.sh b/firmware/app/bin/init_app.sh index d470f63..5362aec 100755 --- a/firmware/app/bin/init_app.sh +++ b/firmware/app/bin/init_app.sh @@ -39,6 +39,7 @@ fi # Create empty configuration file if it is missing if [ ! -f /usr/app/share/mjsxj02hl.conf ]; then + echo "Create empty configuration file..." touch /usr/app/share/mjsxj02hl.conf chmod 644 /usr/app/share/mjsxj02hl.conf fi From 8ca13ed15697ce8398c4dfc43449c2f8a8376c66 Mon Sep 17 00:00:00 2001 From: Sergey Avdeev Date: Sun, 22 Oct 2023 21:03:41 +0300 Subject: [PATCH 06/23] Update init_app.sh --- firmware/app/bin/init_app.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/firmware/app/bin/init_app.sh b/firmware/app/bin/init_app.sh index 5362aec..de052e2 100755 --- a/firmware/app/bin/init_app.sh +++ b/firmware/app/bin/init_app.sh @@ -44,6 +44,18 @@ if [ ! -f /usr/app/share/mjsxj02hl.conf ]; then chmod 644 /usr/app/share/mjsxj02hl.conf fi +# Create default run.sh file if it is missing +if [ ! -f /configs/run.sh ]; then + echo "reate default run.sh file..." + touch /configs/run.sh + echo "#"'!'"/bin/sh" >> /configs/run.sh + echo >> /configs/run.sh + echo "# Launching the watchdog" >> /configs/run.sh + echo "watchdog.sh &" >> /configs/run.sh + echo >> /configs/run.sh + chmod 755 /configs/run.sh +fi + # Connect to Wi-Fi ifconfig wlan0 up if [ -f /etc/wpa_supplicant.conf ]; then From 3b115b919ca01897378753a1fe1d66e83f9fd706 Mon Sep 17 00:00:00 2001 From: Sergey Avdeev Date: Sun, 22 Oct 2023 22:57:45 +0300 Subject: [PATCH 07/23] Update zlib, openssl, curl --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 487f970..acff29c 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ BRANCH := main -ZLIB_VERSION := 1.2.13 -OPENSSL_VERSION := 1.1.1s -CURL_VERSION := 7.87.0 +ZLIB_VERSION := 1.3 +OPENSSL_VERSION := 1.1.1w +CURL_VERSION := 8.4.0 TEMPORARY_DIR := temp @@ -54,7 +54,7 @@ curl: openssl zlib wget -O "$(FIRMWARE_DIR)/rootfs/usr/local/cacert.pem" "https://curl.haxx.se/ca/cacert.pem" wget -O "$(TEMPORARY_DIR)/curl-$(CURL_VERSION).tar.gz" "https://curl.se/download/curl-$(CURL_VERSION).tar.gz" tar -xf $(TEMPORARY_DIR)/curl-$(CURL_VERSION).tar.gz -C $(TEMPORARY_DIR) && mv $(TEMPORARY_DIR)/curl-$(CURL_VERSION) $(TEMPORARY_DIR)/curl - cd $(TEMPORARY_DIR)/curl && ./configure --host="$(CROSS_COMPILE)" CC="$(CROSS_COMPILE)-gcc" CFLAGS="$(CCFLAGS)" LDFLAGS="-L$(LDPATH)" --enable-shared --disable-static --disable-manual --disable-libcurl-option --with-openssl --with-zlib --disable-ipv6 --disable-dict --disable-file --disable-ftp --disable-gopher --disable-imap --disable-mqtt --disable-pop3 --disable-smtp --disable-telnet --disable-tftp --disable-smb --with-ca-bundle=/usr/local/cacert.pem + cd $(TEMPORARY_DIR)/curl && ./configure --host="$(CROSS_COMPILE)" CC="$(CROSS_COMPILE)-gcc" CFLAGS="$(CCFLAGS)" LDFLAGS="-L$(LDPATH)" --enable-shared --disable-static --disable-manual --disable-libcurl-option --with-openssl=$(CURDIR)/$(TEMPORARY_DIR)/openssl --with-zlib --disable-ipv6 --disable-dict --disable-file --disable-ftp --disable-gopher --disable-imap --disable-mqtt --disable-pop3 --disable-smtp --disable-telnet --disable-tftp --disable-smb --with-ca-bundle=/usr/local/cacert.pem make -C "$(TEMPORARY_DIR)/curl" cp -f $(TEMPORARY_DIR)/curl/src/.libs/curl $(FIRMWARE_DIR)/rootfs/bin ln -fs ../../bin/curl $(FIRMWARE_DIR)/rootfs/usr/bin/curl From 0a1fdf6c283eb2992ec85e33476a1a302c500055 Mon Sep 17 00:00:00 2001 From: Sergey Avdeev Date: Sun, 29 Oct 2023 16:42:03 +0300 Subject: [PATCH 08/23] Update README.md --- README.md | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e31b8f1..3710b51 100644 --- a/README.md +++ b/README.md @@ -6,14 +6,38 @@ Build tools for mjsxj02hl firmware **Attention! This firmware is no longer supported by the author. We recommend using [OpenIPC](https://github.com/OpenIPC/device-mjsxj02hl).** +## Preparation of tools -## Dependencies +1. Install dependencies: ```bash -sudo apt install u-boot-tools dbus python3-pip +sudo apt install git u-boot-tools dbus python3-pip pip install click ``` +2. Install Hi3518Ev300 toolchain: + +```bash +tar -zxf arm-himix100-linux.tgz +sudo ./arm-himix100-linux.install +``` + +3. Clone the repository: + +```bash +git clone https://github.com/kasitoru/mjsxj02hl_firmware +cd mjsxj02hl_firmware +``` + +4. Copy the libraries from directory `/usr/app/lib` of the original firmware to directory `/opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/app/lib`: + +```bash +sudo mkdir -p /opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/app/lib +sudo chmod 755 /opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/app/lib + +cp -a ./firmware/app/lib/. /opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/app/lib/ +``` + ## Usage ### Build firmware: From 5846f29121a1131a0314e15cc82ae841e566734b Mon Sep 17 00:00:00 2001 From: Sergey Avdeev Date: Sun, 29 Oct 2023 16:56:08 +0300 Subject: [PATCH 09/23] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3710b51..c6174f3 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ cd mjsxj02hl_firmware ```bash sudo mkdir -p /opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/app/lib -sudo chmod 755 /opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/app/lib +sudo chmod 777 /opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/app/lib cp -a ./firmware/app/lib/. /opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/app/lib/ ``` From c268a11d5b36df9fca00cae24e7a4c009b81fa2b Mon Sep 17 00:00:00 2001 From: Sergey Avdeev Date: Sun, 29 Oct 2023 17:09:49 +0300 Subject: [PATCH 10/23] Update README.md --- README.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c6174f3..3df149b 100644 --- a/README.md +++ b/README.md @@ -22,20 +22,18 @@ tar -zxf arm-himix100-linux.tgz sudo ./arm-himix100-linux.install ``` -3. Clone the repository: +3. Creating a directory for shared libraries and setting permissions: ```bash -git clone https://github.com/kasitoru/mjsxj02hl_firmware -cd mjsxj02hl_firmware +sudo mkdir -p /opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/app/lib +sudo chmod 777 /opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/app/lib ``` -4. Copy the libraries from directory `/usr/app/lib` of the original firmware to directory `/opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/app/lib`: +4. Clone the repository: ```bash -sudo mkdir -p /opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/app/lib -sudo chmod 777 /opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/app/lib - -cp -a ./firmware/app/lib/. /opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/app/lib/ +git clone https://github.com/kasitoru/mjsxj02hl_firmware +cd mjsxj02hl_firmware ``` ## Usage From 830343b4a0f84525d7ec4c4e2bed0dd956e4b7b3 Mon Sep 17 00:00:00 2001 From: Sergey Avdeev Date: Sun, 29 Oct 2023 17:23:20 +0300 Subject: [PATCH 11/23] Update Makefile --- Makefile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index acff29c..97bc7b6 100644 --- a/Makefile +++ b/Makefile @@ -22,15 +22,15 @@ application: make -C "$(TEMPORARY_DIR)/application" CROSS_COMPILE="$(CROSS_COMPILE)-" CCFLAGS="$(CCFLAGS)" LDPATH="$(LDPATH)" cp -f $(TEMPORARY_DIR)/application/bin/mjsxj02hl $(FIRMWARE_DIR)/app/bin cp -f $(TEMPORARY_DIR)/application/bin/ipctool $(FIRMWARE_DIR)/rootfs/bin - cp -arf $(TEMPORARY_DIR)/application/lib/. $(FIRMWARE_DIR)/app/lib + cp -rf $(TEMPORARY_DIR)/application/lib/. $(FIRMWARE_DIR)/app/lib web: git clone --branch "$(BRANCH)" "https://github.com/kasitoru/mjsxj02hl_web" "$(TEMPORARY_DIR)/web" make -C "$(TEMPORARY_DIR)/web" CROSS_COMPILE="$(CROSS_COMPILE)-" CCFLAGS="$(CCFLAGS)" - cp -arf $(TEMPORARY_DIR)/web/bin/. $(FIRMWARE_DIR)/app/bin - cp -arf $(TEMPORARY_DIR)/web/lib/. $(FIRMWARE_DIR)/app/lib - cp -arf $(TEMPORARY_DIR)/web/share/. $(FIRMWARE_DIR)/app/share - cp -arf $(TEMPORARY_DIR)/web/www/. $(FIRMWARE_DIR)/app/www + cp -rf $(TEMPORARY_DIR)/web/bin/. $(FIRMWARE_DIR)/app/bin + cp -rf $(TEMPORARY_DIR)/web/lib/. $(FIRMWARE_DIR)/app/lib + cp -rf $(TEMPORARY_DIR)/web/share/. $(FIRMWARE_DIR)/app/share + cp -rf $(TEMPORARY_DIR)/web/www/. $(FIRMWARE_DIR)/app/www zlib: wget -O "$(TEMPORARY_DIR)/zlib-$(ZLIB_VERSION).tar.gz" "http://www.zlib.net/zlib-$(ZLIB_VERSION).tar.gz" @@ -50,11 +50,11 @@ openssl: zlib cp -fP $(TEMPORARY_DIR)/openssl/libcrypto.so* $(LDPATH) cp -fP $(TEMPORARY_DIR)/openssl/libssl.so* $(LDPATH) -curl: openssl zlib +curl: zlib openssl wget -O "$(FIRMWARE_DIR)/rootfs/usr/local/cacert.pem" "https://curl.haxx.se/ca/cacert.pem" wget -O "$(TEMPORARY_DIR)/curl-$(CURL_VERSION).tar.gz" "https://curl.se/download/curl-$(CURL_VERSION).tar.gz" tar -xf $(TEMPORARY_DIR)/curl-$(CURL_VERSION).tar.gz -C $(TEMPORARY_DIR) && mv $(TEMPORARY_DIR)/curl-$(CURL_VERSION) $(TEMPORARY_DIR)/curl - cd $(TEMPORARY_DIR)/curl && ./configure --host="$(CROSS_COMPILE)" CC="$(CROSS_COMPILE)-gcc" CFLAGS="$(CCFLAGS)" LDFLAGS="-L$(LDPATH)" --enable-shared --disable-static --disable-manual --disable-libcurl-option --with-openssl=$(CURDIR)/$(TEMPORARY_DIR)/openssl --with-zlib --disable-ipv6 --disable-dict --disable-file --disable-ftp --disable-gopher --disable-imap --disable-mqtt --disable-pop3 --disable-smtp --disable-telnet --disable-tftp --disable-smb --with-ca-bundle=/usr/local/cacert.pem + cd $(TEMPORARY_DIR)/curl && ./configure --host="$(CROSS_COMPILE)" CC="$(CROSS_COMPILE)-gcc" CFLAGS="$(CCFLAGS)" LDFLAGS="-L$(LDPATH)" --enable-shared --disable-static --disable-manual --disable-libcurl-option --with-openssl=$(CURDIR)/$(TEMPORARY_DIR)/openssl --with-zlib=$(CURDIR)/$(TEMPORARY_DIR)/zlib --disable-ipv6 --disable-dict --disable-file --disable-ftp --disable-gopher --disable-imap --disable-mqtt --disable-pop3 --disable-smtp --disable-telnet --disable-tftp --disable-smb --with-ca-bundle=/usr/local/cacert.pem make -C "$(TEMPORARY_DIR)/curl" cp -f $(TEMPORARY_DIR)/curl/src/.libs/curl $(FIRMWARE_DIR)/rootfs/bin ln -fs ../../bin/curl $(FIRMWARE_DIR)/rootfs/usr/bin/curl @@ -115,7 +115,7 @@ endif echo $(FIRMWARE_VERB) > $(FIRMWARE_DIR)/app/share/.version install-libs: - -cp -arf $(FIRMWARE_DIR)/app/lib/. $(LDPATH) - -cp -arf $(FIRMWARE_DIR)/rootfs/lib/. $(LDPATH) - -cp -arf $(FIRMWARE_DIR)/rootfs/thirdlib/. $(LDPATH) + -cp -rf $(FIRMWARE_DIR)/app/lib/. $(LDPATH) + -cp -rf $(FIRMWARE_DIR)/rootfs/lib/. $(LDPATH) + -cp -rf $(FIRMWARE_DIR)/rootfs/thirdlib/. $(LDPATH) From d854eb3934f006475cab65c8878a5f90ae34cc7b Mon Sep 17 00:00:00 2001 From: Sergey Avdeev Date: Sun, 29 Oct 2023 18:38:51 +0300 Subject: [PATCH 12/23] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3df149b..35d7380 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Build tools for mjsxj02hl firmware 1. Install dependencies: ```bash -sudo apt install git u-boot-tools dbus python3-pip +sudo apt install git cmake u-boot-tools dbus python3-pip pip install click ``` @@ -20,6 +20,7 @@ pip install click ```bash tar -zxf arm-himix100-linux.tgz sudo ./arm-himix100-linux.install +gnome-session-quit ``` 3. Creating a directory for shared libraries and setting permissions: From 0e70fa40109eca5cb44b2a883fc4d000bc08c89d Mon Sep 17 00:00:00 2001 From: Sergey Avdeev Date: Sun, 29 Oct 2023 19:09:11 +0300 Subject: [PATCH 13/23] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 35d7380..9c37eb7 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Build tools for mjsxj02hl firmware 1. Install dependencies: ```bash -sudo apt install git cmake u-boot-tools dbus python3-pip +sudo apt install git cmake lib32z1 lib32stdc++6 u-boot-tools dbus python3-pip dos2unix pip install click ``` From aad825cad27f775bd1d52755152ca15dbc0c1d56 Mon Sep 17 00:00:00 2001 From: Sergey Avdeev Date: Sun, 29 Oct 2023 22:19:22 +0300 Subject: [PATCH 14/23] Update packer.py --- packer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packer.py b/packer.py index 539bcc9..ca1c652 100755 --- a/packer.py +++ b/packer.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # coding=utf-8 import os From 8480920de7a8fad88e236fda0d82cc13adafec47 Mon Sep 17 00:00:00 2001 From: Sergey Avdeev Date: Sun, 29 Oct 2023 22:19:39 +0300 Subject: [PATCH 15/23] Update Makefile --- Makefile | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 97bc7b6..e99a1e5 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,18 @@ -BRANCH := main +BRANCH := main -ZLIB_VERSION := 1.3 -OPENSSL_VERSION := 1.1.1w -CURL_VERSION := 8.4.0 +ZLIB_VERSION := 1.3 +OPENSSL_VERSION := 1.1.1w +CURL_VERSION := 8.4.0 -TEMPORARY_DIR := temp +TEMPORARY_DIR := temp -FIRMWARE_SRC := firmware -FIRMWARE_DIR := $(TEMPORARY_DIR)/firmware -FIRMWARE_FILE := demo_hlc6.bin +FIRMWARE_SRC := firmware +FIRMWARE_DIR := $(TEMPORARY_DIR)/firmware +FIRMWARE_FILE := demo_hlc6.bin -CROSS_COMPILE := arm-himix100-linux -CCFLAGS := -march=armv7-a -mfpu=neon-vfpv4 -funsafe-math-optimizations -LDPATH := /opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/app/lib +CROSS_COMPILE := arm-himix100-linux +CCFLAGS := -march=armv7-a -mfpu=neon-vfpv4 -funsafe-math-optimizations +LDPATH := /opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/app/lib .SILENT: all: mkdirs install-libs application web curl chmod pack From bb994639aca929cd7f0c41249f4484f26a2e76df Mon Sep 17 00:00:00 2001 From: Sergey Avdeev Date: Sun, 29 Oct 2023 22:19:56 +0300 Subject: [PATCH 16/23] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9c37eb7..07a9a26 100644 --- a/README.md +++ b/README.md @@ -30,15 +30,15 @@ sudo mkdir -p /opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/app/lib sudo chmod 777 /opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/app/lib ``` -4. Clone the repository: +## Usage + +Clone the repository: ```bash git clone https://github.com/kasitoru/mjsxj02hl_firmware cd mjsxj02hl_firmware ``` -## Usage - ### Build firmware: ```bash make FIRMWARE_VER=x.y.z From 381b4f36f1874ce7de4f038dca59c08b925c5bb9 Mon Sep 17 00:00:00 2001 From: Sergey Avdeev Date: Sun, 29 Oct 2023 22:55:18 +0300 Subject: [PATCH 17/23] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 07a9a26..ba98f62 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,13 @@ Build tools for mjsxj02hl firmware **Attention! This firmware is no longer supported by the author. We recommend using [OpenIPC](https://github.com/OpenIPC/device-mjsxj02hl).** -## Preparation of tools +## Preparation 1. Install dependencies: ```bash sudo apt install git cmake lib32z1 lib32stdc++6 u-boot-tools dbus python3-pip dos2unix -pip install click +pip3 install click ``` 2. Install Hi3518Ev300 toolchain: From f9ad59923ff07ace757b0572bfe2fbbf31e3d47f Mon Sep 17 00:00:00 2001 From: Sergey Avdeev Date: Mon, 30 Oct 2023 09:21:13 +0300 Subject: [PATCH 18/23] Update README.md --- README.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ba98f62..848764b 100644 --- a/README.md +++ b/README.md @@ -18,18 +18,14 @@ pip3 install click 2. Install Hi3518Ev300 toolchain: ```bash +sudo mkdir /opt/hisi-linux +sudo chmod 777 /opt/hisi-linux tar -zxf arm-himix100-linux.tgz -sudo ./arm-himix100-linux.install +source ./arm-himix100-linux.install +mkdir -p /opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/app/lib gnome-session-quit ``` -3. Creating a directory for shared libraries and setting permissions: - -```bash -sudo mkdir -p /opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/app/lib -sudo chmod 777 /opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/app/lib -``` - ## Usage Clone the repository: From 6039c098c4d6f3dcabdc3656663cab1ab5d58183 Mon Sep 17 00:00:00 2001 From: Sergey Avdeev Date: Mon, 30 Oct 2023 12:44:38 +0300 Subject: [PATCH 19/23] Update Makefile --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e99a1e5..dd129a6 100644 --- a/Makefile +++ b/Makefile @@ -33,12 +33,11 @@ web: cp -rf $(TEMPORARY_DIR)/web/www/. $(FIRMWARE_DIR)/app/www zlib: - wget -O "$(TEMPORARY_DIR)/zlib-$(ZLIB_VERSION).tar.gz" "http://www.zlib.net/zlib-$(ZLIB_VERSION).tar.gz" + wget -O "$(TEMPORARY_DIR)/zlib-$(ZLIB_VERSION).tar.gz" "https://www.zlib.net/fossils/zlib-$(ZLIB_VERSION).tar.gz" tar -xf $(TEMPORARY_DIR)/zlib-$(ZLIB_VERSION).tar.gz -C $(TEMPORARY_DIR) && mv $(TEMPORARY_DIR)/zlib-$(ZLIB_VERSION) $(TEMPORARY_DIR)/zlib cd $(TEMPORARY_DIR)/zlib && CROSS_PREFIX="$(CROSS_COMPILE)-" CFLAGS="$(CCFLAGS)" ./configure make -C "$(TEMPORARY_DIR)/zlib" cp -fP $(TEMPORARY_DIR)/zlib/libz.so* $(FIRMWARE_DIR)/rootfs/thirdlib - cp -fP $(TEMPORARY_DIR)/zlib/libz.so* $(LDPATH) openssl: zlib wget -O "$(TEMPORARY_DIR)/openssl-$(OPENSSL_VERSION).tar.gz" "https://www.openssl.org/source/openssl-$(OPENSSL_VERSION).tar.gz" From e1ec40f5efff7260d986dba57d92784e46197cf3 Mon Sep 17 00:00:00 2001 From: Sergey Avdeev Date: Mon, 30 Oct 2023 12:44:52 +0300 Subject: [PATCH 20/23] Update Makefile --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index dd129a6..50990a2 100644 --- a/Makefile +++ b/Makefile @@ -43,11 +43,10 @@ openssl: zlib wget -O "$(TEMPORARY_DIR)/openssl-$(OPENSSL_VERSION).tar.gz" "https://www.openssl.org/source/openssl-$(OPENSSL_VERSION).tar.gz" tar -xf $(TEMPORARY_DIR)/openssl-$(OPENSSL_VERSION).tar.gz -C $(TEMPORARY_DIR) && mv $(TEMPORARY_DIR)/openssl-$(OPENSSL_VERSION) $(TEMPORARY_DIR)/openssl cd $(TEMPORARY_DIR)/openssl && ./Configure linux-armv4 shared zlib no-hw no-afalgeng no-async no-aria no-asm no-autoerrinit no-autoload-config no-bf no-blake2 no-camellia no-capieng no-cast no-chacha no-cmac no-cms no-comp no-ct no-deprecated no-dgram no-dso no-dtls no-dynamic-engine no-ec no-ec2m no-ecdh no-ecdsa no-err no-filenames no-gost no-makedepend no-mdc2 no-multiblock no-pinshared no-ocb no-poly1305 no-posix-io no-psk no-rc2 no-rc4 no-rdrand no-rfc3779 no-rmd160 no-scrypt no-seed no-siphash no-sm2 no-sm3 no-sm4 no-srtp no-sse2 no-ssl no-static-engine no-tests no-threads no-ts no-whirlpool no-idea no-srp - make -C "$(TEMPORARY_DIR)/openssl" CROSS_COMPILE="$(CROSS_COMPILE)-" CFLAGS="$(CCFLAGS)" LDFLAGS="-L$(LDPATH)" + make -C "$(TEMPORARY_DIR)/openssl" CROSS_COMPILE="$(CROSS_COMPILE)-" CFLAGS="$(CCFLAGS)" cp -fP $(TEMPORARY_DIR)/openssl/libcrypto.so* $(FIRMWARE_DIR)/rootfs/thirdlib cp -fP $(TEMPORARY_DIR)/openssl/libssl.so* $(FIRMWARE_DIR)/rootfs/thirdlib - cp -fP $(TEMPORARY_DIR)/openssl/libcrypto.so* $(LDPATH) - cp -fP $(TEMPORARY_DIR)/openssl/libssl.so* $(LDPATH) + ln -fs ./ lib curl: zlib openssl wget -O "$(FIRMWARE_DIR)/rootfs/usr/local/cacert.pem" "https://curl.haxx.se/ca/cacert.pem" From b55da7513737620bf5c6b8b53f3fcd83c63ed9a8 Mon Sep 17 00:00:00 2001 From: Sergey Avdeev Date: Mon, 30 Oct 2023 12:45:19 +0300 Subject: [PATCH 21/23] Update Makefile --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 50990a2..e0d9dcc 100644 --- a/Makefile +++ b/Makefile @@ -52,12 +52,11 @@ curl: zlib openssl wget -O "$(FIRMWARE_DIR)/rootfs/usr/local/cacert.pem" "https://curl.haxx.se/ca/cacert.pem" wget -O "$(TEMPORARY_DIR)/curl-$(CURL_VERSION).tar.gz" "https://curl.se/download/curl-$(CURL_VERSION).tar.gz" tar -xf $(TEMPORARY_DIR)/curl-$(CURL_VERSION).tar.gz -C $(TEMPORARY_DIR) && mv $(TEMPORARY_DIR)/curl-$(CURL_VERSION) $(TEMPORARY_DIR)/curl - cd $(TEMPORARY_DIR)/curl && ./configure --host="$(CROSS_COMPILE)" CC="$(CROSS_COMPILE)-gcc" CFLAGS="$(CCFLAGS)" LDFLAGS="-L$(LDPATH)" --enable-shared --disable-static --disable-manual --disable-libcurl-option --with-openssl=$(CURDIR)/$(TEMPORARY_DIR)/openssl --with-zlib=$(CURDIR)/$(TEMPORARY_DIR)/zlib --disable-ipv6 --disable-dict --disable-file --disable-ftp --disable-gopher --disable-imap --disable-mqtt --disable-pop3 --disable-smtp --disable-telnet --disable-tftp --disable-smb --with-ca-bundle=/usr/local/cacert.pem + cd $(TEMPORARY_DIR)/curl && ./configure --host="$(CROSS_COMPILE)" CC="$(CROSS_COMPILE)-gcc" CFLAGS="$(CCFLAGS)" LDFLAGS="-Wl,-rpath-link $(CURDIR)/$(TEMPORARY_DIR)/openssl" --enable-shared --disable-static --disable-manual --disable-libcurl-option --with-openssl=$(CURDIR)/$(TEMPORARY_DIR)/openssl --with-zlib=$(CURDIR)/$(TEMPORARY_DIR)/zlib --disable-ipv6 --disable-dict --disable-file --disable-ftp --disable-gopher --disable-imap --disable-mqtt --disable-pop3 --disable-smtp --disable-telnet --disable-tftp --disable-smb --with-ca-bundle=/usr/local/cacert.pem make -C "$(TEMPORARY_DIR)/curl" cp -f $(TEMPORARY_DIR)/curl/src/.libs/curl $(FIRMWARE_DIR)/rootfs/bin ln -fs ../../bin/curl $(FIRMWARE_DIR)/rootfs/usr/bin/curl cp -fP $(TEMPORARY_DIR)/curl/lib/.libs/libcurl.so* $(FIRMWARE_DIR)/rootfs/thirdlib - cp -fP $(TEMPORARY_DIR)/curl/lib/.libs/libcurl.so* $(LDPATH) chmod: # all From 4b662e8b2df2e5bc05be9f2ba8ce4faa51066cca Mon Sep 17 00:00:00 2001 From: Sergey Avdeev Date: Mon, 30 Oct 2023 22:15:14 +0300 Subject: [PATCH 22/23] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 848764b..f02917e 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,11 @@ pip3 install click 2. Install Hi3518Ev300 toolchain: ```bash -sudo mkdir /opt/hisi-linux -sudo chmod 777 /opt/hisi-linux tar -zxf arm-himix100-linux.tgz -source ./arm-himix100-linux.install -mkdir -p /opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/app/lib +cd arm-himix100-linux +sudo ./arm-himix100-linux.install +sudo mkdir -p /opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/app/lib +sudo chmod 777 /opt/hisi-linux/x86-arm/arm-himix100-linux/target/usr/app/lib gnome-session-quit ``` From 71f551f7b150ab00278e8155b145b4e785352825 Mon Sep 17 00:00:00 2001 From: Sergey Avdeev Date: Mon, 30 Oct 2023 22:57:49 +0300 Subject: [PATCH 23/23] Update Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e0d9dcc..99e5319 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ openssl: zlib make -C "$(TEMPORARY_DIR)/openssl" CROSS_COMPILE="$(CROSS_COMPILE)-" CFLAGS="$(CCFLAGS)" cp -fP $(TEMPORARY_DIR)/openssl/libcrypto.so* $(FIRMWARE_DIR)/rootfs/thirdlib cp -fP $(TEMPORARY_DIR)/openssl/libssl.so* $(FIRMWARE_DIR)/rootfs/thirdlib - ln -fs ./ lib + ln -fs ./ $(TEMPORARY_DIR)/openssl/lib curl: zlib openssl wget -O "$(FIRMWARE_DIR)/rootfs/usr/local/cacert.pem" "https://curl.haxx.se/ca/cacert.pem"