Import of the watch repository from Pebble

This commit is contained in:
Matthieu Jeanson 2024-12-12 16:43:03 -08:00 committed by Katharine Berry
commit 3b92768480
10334 changed files with 2564465 additions and 0 deletions

View file

@ -0,0 +1,44 @@
{
"name" : "Pebble Firmware (Baconator)",
"firmware" : {
"boards" : ["bigboard", "ev2_3"],
"release" : true,
"factory" : true,
"cflags" : []
},
"files" : [
{
"src" : "release-notes/baconator.txt",
"dst" : "release_notes.txt"
},
{
"src" : "build/src/boot/tintin_boot.elf",
"dst" : "pebble_boot_{tag}.elf"
},
{
"src" : "build/src/fw/tintin_fw.elf",
"dst" : "pebble_fw_{tag}.elf"
},
{
"src" : "build/safe/src/fw/tintin_fw.elf",
"dst" : "pebble_recovery_{tag}.elf"
},
{
"src" : "build/system_resources.pbpack",
"dst" : "system_resources_{tag}.pbpack"
},
{
"src" : "tools/elf2hex.sh",
"dst" : "scripts/elf2hex.sh"
},
{
"src" : "tools/elf2bin.sh",
"dst" : "scripts/elf2bin.sh"
}
],
"bundles" : []
}

View file

@ -0,0 +1,51 @@
{
"name" : "EV2-4 Pebble Firmware (Birkenstock)",
"firmware" : {
"board" : "ev2",
"release" : true,
"cflags" : []
},
"files" : [
{
"src" : "release-notes/ev2-4.txt",
"dst" : "README.txt"
},
{
"src" : "build/src/boot/tintin_boot.hex",
"dst" : "pebble_boot_{tag}.hex"
},
{
"src" : "build/safe/src/fw/tintin_fw.hex",
"dst" : "pebble_fw_{tag}.hex"
},
{
"src" : "build/safe/src/fw/tintin_fw.bin",
"dst" : "pebble_recovery_{tag}.bin"
},
{
"src" : "build/system_resources.pbpack",
"dst" : "system_resources_{tag}.pbpack"
},
{
"src" : "docs/spi_flash_imaging.txt",
"dst" : "docs/spi_flash_imaging.txt"
},
{
"src" : "tools/insert_firmware_descr.py",
"dst" : "scripts/insert_firmware_descr.py"
},
{
"src" : "tools/serial_flash_imaging.py",
"dst" : "scripts/serial_flash_imaging.py"
},
{
"src" : "tools/stm32_crc.py",
"dst" : "scripts/stm32_crc.py"
}
],
"bundles" : []
}

View file

@ -0,0 +1,44 @@
{
"name" : "Pebble Firmware (Chicken Nugget)",
"firmware" : {
"boards" : ["bigboard", "ev2_4"],
"release" : true,
"factory" : true,
"cflags" : []
},
"files" : [
{
"src" : "release-notes/chicken-nugget.txt",
"dst" : "release_notes.txt"
},
{
"src" : "build/src/boot/tintin_boot.elf",
"dst" : "pebble_boot_{tag}.elf"
},
{
"src" : "build/src/fw/tintin_fw.elf",
"dst" : "pebble_fw_{tag}.elf"
},
{
"src" : "build/safe/src/fw/tintin_fw.elf",
"dst" : "pebble_recovery_{tag}.elf"
},
{
"src" : "build/system_resources.pbpack",
"dst" : "system_resources_{tag}.pbpack"
},
{
"src" : "tools/elf2hex.sh",
"dst" : "scripts/elf2hex.sh"
},
{
"src" : "tools/elf2bin.sh",
"dst" : "scripts/elf2bin.sh"
}
],
"bundles" : []
}

View file

@ -0,0 +1,43 @@
{
"name" : "Pebble Firmware (Double Down)",
"firmware" : {
"boards" : ["bigboard", "ev2_4"],
"release" : true,
"cflags" : []
},
"files" : [
{
"src" : "release-notes/double-down.txt",
"dst" : "release_notes.txt"
},
{
"src" : "build/src/boot/tintin_boot.elf",
"dst" : "pebble_boot_{tag}.elf"
},
{
"src" : "build/src/fw/tintin_fw.elf",
"dst" : "pebble_fw_{tag}.elf"
},
{
"src" : "build/safe/src/fw/tintin_fw.elf",
"dst" : "pebble_recovery_{tag}.elf"
},
{
"src" : "build/system_resources.pbpack",
"dst" : "system_resources_{tag}.pbpack"
},
{
"src" : "tools/elf2hex.sh",
"dst" : "scripts/elf2hex.sh"
},
{
"src" : "tools/elf2bin.sh",
"dst" : "scripts/elf2bin.sh"
}
],
"bundles" : []
}

