bootctl: downgrade graceful messages to LOG_NOTICE
authorLennart Poettering <lennart@poettering.net>
Tue, 20 Dec 2022 15:34:36 +0000 (16:34 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 4 Jan 2023 14:18:10 +0000 (15:18 +0100)
src/boot/bootctl-random-seed.c
units/systemd-boot-random-seed.service [new file with mode: 0644]
units/systemd-boot-system-token.service [deleted file]

index 1f33b5b71be7b89ca4625d4271b9d9b391d00beb..de1dec19e58db640e8a0ed7ec6475a23410e8356 100644 (file)
@@ -152,9 +152,9 @@ int install_random_seed(const char *esp) {
                                 return log_error_errno(r, "Failed to write 'LoaderSystemToken' EFI variable: %m");
 
                         if (r == -EINVAL)
-                                log_warning_errno(r, "Unable to write 'LoaderSystemToken' EFI variable (firmware problem?), ignoring: %m");
+                                log_notice_errno(r, "Unable to write 'LoaderSystemToken' EFI variable (firmware problem?), ignoring: %m");
                         else
-                                log_warning_errno(r, "Unable to write 'LoaderSystemToken' EFI variable, ignoring: %m");
+                                log_notice_errno(r, "Unable to write 'LoaderSystemToken' EFI variable, ignoring: %m");
                 } else
                         log_info("Successfully initialized system token in EFI variable with %zu bytes.", sizeof(buffer));
         }
diff --git a/units/systemd-boot-random-seed.service b/units/systemd-boot-random-seed.service
new file mode 100644 (file)
index 0000000..ef55775
--- /dev/null
@@ -0,0 +1,29 @@
+#  SPDX-License-Identifier: LGPL-2.1-or-later
+#
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU Lesser General Public License as published by
+#  the Free Software Foundation; either version 2.1 of the License, or
+#  (at your option) any later version.
+
+[Unit]
+Description=Store a System Token in an EFI Variable
+Documentation=man:systemd-boot-system-token.service(8)
+
+DefaultDependencies=no
+After=local-fs.target systemd-random-seed.service
+Conflicts=shutdown.target initrd-switch-root.target
+Before=shutdown.target initrd-switch-root.target
+
+# Only run this if the boot loader can support random seed initialization.
+ConditionPathExists=|/sys/firmware/efi/efivars/LoaderFeatures-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f
+ConditionPathExists=|/sys/firmware/efi/efivars/StubFeatures-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f
+
+# Only run this if there is no system token defined yet
+ConditionPathExists=!/sys/firmware/efi/efivars/LoaderSystemToken-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=bootctl random-seed --graceful
diff --git a/units/systemd-boot-system-token.service b/units/systemd-boot-system-token.service
deleted file mode 100644 (file)
index ef55775..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#  SPDX-License-Identifier: LGPL-2.1-or-later
-#
-#  This file is part of systemd.
-#
-#  systemd is free software; you can redistribute it and/or modify it
-#  under the terms of the GNU Lesser General Public License as published by
-#  the Free Software Foundation; either version 2.1 of the License, or
-#  (at your option) any later version.
-
-[Unit]
-Description=Store a System Token in an EFI Variable
-Documentation=man:systemd-boot-system-token.service(8)
-
-DefaultDependencies=no
-After=local-fs.target systemd-random-seed.service
-Conflicts=shutdown.target initrd-switch-root.target
-Before=shutdown.target initrd-switch-root.target
-
-# Only run this if the boot loader can support random seed initialization.
-ConditionPathExists=|/sys/firmware/efi/efivars/LoaderFeatures-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f
-ConditionPathExists=|/sys/firmware/efi/efivars/StubFeatures-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f
-
-# Only run this if there is no system token defined yet
-ConditionPathExists=!/sys/firmware/efi/efivars/LoaderSystemToken-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f
-
-[Service]
-Type=oneshot
-RemainAfterExit=yes
-ExecStart=bootctl random-seed --graceful