diff options
author | Ming Liu <liu.ming50@gmail.com> | 2018-11-11 11:53:01 +0100 |
---|---|---|
committer | Patrick Vacek <patrickvacek@gmail.com> | 2019-02-14 13:36:10 +0100 |
commit | c53e9091760adac4ef7719935a6046d998a24285 (patch) | |
tree | efd4ef81b51cbc76d70845d177a9c290c60f8ec5 | |
parent | ee2e6a54d33883cc829578f558acfd20967594a5 (diff) | |
download | meta-updater-c53e9091760adac4ef7719935a6046d998a24285.tar.gz |
meta: replace bberror with bbfatal
When calling bbfatal, it reports error message and exit 1, it should be
used to replace of 'bberror && exit 1' to avoid being redundant.
Also fixed some incorrect bberror usages and typos.
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
-rw-r--r-- | classes/image_types_ostree.bbclass | 12 | ||||
-rw-r--r-- | classes/image_types_ota.bbclass | 4 | ||||
-rw-r--r-- | recipes-sota/aktualizr/aktualizr-ca-implicit-prov-creds.bb | 2 |
3 files changed, 7 insertions, 11 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 0acc786..9ecaaa1 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
@@ -113,8 +113,7 @@ IMAGE_CMD_ostree () { | |||
113 | 113 | ||
114 | if [ -d root ] && [ ! -L root ]; then | 114 | if [ -d root ] && [ ! -L root ]; then |
115 | if [ "$(ls -A root)" ]; then | 115 | if [ "$(ls -A root)" ]; then |
116 | bberror "Data in /root directory is not preserved by OSTree." | 116 | bbfatal "Data in /root directory is not preserved by OSTree." |
117 | exit 1 | ||
118 | fi | 117 | fi |
119 | 118 | ||
120 | if [ -n "$SYSTEMD_USED" ]; then | 119 | if [ -n "$SYSTEMD_USED" ]; then |
@@ -197,11 +196,9 @@ IMAGE_CMD_garagesign () { | |||
197 | 196 | ||
198 | java_version=$( java -version 2>&1 | awk -F '"' '/version/ {print $2}' ) | 197 | java_version=$( java -version 2>&1 | awk -F '"' '/version/ {print $2}' ) |
199 | if [ "${java_version}" = "" ]; then | 198 | if [ "${java_version}" = "" ]; then |
200 | bberror "Java is required for synchronization with update backend, but is not installed on the host machine" | 199 | bbfatal "Java is required for synchronization with update backend, but is not installed on the host machine" |
201 | exit 1 | ||
202 | elif [ "${java_version}" \< "1.8" ]; then | 200 | elif [ "${java_version}" \< "1.8" ]; then |
203 | bberror "Java version >= 8 is required for synchronization with update backend" | 201 | bbfatal "Java version >= 8 is required for synchronization with update backend" |
204 | exit 1 | ||
205 | fi | 202 | fi |
206 | 203 | ||
207 | rm -rf ${GARAGE_SIGN_REPO} | 204 | rm -rf ${GARAGE_SIGN_REPO} |
@@ -252,8 +249,7 @@ IMAGE_CMD_garagesign () { | |||
252 | rm -rf ${GARAGE_SIGN_REPO} | 249 | rm -rf ${GARAGE_SIGN_REPO} |
253 | 250 | ||
254 | if [ "$push_success" -ne "1" ]; then | 251 | if [ "$push_success" -ne "1" ]; then |
255 | bberror "Couldn't push to garage repository" | 252 | bbfatal "Couldn't push to garage repository" |
256 | exit 1 | ||
257 | fi | 253 | fi |
258 | fi | 254 | fi |
259 | } | 255 | } |
diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass index f677491..2aa4306 100644 --- a/classes/image_types_ota.bbclass +++ b/classes/image_types_ota.bbclass | |||
@@ -79,8 +79,8 @@ IMAGE_CMD_otaimg () { | |||
79 | elif [ "${OSTREE_BOOTLOADER}" = "u-boot" ]; then | 79 | elif [ "${OSTREE_BOOTLOADER}" = "u-boot" ]; then |
80 | touch ${PHYS_SYSROOT}/boot/loader/uEnv.txt | 80 | touch ${PHYS_SYSROOT}/boot/loader/uEnv.txt |
81 | else | 81 | else |
82 | bberror "Invalid bootloader: ${OSTREE_BOOTLOADER}" | 82 | bbfatal "Invalid bootloader: ${OSTREE_BOOTLOADER}" |
83 | fi; | 83 | fi |
84 | 84 | ||
85 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) | 85 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) |
86 | 86 | ||
diff --git a/recipes-sota/aktualizr/aktualizr-ca-implicit-prov-creds.bb b/recipes-sota/aktualizr/aktualizr-ca-implicit-prov-creds.bb index 41af7c0..e2d52da 100644 --- a/recipes-sota/aktualizr/aktualizr-ca-implicit-prov-creds.bb +++ b/recipes-sota/aktualizr/aktualizr-ca-implicit-prov-creds.bb | |||
@@ -33,7 +33,7 @@ do_install() { | |||
33 | fi | 33 | fi |
34 | 34 | ||
35 | if [ -z ${SOTA_CAKEY_PATH} ]; then | 35 | if [ -z ${SOTA_CAKEY_PATH} ]; then |
36 | bberror "SOTA_CAKEY_PATH should be set when using implicit provisioning" | 36 | bbfatal "SOTA_CAKEY_PATH should be set when using implicit provisioning" |
37 | fi | 37 | fi |
38 | 38 | ||
39 | install -m 0700 -d ${D}${localstatedir}/sota | 39 | install -m 0700 -d ${D}${localstatedir}/sota |