View file

@ -0,0 +1,43 @@
{
"name" : "Pebble Firmware (Egg McMuffin)",
"firmware" : {
"boards" : ["bigboard", "ev2_4"],
"release" : true,
"cflags" : []
},
"files" : [
{
"src" : "release-notes/egg-mcmuffin.txt",
"dst" : "release_notes.txt"
},
{
"src" : "build/src/boot/tintin_boot.elf",
"dst" : "pebble_boot_{tag}.elf"
},
{
"src" : "build/src/fw/tintin_fw.elf",
"dst" : "pebble_fw_{tag}.elf"
},
{
"src" : "build/safe/src/fw/tintin_fw.elf",
"dst" : "pebble_recovery_{tag}.elf"
},
{
"src" : "build/system_resources.pbpack",
"dst" : "system_resources_{tag}.pbpack"
},
{
"src" : "tools/elf2hex.sh",
"dst" : "scripts/elf2hex.sh"
},
{
"src" : "tools/elf2bin.sh",
"dst" : "scripts/elf2bin.sh"
}
],
"bundles" : []
}

View file

@ -0,0 +1,43 @@
{
"name" : "Pebble Firmware (Grand Slam)",
"firmware" : {
"boards" : ["ev2_4"],
"release" : false,
"cflags" : []
},
"files" : [
{
"src" : "release-notes/grand-slam.md",
"dst" : "release_notes.txt"
},
{
"src" : "build/src/boot/tintin_boot.elf",
"dst" : "pebble_boot_{tag}.elf"
},
{
"src" : "build/src/fw/tintin_fw.elf",
"dst" : "pebble_fw_{tag}.elf"
},
{
"src" : "build/safe/src/fw/tintin_fw.elf",
"dst" : "pebble_recovery_{tag}.elf"
},
{
"src" : "build/system_resources.pbpack",
"dst" : "system_resources_{tag}.pbpack"
},
{
"src" : "tools/elf2hex.sh",
"dst" : "scripts/elf2hex.sh"
},
{
"src" : "tools/elf2bin.sh",
"dst" : "scripts/elf2bin.sh"
}
],
"bundles" : []
}

View file

@ -0,0 +1,43 @@
{
"name" : "Pebble Firmware (Grand Slam)",
"firmware" : {
"boards" : ["ev2_4"],
"release" : false,
"cflags" : []
},
"files" : [
{
"src" : "release-notes/happy-meal.md",
"dst" : "release_notes.txt"
},
{
"src" : "build/src/boot/tintin_boot.elf",
"dst" : "pebble_boot_{tag}.elf"
},
{
"src" : "build/src/fw/tintin_fw.elf",
"dst" : "pebble_fw_{tag}.elf"
},
{
"src" : "build/safe/src/fw/tintin_fw.elf",
"dst" : "pebble_recovery_{tag}.elf"
},
{
"src" : "build/system_resources.pbpack",
"dst" : "system_resources_{tag}.pbpack"
},
{
"src" : "tools/elf2hex.sh",
"dst" : "scripts/elf2hex.sh"
},
{
"src" : "tools/elf2bin.sh",
"dst" : "scripts/elf2bin.sh"
}
],
"bundles" : []
}

57
release/beta5.sh Executable file
View file

