Add a new break on error
A user running di-b several times while developing an element may not want to drop to a shell in all cases but may only want to do so if one of their in target hooks failed. This patch gives them the ability to do so, If break=after-error is set then a user will be provided a in target shell taking over from where the last failed command left off. Change-Id: Ia2f7ac4c21b64b971f87f4ae9cb867981b13eb5e
This commit is contained in:
parent
4284936084
commit
4651913e55
@ -326,6 +326,8 @@ comma-delimited string. Some examples:
|
|||||||
* break=after-first-boot,before-pre-install will break after the first-boot
|
* break=after-first-boot,before-pre-install will break after the first-boot
|
||||||
hooks and before the pre-install hooks.
|
hooks and before the pre-install hooks.
|
||||||
|
|
||||||
|
* break=after-error will break after an error during a in target hookpoint.
|
||||||
|
|
||||||
Images are built such that the Linux kernel is instructed not to switch into
|
Images are built such that the Linux kernel is instructed not to switch into
|
||||||
graphical consoles (i.e. it will not activate KMS). This maximises
|
graphical consoles (i.e. it will not activate KMS). This maximises
|
||||||
compatibility with remote console interception hardware, such as HP's iLO.
|
compatibility with remote console interception hardware, such as HP's iLO.
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
set -e
|
set -eE
|
||||||
|
|
||||||
# Prevent perl from complaining a lot, but also remove any unexpected side-effects
|
# Prevent perl from complaining a lot, but also remove any unexpected side-effects
|
||||||
# of $LANG varying between build hosts
|
# of $LANG varying between build hosts
|
||||||
|
@ -78,7 +78,9 @@ function run_d_in_target () {
|
|||||||
mkdir -p $DIB_CCACHE_DIR
|
mkdir -p $DIB_CCACHE_DIR
|
||||||
sudo mount --bind $DIB_CCACHE_DIR $TMP_MOUNT_PATH/tmp/ccache
|
sudo mount --bind $DIB_CCACHE_DIR $TMP_MOUNT_PATH/tmp/ccache
|
||||||
check_break before-$1 run_in_target bash
|
check_break before-$1 run_in_target bash
|
||||||
|
trap "check_break after-error run_in_target bash" ERR
|
||||||
run_in_target dib-run-parts /tmp/in_target.d/$1.d
|
run_in_target dib-run-parts /tmp/in_target.d/$1.d
|
||||||
|
trap - ERR
|
||||||
check_break after-$1 run_in_target bash
|
check_break after-$1 run_in_target bash
|
||||||
sudo umount -f $TMP_MOUNT_PATH/tmp/in_target.d
|
sudo umount -f $TMP_MOUNT_PATH/tmp/in_target.d
|
||||||
sudo rmdir $TMP_MOUNT_PATH/tmp/in_target.d
|
sudo rmdir $TMP_MOUNT_PATH/tmp/in_target.d
|
||||||
|
Loading…
Reference in New Issue
Block a user