At the moment, as far as I can see, all errors return exit code 1 which makes it hard to add metrics to track the different types of errors.
Patch here: https://chromium-review.googlesource.com/#/c/403471/
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/vpd/+/6c6fc855a162cfb661b08827f47744128f635c3a commit 6c6fc855a162cfb661b08827f47744128f635c3a Author: David Hendricks <dhendrix@chromium.org> Date: Wed Oct 26 04:01:05 2016 vpd: Introduce new error codes to return to shell. This patch adds new error codes to lib_vpd.h and replaces return values and "retval" assignments to better indicate the type of error encountered. This allows us to know if vpd is encountering flashrom errors, corruption or bugs in the VPD itself, or unrelated system issue such as full filesystem, low memory, etc. BUG= chromium:659086 BRANCH=none TEST=compiled and ran unit tests (make test) Change-Id: I4963faeb82f8818fd46db3a0a24881c1bdfbc46c Signed-off-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/403471 [modify] https://crrev.com/6c6fc855a162cfb661b08827f47744128f635c3a/tests/test_equal.sh [modify] https://crrev.com/6c6fc855a162cfb661b08827f47744128f635c3a/tests/test_multi_add_del.sh [modify] https://crrev.com/6c6fc855a162cfb661b08827f47744128f635c3a/tests/functions.sh [modify] https://crrev.com/6c6fc855a162cfb661b08827f47744128f635c3a/lib/vpd_container.c [modify] https://crrev.com/6c6fc855a162cfb661b08827f47744128f635c3a/vpd.c [modify] https://crrev.com/6c6fc855a162cfb661b08827f47744128f635c3a/tests/test_basic.sh [modify] https://crrev.com/6c6fc855a162cfb661b08827f47744128f635c3a/lib/lib_vpd_test.c [modify] https://crrev.com/6c6fc855a162cfb661b08827f47744128f635c3a/lib/vpd_encode.c [modify] https://crrev.com/6c6fc855a162cfb661b08827f47744128f635c3a/tests/test_seg_fault.sh [modify] https://crrev.com/6c6fc855a162cfb661b08827f47744128f635c3a/include/lib/lib_vpd.h [modify] https://crrev.com/6c6fc855a162cfb661b08827f47744128f635c3a/lib/vpd_decode.c
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/vpd/+/6c72b02a51dae849fdcc3429766a79b6203b7325 commit 6c72b02a51dae849fdcc3429766a79b6203b7325 Author: David Hendricks <dhendrix@chromium.org> Date: Wed Mar 08 05:11:40 2017 vpd: Introduce new error codes to return to shell. This patch adds new error codes to lib_vpd.h and replaces return values and "retval" assignments to better indicate the type of error encountered. This allows us to know if vpd is encountering flashrom errors, corruption or bugs in the VPD itself, or unrelated system issue such as full filesystem, low memory, etc. BUG= chromium:659086 BRANCH=none TEST=compiled and ran unit tests (make test) Change-Id: I4963faeb82f8818fd46db3a0a24881c1bdfbc46c Signed-off-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/403471 Reviewed-on: https://chromium-review.googlesource.com/451221 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Commit-Queue: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org> [modify] https://crrev.com/6c72b02a51dae849fdcc3429766a79b6203b7325/tests/test_equal.sh [modify] https://crrev.com/6c72b02a51dae849fdcc3429766a79b6203b7325/tests/test_multi_add_del.sh [modify] https://crrev.com/6c72b02a51dae849fdcc3429766a79b6203b7325/tests/functions.sh [modify] https://crrev.com/6c72b02a51dae849fdcc3429766a79b6203b7325/lib/vpd_container.c [modify] https://crrev.com/6c72b02a51dae849fdcc3429766a79b6203b7325/vpd.c [modify] https://crrev.com/6c72b02a51dae849fdcc3429766a79b6203b7325/tests/test_basic.sh [modify] https://crrev.com/6c72b02a51dae849fdcc3429766a79b6203b7325/lib/lib_vpd_test.c [modify] https://crrev.com/6c72b02a51dae849fdcc3429766a79b6203b7325/lib/vpd_encode.c [modify] https://crrev.com/6c72b02a51dae849fdcc3429766a79b6203b7325/tests/test_seg_fault.sh [modify] https://crrev.com/6c72b02a51dae849fdcc3429766a79b6203b7325/include/lib/lib_vpd.h [modify] https://crrev.com/6c72b02a51dae849fdcc3429766a79b6203b7325/lib/vpd_decode.c
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/vpd/+/8a7fcdb17bc868cd18b89ca51f9d73cdb43f0230 commit 8a7fcdb17bc868cd18b89ca51f9d73cdb43f0230 Author: David Hendricks <dhendrix@chromium.org> Date: Wed Mar 08 05:17:09 2017 vpd: Introduce new error codes to return to shell. This patch adds new error codes to lib_vpd.h and replaces return values and "retval" assignments to better indicate the type of error encountered. This allows us to know if vpd is encountering flashrom errors, corruption or bugs in the VPD itself, or unrelated system issue such as full filesystem, low memory, etc. BUG= chromium:659086 BRANCH=none TEST=compiled and ran unit tests (make test) Change-Id: I4963faeb82f8818fd46db3a0a24881c1bdfbc46c Signed-off-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/403471 (cherry picked from commit 6c6fc855a162cfb661b08827f47744128f635c3a) Reviewed-on: https://chromium-review.googlesource.com/451223 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Commit-Queue: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org> Trybot-Ready: Hung-Te Lin <hungte@chromium.org> [modify] https://crrev.com/8a7fcdb17bc868cd18b89ca51f9d73cdb43f0230/tests/test_equal.sh [modify] https://crrev.com/8a7fcdb17bc868cd18b89ca51f9d73cdb43f0230/tests/test_multi_add_del.sh [modify] https://crrev.com/8a7fcdb17bc868cd18b89ca51f9d73cdb43f0230/tests/functions.sh [modify] https://crrev.com/8a7fcdb17bc868cd18b89ca51f9d73cdb43f0230/lib/vpd_container.c [modify] https://crrev.com/8a7fcdb17bc868cd18b89ca51f9d73cdb43f0230/vpd.c [modify] https://crrev.com/8a7fcdb17bc868cd18b89ca51f9d73cdb43f0230/tests/test_basic.sh [modify] https://crrev.com/8a7fcdb17bc868cd18b89ca51f9d73cdb43f0230/lib/lib_vpd_test.c [modify] https://crrev.com/8a7fcdb17bc868cd18b89ca51f9d73cdb43f0230/lib/vpd_encode.c [modify] https://crrev.com/8a7fcdb17bc868cd18b89ca51f9d73cdb43f0230/tests/test_seg_fault.sh [modify] https://crrev.com/8a7fcdb17bc868cd18b89ca51f9d73cdb43f0230/include/lib/lib_vpd.h [modify] https://crrev.com/8a7fcdb17bc868cd18b89ca51f9d73cdb43f0230/lib/vpd_decode.c
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/vpd/+/6c651764ff04b6933489fcc7cb883a50da3dd0bf commit 6c651764ff04b6933489fcc7cb883a50da3dd0bf Author: David Hendricks <dhendrix@chromium.org> Date: Wed Mar 08 05:18:48 2017 vpd: Introduce new error codes to return to shell. This patch adds new error codes to lib_vpd.h and replaces return values and "retval" assignments to better indicate the type of error encountered. This allows us to know if vpd is encountering flashrom errors, corruption or bugs in the VPD itself, or unrelated system issue such as full filesystem, low memory, etc. BUG= chromium:659086 BRANCH=none TEST=compiled and ran unit tests (make test) Change-Id: I4963faeb82f8818fd46db3a0a24881c1bdfbc46c Signed-off-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/403471 Reviewed-on: https://chromium-review.googlesource.com/451339 Commit-Queue: Hung-Te Lin <hungte@chromium.org> Trybot-Ready: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org> [modify] https://crrev.com/6c651764ff04b6933489fcc7cb883a50da3dd0bf/tests/test_equal.sh [modify] https://crrev.com/6c651764ff04b6933489fcc7cb883a50da3dd0bf/tests/test_multi_add_del.sh [modify] https://crrev.com/6c651764ff04b6933489fcc7cb883a50da3dd0bf/tests/functions.sh [modify] https://crrev.com/6c651764ff04b6933489fcc7cb883a50da3dd0bf/lib/vpd_container.c [modify] https://crrev.com/6c651764ff04b6933489fcc7cb883a50da3dd0bf/vpd.c [modify] https://crrev.com/6c651764ff04b6933489fcc7cb883a50da3dd0bf/tests/test_basic.sh [modify] https://crrev.com/6c651764ff04b6933489fcc7cb883a50da3dd0bf/lib/lib_vpd_test.c [modify] https://crrev.com/6c651764ff04b6933489fcc7cb883a50da3dd0bf/lib/vpd_encode.c [modify] https://crrev.com/6c651764ff04b6933489fcc7cb883a50da3dd0bf/tests/test_seg_fault.sh [modify] https://crrev.com/6c651764ff04b6933489fcc7cb883a50da3dd0bf/include/lib/lib_vpd.h [modify] https://crrev.com/6c651764ff04b6933489fcc7cb883a50da3dd0bf/lib/vpd_decode.c
Comment 1 by tnagel@chromium.org
, Oct 25 2016