summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMing Liu <liu.ming50@gmail.com>2018-11-11 11:53:01 +0100
committerPatrick Vacek <patrickvacek@gmail.com>2019-02-20 09:36:17 +0100
commit7d4a76cef36a229b3a3ffae7972a64f5ed499873 (patch)
treec9d6e52f7ac5bef62f893514f5199c2ea779eb56
parentecb5a28db62e5fc40847d86b227a59b40783bd6c (diff)
downloadmeta-updater-7d4a76cef36a229b3a3ffae7972a64f5ed499873.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.bbclass6
-rw-r--r--recipes-sota/aktualizr/aktualizr-ca-implicit-prov-creds.bb2
3 files changed, 8 insertions, 12 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..04f9851 100644
--- a/classes/image_types_ota.bbclass
+++ b/classes/image_types_ota.bbclass
@@ -40,7 +40,7 @@ calculate_size () {
40 return -1 40 return -1
41 fi 41 fi
42 fi 42 fi
43 43
44 echo "${SIZE}" 44 echo "${SIZE}"
45} 45}
46 46
@@ -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