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

systemd / systemd / 15263807472

26 May 2025 08:53PM UTC coverage: 72.046% (-0.002%) from 72.048%
15263807472

push

github

yuwata
src/core/manager.c: log preset activity on first boot

This gives us a little more information about what units were enabled
or disabled on that first boot and will be useful for OS developers
tracking down the source of unit state.

An example with this enabled looks like:

```
NET: Registered PF_VSOCK protocol family
systemd[1]: Applying preset policy.
systemd[1]: Unit /etc/systemd/system/dnsmasq.service is masked, ignoring.
systemd[1]: Unit /etc/systemd/system/systemd-repart.service is masked, ignoring.
systemd[1]: Removed '/etc/systemd/system/sockets.target.wants/systemd-resolved-monitor.socket'.
systemd[1]: Removed '/etc/systemd/system/sockets.target.wants/systemd-resolved-varlink.socket'.
systemd[1]: Created symlink '/etc/systemd/system/multi-user.target.wants/var-mnt-workdir.mount' → '/etc/systemd/system/var-mnt-workdir.mount'.
systemd[1]: Created symlink '/etc/systemd/system/multi-user.target.wants/var-mnt-workdir\x2dtmp.mount' → '/etc/systemd/system/var-mnt-workdir\x2dtmp.mount'.
systemd[1]: Created symlink '/etc/systemd/system/afterburn-sshkeys.target.requires/afterburn-sshkeys@core.service' → '/usr/lib/systemd/system/afterburn-sshkeys@.service'.
systemd[1]: Created symlink '/etc/systemd/system/sockets.target.wants/systemd-resolved-varlink.socket' → '/usr/lib/systemd/system/systemd-resolved-varlink.socket'.
systemd[1]: Created symlink '/etc/systemd/system/sockets.target.wants/systemd-resolved-monitor.socket' → '/usr/lib/systemd/system/systemd-resolved-monitor.socket'.
systemd[1]: Populated /etc with preset unit settings.
```

Considering it only happens on first boot and not on every boot I think
the extra information is worth the extra verbosity in the logs just for
that boot.

5 of 6 new or added lines in 1 file covered. (83.33%)

5463 existing lines in 165 files now uncovered.

299151 of 415222 relevant lines covered (72.05%)

702386.45 hits per line

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

61.43
/src/basic/iovec-wrapper.c
1
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2

3
#include "alloc-util.h"
4
#include "iovec-util.h"
5
#include "iovec-wrapper.h"
6
#include "string-util.h"
7

8
struct iovec_wrapper *iovw_new(void) {
23✔
9
        return new0(struct iovec_wrapper, 1);
23✔
10
}
11

12
void iovw_done(struct iovec_wrapper *iovw) {
23,596✔
13
        assert(iovw);
23,596✔
14

15
        iovw->iovec = mfree(iovw->iovec);
23,596✔
16
        iovw->count = 0;
23,596✔
17
}
23,596✔
18

19
void iovw_done_free(struct iovec_wrapper *iovw) {
26✔
20
        assert(iovw);
26✔
21

22
        FOREACH_ARRAY(i, iovw->iovec, iovw->count)
755✔
23
                iovec_done(i);
729✔
24

25
        iovw_done(iovw);
26✔
26
}
26✔
27

28
struct iovec_wrapper *iovw_free_free(struct iovec_wrapper *iovw) {
14✔
29
        if (!iovw)
14✔
30
                return NULL;
31

32
        iovw_done_free(iovw);
14✔
33
        return mfree(iovw);
14✔
34
}
35

UNCOV
36
struct iovec_wrapper *iovw_free(struct iovec_wrapper *iovw) {
×
UNCOV
37
        if (!iovw)
×
38
                return NULL;
39

40
        iovw_done(iovw);
×
UNCOV
41
        return mfree(iovw);
×
42
}
43

44
int iovw_put(struct iovec_wrapper *iovw, void *data, size_t len) {
589,794✔
45
        assert(iovw);
589,794✔
46

47
        if (len == 0)
589,794✔
48
                return 0;
49

50
        assert(data);
589,794✔
51

52
        if (iovw->count >= IOV_MAX)
589,794✔
53
                return -E2BIG;
54

55
        if (!GREEDY_REALLOC(iovw->iovec, iovw->count + 1))
589,794✔
56
                return -ENOMEM;
57

58
        iovw->iovec[iovw->count++] = IOVEC_MAKE(data, len);
589,794✔
59
        return 0;
589,794✔
60
}
61

62
int iovw_put_string_field(struct iovec_wrapper *iovw, const char *field, const char *value) {
389✔
63
        _cleanup_free_ char *x = NULL;
389✔
64
        int r;
389✔
65

66
        assert(iovw);
389✔
67

68
        x = strjoin(field, value);
389✔
69
        if (!x)
389✔
70
                return -ENOMEM;
71

72
        r = iovw_put(iovw, x, strlen(x));
389✔
73
        if (r >= 0)
389✔
74
                TAKE_PTR(x);
389✔
75

76
        return r;
77
}
78

79
int iovw_put_string_field_free(struct iovec_wrapper *iovw, const char *field, char *value) {
220✔
80
        _cleanup_free_ _unused_ char *free_ptr = value;
220✔
81

82
        return iovw_put_string_field(iovw, field, value);
220✔
83
}
84

85
void iovw_rebase(struct iovec_wrapper *iovw, void *old, void *new) {
2,376✔
86
        assert(iovw);
2,376✔
87

88
        FOREACH_ARRAY(i, iovw->iovec, iovw->count) {
24,885✔
89
                assert(i->iov_base >= old);
22,509✔
90
                i->iov_base = (uint8_t*) i->iov_base - (uint8_t*) old + (uint8_t*) new;
22,509✔
91
        }
92
}
2,376✔
93

UNCOV
94
size_t iovw_size(const struct iovec_wrapper *iovw) {
×
UNCOV
95
        if (!iovw)
×
96
                return 0;
97

98
        return iovec_total_size(iovw->iovec, iovw->count);
×
99
}
100

101
int iovw_append(struct iovec_wrapper *target, const struct iovec_wrapper *source) {
×
UNCOV
102
        size_t original_count;
×
UNCOV
103
        int r;
×
104

105
        assert(target);
×
106

107
        /* This duplicates the source and merges it into the target. */
108

UNCOV
109
        if (iovw_isempty(source))
×
110
                return 0;
111

112
        original_count = target->count;
×
113

UNCOV
114
        FOREACH_ARRAY(iovec, source->iovec, source->count) {
×
115
                void *dup;
×
116

117
                dup = memdup(iovec->iov_base, iovec->iov_len);
×
118
                if (!dup) {
×
UNCOV
119
                        r = -ENOMEM;
×
120
                        goto rollback;
×
121
                }
122

123
                r = iovw_consume(target, dup, iovec->iov_len);
×
UNCOV
124
                if (r < 0)
×
UNCOV
125
                        goto rollback;
×
126
        }
127

128
        return 0;
129

UNCOV
130
rollback:
×
UNCOV
131
        for (size_t i = original_count; i < target->count; i++)
×
UNCOV
132
                iovec_done(target->iovec + i);
×
133

134
        target->count = original_count;
×
135
        return r;
×
136
}
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