~aleteoryx/muditaos

ref: sign_test muditaos/tools/generate_default_eeprom_bin.sh -rwxr-xr-x 1.3 KiB
a217eeb3 — Dawid Wojtas [BH-2024] Fix lack of alarm directory after updating software 1 year, 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash -e
# Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

# Redefine these variables to fit the required configuration
SERIAL='180416261221'
MODEL='1.00'
COLOUR='black'
PCB_MB_VERSION='7v1'
PCB_UM_VERSION='5v1'
PCB_LM_VERSION='5v1'
PCB_AM_VERSION='N50-4001-01EB'
BATTERY_REVISION='A'
IMAGE_FILE_NAME='eeprom.bin'

printf "\nTool to generate default EEPROM file for Mudita Pure\n\n"

# Check if file already exists
if [[ -f ${IMAGE_FILE_NAME} ]]; then
  printf "File '%s' already exists, continuing will result in its contents being overwritten!\n" ${IMAGE_FILE_NAME}
  read -p "Do you want to continue? (y/n): " -n 1 -r
  printf "\n"
  if [[ ! $REPLY =~ ^[Yy]$ ]]; then
    printf "Aborting...\n"
    exit 1
  fi

  # Remove previous image
  rm ${IMAGE_FILE_NAME}
fi


# Generate new image
./eepromgen.sh ${IMAGE_FILE_NAME} \
               serial=${SERIAL} \
               model=${MODEL} \
               case_colour=${COLOUR}  \
               pcb_mb_version=${PCB_MB_VERSION} \
               pcb_um_version=${PCB_UM_VERSION} \
               pcb_lm_version=${PCB_LM_VERSION} \
               pcb_am_version=${PCB_AM_VERSION} \
               battery_revision=${BATTERY_REVISION}

printf "\nEEPROM file '%s' has been created!\n" ${IMAGE_FILE_NAME}