CMSIS-Build: cp_init.sh: Setup Pack Directory

| CMSIS-Build Version 0.9.0 (beta) Tools, software frameworks, and work flows for productivity with CMSIS based projects

- Main Page
- Usage and Description

All Pages
cp_init.sh: Setup Pack Directory

The cp_init.sh script is used to setup a build environment from scratch. It is called from the Bash command line with the following syntax:

cp_init.sh [<pack-directory>]

Where:

`cp_init.sh` is the name of the script.

<`pack-directory>` specifies the directory where software packs should be stored. If not specified, the $CMSIS_PACK_ROOT directory is used.

The cp_init.sp script downloads the public CMSIS-Pack index file from https://www.keil.com/pack/index/pidx and stores this catalog file in pack directory under ./Web. This file is used by cbuildgen: Build Process Manager to find the latest version of the public software packs.

# Usage Example

    $ cp_init.sh ./packrepo
    (cp_init.sh): Setup Pack Directory 0.9.0 (C) 2020 ARM
    info: reading directory: ./packrepo
    downloading package index file from
    ######################################################################## 100.0%
    pack repository created successfully
    Please setup environment variable CMSIS_PACK_ROOT to:
    /c/cbuild/packrepo

# Error Messages

Type | Message | Action
--- | --- | ---
ERROR | error: no argument passed and CMSIS_PACK_ROOT environment variable not set | See usage and correct the argument.
ERROR | error: more than one command line argument passed | See usage and correct the argument.
ERROR | error: directory already exists. Cannot create new pack repository | See usage and correct the argument.
ERROR | error: index.pidx download failed | Check internet connection and server availability.
ERROR | error: downloaded file is not an xml file | Check downloaded file.
INFO | info: no argument passed - using CMSIS_PACK_ROOT environment variable | For information only.
INFO | pack repository created successfully | For information only.