Skip to content

Commit

Permalink
Apparently working release.sh, .json.TEMPLATE and boards.txt !
Browse files Browse the repository at this point in the history
  • Loading branch information
WestfW committed May 30, 2015
1 parent 988c239 commit bfb3d5f
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 26 deletions.
3 changes: 3 additions & 0 deletions optiboot/boards-1.6.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ optiboot28.bootloader.tool=arduino:avrdude
optiboot28.bootloader.low_fuses=0xF7
optiboot28.bootloader.unlock_bits=0x0F
optiboot28.bootloader.lock_bits=0x2F
optiboot28.build.f_cpu=16000000L


#
# Other Clock speeds.
Expand Down Expand Up @@ -139,6 +141,7 @@ optiboot32.bootloader.tool=arduino:avrdude
optiboot32.bootloader.low_fuses=0xF7
optiboot32.bootloader.unlock_bits=0x2F
optiboot32.bootloader.lock_bits=0x0F
optiboot32.build.f_cpu=16000000L

#
# Other Clock speeds.
Expand Down
33 changes: 19 additions & 14 deletions optiboot/package_optiboot_optiboot-additional_index.json.TEMPLATE
Original file line number Diff line number Diff line change
@@ -1,42 +1,47 @@
# Template file for generating the .json file that the Arduino IDE
# "Boards Manager" wants to see. This file must be pre-processed
# before it will be valid:
# Strip comments.
# Replace variables:
# %VERSION% gets the Optiboot Version
# %HASH% gets the SHA-256 has for the .zip file.
# (generate with: openssl dgst -sha256 optiboot.zip | sed -e 's/.* //'
# %SIZE% gets the size of the .zip file
#
{
"packages": [
{
"name": "Optiboot-additional",
"name": "Optiboot",
"maintainer": "westfw",
"websiteURL": "https://github.com/optboot/optiboot",
"websiteURL": "https://github.com/Optiboot/optiboot",
"email": "",
"help": {
"online": ""
},
"platforms": [
{
"name": "Additional chips with optiboot",
"name": "Optiboot %VERSION%",
"architecture": "avr",
"version": "6.2.0",
"version": "0.%VERSION%",
"category": "Optiboot",
"help": {
"online": ""
},
"url": "https://github.com/Optiboot/optiboot/raw/master/optiboot/optiboot.zip",
"url": "https://github.com/Optiboot/optiboot/releases/download/v%VERSION%/optiboot.zip",
"archiveFileName": "optiboot.zip",
"checksum": "SHA-256:ab00d9fcf91fe1d81c4fb75058d6b3544d1981a3c95a45eb643e7f0830bbdfc7",
"size": "14446",
"checksum": "SHA-256:%HASH%",
"size": "%SIZE%",
"boards": [
{"name": "Optiboot Bootloader"},
{"name": "New Optiboot"}
],
"toolsDependencies": [
{
"packager": "arduino",
"name": "avr-gcc",
"version": "4.8.1-arduino5"
},
{
"packager": "arduino",
"name": "avrdude",
"version": "6.0.1-arduino5"
}
]
},
}
]
}
]
Expand Down
35 changes: 23 additions & 12 deletions optiboot/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,31 @@ rm -Rf /tmp/optiboot-release

#
# Create the 3rd-party hardware extension directory structure
mkdir /tmp/optiboot-release
mkdir /tmp/optiboot-release/Optiboot
mkdir /tmp/optiboot-release/Optiboot/avr
mkdir /tmp/optiboot-release/Optiboot/avr/bootloaders
mkdir /tmp/optiboot-release/Optiboot/avr/bootloaders/optiboot
cp ../../boards-1.6.txt /tmp/optiboot-release/Optiboot/avr/boards.txt
# Note that the structure under "packages" (handed by boards manager)
# is different than the structure under "sketchbook/hardware" would be.

mkdir -p /tmp/optiboot-release/Optiboot/bootloaders/optiboot
TOP=/tmp/optiboot-release/Optiboot/
cp ../../boards-1.6.txt $TOP/boards.txt

#
# Create platform.tx, because it contains the "group" name for the boards menu
echo name=\[Optiboot $1\] > /tmp/optiboot-release/Optiboot/avr/platform.txt
echo version=$1 >> /tmp/optiboot-release/Optiboot/avr/platform.txt
echo name=Optiboot $1 > $TOP/platform.txt
echo version=$1 >> $TOP/platform.txt

#
# Create a README file.
echo This is an Optiboot version $1 \"Binary\" Release. > /tmp/optiboot-release/Optiboot/README.TXT
echo >> /tmp/optiboot-release/Optiboot/README.TXT
echo For Source code see http://github.com/Optiboot/optiboot >> /tmp/optiboot-release/Optiboot/README.TXT
echo This is an Optiboot version $1 \"Binary\" Release. > $TOP/README.TXT
echo >> $TOP/README.TXT
echo For Source code see http://github.com/Optiboot/optiboot>> $TOP/README.TXT

#
# Copy over our "binaries."
cp *.hex /tmp/optiboot-release/Optiboot/avr/bootloaders/optiboot
cp *.hex $TOP/bootloaders/optiboot

#
# Copy examples ? (examples for a boards.txt don't seem possible?)


# files we'd specifical exclude, if we weren't doing only .hex files.
#rm /tmp/optiboot-release/Optiboot/avr/bootloaders/optiboot/*.lst
Expand All @@ -43,5 +48,11 @@ cp *.hex /tmp/optiboot-release/Optiboot/avr/bootloaders/optiboot
# zip everything up.
pushd /tmp/optiboot-release
zip -r Optiboot.zip Optiboot
HASH=`openssl dgst -sha256 Optiboot.zip | sed -e 's/.* //'`
SIZE=`stat -f %z Optiboot.zip`
echo size = $SIZE
echo hash = $HASH
popd
echo sed -e "s/%HASH%/$HASH/" -e "s/%VERSION%/$1/" -e "s/%SIZE%/$SIZE/" ../../package_optiboot_optiboot-additional_index.json.TEMPLATE
sed -e "s/#.*//" -e "s/%HASH%/$HASH/" -e "s/%VERSION%/$1/" -e "s/%SIZE%/$SIZE/" ../../package_optiboot_optiboot-additional_index.json.TEMPLATE > /tmp/optiboot-release/package_optiboot_optiboot-additional_index.json

0 comments on commit bfb3d5f

Please sign in to comment.