Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit 69a4d5a

Browse files
authored
Merge pull request #58 from NordicSemiconductor/feature/devicefamilypack
Add downloading of corresponding DeviceFamilyPack in bootstrap script
2 parents 4a2c02f + d2b4231 commit 69a4d5a

3 files changed

Lines changed: 28 additions & 0 deletions

File tree

hex/bootstrap.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ function set_sdk_link () {
2121
SDK_NAME=${SDK_FILE%.zip} # SDK folder name without extension
2222
}
2323

24+
function set_familypack_link () {
25+
FAMILYPACK_LINK=$1
26+
27+
FAMILYPACK_FILE=${FAMILYPACK_LINK##*/}
28+
FAMILYPACK_NAME=${FAMILYPACK_FILE%.pack}
29+
}
30+
2431
# Configuration of the destination folder (relative path from this script)
2532
function set_dl_location () {
2633
DL_LOCATION="$ABS_PATH/$1"
@@ -160,13 +167,31 @@ function sdk_download () {
160167
# Keep only the components and the connectivity application ?
161168
}
162169

170+
function familypack_download () {
171+
if [[ -z "${FAMILYPACK_NAME}" ]]; then
172+
fatal "Invalid Device Family Pack link"
173+
fi
174+
175+
echo "> Downloading Device Family Pack '${FAMILYPACK_NAME}'..."
176+
177+
curl --progress-bar -o $DL_LOCATION/$SDK_NAME/$FAMILYPACK_FILE $FAMILYPACK_LINK
178+
179+
err_code=$?
180+
if [ "$err_code" != "0" ]; then
181+
fatal "Could not download Device Family Pack from '${FAMILYPACK_LINK}'"
182+
fi
183+
}
184+
163185
function main() {
164186

165187
while [ "$1" != "" ]; do
166188
case $1 in
167189
-l | --link ) shift
168190
set_sdk_link $1
169191
;;
192+
-f | --familypack ) shift
193+
set_familypack_link $1
194+
;;
170195
-d | --dest ) shift
171196
set_dl_location $1
172197
;;
@@ -186,6 +211,7 @@ function main() {
186211
check_config
187212
sdk_download
188213
sdk_patch
214+
familypack_download
189215

190216
echo "> SDK ready to use. Exit."
191217
exit

hex/sd_api_v2/bootstrap_sd_api_v2.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ ABS_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
77

88
source $ABS_PATH/../bootstrap.sh \
99
-l 'https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v11.x.x/nRF5_SDK_11.0.0_89a8197.zip' \
10+
-f 'https://developer.nordicsemi.com/nRF5_SDK/pieces/nRF_DeviceFamilyPack/NordicSemiconductor.nRF_DeviceFamilyPack.8.5.0.pack' \
1011
-d "../sdk" \
1112
-p 'sd_api_v2/sdk110_connectivity.patch'

hex/sd_api_v5/bootstrap_sd_api_v5.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ ABS_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
77

88
source $ABS_PATH/../bootstrap.sh \
99
-l 'https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v14.x.x/nRF5_SDK_14.0.0_3bcc1f7.zip' \
10+
-f 'https://developer.nordicsemi.com/nRF5_SDK/pieces/nRF_DeviceFamilyPack/NordicSemiconductor.nRF_DeviceFamilyPack.8.14.1.pack' \
1011
-d "../sdk" \
1112
-p 'sd_api_v5/sdk140_connectivity.patch'

0 commit comments

Comments
 (0)