Преглед на файлове

[image] Log image executions

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown преди 12 години
родител
ревизия
730c972124
променени са 1 файла, в които са добавени 13 реда и са изтрити 0 реда
  1. 13
    0
      src/core/image.c

+ 13
- 0
src/core/image.c Целия файл

@@ -25,6 +25,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
25 25
 #include <errno.h>
26 26
 #include <assert.h>
27 27
 #include <libgen.h>
28
+#include <syslog.h>
28 29
 #include <ipxe/list.h>
29 30
 #include <ipxe/umalloc.h>
30 31
 #include <ipxe/uri.h>
@@ -286,6 +287,9 @@ int image_exec ( struct image *image ) {
286 287
 	 */
287 288
 	current_image = image_get ( image );
288 289
 
290
+	/* Record boot attempt */
291
+	syslog ( LOG_NOTICE, "Executing \"%s\"\n", image->name );
292
+
289 293
 	/* Try executing the image */
290 294
 	if ( ( rc = image->type->exec ( image ) ) != 0 ) {
291 295
 		DBGC ( image, "IMAGE %s could not execute: %s\n",
@@ -293,6 +297,15 @@ int image_exec ( struct image *image ) {
293 297
 		/* Do not return yet; we still have clean-up to do */
294 298
 	}
295 299
 
300
+	/* Record result of boot attempt */
301
+	if ( rc == 0 ) {
302
+		syslog ( LOG_NOTICE, "Execution of \"%s\" completed\n",
303
+			 image->name );
304
+	} else {
305
+		syslog ( LOG_ERR, "Execution of \"%s\" failed: %s\n",
306
+			 image->name, strerror ( rc ) );
307
+	}
308
+
296 309
 	/* Pick up replacement image before we drop the original
297 310
 	 * image's temporary reference.  The replacement image must
298 311
 	 * already be registered, so we don't need to hold a temporary

Loading…
Отказ
Запис