Run and Report

July 10, 2020
shell cmdline yocto bitbake

If you’re frequently starting long running jobs (like yocto builds) and want to be notified as soon as they’ve completed (instead of having to return an hour later to discover the compilation errored out two minutes into the build), the following little helper may be for you. Just drop the following function into your .bashrc:

rnr()
{
    eval $@
    MSG="rnr: $@ exited with status $?"
    notify-send "$MSG"
}

Now pass your build command to rnr to be informed when it finishes:

$ rnr bitbake core-image-minimal
...

If you’re lucky you’ll get

Notes: