diff --git a/boot/boot_serial/src/regenerate_serial_recovery_cbor.sh b/boot/boot_serial/src/regenerate_serial_recovery_cbor.sh deleted file mode 100755 index 33fa6303..00000000 --- a/boot/boot_serial/src/regenerate_serial_recovery_cbor.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -if [ "$1" == "--help" ] || [ "$1" == "" ]; then - echo "Regenerate serial_recovery_cbor.c|h if the zcbor submodule is updated." - echo "Usage: $0 " - echo " e.g. $0 \"2022 Nordic Semiconductor ASA\"" - exit -1 -fi - -add_copy_notice() { -echo "$(printf '/* - * This file has been %s from the zcbor library. - * Commit %s - */ - -' "$2" "$(zcbor --version)"; cat $1;)" > $1 -} - -echo "Copying zcbor_decode.c|h" -copy_with_copy_notice() { - cp $1 $2 - add_copy_notice $2 "copied" -} - -add_copyright() { -echo "$(printf '/* - * Copyright (c) %s - * - * SPDX-License-Identifier: Apache-2.0 - */ - -' "$2"; cat $1;)" > $1 -} - -add_copy_notice zcbor_decode.c "copied" -add_copy_notice zcbor_encode.c "copied" -add_copy_notice zcbor_common.c "copied" -add_copy_notice zcbor_decode.h "copied" -add_copy_notice zcbor_encode.h "copied" -add_copy_notice zcbor_common.h "copied" diff --git a/boot/zcbor/add_zcbor_copy_version.sh b/boot/zcbor/add_zcbor_copy_version.sh new file mode 100755 index 00000000..dc49887c --- /dev/null +++ b/boot/zcbor/add_zcbor_copy_version.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +if [ "$1" == "--help" ]; then + echo "Add header if the zcbor files are updated." + exit -1 +fi + +add_copy_notice() { +echo "$(printf '/* + * This file has been %s from the zcbor library. + * Commit %s + */ + +' "$2" "$(zcbor --version)"; cat $1;)" > $1 +} + +add_copy_notice src/zcbor_decode.c "copied" +add_copy_notice src/zcbor_encode.c "copied" +add_copy_notice src/zcbor_common.c "copied" +add_copy_notice include/zcbor_decode.h "copied" +add_copy_notice include/zcbor_encode.h "copied" +add_copy_notice include/zcbor_common.h "copied"