From 96d69cdcc277c8a65c525a2e68089f5df67ee7bc Mon Sep 17 00:00:00 2001 From: Ivan Zorin Date: Tue, 27 Jun 2023 15:42:11 +0300 Subject: [PATCH 1/9] Root directory refactoring: - move info about Bootup Logo from a sepatate README to main README; - replace separate root scripts build.sh and start_dev.sh by root Makefile; - make Scripts directory and move there: flash_ts100_linux.sh script, ci/ directory, dockerfile, LICENSE_RELEASE, and PULL_REQUEST_TEMPLATE; - reconfigure build & deploy scripts according to changes --- .github/workflows/docs.yml | 2 +- .github/workflows/push.yml | 4 +- Bootup Logo/README.md | 7 --- Documentation/Flashing/MHP30.md | 2 +- Documentation/Flashing/TS100.md | 2 +- docker-compose.yml => IronOS.yml | 3 +- Makefile | 62 +++++++++++++++++++ README.md | 3 + mkdocs.yml => Scripts/IronOS-mkdocs.yml | 2 +- Dockerfile => Scripts/IronOS.Dockerfile | 2 +- .../LICENSE_RELEASE.md | 0 .../PULL_REQUEST_TEMPLATE.md | 0 {ci => Scripts/ci}/buildAll.sh | 2 +- ...-10-2020-q4-major-x86_64-linux.tar.bz2.md5 | 0 ...wlibc_prebuilt_linux64_2020.08.tar.bz2.md5 | 0 {Flashing => Scripts}/flash_ts100_linux.sh | 0 build.sh | 2 - start_dev.sh | 2 - 18 files changed, 75 insertions(+), 20 deletions(-) delete mode 100644 Bootup Logo/README.md rename docker-compose.yml => IronOS.yml (65%) create mode 100644 Makefile rename mkdocs.yml => Scripts/IronOS-mkdocs.yml (98%) rename Dockerfile => Scripts/IronOS.Dockerfile (93%) rename LICENSE_RELEASE.md => Scripts/LICENSE_RELEASE.md (100%) rename PULL_REQUEST_TEMPLATE.md => Scripts/PULL_REQUEST_TEMPLATE.md (100%) rename {ci => Scripts/ci}/buildAll.sh (92%) rename {ci => Scripts/ci}/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2.md5 (100%) rename {ci => Scripts/ci}/nuclei_riscv_newlibc_prebuilt_linux64_2020.08.tar.bz2.md5 (100%) rename {Flashing => Scripts}/flash_ts100_linux.sh (100%) delete mode 100755 build.sh delete mode 100755 start_dev.sh diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b8f9f5627..3716f8151 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -37,4 +37,4 @@ jobs: - run: git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com' - name: Publish docs - run: mkdocs gh-deploy + run: mkdocs gh-deploy -f Scripts/IronOS-mkdocs.yml -d ../site diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 9f944d03a..c9d9e58ac 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -32,7 +32,7 @@ jobs: - name: copy license text run: | cp LICENSE source/Hexfile/LICENSE - cp LICENSE_RELEASE.md source/Hexfile/LICENSE_RELEASE.md + cp Scripts/LICENSE_RELEASE.md source/Hexfile/LICENSE_RELEASE.md - name: Archive ${{ matrix.model }} artifacts uses: actions/upload-artifact@v3 @@ -83,7 +83,7 @@ jobs: - name: copy license text run: | cp LICENSE source/Hexfile/LICENSE - cp LICENSE_RELEASE.md source/Hexfile/LICENSE_RELEASE.md + cp Scripts/LICENSE_RELEASE.md source/Hexfile/LICENSE_RELEASE.md - name: Archive ${{ matrix.model }} artifacts uses: actions/upload-artifact@v3 diff --git a/Bootup Logo/README.md b/Bootup Logo/README.md deleted file mode 100644 index 30aeabd68..000000000 --- a/Bootup Logo/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Bootup logo's - -IronOS supports both a bootup logo _AND_ bootup animations. - -However, they are no longer included in this repo. - -[Please read the docs](https://ralim.github.io/IronOS/Logo/) diff --git a/Documentation/Flashing/MHP30.md b/Documentation/Flashing/MHP30.md index ff8484b03..b24f5034b 100644 --- a/Documentation/Flashing/MHP30.md +++ b/Documentation/Flashing/MHP30.md @@ -55,7 +55,7 @@ sgr1ff1n (Shane) commented in [issue 11](https://github.com/Ralim/IronOS/issues/ While in the past there were reports of unreliable upgrades, the consensus in [issue 11](https://github.com/Ralim/IronOS/issues/11) is that things work mostly as expected in Linux. -@awigen has contributed a script [flash_ts100_linux.sh](https://raw.githubusercontent.com/Ralim/IronOS/master/Flashing/flash_ts100_linux.sh) that works on Ubuntu 16.04 as well as other distros. +@awigen has contributed a script [flash_ts100_linux.sh](https://raw.githubusercontent.com/Ralim/IronOS/dev/Scripts/flash_ts100_linux.sh) that works on Ubuntu 16.04 as well as other distros. If you want to do it manually (or if the script does not work for some reason) the general procedure is the same as for Windows, the differences are in the way to mount the unit and copy the firmware. Remember that after flashing, the firmware filename will have changed to end in `.RDY` or `.ERR` or `.NOT` and only `.RDY` means the flashing was successful! diff --git a/Documentation/Flashing/TS100.md b/Documentation/Flashing/TS100.md index c5b8d1d2f..a5aa9cf59 100644 --- a/Documentation/Flashing/TS100.md +++ b/Documentation/Flashing/TS100.md @@ -55,7 +55,7 @@ sgr1ff1n (Shane) commented in [issue 11](https://github.com/Ralim/IronOS/issues/ While in the past there were reports of unreliable upgrades, the consensus in [issue 11](https://github.com/Ralim/IronOS/issues/11) is that things work mostly as expected in Linux. -@awigen has contributed a script [flash_ts100_linux.sh](https://raw.githubusercontent.com/Ralim/IronOS/master/Flashing/flash_ts100_linux.sh) that works on Ubuntu 16.04 as well as other distros. +@awigen has contributed a script [flash_ts100_linux.sh](https://raw.githubusercontent.com/Ralim/IronOS/dev/Scripts/flash_ts100_linux.sh) that works on Ubuntu 16.04 as well as other distros. If you want to do it manually (or if the script does not work for some reason) the general procedure is the same as for Windows, the differences are in the way to mount the unit and copy the firmware. Remember that after flashing, the firmware filename will have changed to end in `.RDY` or `.ERR` or `.NOT` and only `.RDY` means the flashing was successful! diff --git a/docker-compose.yml b/IronOS.yml similarity index 65% rename from docker-compose.yml rename to IronOS.yml index 83e749479..95ac0b76b 100644 --- a/docker-compose.yml +++ b/IronOS.yml @@ -6,7 +6,8 @@ services: tty: true build: context: . + dockerfile: Scripts/IronOS.Dockerfile command: /bin/sh volumes: - - ./ci:/build/ci:Z + - ./Scripts/ci:/build/ci:Z - ./:/build/source:Z diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..d0eb34887 --- /dev/null +++ b/Makefile @@ -0,0 +1,62 @@ +#!/usr/bin/env make +# Root Makefile for IronOS - Soldering Iron Open Source Firmware Project + + +### global adjustable variables + +# command for docker-compose tool +ifndef DOCKER_COMPOSE +DOCKER_COMPOSE:=docker-compose +endif + +# command for python-based mkdocs tool +ifndef MKDOCS +MKDOCS:=mkdocs +endif + + +### global static variables + +# docker-related files +DOCKER_YML=$(CURDIR)/IronOS.yml +DOCKER_FILE=$(CURDIR)/Scripts/IronOS.Dockerfile + +# docker dependencies +DOCKER_DEPS=$(DOCKER_YML) $(DOCKER_FILE) + +# compose docker-compose command +DOCKER_CMD=$(DOCKER_COMPOSE) -f $(DOCKER_YML) run --rm builder + +# MkDocs config +MKDOCS_YML=$(CURDIR)/Scripts/IronOS-mkdocs.yml + + +### helper targets + +# former start_dev.sh +docker-shell: $(DOCKER_DEPS) + @$(DOCKER_CMD) + +# former build.sh +docker-build: $(DOCKER_DEPS) + @$(DOCKER_CMD) /bin/bash /build/ci/buildAll.sh + +# delete container +docker-clean: + -@docker rmi ironos-builder:latest + +# generate docs in site/ directory (DIR for -d is relative to mkdocs.yml file location, hence use default name/location site by setting up ../site) +docs: $(MKDOCS_YML) Documentation/* Documentation/Flashing/* Documentation/images/* + @$(MKDOCS) build -f $(MKDOCS_YML) -d ../site + +# pass-through target for Makefile inside source/ dir +%: + make -C source/ $@ + +# global clean-up target +clean-full: docker-clean + make -C source/ clean-all + rm -Rf site + rm -Rf Scripts/ci/artefacts + +.PHONY: docker-shell docker-build docker-clean docs clean-full diff --git a/README.md b/README.md index 2125e6301..bde4ce3f9 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,9 @@ For notes on installation for your device, please refer to the flashing guide fo - [Custom boot up logo support](https://ralim.github.io/IronOS/Logo/) - Automatic LCD rotation based on the orientation +**Bootup Logo NOTICE**: +IronOS supports both a bootup logo _AND_ bootup animations. However, _they are no longer included in this repo_. Please, [read the docs](https://ralim.github.io/IronOS/Logo/) for more information. + ## Menu System This new firmware uses a new menu system to allow access to the settings on the device. diff --git a/mkdocs.yml b/Scripts/IronOS-mkdocs.yml similarity index 98% rename from mkdocs.yml rename to Scripts/IronOS-mkdocs.yml index 13d9a2ff1..f30058760 100644 --- a/mkdocs.yml +++ b/Scripts/IronOS-mkdocs.yml @@ -6,7 +6,7 @@ site_description: "IronOS Open Source Soldering Iron firmware for Miniware and P # repo config repo_url: https://github.com/ralim/IronOS/ -docs_dir: Documentation +docs_dir: ../Documentation edit_uri: edit/dev/Documentation/ # Theme and config diff --git a/Dockerfile b/Scripts/IronOS.Dockerfile similarity index 93% rename from Dockerfile rename to Scripts/IronOS.Dockerfile index c3f98f34e..ada341c5a 100644 --- a/Dockerfile +++ b/Scripts/IronOS.Dockerfile @@ -26,4 +26,4 @@ RUN python3 -m pip install ${PIP_PKGS} RUN git config --global --add safe.directory /build/source COPY . /build/source -COPY ./ci /build/ci +COPY ./Scripts/ci /build/ci diff --git a/LICENSE_RELEASE.md b/Scripts/LICENSE_RELEASE.md similarity index 100% rename from LICENSE_RELEASE.md rename to Scripts/LICENSE_RELEASE.md diff --git a/PULL_REQUEST_TEMPLATE.md b/Scripts/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from PULL_REQUEST_TEMPLATE.md rename to Scripts/PULL_REQUEST_TEMPLATE.md diff --git a/ci/buildAll.sh b/Scripts/ci/buildAll.sh similarity index 92% rename from ci/buildAll.sh rename to Scripts/ci/buildAll.sh index 566cfe728..082f64186 100755 --- a/ci/buildAll.sh +++ b/Scripts/ci/buildAll.sh @@ -5,7 +5,7 @@ set -u mkdir -p /build/ci/artefacts # Build STM code -cd /build/source/source/ +cd /build/source/source bash ./build.sh || exit 1 echo "All Firmware built" # Copy out all the final resulting files we would like to store for the next op diff --git a/ci/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2.md5 b/Scripts/ci/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2.md5 similarity index 100% rename from ci/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2.md5 rename to Scripts/ci/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2.md5 diff --git a/ci/nuclei_riscv_newlibc_prebuilt_linux64_2020.08.tar.bz2.md5 b/Scripts/ci/nuclei_riscv_newlibc_prebuilt_linux64_2020.08.tar.bz2.md5 similarity index 100% rename from ci/nuclei_riscv_newlibc_prebuilt_linux64_2020.08.tar.bz2.md5 rename to Scripts/ci/nuclei_riscv_newlibc_prebuilt_linux64_2020.08.tar.bz2.md5 diff --git a/Flashing/flash_ts100_linux.sh b/Scripts/flash_ts100_linux.sh similarity index 100% rename from Flashing/flash_ts100_linux.sh rename to Scripts/flash_ts100_linux.sh diff --git a/build.sh b/build.sh deleted file mode 100755 index 268abd282..000000000 --- a/build.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -docker-compose run --rm builder /bin/bash /build/ci/buildAll.sh diff --git a/start_dev.sh b/start_dev.sh deleted file mode 100755 index ef95947f0..000000000 --- a/start_dev.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -docker-compose run --rm builder From 121a2820921070d5c17d170f141a27f6738d524e Mon Sep 17 00:00:00 2001 From: Ivan Zorin Date: Tue, 27 Jun 2023 16:53:38 +0300 Subject: [PATCH 2/9] Scripts => scripts --- .github/workflows/docs.yml | 2 +- .github/workflows/push.yml | 4 ++-- Documentation/Flashing/MHP30.md | 2 +- Documentation/Flashing/TS100.md | 2 +- IronOS.yml | 2 +- Makefile | 6 +++--- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 3716f8151..8c8f71a31 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -37,4 +37,4 @@ jobs: - run: git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com' - name: Publish docs - run: mkdocs gh-deploy -f Scripts/IronOS-mkdocs.yml -d ../site + run: mkdocs gh-deploy -f scripts/IronOS-mkdocs.yml -d ../site diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index c9d9e58ac..765910f9d 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -32,7 +32,7 @@ jobs: - name: copy license text run: | cp LICENSE source/Hexfile/LICENSE - cp Scripts/LICENSE_RELEASE.md source/Hexfile/LICENSE_RELEASE.md + cp scripts/LICENSE_RELEASE.md source/Hexfile/LICENSE_RELEASE.md - name: Archive ${{ matrix.model }} artifacts uses: actions/upload-artifact@v3 @@ -83,7 +83,7 @@ jobs: - name: copy license text run: | cp LICENSE source/Hexfile/LICENSE - cp Scripts/LICENSE_RELEASE.md source/Hexfile/LICENSE_RELEASE.md + cp scripts/LICENSE_RELEASE.md source/Hexfile/LICENSE_RELEASE.md - name: Archive ${{ matrix.model }} artifacts uses: actions/upload-artifact@v3 diff --git a/Documentation/Flashing/MHP30.md b/Documentation/Flashing/MHP30.md index b24f5034b..4ac4c5d1d 100644 --- a/Documentation/Flashing/MHP30.md +++ b/Documentation/Flashing/MHP30.md @@ -55,7 +55,7 @@ sgr1ff1n (Shane) commented in [issue 11](https://github.com/Ralim/IronOS/issues/ While in the past there were reports of unreliable upgrades, the consensus in [issue 11](https://github.com/Ralim/IronOS/issues/11) is that things work mostly as expected in Linux. -@awigen has contributed a script [flash_ts100_linux.sh](https://raw.githubusercontent.com/Ralim/IronOS/dev/Scripts/flash_ts100_linux.sh) that works on Ubuntu 16.04 as well as other distros. +@awigen has contributed a script [flash_ts100_linux.sh](https://raw.githubusercontent.com/Ralim/IronOS/dev/scripts/flash_ts100_linux.sh) that works on Ubuntu 16.04 as well as other distros. If you want to do it manually (or if the script does not work for some reason) the general procedure is the same as for Windows, the differences are in the way to mount the unit and copy the firmware. Remember that after flashing, the firmware filename will have changed to end in `.RDY` or `.ERR` or `.NOT` and only `.RDY` means the flashing was successful! diff --git a/Documentation/Flashing/TS100.md b/Documentation/Flashing/TS100.md index a5aa9cf59..787164e10 100644 --- a/Documentation/Flashing/TS100.md +++ b/Documentation/Flashing/TS100.md @@ -55,7 +55,7 @@ sgr1ff1n (Shane) commented in [issue 11](https://github.com/Ralim/IronOS/issues/ While in the past there were reports of unreliable upgrades, the consensus in [issue 11](https://github.com/Ralim/IronOS/issues/11) is that things work mostly as expected in Linux. -@awigen has contributed a script [flash_ts100_linux.sh](https://raw.githubusercontent.com/Ralim/IronOS/dev/Scripts/flash_ts100_linux.sh) that works on Ubuntu 16.04 as well as other distros. +@awigen has contributed a script [flash_ts100_linux.sh](https://raw.githubusercontent.com/Ralim/IronOS/dev/scripts/flash_ts100_linux.sh) that works on Ubuntu 16.04 as well as other distros. If you want to do it manually (or if the script does not work for some reason) the general procedure is the same as for Windows, the differences are in the way to mount the unit and copy the firmware. Remember that after flashing, the firmware filename will have changed to end in `.RDY` or `.ERR` or `.NOT` and only `.RDY` means the flashing was successful! diff --git a/IronOS.yml b/IronOS.yml index 95ac0b76b..989459849 100644 --- a/IronOS.yml +++ b/IronOS.yml @@ -9,5 +9,5 @@ services: dockerfile: Scripts/IronOS.Dockerfile command: /bin/sh volumes: - - ./Scripts/ci:/build/ci:Z + - ./scripts/ci:/build/ci:Z - ./:/build/source:Z diff --git a/Makefile b/Makefile index d0eb34887..edb1f39c0 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ endif # docker-related files DOCKER_YML=$(CURDIR)/IronOS.yml -DOCKER_FILE=$(CURDIR)/Scripts/IronOS.Dockerfile +DOCKER_FILE=$(CURDIR)/scripts/IronOS.Dockerfile # docker dependencies DOCKER_DEPS=$(DOCKER_YML) $(DOCKER_FILE) @@ -28,7 +28,7 @@ DOCKER_DEPS=$(DOCKER_YML) $(DOCKER_FILE) DOCKER_CMD=$(DOCKER_COMPOSE) -f $(DOCKER_YML) run --rm builder # MkDocs config -MKDOCS_YML=$(CURDIR)/Scripts/IronOS-mkdocs.yml +MKDOCS_YML=$(CURDIR)/scripts/IronOS-mkdocs.yml ### helper targets @@ -57,6 +57,6 @@ docs: $(MKDOCS_YML) Documentation/* Documentation/Flashing/* Documentation/im clean-full: docker-clean make -C source/ clean-all rm -Rf site - rm -Rf Scripts/ci/artefacts + rm -Rf scripts/ci/artefacts .PHONY: docker-shell docker-build docker-clean docs clean-full From 49366e44457a0f66ca8204a48310b99deb0d9420 Mon Sep 17 00:00:00 2001 From: Ivan Zorin Date: Tue, 27 Jun 2023 17:03:56 +0300 Subject: [PATCH 3/9] Scripts -> scripts: re-add missing renamed files --- {Scripts => scripts}/IronOS-mkdocs.yml | 0 {Scripts => scripts}/IronOS.Dockerfile | 0 {Scripts => scripts}/LICENSE_RELEASE.md | 0 {Scripts => scripts}/PULL_REQUEST_TEMPLATE.md | 0 {Scripts => scripts}/ci/buildAll.sh | 2 +- .../gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2.md5 | 0 .../nuclei_riscv_newlibc_prebuilt_linux64_2020.08.tar.bz2.md5 | 0 {Scripts => scripts}/flash_ts100_linux.sh | 0 8 files changed, 1 insertion(+), 1 deletion(-) rename {Scripts => scripts}/IronOS-mkdocs.yml (100%) rename {Scripts => scripts}/IronOS.Dockerfile (100%) rename {Scripts => scripts}/LICENSE_RELEASE.md (100%) rename {Scripts => scripts}/PULL_REQUEST_TEMPLATE.md (100%) rename {Scripts => scripts}/ci/buildAll.sh (92%) rename {Scripts => scripts}/ci/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2.md5 (100%) rename {Scripts => scripts}/ci/nuclei_riscv_newlibc_prebuilt_linux64_2020.08.tar.bz2.md5 (100%) rename {Scripts => scripts}/flash_ts100_linux.sh (100%) diff --git a/Scripts/IronOS-mkdocs.yml b/scripts/IronOS-mkdocs.yml similarity index 100% rename from Scripts/IronOS-mkdocs.yml rename to scripts/IronOS-mkdocs.yml diff --git a/Scripts/IronOS.Dockerfile b/scripts/IronOS.Dockerfile similarity index 100% rename from Scripts/IronOS.Dockerfile rename to scripts/IronOS.Dockerfile diff --git a/Scripts/LICENSE_RELEASE.md b/scripts/LICENSE_RELEASE.md similarity index 100% rename from Scripts/LICENSE_RELEASE.md rename to scripts/LICENSE_RELEASE.md diff --git a/Scripts/PULL_REQUEST_TEMPLATE.md b/scripts/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from Scripts/PULL_REQUEST_TEMPLATE.md rename to scripts/PULL_REQUEST_TEMPLATE.md diff --git a/Scripts/ci/buildAll.sh b/scripts/ci/buildAll.sh similarity index 92% rename from Scripts/ci/buildAll.sh rename to scripts/ci/buildAll.sh index 082f64186..566cfe728 100755 --- a/Scripts/ci/buildAll.sh +++ b/scripts/ci/buildAll.sh @@ -5,7 +5,7 @@ set -u mkdir -p /build/ci/artefacts # Build STM code -cd /build/source/source +cd /build/source/source/ bash ./build.sh || exit 1 echo "All Firmware built" # Copy out all the final resulting files we would like to store for the next op diff --git a/Scripts/ci/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2.md5 b/scripts/ci/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2.md5 similarity index 100% rename from Scripts/ci/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2.md5 rename to scripts/ci/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2.md5 diff --git a/Scripts/ci/nuclei_riscv_newlibc_prebuilt_linux64_2020.08.tar.bz2.md5 b/scripts/ci/nuclei_riscv_newlibc_prebuilt_linux64_2020.08.tar.bz2.md5 similarity index 100% rename from Scripts/ci/nuclei_riscv_newlibc_prebuilt_linux64_2020.08.tar.bz2.md5 rename to scripts/ci/nuclei_riscv_newlibc_prebuilt_linux64_2020.08.tar.bz2.md5 diff --git a/Scripts/flash_ts100_linux.sh b/scripts/flash_ts100_linux.sh similarity index 100% rename from Scripts/flash_ts100_linux.sh rename to scripts/flash_ts100_linux.sh From 7eb03803f6bc2227d6198b3dac371339476b981d Mon Sep 17 00:00:00 2001 From: Ivan Zorin Date: Fri, 30 Jun 2023 17:21:34 +0300 Subject: [PATCH 4/9] Directories refactoring: add top-level Makefile, add scripts/deploy.sh script, move github templates from top-level dir to .github, organize files inside Development Resources --- .../pull_request_template.md | 0 SECURITY.md => .github/security.md | 0 .../{ => Hex}/DO NOT FLASH_Flash Backup.hex | 0 .../{ => Hex}/force_blank_flash.hex | 0 .../{ => Pics}/BatteryIcon.bmp | Bin .../{ => Pics}/sa-720x300.png | Bin .../TS100 V2.46 Schematics V1.0.pdf | Bin .../{ => TS80}/TS80-Bootloader.hex | 0 IronOS.yml | 2 +- Makefile | 78 +++++++++++++-- README.md | 9 +- scripts/IronOS.Dockerfile | 2 +- scripts/deploy.sh | 90 ++++++++++++++++++ 13 files changed, 166 insertions(+), 15 deletions(-) rename scripts/PULL_REQUEST_TEMPLATE.md => .github/pull_request_template.md (100%) rename SECURITY.md => .github/security.md (100%) rename Development Resources/{ => Hex}/DO NOT FLASH_Flash Backup.hex (100%) rename Development Resources/{ => Hex}/force_blank_flash.hex (100%) rename Development Resources/{ => Pics}/BatteryIcon.bmp (100%) rename Development Resources/{ => Pics}/sa-720x300.png (100%) rename Development Resources/{ => TS100}/TS100 V2.46 Schematics V1.0.pdf (100%) rename Development Resources/{ => TS80}/TS80-Bootloader.hex (100%) create mode 100755 scripts/deploy.sh diff --git a/scripts/PULL_REQUEST_TEMPLATE.md b/.github/pull_request_template.md similarity index 100% rename from scripts/PULL_REQUEST_TEMPLATE.md rename to .github/pull_request_template.md diff --git a/SECURITY.md b/.github/security.md similarity index 100% rename from SECURITY.md rename to .github/security.md diff --git a/Development Resources/DO NOT FLASH_Flash Backup.hex b/Development Resources/Hex/DO NOT FLASH_Flash Backup.hex similarity index 100% rename from Development Resources/DO NOT FLASH_Flash Backup.hex rename to Development Resources/Hex/DO NOT FLASH_Flash Backup.hex diff --git a/Development Resources/force_blank_flash.hex b/Development Resources/Hex/force_blank_flash.hex similarity index 100% rename from Development Resources/force_blank_flash.hex rename to Development Resources/Hex/force_blank_flash.hex diff --git a/Development Resources/BatteryIcon.bmp b/Development Resources/Pics/BatteryIcon.bmp similarity index 100% rename from Development Resources/BatteryIcon.bmp rename to Development Resources/Pics/BatteryIcon.bmp diff --git a/Development Resources/sa-720x300.png b/Development Resources/Pics/sa-720x300.png similarity index 100% rename from Development Resources/sa-720x300.png rename to Development Resources/Pics/sa-720x300.png diff --git a/Development Resources/TS100 V2.46 Schematics V1.0.pdf b/Development Resources/TS100/TS100 V2.46 Schematics V1.0.pdf similarity index 100% rename from Development Resources/TS100 V2.46 Schematics V1.0.pdf rename to Development Resources/TS100/TS100 V2.46 Schematics V1.0.pdf diff --git a/Development Resources/TS80-Bootloader.hex b/Development Resources/TS80/TS80-Bootloader.hex similarity index 100% rename from Development Resources/TS80-Bootloader.hex rename to Development Resources/TS80/TS80-Bootloader.hex diff --git a/IronOS.yml b/IronOS.yml index 989459849..28024651d 100644 --- a/IronOS.yml +++ b/IronOS.yml @@ -6,7 +6,7 @@ services: tty: true build: context: . - dockerfile: Scripts/IronOS.Dockerfile + dockerfile: scripts/IronOS.Dockerfile command: /bin/sh volumes: - ./scripts/ci:/build/ci:Z diff --git a/Makefile b/Makefile index edb1f39c0..972f579b2 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,29 @@ #!/usr/bin/env make -# Root Makefile for IronOS - Soldering Iron Open Source Firmware Project +INFO:=top-level Makefile for IronOS - Soldering Iron Open Source Firmware Project. ### global adjustable variables -# command for docker-compose tool -ifndef DOCKER_COMPOSE -DOCKER_COMPOSE:=docker-compose +# command for "docker compose" from DOCKER env. var. +ifdef DOCKER +DOCKER_BIN:=$(DOCKER) +else +DOCKER_BIN:= endif +# detect availability of docker +ifndef DOCKER_BIN +DOCKER_COMPOSE:=$(shell command -v docker-compose 2>/dev/null) +DOCKER_TOOL:=$(shell command -v docker 2>/dev/null) +ifdef DOCKER_COMPOSE +DOCKER_BIN:=$(DOCKER_COMPOSE) +else ifdef DOCKER_TOOL +DOCKER_BIN:=$(DOCKER_TOOL) compose +else +$(error ERROR: Can't find docker-compose nor docker tool. Please, install docker and try again) +endif # DOCKER_* checks +endif # DOCKER_BIN + # command for python-based mkdocs tool ifndef MKDOCS MKDOCS:=mkdocs @@ -25,29 +40,71 @@ DOCKER_FILE=$(CURDIR)/scripts/IronOS.Dockerfile DOCKER_DEPS=$(DOCKER_YML) $(DOCKER_FILE) # compose docker-compose command -DOCKER_CMD=$(DOCKER_COMPOSE) -f $(DOCKER_YML) run --rm builder +DOCKER_CMD=$(DOCKER_BIN) -f $(DOCKER_YML) run --rm builder # MkDocs config MKDOCS_YML=$(CURDIR)/scripts/IronOS-mkdocs.yml -### helper targets +### targets + +# default target to show help +help: + @echo + @echo "Welcome!\nThis is $(INFO)" + @echo "To read more about supported commands (aka \"targets\"), type \"make list\"." + @echo "But if you're impatient then just type \"make docker-build\" - it will:" + @echo "\t * download, configure & start docker container" + @echo "\t * compile builds of IronOS firmware for all supported models inside that container" + @echo "\t * export generated binaries to \"scripts/ci/artefacts/\" local directory" + @echo "Patches are welcome. Happy Hacking!" + @echo + +# target to list supported targets with additional info +list: + @echo "" + @echo "Supported top-level targets:" + @echo "\t * help - shows short basic help" + @echo "\t * list - this output" + @echo "\t * docker-shell - start docker container with shell inside to work on IronOS with all tools needed" + @echo "\t * docker-build - compile builds of IronOS for supported models inside docker container and place them to \"scripts/ci/artefacts/\"" + @echo "\t * docker-clean - delete created docker container (but not pre-downloaded data for it)" + @echo "\t * docs - generate \"site\"/ directory with documentation in a form of static html files using ReadTheDocs framework and $(MKDOCS_YML) local config file" + @echo "\t * clean-full - delete files & directories generated by all the targets above " + @echo "" + @echo "NOTES on supported pass-trough targets:" + @echo "\t * main Makefile is located in source/ directory and used to build the firmware itself;" + @echo "\t * this top-level Makefile supports to call targets from source/Makefile;" + @echo "\t * if you set up development environment right on your host, then to build firmware locally, you can just type right from here:" + @echo + @echo "\t> make firmware-LANG_ID model=MODEL_ID" + @echo + @echo "Full list of current supported IDs:" + @echo "\t * LANG_ID: BE BG CS DA DE EL EN ES FI FR HR HU IT JA_JP LT NB NL_BE NL PL PT RO RU SK SL SR_CYRL SR_LATN SV TR UK VI YUE_HK ZH_CN ZH_TW" + @echo "\t * MODEL_ID: TS100 TS101 TS80 TS80P MHP30 Pinecil Pinecilv2 S60" + @echo + @echo "For example, to make a local build of IronOS firmware for TS100 with English language, just type:" + @echo "\n\t> make firmware-EN model=TS100" + @echo + +# bash one-liner to generate langs for "make list": +# echo "`ls Translations/ | grep -e "^translation_.*.json$" | sed -e 's,^translation_,,g; s,\.json$,,g; ' | tr '\n' ' '`" # former start_dev.sh docker-shell: $(DOCKER_DEPS) - @$(DOCKER_CMD) + $(DOCKER_CMD) # former build.sh docker-build: $(DOCKER_DEPS) - @$(DOCKER_CMD) /bin/bash /build/ci/buildAll.sh + $(DOCKER_CMD) /bin/bash /build/ci/buildAll.sh # delete container docker-clean: - -@docker rmi ironos-builder:latest + -docker rmi ironos-builder:latest # generate docs in site/ directory (DIR for -d is relative to mkdocs.yml file location, hence use default name/location site by setting up ../site) docs: $(MKDOCS_YML) Documentation/* Documentation/Flashing/* Documentation/images/* - @$(MKDOCS) build -f $(MKDOCS_YML) -d ../site + $(MKDOCS) build -f $(MKDOCS_YML) -d ../site # pass-through target for Makefile inside source/ dir %: @@ -60,3 +117,4 @@ clean-full: docker-clean rm -Rf scripts/ci/artefacts .PHONY: docker-shell docker-build docker-clean docs clean-full + diff --git a/README.md b/README.md index bde4ce3f9..f1cbc655f 100644 --- a/README.md +++ b/README.md @@ -67,11 +67,14 @@ For notes on installation for your device, please refer to the flashing guide fo - Boost mode lets you temporarily change the temperature when soldering (i.e. raise the temperature for short periods) - (TS100/Pinecil) Battery charge level indicator if power source set to a lipo cell count - (TS80/TS80P/Pinecil) Power bank operating voltage is displayed -- [Custom boot up logo support](https://ralim.github.io/IronOS/Logo/) +- [Custom boot up logo support](https://ralim.github.io/IronOS/Logo/)[^bootlogo] - Automatic LCD rotation based on the orientation -**Bootup Logo NOTICE**: -IronOS supports both a bootup logo _AND_ bootup animations. However, _they are no longer included in this repo_. Please, [read the docs](https://ralim.github.io/IronOS/Logo/) for more information. + +[^bootlogo]: **BOOTUP LOGO NOTICE**: + IronOS supports both a bootup logo _AND_ bootup animations. + However, _**they are no longer included in this repo**_. + **Please, [read the docs](https://ralim.github.io/IronOS/Logo/) for more information**. ## Menu System diff --git a/scripts/IronOS.Dockerfile b/scripts/IronOS.Dockerfile index ada341c5a..b3026b4d3 100644 --- a/scripts/IronOS.Dockerfile +++ b/scripts/IronOS.Dockerfile @@ -26,4 +26,4 @@ RUN python3 -m pip install ${PIP_PKGS} RUN git config --global --add safe.directory /build/source COPY . /build/source -COPY ./Scripts/ci /build/ci +COPY ./scripts/ci /build/ci diff --git a/scripts/deploy.sh b/scripts/deploy.sh new file mode 100755 index 000000000..65bab0c0b --- /dev/null +++ b/scripts/deploy.sh @@ -0,0 +1,90 @@ +#!/usr/bin/env bash + +# little helper for docker deployment to: +# - start development environment for IronOS ("shell" sub-command) +# - generate full set of builds ("build" sub-command) + +#set -x +#set -e + +usage() +{ + echo -e "\nUsage: ${0} [CMD]\n" + echo "CMD:" + echo -e "\tshell - start docker container with shell inside to work on IronOS with all tools needed" + echo -e "\tbuild - compile builds of IronOS inside docker container for supported hardware" + echo -e "\tclean - delete created docker container (but not pre-downloaded data for it)\n" + echo -e "STORAGE NOTICE: for \"shell\" and \"build\" commands extra files will be downloaded so make sure that you have ~5GB of free space.\n" +} + +### main + +docker_conf="IronOS.yml" + +# allow providing custom path to docker tool using DOCKER_BIN external env. var. +# (compose sub-command must be included, i.e. DOCKER_BIN="/usr/local/bin/docker compose" ./deploy.sh) + +if [ -z "${DOCKER_BIN}" ]; then + docker_bin="" +else + docker_bin="${DOCKER_BIN}" +fi; + +# detect availability of docker + +docker_compose="`command -v docker-compose`" +if [ "${?}" -eq 0 ] && [ -n "${docker_compose}" ] && [ -z "${docker_bin}" ]; then + docker_bin="${docker_compose}" +fi; + +docker_tool="`command -v docker`" +if [ "${?}" -eq 0 ] && [ -n "${docker_tool}" ] && [ -z "${docker_bin}" ]; then + docker_bin="${docker_tool} compose" +fi; + +if [ -z "${docker_bin}" ]; then + echo "ERROR: Can't find docker-compose nor docker tool. Please, install docker and try again." + exit 1 +fi; + +# construct command to run + +cmd="${1}" +if [ -z "${cmd}" ] || [ "${cmd}" = "shell" ]; then + docker_cmd="run --rm builder" +elif [ "${cmd}" = "build" ]; then + docker_cmd="run --rm builder /bin/bash /build/ci/buildAll.sh" +elif [ "${cmd}" = "clean" ]; then + docker rmi ironos-builder:latest + exit "${?}" +else + usage + exit 1 +fi; + +# get absolute location of project root dir to make docker happy with config(s) +# (successfully tested on relatively POSIX-compliant Dash shell) + +# this script +script_file="/deploy.sh" +# IronOS/scripts/deploy.sh +script_path="${PWD}"/"${0}" +# IronOS/scripts/ +script_dir=${script_path%"${script_file}"} +# IronOS/ +root_dir="${script_dir}/.." +# IronOS/IronOS.yml +docker_file="-f ${root_dir}/${docker_conf}" + +# change dir to project root dir & run constructed command + +cd "${root_dir}" +echo -e "\n====>>>> Firing up & starting container..." +if [ "${cmd}" = "shell" ]; then +echo -e "\t* type \"exit\" to end the session when done;" +fi; +echo -e "\t* type \"${0} clean\" to delete created container (but not cached data)" +echo -e "\n====>>>> ${docker_bin} ${docker_file} ${docker_cmd}\n" +${docker_bin} ${docker_file} ${docker_cmd} +exit "${?}" + From 379be8bf79fb6a30db839de270fada84da94dfb8 Mon Sep 17 00:00:00 2001 From: Ivan Zorin Date: Fri, 30 Jun 2023 18:36:22 +0300 Subject: [PATCH 5/9] Update scripts/deploy.sh accroding to codestyle syntax shellcheck --- scripts/deploy.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 65bab0c0b..46e91ae7f 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -32,13 +32,13 @@ fi; # detect availability of docker -docker_compose="`command -v docker-compose`" -if [ "${?}" -eq 0 ] && [ -n "${docker_compose}" ] && [ -z "${docker_bin}" ]; then +docker_compose="$(command -v docker-compose)" +if [ -n "${docker_compose}" ] && [ -z "${docker_bin}" ]; then docker_bin="${docker_compose}" fi; -docker_tool="`command -v docker`" -if [ "${?}" -eq 0 ] && [ -n "${docker_tool}" ] && [ -z "${docker_bin}" ]; then +docker_tool="$(command -v docker)" +if [ -n "${docker_tool}" ] && [ -z "${docker_bin}" ]; then docker_bin="${docker_tool} compose" fi; @@ -78,13 +78,13 @@ docker_file="-f ${root_dir}/${docker_conf}" # change dir to project root dir & run constructed command -cd "${root_dir}" +cd "${root_dir}" || exit 1 echo -e "\n====>>>> Firing up & starting container..." if [ "${cmd}" = "shell" ]; then echo -e "\t* type \"exit\" to end the session when done;" fi; echo -e "\t* type \"${0} clean\" to delete created container (but not cached data)" echo -e "\n====>>>> ${docker_bin} ${docker_file} ${docker_cmd}\n" -${docker_bin} ${docker_file} ${docker_cmd} +eval "${docker_bin} ${docker_file} ${docker_cmd}" exit "${?}" From 96f5d891d82ebbf64288f6c0dcdfdf1023408719 Mon Sep 17 00:00:00 2001 From: Ivan Zorin Date: Sat, 1 Jul 2023 00:59:20 +0300 Subject: [PATCH 6/9] Makefile: add docs-deploy target for mkdocs gh-deploy --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 972f579b2..3b917eb90 100644 --- a/Makefile +++ b/Makefile @@ -70,6 +70,7 @@ list: @echo "\t * docker-build - compile builds of IronOS for supported models inside docker container and place them to \"scripts/ci/artefacts/\"" @echo "\t * docker-clean - delete created docker container (but not pre-downloaded data for it)" @echo "\t * docs - generate \"site\"/ directory with documentation in a form of static html files using ReadTheDocs framework and $(MKDOCS_YML) local config file" + @echo "\t * docs-deploy - generate & deploy docs online to gh-pages branch of current github repo" @echo "\t * clean-full - delete files & directories generated by all the targets above " @echo "" @echo "NOTES on supported pass-trough targets:" @@ -106,6 +107,10 @@ docker-clean: docs: $(MKDOCS_YML) Documentation/* Documentation/Flashing/* Documentation/images/* $(MKDOCS) build -f $(MKDOCS_YML) -d ../site +# deploy docs to gh-pages branch of current repo automagically using ReadTheDocs framework +docs-deploy: $(MKDOCS_YML) Documentation/* Documentation/Flashing/* Documentation/images/* + $(MKDOCS) gh-deploy -f $(MKDOCS_YML) -d ../site + # pass-through target for Makefile inside source/ dir %: make -C source/ $@ From d8dfb5edd93be285b2b8a58c98f9c119c8ff74e0 Mon Sep 17 00:00:00 2001 From: Ivan Zorin Date: Sat, 1 Jul 2023 12:31:12 +0300 Subject: [PATCH 7/9] Rename IronOS.yml > Env.yml, update related files --- IronOS.yml => Env.yml | 0 Makefile | 2 +- scripts/deploy.sh | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) rename IronOS.yml => Env.yml (100%) diff --git a/IronOS.yml b/Env.yml similarity index 100% rename from IronOS.yml rename to Env.yml diff --git a/Makefile b/Makefile index 3b917eb90..40d6b8b2c 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ endif ### global static variables # docker-related files -DOCKER_YML=$(CURDIR)/IronOS.yml +DOCKER_YML=$(CURDIR)/Env.yml DOCKER_FILE=$(CURDIR)/scripts/IronOS.Dockerfile # docker dependencies diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 46e91ae7f..fa89036d5 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -19,7 +19,7 @@ usage() ### main -docker_conf="IronOS.yml" +docker_conf="Env.yml" # allow providing custom path to docker tool using DOCKER_BIN external env. var. # (compose sub-command must be included, i.e. DOCKER_BIN="/usr/local/bin/docker compose" ./deploy.sh) @@ -73,7 +73,7 @@ script_path="${PWD}"/"${0}" script_dir=${script_path%"${script_file}"} # IronOS/ root_dir="${script_dir}/.." -# IronOS/IronOS.yml +# IronOS/Env.yml docker_file="-f ${root_dir}/${docker_conf}" # change dir to project root dir & run constructed command From 0737e7c15c16bd251bb0286355baa31bbad23e9b Mon Sep 17 00:00:00 2001 From: Ivan Zorin Date: Sat, 1 Jul 2023 12:33:14 +0300 Subject: [PATCH 8/9] Docs configs: remove empty characters --- .github/workflows/docs.yml | 2 +- scripts/IronOS-mkdocs.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 8c8f71a31..9ac8cf599 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -35,6 +35,6 @@ jobs: mkdocs-git-revision-date-plugin mkdocs-autolinks-plugin \ mkdocs-awesome-pages-plugin - run: git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com' - + - name: Publish docs run: mkdocs gh-deploy -f scripts/IronOS-mkdocs.yml -d ../site diff --git a/scripts/IronOS-mkdocs.yml b/scripts/IronOS-mkdocs.yml index f30058760..9514aa1b1 100644 --- a/scripts/IronOS-mkdocs.yml +++ b/scripts/IronOS-mkdocs.yml @@ -46,8 +46,8 @@ plugins: - autolinks - awesome-pages - git-revision-date - - + + # Markdown Extensions markdown_extensions: - attr_list From 43ab0d7f89b32ea02d787501b38db5f57500339c Mon Sep 17 00:00:00 2001 From: Ivan Zorin Date: Sat, 1 Jul 2023 22:45:22 +0300 Subject: [PATCH 9/9] docs/devel: update usage of new script --- Documentation/Development.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/Development.md b/Documentation/Development.md index b43ae2d10..83470d892 100644 --- a/Documentation/Development.md +++ b/Documentation/Development.md @@ -125,7 +125,7 @@ On Windows follow the instructions on the official documentation to install 'Win ```sh cd IronOS - ./start_dev.sh + ./scripts/deploy.sh ``` This script will build a Docker image and run a container with the necessary tools to build the firmware.