]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
fix: prefix of dmesg pstore files
authorДамјан Георгиевски <gdamjan@gmail.com>
Fri, 1 Dec 2023 10:46:36 +0000 (11:46 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 1 Dec 2023 17:34:43 +0000 (17:34 +0000)
A change in the kernel[1] renamed the prefix of the pstore files from
`dmesg-efi-` to `dmesg-efi_pstore-`.

[1]
https://git.kernel.org/linus/893c5f1de620

src/pstore/pstore.c

index 3c1d9bd74b2763dc2456f63accf9b82f71127bb0..8f32a0a2ae152bca07a0be246185d1108fb9eec0 100644 (file)
@@ -227,7 +227,9 @@ static int process_dmesg_files(PStoreList *list) {
                 if (!startswith(pe->dirent.d_name, "dmesg-"))
                         continue;
 
-                if ((p = startswith(pe->dirent.d_name, "dmesg-efi-"))) {
+                /* The linux kernel changed the prefix from dmesg-efi- to dmesg-efi_pstore-
+                 * so now we have to handle both cases. */
+                if ((p = STARTSWITH_SET(pe->dirent.d_name, "dmesg-efi-", "dmesg-efi_pstore-"))) {
                         /* For the EFI backend, the 3 least significant digits of record id encodes a
                          * "count" number, the next 2 least significant digits for the dmesg part
                          * (chunk) number, and the remaining digits as the timestamp.  See