Compare commits

...

6 Commits

Author SHA1 Message Date
Ben V. Brown
a7ac4df252 Update img2logo.py 2024-08-20 22:59:22 +10:00
Ben V. Brown
22ce26026d add py3-intelhex 2024-08-20 22:55:48 +10:00
Ben V. Brown
4193362fce . 2024-08-20 22:52:12 +10:00
Ben V. Brown
4261a7e5a2 Remove TS101 from CI 2024-08-20 22:50:59 +10:00
Ben V. Brown
d4c6978bfe Update TS101 to require merge 2024-08-20 22:50:28 +10:00
Ben V. Brown
ee6c5e911a Update output_hex.py 2024-08-20 22:50:13 +10:00
6 changed files with 83 additions and 90 deletions

View File

@@ -14,13 +14,12 @@ jobs:
- model: "pinecilv1"
- model: "pinecilv2"
- model: "mhp30"
- model: "ts101"
- model: "s60"
fail-fast: true
steps:
- name: Install dependencies (apk)
run: apk add --no-cache git python3 py3-pip zlib py3-pillow
run: apk add --no-cache git python3 py3-pip zlib py3-pillow py3-intelhex
- uses: actions/checkout@v3
with:

View File

@@ -1,69 +1,63 @@
---
name: "release"
on:
push:
branches:
- "main"
jobs:
release:
name: "Release"
runs-on: "ubuntu-22.04"
steps:
- name: Install dependencies (apk)
run: sudo apt update && sudo apt-get install -y git python3 python3-pillow
- uses: actions/checkout@v3
with:
submodules: true
- name: prep
run: |
mkdir -p /tmp/pinecilv1 && \
mkdir -p /tmp/pinecilv2 && \
mkdir -p /tmp/miniware && \
mkdir -p /tmp/ts101 && \
mkdir -p /tmp/mhp30 && \
mkdir -p /tmp/s60
- name: build all files for the device
run: |
cd Bootup\ Logos && \
./run.sh /tmp/pinecilv1/ -m pinecilv1 && \
./run.sh /tmp/pinecilv2/ -m pinecilv2 && \
./run.sh /tmp/miniware/ -m miniware && \
./run.sh /tmp/ts101/ -m ts101 && \
./run.sh /tmp/mhp30/ -m mhp30 && \
./run.sh /tmp/s60/ -m s60
- name: build logo erase file
run: |
cd Bootup\ Logos && \
python3 img2logo.py -E erase_stored_image /tmp/pinecilv1/ -m pinecilv1 && \
python3 img2logo.py -E erase_stored_image /tmp/pinecilv2/ -m pinecilv2 && \
python3 img2logo.py -E erase_stored_image /tmp/miniware/ -m miniware && \
python3 img2logo.py -E erase_stored_image /tmp/ts101/ -m ts101 && \
python3 img2logo.py -E erase_stored_image /tmp/mhp30/ -m mhp30 && \
python3 img2logo.py -E erase_stored_image /tmp/s60/ -m s60
- name: compress logo files
run: |
zip -rj pinecilv1.zip /tmp/pinecilv1/* && \
zip -rj miniware.zip /tmp/miniware/* && \
zip -rj pinecilv2.zip /tmp/pinecilv2/* && \
zip -rj ts101.zip /tmp/ts101/* && \
zip -rj mhp30.zip /tmp/mhp30/* && \
zip -rj s60_s60p.zip /tmp/s60/*
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
title: "Release"
files: |
*.zip
name: "release"
on:
push:
branches:
- "main"
jobs:
release:
name: "Release"
runs-on: "ubuntu-22.04"
steps:
- name: Install dependencies (apk)
run: sudo apt update && sudo apt-get install -y git python3 python3-pillow py3-intelhex
- uses: actions/checkout@v3
with:
submodules: true
- name: prep
run: |
mkdir -p /tmp/pinecilv1 && \
mkdir -p /tmp/pinecilv2 && \
mkdir -p /tmp/miniware && \
mkdir -p /tmp/mhp30 && \
mkdir -p /tmp/s60
- name: build all files for the device
run: |
cd Bootup\ Logos && \
./run.sh /tmp/pinecilv1/ -m pinecilv1 && \
./run.sh /tmp/pinecilv2/ -m pinecilv2 && \
./run.sh /tmp/miniware/ -m miniware && \
./run.sh /tmp/mhp30/ -m mhp30 && \
./run.sh /tmp/s60/ -m s60
- name: build logo erase file
run: |
cd Bootup\ Logos && \
python3 img2logo.py -E erase_stored_image /tmp/pinecilv1/ -m pinecilv1 && \
python3 img2logo.py -E erase_stored_image /tmp/pinecilv2/ -m pinecilv2 && \
python3 img2logo.py -E erase_stored_image /tmp/miniware/ -m miniware && \
python3 img2logo.py -E erase_stored_image /tmp/mhp30/ -m mhp30 && \
python3 img2logo.py -E erase_stored_image /tmp/s60/ -m s60
- name: compress logo files
run: |
zip -rj pinecilv1.zip /tmp/pinecilv1/* && \
zip -rj miniware.zip /tmp/miniware/* && \
zip -rj pinecilv2.zip /tmp/pinecilv2/* && \
zip -rj mhp30.zip /tmp/mhp30/* && \
zip -rj s60_s60p.zip /tmp/s60/*
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
title: "Release"
files: |
*.zip

View File

@@ -4,6 +4,7 @@ from __future__ import division
import argparse
import copy
import os, sys
from typing import Optional
from intelhex import IntelHex
from output_hex import HexOutput
from output_dfu import DFUOutput
@@ -50,7 +51,7 @@ class S60Settings:
class TS101Settings:
IMAGE_ADDRESS = 0x08000000 + (126 * 1024)
IMAGE_ADDRESS = 0x08000000 + (99 * 1024)
DFU_TARGET_NAME = b"IronOS-dfu"
DFU_ALT = 0
DFU_VENDOR = 0x1209
@@ -243,7 +244,7 @@ def animated_image_to_bytes(
def img2hex(
input_filename,
device_model_name: str,
merge_hex_file: str | None,
merge_hex_file: Optional[str],
preview_filename=None,
threshold=128,
dither=False,
@@ -306,6 +307,11 @@ def img2hex(
deviceSettings = Pinecilv2Settings
elif device_name == "ts101":
deviceSettings = TS101Settings
if merge_hex_file is None:
print(
"For the TS101 for compatibility with bugs in the Miniware Loader, you must merge the main firmware with the logo to flash it"
)
exit(1)
elif device_name == "s60":
deviceSettings = S60Settings
elif device_name == "mhp30":
@@ -359,7 +365,7 @@ def read_merge_write(
# Merge in the image data, error if collision
base_hex_file.merge(logo_hex_file, overlap="error")
binary_base = base_hex_file.minaddr()
base_hex_file.padding = 0xA5
base_hex_file.padding = 0xFF
binary_blob = base_hex_file.tobinarray(start=binary_base)
print(
f"Post-merge output image starts at 0x{binary_base:x}, len {len(binary_blob)}"
@@ -373,13 +379,17 @@ def read_merge_write(
deviceSettings.DFU_PRODUCT,
deviceSettings.DFU_VENDOR,
)
# Gap fill any missing segments
# This is required for the TS101 bootloader
segments = base_hex_file.segments()
for seg_pair in zip(segments, segments[1:]):
start = seg_pair[0][1]
end = seg_pair[1][0]
filler = [0xFE] * (end - start)
base_hex_file.frombytes(filler, start)
HexOutput.writeFile(
output_filename + ".hex",
binary_blob,
binary_base,
deviceSettings.MINIMUM_HEX_SIZE,
)
with open(output_filename + ".hex", "w") as output:
base_hex_file.write_hex_file(output, eolstyle="CRLF")
def parse_commandline():

View File

@@ -65,13 +65,6 @@ class HexOutput:
def write(generator):
output.write("".join(generator))
if len(data) % cls.INTELHEX_BYTES_PER_LINE != 0:
raise ValueError(
"Program error: Size of LCD data is not evenly divisible by {}".format(
cls.INTELHEX_BYTES_PER_LINE
)
)
address_lo = data_address & 0xFFFF
address_hi = (data_address >> 16) & 0xFFFF

View File

@@ -1 +0,0 @@

View File

@@ -7,11 +7,10 @@ This includes photographs of hardware, datasheets, schematics, original propriet
This repository uses github actions to automagically build the logos for each device.
Periodically a "release" will be tagged and pre-compiled logo's will be put there as well to make it easy.
# Boot-Up Logos
The IronOS firmware supports a user created bootup logo.
By default, there is _not_ one included in the firmware. This means that once flashed they generally stay. If you want no logo again, you would have to flash a blank image to the bootup logo.
By default, there is _not_ one included in the firmware. This means that once flashed they generally stay. If you want no logo again, you would have to flash a blank image to the bootup logo.
- Safe & Fun: will not over write your firmware
- Easy install: use dfu tool just like updating firmware (or Pine64 Updater if you have a Pinecil).
@@ -22,4 +21,3 @@ There are community logo's already converted and ready to use in [IronOS-Meta/re
Download the zip for Pinecil or Miniware and then install using the instructions on the [main IronOS documentation](https://ralim.github.io/IronOS/Logo/).
Alternatively if you want to make your own logo files, there is also documentation on how best to do this in the [main IronOS documentation](https://ralim.github.io/IronOS/Logo/).