Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:vlefebvre:unified
systemd
logger.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File logger.patch of Package systemd
diff -Ppdru systemd-v255.7+suse.33.g603cd1d4d8/src/boot/efi/boot.c systemd-v255.7+suse.33.g603cd1d4d8-new/src/boot/efi/boot.c --- systemd-v255.7+suse.33.g603cd1d4d8/src/boot/efi/boot.c 2024-06-25 16:47:37.264021207 +0200 +++ systemd-v255.7+suse.33.g603cd1d4d8-new/src/boot/efi/boot.c 2024-06-12 14:04:13.999063349 +0200 @@ -1488,6 +1488,7 @@ static void boot_entry_add_type1( entry->initrd[n_initrd++] = xstr8_to_path(value); entry->initrd[n_initrd] = NULL; } else if (streq8(key, "add-on")) { + log_error_status(0, "Addon key found"); entry->addons = xrealloc_extra_item( uint16_t, entry->addons, @@ -1495,6 +1496,7 @@ static void boot_entry_add_type1( ); entry->addons[n_addons++] = xstr8_to_path(value); entry->addons[n_addons] = NULL; + log_error_status(0, "Addon key Added to list"); } else if (streq8(key, "options")) { _cleanup_free_ char16_t *new = NULL; diff -Ppdru systemd-v255.7+suse.33.g603cd1d4d8/src/boot/efi/device-path-util.c systemd-v255.7+suse.33.g603cd1d4d8-new/src/boot/efi/device-path-util.c --- systemd-v255.7+suse.33.g603cd1d4d8/src/boot/efi/device-path-util.c 2024-06-25 16:47:37.264021207 +0200 +++ systemd-v255.7+suse.33.g603cd1d4d8-new/src/boot/efi/device-path-util.c 2024-06-12 14:04:13.999063349 +0200 @@ -2,6 +2,7 @@ #include "device-path-util.h" #include "util.h" +#include "log.h" EFI_STATUS make_multiple_file_device_path( EFI_HANDLE device, @@ -149,9 +150,11 @@ EFI_STATUS device_path_to_str(const EFI_ assert(dp); assert(ret); - + err = BS->LocateProtocol(MAKE_GUID_PTR(EFI_DEVICE_PATH_TO_TEXT_PROTOCOL), NULL, (void **) &dp_to_text); + if (err != EFI_SUCCESS) { + log_error_status(err, "Failed loading protocol, %m"); *ret = device_path_to_str_internal(dp); return EFI_SUCCESS; } diff -Ppdru systemd-v255.7+suse.33.g603cd1d4d8/src/boot/efi/stub.c systemd-v255.7+suse.33.g603cd1d4d8-new/src/boot/efi/stub.c --- systemd-v255.7+suse.33.g603cd1d4d8/src/boot/efi/stub.c 2024-06-25 16:47:37.280021180 +0200 +++ systemd-v255.7+suse.33.g603cd1d4d8-new/src/boot/efi/stub.c 2024-06-25 16:46:35.788126243 +0200 @@ -38,7 +38,6 @@ struct addon_entry { static int cmp_addon_entry(const struct addon_entry *s1, const struct addon_entry *s2) { assert(s1); assert(s2); - return strcmp16((const char16_t*)&s1->source_path, (const char16_t*)&s2->source_path); } @@ -238,6 +237,7 @@ static EFI_STATUS load_addons_from_dir( _cleanup_free_ char16_t *d = NULL; err = readdir(extra_dir, &dirent, &dirent_size); + if (err != EFI_SUCCESS) return log_error_status(err, "Failed to read addons directory of loaded image: %m"); if (!dirent) /* End of directory */ @@ -294,20 +294,32 @@ static EFI_STATUS load_addons_from_efi( err = BS->HandleProtocol(image->DeviceHandle, MAKE_GUID_PTR(SYSTEMD_ADDON_MEDIA), (void **) &addon_paths); - if (err == EFI_UNSUPPORTED) + if (err == EFI_UNSUPPORTED){ /* No addons from EFI, that's OK */ + log_error_status(0, "No addons from EFI protocol: %m"); return EFI_SUCCESS; + } if (err != EFI_SUCCESS) return log_error_status(err, "Failed to load addons from EFI protocol: %m"); + log_error_status(0, "Addon loaded from EFI protocol"); while (*addon_paths && (*addon_paths)->Length > 0 && (*addon_paths)->Type > 0) { char16_t *spath = NULL; /* If we increment this pointer instead of addon_paths_split, we will arrive on a end node * marker */ const EFI_DEVICE_PATH *addon_dpath = *addon_paths; + log_error_status(0, "Path to str ..."); + if (*addon_paths == NULL) { + log_error_status(0, "addon_dpath NULL"); + } else { + log_error_status(0, "dp type %u", (*addon_paths)->Type); + } err = device_path_to_str(addon_dpath, &spath); - if (err != EFI_SUCCESS) + if (err != EFI_SUCCESS) { + log_error_status(err, "Failed to parse device path to str, %m"); return err; + } + log_error_status(0, "Path %ls", spath); if (*n_items + 2 > *n_allocated) { /* We allocate 16 entries at a time, as a matter of optimization */ @@ -325,8 +337,10 @@ static EFI_STATUS load_addons_from_efi( .device_path = TAKE_PTR(addon_dpath) }; *n_items = *n_items + 1; + log_error_status(0, "n_items %lu", *n_items); addon_paths++; } + log_error_status(0, "loop end"); return EFI_SUCCESS; } @@ -445,6 +459,7 @@ static EFI_STATUS load_addons( char16_t ***ret_dt_filenames, size_t *ret_n_dt) { + log_error_status(0, "Sarting Load addons ..."); _cleanup_free_ struct addon_entry *addons = NULL; _cleanup_free_ size_t *dt_sizes = NULL; _cleanup_(file_closep) EFI_FILE *root = NULL; @@ -477,10 +492,13 @@ static EFI_STATUS load_addons( if (err != EFI_SUCCESS) return log_error_status(err, "Unable to open root directory: %m"); + log_error_status(0, "Load addons from dir ..."); err = load_addons_from_dir(loaded_image, root, prefix, &addons, &n_items, &n_allocated); if (err != EFI_SUCCESS) return err; + log_error_status(0, "addons loaded from dir. Number loaded: %lu", n_items); + log_error_status(0, "Load addons from efi ..."); if (load_from_efi) { err = load_addons_from_efi(loaded_image, &addons, &n_items, &n_allocated); if (err != EFI_SUCCESS) @@ -489,6 +507,14 @@ static EFI_STATUS load_addons( if (n_items == 0) return EFI_SUCCESS; /* Empty directory */ + for (size_t i = 0; i < n_items; i++) { + log_error_status(0, "addon %lu: %ls, length: %u, type: %u, SubType: %u", + i, + addons[i].source_path, + addons[i].device_path->Length, + addons[i].device_path->Type, + addons[i].device_path->SubType); + } /* Now, sort the files we found, to make this uniform and stable (and to ensure the TPM measurements * are not dependent on read order) */ @@ -501,12 +527,18 @@ static EFI_STATUS load_addons( /* By using shim_load_image, we cover both the case where the PE files are signed with MoK * and with DB, and running with or without shim. */ + log_error_status(0, "load addoni %lu: %ls, length: %u, type: %u, SubType: %u", i, + addons[i].source_path, + addons[i].device_path->Length, + addons[i].device_path->Type, + addons[i].device_path->SubType); err = shim_load_image(stub_image, addons[i].device_path, &addon); if (err != EFI_SUCCESS) { log_error_status(err, "Failed to read '%ls', ignoring: %m", addons[i].source_path); continue; } + log_error_status(0, "addon loaded to shim"); err = BS->HandleProtocol(addon, MAKE_GUID_PTR(EFI_LOADED_IMAGE_PROTOCOL), @@ -631,6 +663,8 @@ static EFI_STATUS run(EFI_HANDLE image) CLEANUP_ARRAY(dt_filenames_addons_global, n_dts_addons_global, dt_filenames_free); CLEANUP_ARRAY(dt_filenames_addons_uki, n_dts_addons_uki, dt_filenames_free); + log_error_status(0, "Load addons ..."); + if (szs[UNIFIED_SECTION_UNAME] > 0) uname = xstrndup8((char *)loaded_image->ImageBase + addrs[UNIFIED_SECTION_UNAME], szs[UNIFIED_SECTION_UNAME]); diff: systemd-v255.7+suse.33.g603cd1d4d8/test/testdata: recursive directory loop
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor