summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMing Liu <liu.ming50@gmail.com>2018-11-11 11:53:01 +0100
committerMing Liu <liu.ming50@gmail.com>2018-11-24 12:12:25 +0100
commitc72d82867d4dd7e2dddaea24e1e56b2349f1af03 (patch)
tree0b6bdcdcdf6a60e26aa9173c9df05ff98df829d6
parentbc678ac4ca43e43b0a0597efe434b44b832080f6 (diff)
downloadmeta-updater-c72d82867d4dd7e2dddaea24e1e56b2349f1af03.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.bbclass12
-rw-r--r--classes/image_types_ota.bbclass4
-rw-r--r--recipes-sota/aktualizr/aktualizr-ca-implicit-prov-creds.bb2
3 files changed, 7 insertions, 11 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass
index 05c73ff..ec2de9f 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -112,8 +112,7 @@ IMAGE_CMD_ostree () {
112 112
113 if [ -d root ] && [ ! -L root ]; then 113 if [ -d root ] && [ ! -L root ]; then
114 if [ "$(ls -A root)" ]; then 114 if [ "$(ls -A root)" ]; then
115 bberror "Data in /root directory is not preserved by OSTree." 115 bbfatal "Data in /root directory is not preserved by OSTree."
116 exit 1
117 fi 116 fi
118 117
119 if [ -n "$SYSTEMD_USED" ]; then 118 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 03fe8d8..790ac31 100644
--- a/classes/image_types_ota.bbclass
+++ b/classes/image_types_ota.bbclass
@@ -82,8 +82,8 @@ fakeroot do_otasetup () {
82 elif [ "${OSTREE_BOOTLOADER}" = "u-boot" ]; then 82 elif [ "${OSTREE_BOOTLOADER}" = "u-boot" ]; then
83 touch ${OTA_SYSROOT}/boot/loader/uEnv.txt 83 touch ${OTA_SYSROOT}/boot/loader/uEnv.txt
84 else 84 else
85 bberror "Invalid bootloader: ${OSTREE_BOOTLOADER}" 85 bbfatal "Invalid bootloader: ${OSTREE_BOOTLOADER}"
86 fi; 86 fi
87 87
88 ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) 88 ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME})
89 89
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