summaryrefslogtreecommitdiffstats
path: root/src/core/image.c
diff options
context:
space:
mode:
authorMichael Brown2012-03-27 12:11:28 +0200
committerMichael Brown2012-03-27 12:11:28 +0200
commit730c97212418e1cf272ed80272f266455e01eb17 (patch)
treeb28b702dc57a557e9fe6799c93d81a86a9101abe /src/core/image.c
parent[console] Remove "log message" usage from interactive console defaults (diff)
downloadipxe-730c97212418e1cf272ed80272f266455e01eb17.tar.gz
ipxe-730c97212418e1cf272ed80272f266455e01eb17.tar.xz
ipxe-730c97212418e1cf272ed80272f266455e01eb17.zip
[image] Log image executions
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core/image.c')
-rw-r--r--src/core/image.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/image.c b/src/core/image.c
index b02b8936..3cb2d62d 100644
--- a/src/core/image.c
+++ b/src/core/image.c
@@ -25,6 +25,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <errno.h>
#include <assert.h>
#include <libgen.h>
+#include <syslog.h>
#include <ipxe/list.h>
#include <ipxe/umalloc.h>
#include <ipxe/uri.h>
@@ -286,6 +287,9 @@ int image_exec ( struct image *image ) {
*/
current_image = image_get ( image );
+ /* Record boot attempt */
+ syslog ( LOG_NOTICE, "Executing \"%s\"\n", image->name );
+
/* Try executing the image */
if ( ( rc = image->type->exec ( image ) ) != 0 ) {
DBGC ( image, "IMAGE %s could not execute: %s\n",
@@ -293,6 +297,15 @@ int image_exec ( struct image *image ) {
/* Do not return yet; we still have clean-up to do */
}
+ /* Record result of boot attempt */
+ if ( rc == 0 ) {
+ syslog ( LOG_NOTICE, "Execution of \"%s\" completed\n",
+ image->name );
+ } else {
+ syslog ( LOG_ERR, "Execution of \"%s\" failed: %s\n",
+ image->name, strerror ( rc ) );
+ }
+
/* Pick up replacement image before we drop the original
* image's temporary reference. The replacement image must
* already be registered, so we don't need to hold a temporary