• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

systemd / systemd / 21192089104

20 Jan 2026 11:35PM UTC coverage: 72.524% (-0.3%) from 72.818%
21192089104

push

github

yuwata
mkdir: reset mtime *after* fchown()

Follow-up for 34c3d5747

Also, drop pointless shortcut.

1 of 2 new or added lines in 1 file covered. (50.0%)

2960 existing lines in 48 files now uncovered.

309808 of 427181 relevant lines covered (72.52%)

1236537.64 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/bless-boot/bless-boot-generator.c
1
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2

3
#include <unistd.h>
4

5
#include "efivars.h"
6
#include "generator.h"
7
#include "initrd-util.h"
8
#include "log.h"
9
#include "special.h"
10
#include "virt.h"
11

12
/* This generator pulls systemd-bless-boot.service into the initial transaction if the "LoaderBootCountPath"
13
 * EFI variable is set, i.e. the system boots up with boot counting in effect, which means we should mark the
14
 * boot as "good" if we manage to boot up far enough. */
15

16
static int run(const char *dest, const char *dest_early, const char *dest_late) {
×
17
        assert(dest_early);
×
18

19
        if (in_initrd()) {
×
20
                log_debug("Skipping generator, running in the initrd.");
×
21
                return 0;
×
22
        }
23

24
        if (detect_container() > 0) {
×
25
                log_debug("Skipping generator, running in a container.");
×
26
                return 0;
×
27
        }
28

29
        if (generator_soft_rebooted()) {
×
30
                log_debug("Skipping generator, current system is entered via soft-reboot.");
×
31
                return 0;
×
32
        }
33

34
        if (!is_efi_boot()) {
×
35
                log_debug("Skipping generator, not an EFI boot.");
×
36
                return 0;
×
37
        }
38

UNCOV
39
        if (access(EFIVAR_PATH(EFI_LOADER_VARIABLE_STR("LoaderBootCountPath")), F_OK) < 0) {
×
40
                if (errno == ENOENT) {
×
UNCOV
41
                        log_debug_errno(errno, "Skipping generator, not booted with boot counting in effect.");
×
UNCOV
42
                        return 0;
×
43
                }
44

45
                return log_error_errno(errno, "Failed to check if LoaderBootCountPath EFI variable exists: %m");
×
46
        }
47

48
        /* We pull this in from basic.target so that it ends up in all "regular" boot ups, but not in
49
         * rescue.target or even emergency.target. */
UNCOV
50
        return generator_add_symlink(dest_early, SPECIAL_BASIC_TARGET, "wants", "systemd-bless-boot.service");
×
51
}
52

UNCOV
53
DEFINE_MAIN_GENERATOR_FUNCTION(run);
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc