diff options
author | Dave Reisner <dreisner@archlinux.org> | 2012-02-13 16:39:33 +0100 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2012-02-14 02:04:43 +0100 |
commit | 09ae1b320ebde6d5f1ffc0efb2d9e1d59e8355cf (patch) | |
tree | fd06f2850d2e22c57ba4ecb1bcab2aa8a2fe5fe9 | |
parent | d11ba0046d74b61f14c79c0793e53a99e51395cb (diff) | |
download | mkinitcpio-09ae1b320ebde6d5f1ffc0efb2d9e1d59e8355cf.tar.gz mkinitcpio-09ae1b320ebde6d5f1ffc0efb2d9e1d59e8355cf.tar.xz |
mkinitcpio: catch more buildtime errors
Move the unsetting of the errtrace and ERR trap flags to after the
image has been built. This lets us capture errors during module
installation to the build root and the call to depmod. Either of these
steps failing could be hazardous and should prompt a failure.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rwxr-xr-x | mkinitcpio | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -335,9 +335,8 @@ for var in cfg_{MODULES,BINARIES,FILES}; do done parse_hook -# unset errtrace and trap -set +E -trap ERR +# reset the trap to catch all errors +trap '(( ++builderrors ))' ERR if (( ${#ADDED_MODULES[*]} )); then mkdir -p "${MODPATHS[@]%/*}" @@ -358,6 +357,10 @@ else warning "No modules were added to the image. This is probably not what you want." fi +# unset errtrace and trap +set +E +trap ERR + declare -i status=0 declare -a pipesave if [[ "${GENIMG}" ]]; then |