Open-CMSIS-Pack  Version 1.7.14
Delivery Mechanism for Software Packs
Bash Script gen_pack.sh

A Bash shell script template and library are available that allow you to generate a pack file. The library and template are released via Open-CMSIS-Pack. Check the prerequisites to successfully use this under Linux, Mac OS, or Windows.

A template "gen_pack.sh" file is available that is generic enough to cope with a wide range of requirements. It uses the information from the *.PDSC file to generate the output filename according the CMSIS-Pack conventions and validates the pack consistency with packchk. The only change you need to make is entering the library version you are using in this line:

REQUIRED_GEN_PACK_LIB="<pin lib version here>"
Note
Refer to the documentation on how to install and determine the library version.

Sample output

$ ./gen_pack.sh
Starting CMSIS-Pack Generation: 04 Aug 2022 09:45:41
CMSIS-Pack root is C:/Users/username/AppData/Local/Arm/Packs
Zip is /c/Program Files/7-Zip/7z
PackChk is C:/Users/username/AppData/Local/Arm/Packs/ARM/CMSIS/5.9.0/CMSIS/Utilities/Win32/packchk
XML-Lint is /mingw64/bin/xmllint
Curl is /mingw64/bin/curl
PDSC is /c/work/Packs/MyVendor/MyVendor.MyPack.pdsc
Generating Pack for MyVendor.MyPack
via /c/work/Packs/MyVendor/build
to /c/work/Packs/MyVendor/output
Adding directories to pack:
Boards
CMSIS
Device
Examples
Flash
Adding files to pack:
Deleting files from pack:
Applying patches to pack:
Running schema check for /c/work/Packs/MyVendor/build/MyVendor.MyPack.pdsc
Fetching schema file...
"/mingw64/bin/curl" -sL PACK.xsd --output "/tmp/PACK.xsd"
Failed downloading schema from 'PACK.xsd'. Skipping schema check.
"C:/Users/username/AppData/Local/Arm/Packs/ARM/CMSIS/5.9.0/CMSIS/Utilities/Win32/packchk" "/c/work/Packs/MyVendor/build/MyVendor.MyPack.pdsc" -i "C:/Users/username/AppData/Local/Arm/Packs/.Web/ARM.CMSIS.pdsc" -n PackName.txt
CMSIS Pack Checker 1.3.95 (Apr 6 2022 14:04:41)
Copyright (C) 2012-2022 ARM Ltd and ARM Germany GmbH. All rights reserved.
Phase1: Read PDSC files
Phase2: Static Data & Dependencies check
Phase3: RTE Model based Data & Dependencies check
Found 0 Error(s) and 0 Warning(s).
pushd "/c/work/Packs/MyVendor/build"; "/c/Program Files/7-Zip/7z" a -tzip "/c/work/Packs/MyVendor/output/MyVendor.MyPack.0.3.1.pack" .
7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21
Scanning the drive:
50 folders, 202 files, 3118115 bytes (3046 KiB)
Creating archive: C:/work/Packs/MyVendor/output/MyVendor.MyPack.0.3.1.pack
Add new data to archive: 50 folders, 202 files, 3118115 bytes (3046 KiB)
Files read from disk: 202
Archive size: 624803 bytes (611 KiB)
Everything is Ok