@ -0,0 +1,57 @@
#!/bin/bash
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# check for prerequisites
if ! which srec_cat > /dev/null; then echo "Error! srec_cat is not installed" >&2; exit 1; fi
echo "(╯°□°)╯︵ ┻━┻"
echo "Building beta5..."
TINTIN_HOME="$(dirname $0)/.."
RELEASE_NAME=beta5
BOARDS=('ev2_4' 'v1_5' 'v2_0')
cd $TINTIN_HOME
FW_VERSION=$(git describe)
for BOARD in "${BOARDS[@]}"
do
DIST_DIR=$TINTIN_HOME/dist/beta5/$BOARD
rm -rf $DIST_DIR
mkdir -p $DIST_DIR/mfg
echo "Building target: $BOARD"
./waf distclean &&
./waf configure --board=$BOARD --release &&
./waf -p clean build bundle &&
cp build/src/boot/tintin_boot.elf $DIST_DIR/$BOARD-$FW_VERSION-boot.elf &&
cp build/src/fw/tintin_fw.elf $DIST_DIR/$BOARD-$FW_VERSION-fw.elf &&
cp build/system_resources.pbpack $DIST_DIR/$BOARD-$FW_VERSION-resources.pbpack &&
cp build/*normal_$BOARD*.pbz $DIST_DIR/ &&
cp build/system_resources.pbpack $DIST_DIR/mfg/$BOARD-$FW_VERSION-resources.pbpack &&
srec_cat build/src/boot/tintin_boot.hex -intel build/src/fw/tintin_fw.hex -intel -o $DIST_DIR/mfg/$BOARD-$FW_VERSION-boot-fw.hex -intel -Output_Block_Size=16
if [[ $? -ne 0 ]]; then
echo "release failed"
exit;
fi
done
echo "ok"

57
release/beta7-pre-rc.sh Executable file
View file

@ -0,0 +1,57 @@
#!/bin/bash
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# check for prerequisites
if ! which srec_cat > /dev/null; then echo "Error! srec_cat is not installed" >&2; exit 1; fi
echo "(╯°□°)╯︵ ┻━┻"
echo "Building beta7-pre-rc..."
TINTIN_HOME="$(dirname $0)/.."
RELEASE_NAME=beta7-pre-rc
BOARDS=('v2_0')
cd $TINTIN_HOME
FW_VERSION=$(git describe)
for BOARD in "${BOARDS[@]}"
do
DIST_DIR=$TINTIN_HOME/dist/beta7-pre-rc/$BOARD
rm -rf $DIST_DIR
mkdir -p $DIST_DIR/mfg
echo "Building target: $BOARD"
./waf distclean &&
./waf configure --board=$BOARD --release &&
./waf -p clean build bundle &&
cp build/src/boot/tintin_boot.elf $DIST_DIR/$BOARD-$FW_VERSION-boot.elf &&
cp build/src/fw/tintin_fw.elf $DIST_DIR/$BOARD-$FW_VERSION-fw.elf &&
cp build/system_resources.pbpack $DIST_DIR/$BOARD-$FW_VERSION-resources.pbpack &&
cp build/*normal_$BOARD*.pbz $DIST_DIR/ &&
cp build/system_resources.pbpack $DIST_DIR/mfg/$BOARD-$FW_VERSION-resources.pbpack &&
srec_cat build/src/boot/tintin_boot.hex -intel build/src/fw/tintin_fw.hex -intel -o $DIST_DIR/mfg/$BOARD-$FW_VERSION-boot-fw.hex -intel -Output_Block_Size=16
if [[ $? -ne 0 ]]; then
echo "release failed"
exit;
fi
done
echo "ok"

55
release/happy_meal.sh Normal file
View file

@ -0,0 +1,55 @@
#!/bin/bash
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
echo "(╯°□°)╯︵ ┻━┻"
echo "Building Happy-Meal..."
if [ -z "$TINTIN_HOME" ]; then
echo "TINTIN_HOME must be set";
exit -1;
fi
RELEASE_NAME=hm
BOARD=ev2_4
DIST_DIR=$TINTIN_HOME/dist/happy-meal/$BOARD
rm -rf $DIST_DIR
mkdir -p $DIST_DIR
cd $TINTIN_HOME
git checkout -f release-happy-meal
SHORT_HASH=$(git rev-parse --short HEAD)
echo "Building targets..."
./waf distclean &&
./waf configure --board=$BOARD --release &&
./waf -p clean build build_safe bundle bundle_safe &&
cp build/src/boot/tintin_boot.elf $DIST_DIR/$BOARD-$SHORT_HASH-boot.elf &&
cp build/src/fw/tintin_fw.elf $DIST_DIR/$BOARD-$SHORT_HASH-fw.elf &&
cp build/safe/src/fw/tintin_fw.elf $DIST_DIR/$BOARD-$SHORT_HASH-recovery.elf &&
cp build/system_resources.pbpack $DIST_DIR/$BOARD-$SHORT_HASH-resources.pbpack &&
cp build/*normal_ev2_4*.pbz $DIST_DIR/ && cp build/*recovery_ev2_4*.pbz $DIST_DIR/
if [[ $? -ne 0 ]]; then
echo "release failed"
exit;
fi
echo "ok"

53
release/in-n-out.sh Executable file
View file

@ -0,0 +1,53 @@
#!/bin/bash
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
echo "(╯°□°)╯︵ ┻━┻"
echo "Building In-N-Out..."
if [ -z "$TINTIN_HOME" ]; then
echo "TINTIN_HOME must be set";
exit -1;
fi
RELEASE_NAME=ino
BOARD=ev2_4
DIST_DIR=$TINTIN_HOME/dist/in-n-out/$BOARD
rm -rf $DIST_DIR
mkdir -p $DIST_DIR
cd $TINTIN_HOME
SHORT_HASH=$(git rev-parse --short HEAD)
echo "Building targets..."
./waf distclean &&
./waf configure --board=$BOARD --release &&
./waf -p clean build build_safe bundle bundle_safe &&
cp build/src/boot/tintin_boot.elf $DIST_DIR/$BOARD-$SHORT_HASH-boot.elf &&
cp build/src/fw/tintin_fw.elf $DIST_DIR/$BOARD-$SHORT_HASH-fw.elf &&
cp build/safe/src/fw/tintin_fw.elf $DIST_DIR/$BOARD-$SHORT_HASH-recovery.elf &&
cp build/system_resources.pbpack $DIST_DIR/$BOARD-$SHORT_HASH-resources.pbpack &&
cp build/*normal_ev2_4*.pbz $DIST_DIR/ && cp build/*recovery_ev2_4*.pbz $DIST_DIR/
if [[ $? -ne 0 ]]; then
echo "release failed"
exit;
fi
echo "ok"

53
release/kiwiburger.sh Executable file
View file

@ -0,0 +1,53 @@
#!/bin/bash
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
echo "(╯°□°)╯︵ ┻━┻"
echo "Building Kiwiburger..."
if [ -z "$TINTIN_HOME" ]; then
echo "TINTIN_HOME must be set";
exit -1;
fi
RELEASE_NAME=kiwiburger
BOARD=ev2_4
DIST_DIR=$TINTIN_HOME/dist/kiwiburger/$BOARD
rm -rf $DIST_DIR
mkdir -p $DIST_DIR
cd $TINTIN_HOME
SHORT_HASH=$(git rev-parse --short HEAD)
echo "Building targets..."
./waf distclean &&
./waf configure --board=$BOARD --release &&
./waf -p clean build build_safe bundle bundle_safe &&
cp build/src/boot/tintin_boot.elf $DIST_DIR/$BOARD-$SHORT_HASH-boot.elf &&
cp build/src/fw/tintin_fw.elf $DIST_DIR/$BOARD-$SHORT_HASH-fw.elf &&
cp build/safe/src/fw/tintin_fw.elf $DIST_DIR/$BOARD-$SHORT_HASH-recovery.elf &&
cp build/system_resources.pbpack $DIST_DIR/$BOARD-$SHORT_HASH-resources.pbpack &&
cp build/*normal_ev2_4*.pbz $DIST_DIR/ && cp build/*recovery_ev2_4*.pbz $DIST_DIR/
if [[ $? -ne 0 ]]; then
echo "release failed"
exit;
fi
echo "ok"

59
release/litre-o-cola.sh Executable file
View file

@ -0,0 +1,59 @@
#!/bin/bash
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# check for prerequisites
if ! which srec_cat > /dev/null; then echo "Error! srec_cat is not installed" >&2; exit 1; fi
echo "(╯°□°)╯︵ ┻━┻"
echo "Building Litre-O-Cola..."
TINTIN_HOME="$(dirname $0)/.."
RELEASE_NAME=litre-o-cola
BOARDS=('ev2_4' 'v1_5' 'v2_0')
cd $TINTIN_HOME
FW_VERSION=$(git describe)
for BOARD in "${BOARDS[@]}"
do
DIST_DIR=$TINTIN_HOME/dist/litre-o-cola/$BOARD
rm -rf $DIST_DIR
mkdir -p $DIST_DIR/mfg
echo "Building target: $BOARD"
./waf distclean &&
./waf configure --board=$BOARD --release &&
./waf -p clean build build_safe bundle bundle_safe &&
cp build/src/boot/tintin_boot.elf $DIST_DIR/$BOARD-$FW_VERSION-boot.elf &&
cp build/src/fw/tintin_fw.elf $DIST_DIR/$BOARD-$FW_VERSION-fw.elf &&
cp build/safe/src/fw/tintin_fw.elf $DIST_DIR/$BOARD-$FW_VERSION-recovery.elf &&
cp build/system_resources.pbpack $DIST_DIR/$BOARD-$FW_VERSION-resources.pbpack &&
cp build/*normal_$BOARD*.pbz $DIST_DIR/ && cp build/*recovery_$BOARD*.pbz $DIST_DIR/ &&
cp build/safe/src/fw/tintin_fw.bin $DIST_DIR/mfg/$BOARD-$FW_VERSION-recovery.bin &&
cp build/system_resources.pbpack $DIST_DIR/mfg/$BOARD-$FW_VERSION-resources.pbpack &&
srec_cat build/src/boot/tintin_boot.hex -intel build/src/fw/tintin_fw.hex -intel -o $DIST_DIR/mfg/$BOARD-$FW_VERSION-boot-fw.hex -intel -Output_Block_Size=16
if [[ $? -ne 0 ]]; then
echo "release failed"
exit;
fi
done
echo "ok"

57
release/mcrib.sh Executable file
View file

@ -0,0 +1,57 @@
#!/bin/bash
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# check for prerequisites
if ! which srec_cat > /dev/null; then echo "Error! srec_cat is not installed" >&2; exit 1; fi
echo "(╯°□°)╯︵ ┻━┻"
echo "Building McRib..."
TINTIN_HOME="$(dirname $0)/.."
RELEASE_NAME=mcrib
BOARDS=('ev2_4' 'v1_5' 'v2_0')
cd $TINTIN_HOME
FW_VERSION=$(git describe)
for BOARD in "${BOARDS[@]}"
do
DIST_DIR=$TINTIN_HOME/dist/mcrib/$BOARD
rm -rf $DIST_DIR
mkdir -p $DIST_DIR/mfg
echo "Building target: $BOARD"
./waf distclean &&
./waf configure --board=$BOARD --release &&
./waf -p clean build bundle &&
cp build/src/boot/tintin_boot.elf $DIST_DIR/$BOARD-$FW_VERSION-boot.elf &&
cp build/src/fw/tintin_fw.elf $DIST_DIR/$BOARD-$FW_VERSION-fw.elf &&
cp build/system_resources.pbpack $DIST_DIR/$BOARD-$FW_VERSION-resources.pbpack &&
cp build/*normal_$BOARD*.pbz $DIST_DIR/ &&
cp build/system_resources.pbpack $DIST_DIR/mfg/$BOARD-$FW_VERSION-resources.pbpack &&
srec_cat build/src/boot/tintin_boot.hex -intel build/src/fw/tintin_fw.hex -intel -o $DIST_DIR/mfg/$BOARD-$FW_VERSION-boot-fw.hex -intel -Output_Block_Size=16
if [[ $? -ne 0 ]]; then
echo "release failed"
exit;
fi
done
echo "ok"

123
release/release.py Executable file
View file

@ -0,0 +1,123 @@
#!/usr/bin/env python
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function
import argparse
import json
import os
import re
import sh
import shutil
import sys
import tempfile
def prepare_staging_directory(board_type, git_tag):
temp_path = tempfile.mkdtemp('tintin')
artifacts_root = os.path.join(temp_path, 'pebble_{}_{}'.format(board_type, git_tag))
os.mkdir(artifacts_root)
return artifacts_root
def waf_build(root, board, cflags, is_release=True):
waf_env = os.environ.copy()
waf_env["CFLAGS"] = ' '.join(cflags)
waf = sh.Command('{}/waf'.format(root))
sh.cd(root)
waf.distclean()
try:
waf.configure(release=is_release, jtag='olimex', board=board, _env = waf_env)
except sh.ErrorReturnCode_1, e:
print(e.stderr)
for target in ('build', 'build_safe'):
waf(target, _env = waf_env)
def waf_cleanup(root):
sh.cd(root)
waf.distclean()
def copy_files(root, staging, files, tag):
for f in files:
s = os.path.join(root, f['src'])
d = os.path.join(staging, f['dst'].format(tag=tag))
if not os.path.isfile(s):
raise Exception("File '{}' does not exist".format(s))
dest_dir = os.path.dirname(d)
if not os.path.isdir(dest_dir):
os.makedirs(dest_dir)
shutil.copyfile(s, d)
def do_release(root, recipe, no_build):
print('releasing {}...'.format(recipe['name']))
fw_params = recipe['firmware']
for board in recipe['firmware']['boards']:
sh.cd(root)
tag = sh.git.describe().strip()
dest_dir = prepare_staging_directory(board, tag)
outfile = '/tmp/pebble_fw_{}_{}'.format(board, tag)
outfile_format = 'zip'
archive_file = outfile + '.' + outfile_format
if os.path.exists(archive_file):
print('Deleted old archive {}'.format(archive_file))
os.remove(archive_file)
if not no_build:
print('building')
waf_build(root,
board = board,
cflags = fw_params['cflags'],
is_release = fw_params['release'])
print('copying files')
copy_files(root, dest_dir, recipe['files'], tag)
print('archiving')
shutil.make_archive(outfile, outfile_format, dest_dir)
print('created release archive')
print(outfile + '.' + outfile_format)
print()
print('release complete')
def main():
if 'TINTIN_HOME' not in os.environ:
raise Exception('\'TINTIN_HOME\' is must be defined')
tintin_root = os.path.abspath(os.path.expanduser(os.environ['TINTIN_HOME']))
if not os.path.isdir(tintin_root):
raise Exception('TINTIN_HOME points to invalid directory \'{}\''.format(tintin_root))
parser = argparse.ArgumentParser()
parser.add_argument('release_recipe')
parser.add_argument('-v', '--verbose', action='store_true')
parser.add_argument('-s', '--summary', action='store_true')
parser.add_argument('--no-build', action='store_true')
args = parser.parse_args()
with open(args.release_recipe, 'r') as f:
recipe = json.load(f)
do_release(tintin_root, recipe, args.no_build)
if __name__ == '__main__':
main()

154
release/robert_mfg_release.sh Executable file
View file

@ -0,0 +1,154 @@
#!/bin/bash
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Configuration
#######################################
BUILD_TAG=$(git describe)
# This should be outside the build/ directory as we build multiple configurations
OUT_DIR=mfg_release
README_TEXT=\
"This zip archive contains the scripts and files needed for manufacturing testing and validation of
Robert. There are two directories within the archive: firmware and scripts.
The firmware directory contains three different images. The exact name of the files will be
prepended with a unique build id, but will otherwise be as follows:
+---------------------------+--------------------------------------------------------------------+
| File Name | Notes |
+---------------------------+--------------------------------------------------------------------+
| ${BUILD_TAG}_boot.hex | The bootloader which should be loaded via the ST-Link |
| ${BUILD_TAG}_fw.hex | The main MFG firmware which should be loaded via the ST-Link |
| ${BUILD_TAG}_fw.bin | The main MFG firmware to be used to return boards to mfg after PRF |
| ${BUILD_TAG}_prf.bin | The PRF image to be loaded with pulse_flash_imaging.py |
+---------------------------+--------------------------------------------------------------------+
The scripts directory contains many Python scripts which should be used during the manufacturing
process. Most of the Python scripts which are included should not be run directly, and are purely to
support the other scripts. Below is a list of the scripts which are intended to be run directly
during the manufacturing process.
+-------------------------+----------------------------------------------------------------------+
| File Name | Notes |
+-------------------------+----------------------------------------------------------------------+
| pulse_flash_imaging.py | Used to load the PRF image into the external flash on the board |
| audio_recording.py | Gets raw audio data from the watch for validation of the microphone |
+-------------------------+----------------------------------------------------------------------+"
REQUIREMENTS_TEXT=\
"bitarray==0.8.1
pyserial==3.0.1"
# Exit this script if any line below fails
set -e
# Echo lines as we execute them
set -x
# Output directory / scripts
#######################################
# Clean out any existing release files
rm -rf ${OUT_DIR}
# Create the release directory
mkdir -p ${OUT_DIR}
# Create the README.txt file
echo "${README_TEXT}" > ${OUT_DIR}/README.txt
# Create the requirements.txt file
echo "${REQUIREMENTS_TEXT}" > ${OUT_DIR}/requirements.txt
# Copy the scripts we're interested into the ouput directory
mkdir -p ${OUT_DIR}/scripts
cp tools/hdlc.py ${OUT_DIR}/scripts/
cp tools/binutils.py ${OUT_DIR}/scripts/
cp tools/audio_recording.py ${OUT_DIR}/scripts/
cp tools/prompt.py ${OUT_DIR}/scripts/
cp tools/serial_port_wrapper.py ${OUT_DIR}/scripts/
cp tools/stm32_crc.py ${OUT_DIR}/scripts/
cp tools/pebble_tty.py ${OUT_DIR}/scripts/
cp tools/pebble_tty_pyftdi.py ${OUT_DIR}/scripts/
cp tools/fw_binary_info.py ${OUT_DIR}/scripts/
cp tools/insert_firmware_descr.py ${OUT_DIR}/scripts/
cp tools/pulse_legacy_flash_imaging.py ${OUT_DIR}/scripts/pulse_flash_imaging.py
cp tools/accessory_flash_imaging.py ${OUT_DIR}/scripts/
cp tools/accessory_imaging.py ${OUT_DIR}/scripts/
mkdir ${OUT_DIR}/scripts/pulse
cp tools/pulse/*.py ${OUT_DIR}/scripts/pulse/
tar -xf tools/cobs.tar.gz -C ${OUT_DIR}/scripts/
for BOARD in robert_es robert_evt; do
# Build firmware
#######################################
# Build MFG FW (--nohash so we don't have to send our log hash tools)
./waf distclean configure --board=${BOARD} --nohash --mfg --internal_sdk_build \
build_prf bundle_recovery
FIRMWARE_OUT_DIR=${OUT_DIR}/firmware/${BOARD}
mkdir -p ${FIRMWARE_OUT_DIR}
BUILD_PREFIX=${BOARD}_${BUILD_TAG}
cp build/prf/src/fw/tintin_fw.hex ${FIRMWARE_OUT_DIR}/${BUILD_PREFIX}_fw.hex
cp build/prf/src/fw/tintin_fw.bin ${FIRMWARE_OUT_DIR}/${BUILD_PREFIX}_fw.bin
# Build PRF
./waf distclean configure --board=${BOARD} --internal_sdk_build --release \
build_prf bundle_recovery
cp build/prf/src/fw/tintin_fw.bin ${FIRMWARE_OUT_DIR}/${BUILD_PREFIX}_prf.bin
# Copy this into the parent release directory so we don't accidentally throw it in the zip.
# We'll want to save these as artifacts.
cp build/prf/src/fw/tintin_fw.elf ${OUT_DIR}/${BUILD_PREFIX}_fw.elf
cp build/prf/recovery_*.pbz ${OUT_DIR}/${BUILD_PREFIX}_prf.pbz
# Bootloader images
#######################################
# Robert is still under development, so we have to use a wildcard. Add some code to make sure
# we're not picking up multiple files.
if [ "$BOARD" = "robert_evt" -o "$BOARD" = "robert_es" ]; then
# Use the robert_evt bootloader for both robert_es and robert_evt
bootloader=$(find bin/boot -name boot_robert_evt@*.hex)
num_bootloaders=$(echo $bootloader | wc -w)
if [ $num_bootloaders -gt 1 ]; then
>&2 echo "More than 1 bootloader!"
>&2 echo "$bootloader"
exit 1
fi
else
# We should handle this at the top, this is more to prevent us from forgetting to update this
# set of if statements when adding a new board.
echo "Unknown board" >&2
exit 1
fi
cp ${bootloader} ${FIRMWARE_OUT_DIR}/${BUILD_PREFIX}_boot.hex
done
# Package it up
#######################################
cd $OUT_DIR && zip -r ${BUILD_TAG}.zip scripts/ firmware/ README.txt requirements.txt

153
release/silk_mfg_release.sh Executable file
View file

@ -0,0 +1,153 @@
#!/bin/bash
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Configuration
#######################################
BUILD_TAG=$(git describe)
BOARD=silk
# This should be outside the build/ directory as we build multiple configurations
OUT_DIR=mfg_release
FIRMWARE_OUT_DIR=${OUT_DIR}/firmware
README_TEXT=\
"This zip archive contains the scripts and files needed for manufacturing testing and validation of
Silk. There are two directories within the archive: firmware and scripts.
The firmware directory contains three different images. The exact name of the files will be
prepended with a unique build id, but will otherwise be as follows:
+---------------------------+--------------------------------------------------------------------+
| File Name | Notes |
+---------------------------+--------------------------------------------------------------------+
| ${BUILD_TAG}_boot.hex | The bootloader which should be loaded via the ST-Link |
| ${BUILD_TAG}_fw.hex | The main MFG firmware which should be loaded via the ST-Link |
| ${BUILD_TAG}_fw.bin | The main MFG firmware to be used to return boards to mfg after PRF |
| ${BUILD_TAG}_prf.bin | The PRF image to be loaded with pulse_flash_imaging.py |
| SPI_pre_burn.bin | A SPI flash image to burn pre SMT |
+---------------------------+--------------------------------------------------------------------+
The scripts directory contains many Python scripts which should be used during the manufacturing
process. Most of the Python scripts which are included should not be run directly, and are purely to
support the other scripts. Below is a list of the scripts which are intended to be run directly
during the manufacturing process.
+-------------------------+----------------------------------------------------------------------+
| File Name | Notes |
+-------------------------+----------------------------------------------------------------------+
| pulse_flash_imaging.py | Used to load the PRF image into the external flash on the board |
| audio_recording.py | Gets raw audio data from the watch for validation of the microphone |
+-------------------------+----------------------------------------------------------------------+"
REQUIREMENTS_TEXT=\
"bitarray==0.8.1
pyserial==3.0.1"
# Exit this script if any line below fails
set -e
# Echo lines as we execute them
set -x
# Output directory / scripts
#######################################
# Clean out any existing release files
rm -rf ${OUT_DIR}
# Create the release directory
mkdir -p ${OUT_DIR}
# Create the README.txt file
echo "${README_TEXT}" > ${OUT_DIR}/README.txt
# Create the requirements.txt file
echo "${REQUIREMENTS_TEXT}" > ${OUT_DIR}/requirements.txt
# Copy the scripts we're interested into the ouput directory
mkdir -p ${OUT_DIR}/scripts
cp tools/hdlc.py ${OUT_DIR}/scripts/
cp tools/binutils.py ${OUT_DIR}/scripts/
cp tools/audio_recording.py ${OUT_DIR}/scripts/
cp tools/prompt.py ${OUT_DIR}/scripts/
cp tools/serial_port_wrapper.py ${OUT_DIR}/scripts/
cp tools/stm32_crc.py ${OUT_DIR}/scripts/
cp tools/pebble_tty.py ${OUT_DIR}/scripts/
cp tools/pebble_tty_pyftdi.py ${OUT_DIR}/scripts/
cp tools/fw_binary_info.py ${OUT_DIR}/scripts/
cp tools/insert_firmware_descr.py ${OUT_DIR}/scripts/
cp tools/pulse_legacy_flash_imaging.py ${OUT_DIR}/scripts/pulse_flash_imaging.py
cp tools/accessory_flash_imaging.py ${OUT_DIR}/scripts/
cp tools/accessory_imaging.py ${OUT_DIR}/scripts/
mkdir ${OUT_DIR}/scripts/pulse
cp tools/pulse/*.py ${OUT_DIR}/scripts/pulse/
tar -xf tools/cobs.tar.gz -C ${OUT_DIR}/scripts/
# Build firmware
#######################################
# Build MFG FW (--nohash so we don't have to send our log hash tools)
./waf distclean configure --board=${BOARD} --nohash --mfg --bt_fw_builtin \
build_prf bundle_recovery
mkdir -p ${FIRMWARE_OUT_DIR}
cp build/prf/src/fw/tintin_fw.hex ${FIRMWARE_OUT_DIR}/${BUILD_TAG}_fw.hex
cp build/prf/src/fw/tintin_fw.bin ${FIRMWARE_OUT_DIR}/${BUILD_TAG}_fw.bin
# Build PRF
./waf distclean configure --board=${BOARD} --bt_fw_builtin --release \
build_prf bundle_recovery mfg_image_spi
cp build/prf/src/fw/tintin_fw.bin ${FIRMWARE_OUT_DIR}/${BUILD_TAG}_prf.bin
cp build/mfg_prf_image.bin ${FIRMWARE_OUT_DIR}/SPI_pre_burn.bin
# Copy this into the parent release directory so we don't accidentally throw it in the zip.
# We'll want to save these as artifacts.
cp build/prf/src/fw/tintin_fw.elf ${OUT_DIR}/${BUILD_TAG}_fw.elf
cp build/prf/recovery_*.pbz ${OUT_DIR}/${BUILD_TAG}_prf.pbz
# Bootloader images
#######################################
# Silk is still under development, so we have to use a wildcard. Add some code to make sure
# we're not picking up multiple files.
if [ "$BOARD" = "silk" ]; then
bootloader=$(find bin/boot -name boot_silk@*.hex)
num_bootloaders=$(echo $bootloader | wc -w)
if [ $num_bootloaders -gt 1 ]; then
>&2 echo "More than 1 silk bootloader!"
>&2 echo "$bootloader"
exit 1
fi
else
# We should handle this at the top, this is more to prevent us from forgetting to update this
# set of if statements when adding a new board.
echo "Unknown board" >&2
exit 1
fi
cp ${bootloader} ${OUT_DIR}/firmware/${BUILD_TAG}_boot.hex
# Package it up
#######################################
cd $OUT_DIR && zip -r ${BUILD_TAG}.zip scripts/ firmware/ README.txt requirements.txt