1
0
forked from me/IronOS-Meta

Expanding supported devices (#35)

This commit is contained in:
Ben V. Brown
2023-08-01 21:38:09 +10:00
committed by Ben V. Brown
parent c10a130329
commit 3b02e3ea6f
5 changed files with 129 additions and 61 deletions

View File

@@ -10,17 +10,19 @@ jobs:
strategy: strategy:
matrix: matrix:
include: include:
- args: "-m" - model: "miniware"
model: "miniware" - model: "pinecilv1"
- args: "-p" - model: "pinecilv2"
model: "pinecil" - model: "mhp30"
- model: "ts101"
- model: "s60"
fail-fast: true fail-fast: true
steps: steps:
- name: Install dependencies (apk) - 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
- uses: actions/checkout@v2 - uses: actions/checkout@v3
with: with:
submodules: true submodules: true
@@ -28,13 +30,13 @@ jobs:
run: mkdir -p /tmp/${{ matrix.model }} run: mkdir -p /tmp/${{ matrix.model }}
- name: build all files for the device - name: build all files for the device
run: cd Bootup\ Logos && ./run.sh /tmp/${{ matrix.model }}/ ${{matrix.args}} run: cd Bootup\ Logos && ./run.sh /tmp/${{ matrix.model }}/ -m ${{matrix.model}}
- name: build logo erase file - name: build logo erase file
run: cd Bootup\ Logos && python3 img2logo.py -E erase_stored_image /tmp/${{ matrix.model }}/ ${{matrix.args}} run: cd Bootup\ Logos && python3 img2logo.py -E erase_stored_image /tmp/${{ matrix.model }}/ -m ${{matrix.model}}
- name: Archive artifacts - name: Archive artifacts
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v3
with: with:
name: ${{ matrix.model }} name: ${{ matrix.model }}
path: | path: |

View File

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

@@ -1,3 +1,5 @@
# Boot up Logos
## Boot up logo's are logos or animations shown on boot of IronOS ## Boot up logo's are logos or animations shown on boot of IronOS
These are programmed into the device just like the normal firmware. These are programmed into the device just like the normal firmware.
@@ -51,7 +53,6 @@ This just overwrites individual bytes in the output buffer.
|![Alt text](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/wh_40k.png)|wh_40k.png|| |![Alt text](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/wh_40k.png)|wh_40k.png||
|![Alt text](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/wwii_kilroy.png)|wwii_kilroy.png|| |![Alt text](https://github.com/Ralim/IronOS-Meta/blob/main/Bootup%20Logos/Images/wwii_kilroy.png)|wwii_kilroy.png||
**Animated logos** **Animated logos**
|Logo \* |Filename |Note | |Logo \* |Filename |Note |
|:-------------:|:-------------:|:-----:| |:-------------:|:-------------:|:-----:|

View File

@@ -32,13 +32,39 @@ class MiniwareSettings:
DFU_PINECIL_VENDOR = 0x1209 DFU_PINECIL_VENDOR = 0x1209
DFU_PINECIL_PRODUCT = 0xDB42 DFU_PINECIL_PRODUCT = 0xDB42
class S60Settings:
IMAGE_ADDRESS = 0x08000000 + (62 * 1024)
DFU_TARGET_NAME = b"IronOS-dfu"
DFU_PINECIL_ALT = 0
DFU_PINECIL_VENDOR = 0x1209
DFU_PINECIL_PRODUCT = 0xDB42
class TS101Settings:
IMAGE_ADDRESS = 0x08000000 + (126 * 1024)
DFU_TARGET_NAME = b"IronOS-dfu"
DFU_PINECIL_ALT = 0
DFU_PINECIL_VENDOR = 0x1209
DFU_PINECIL_PRODUCT = 0xDB42
class MHP30Settings:
IMAGE_ADDRESS = 0x08000000 + (126 * 1024)
DFU_TARGET_NAME = b"IronOS-dfu"
DFU_PINECIL_ALT = 0
DFU_PINECIL_VENDOR = 0x1209
DFU_PINECIL_PRODUCT = 0xDB42
class PinecilSettings: class PinecilSettings:
IMAGE_ADDRESS = 0x0801F800 IMAGE_ADDRESS = 0x0801F800
DFU_TARGET_NAME = b"Pinecil" DFU_TARGET_NAME = b"Pinecil"
DFU_PINECIL_ALT = 0 DFU_PINECIL_ALT = 0
DFU_PINECIL_VENDOR = 0x28E9 DFU_PINECIL_VENDOR = 0x28E9
DFU_PINECIL_PRODUCT = 0x0189 DFU_PINECIL_PRODUCT = 0x0189
class Pinecilv2Settings:
IMAGE_ADDRESS = (1016 * 1024) # its 2 4k erase pages inset
DFU_TARGET_NAME = b"Pinecilv2"
DFU_PINECIL_ALT = 0
DFU_PINECIL_VENDOR = 0x28E9 # These are ignored by blisp so doesnt matter what we use
DFU_PINECIL_PRODUCT = 0x0189 # These are ignored by blisp so doesnt matter what we use
def still_image_to_bytes(image: Image, negative: bool, dither: bool, threshold: int, preview_filename): def still_image_to_bytes(image: Image, negative: bool, dither: bool, threshold: int, preview_filename):
@@ -190,11 +216,11 @@ def animated_image_to_bytes(imageIn: Image, negative: bool, dither: bool, thresh
def img2hex( def img2hex(
input_filename, input_filename,
device_model_name:str,
preview_filename=None, preview_filename=None,
threshold=128, threshold=128,
dither=False, dither=False,
negative=False, negative=False,
isPinecil=False,
make_erase_image=False, make_erase_image=False,
output_filename_base="out", output_filename_base="out",
flip=False, flip=False,
@@ -235,9 +261,21 @@ def img2hex(
if len(data) < LCD_PAGE_SIZE: if len(data) < LCD_PAGE_SIZE:
pad = [0] * (LCD_PAGE_SIZE - len(data)) pad = [0] * (LCD_PAGE_SIZE - len(data))
data.extend(pad) data.extend(pad)
deviceSettings = MiniwareSettings if device_model_name == "miniware":
if isPinecil: deviceSettings = MiniwareSettings
elif device_model_name == "pinecilv1":
deviceSettings = PinecilSettings deviceSettings = PinecilSettings
elif device_model_name == "pinecilv2":
deviceSettings = Pinecilv2Settings
elif device_model_name == "ts101":
deviceSettings = TS101Settings
elif device_model_name == "s60":
deviceSettings = S60Settings
elif device_model_name == "mhp30":
deviceSettings = MHP30Settings
else:
print("Could not determine device type")
sys.exit(-1)
# Split name from extension so we can mangle in the _L suffix for flipped images # Split name from extension so we can mangle in the _L suffix for flipped images
split_name = os.path.splitext( os.path.basename(input_filename)) split_name = os.path.splitext( os.path.basename(input_filename))
@@ -313,8 +351,7 @@ def parse_commandline():
help="generate a logo erase file instead of a logo", help="generate a logo erase file instead of a logo",
) )
parser.add_argument("-p", "--pinecil", action="store_true", help="generate files for Pinecil") parser.add_argument("-m", "--model", help="device model name")
parser.add_argument("-m", "--miniware", action="store_true", help="generate files for miniware")
parser.add_argument( parser.add_argument(
"-v", "-v",
"--version", "--version",
@@ -334,32 +371,32 @@ if __name__ == "__main__":
sys.stderr.write('Won\'t overwrite existing file "{}" (use --force ' "option to override)\n".format(args.preview)) sys.stderr.write('Won\'t overwrite existing file "{}" (use --force ' "option to override)\n".format(args.preview))
sys.exit(1) sys.exit(1)
if args.miniware == False and args.pinecil == False:
sys.stderr.write("You must provide --miniware or --pinecil to select your model")
sys.exit(1)
print(f"Converting {args.input_filename} => {args.output_filename}") print(f"Converting {args.input_filename} => {args.output_filename}")
img2hex( img2hex(
input_filename=args.input_filename, input_filename=args.input_filename,
output_filename_base=args.output_filename, output_filename_base=args.output_filename,
device_model_name=args.model,
preview_filename=args.preview, preview_filename=args.preview,
threshold=args.threshold, threshold=args.threshold,
dither=args.dither, dither=args.dither,
negative=args.negative, negative=args.negative,
make_erase_image=args.erase, make_erase_image=args.erase,
isPinecil=args.pinecil,
flip = False, flip = False,
) )
img2hex( img2hex(
input_filename=args.input_filename, input_filename=args.input_filename,
output_filename_base=args.output_filename, output_filename_base=args.output_filename,
device_model_name=args.model,
preview_filename=args.preview, preview_filename=args.preview,
threshold=args.threshold, threshold=args.threshold,
dither=args.dither, dither=args.dither,
negative=args.negative, negative=args.negative,
make_erase_image=args.erase, make_erase_image=args.erase,
isPinecil=args.pinecil,
flip = True, flip = True,
) )

View File

@@ -2,4 +2,4 @@
echo $1 echo $1
echo $2 echo $2
set -e set -e
find Images/ -type f -exec python3 img2logo.py {} "$1" "$2" \; find Images/ -type f -exec python3 img2logo.py {} "$1" "$2" "$3" \;