Commit Graph
54455 Commits
Author SHA1 Message Date
Yu Watanabe 16ed53658a Merge pull request #18243 from ssahani/ensure-put-use
tree-wide: introduce hashmap_ensure_put() and use it
2021-01-17 15:39:41 +09:00
Yu Watanabe 95dd454edc Merge pull request #18261 from ssahani/net2
network: modernize routing policy rule and add 0 validation where needed
2021-01-17 15:39:01 +09:00
Susant Sahani cda7fc8db3 network: tighten variable scope used in loop (#18277) 2021-01-17 15:38:33 +09:00
Adam Nielsen e64652f70c man: clarify what network scopes are 2021-01-17 12:47:08 +09:00
Susant Sahani a307a7dd38 network: nexthop - use hashmap_ensure_put 2021-01-16 23:10:32 +01:00
Susant Sahani dcd46cc42d network: use hashmap_ensure_put 2021-01-16 23:10:18 +01:00
Susant Sahani 8eeffefbf0 network: routing-policy-rule - TAKE_PTR 2021-01-16 23:04:07 +01:00
Susant Sahani fd9d7de176 network: route - add a zero verification for tcp window 2021-01-16 23:04:07 +01:00
Susant Sahani 0132453c40 network: tc - use TAKE_PTR (#18266)
* network: tc cake - use TAKE_PTR

* network: tc htb - use TAKE_PTR

* network: tc pie - use TAKE_PTR

* network: tc netem - use TAKE_PTR

* network: tc hhf - use TAKE_PTR

* network: tc gred - use TAKE_PTR

* network: tc fq codel - use TAKE_PTR

* network: tc fifo - use TAKE_PTR

* network: tc drr - use TAKE_PTR

* network: tc qdisc - use TAKE_PTR
2021-01-17 06:08:36 +09:00
Zbigniew Jędrzejewski-Szmek 2b5a1402f6 Merge pull request #18263 from keszybz/syscalls-auto
Generate missing syscalls headers programatically
2021-01-16 17:21:34 +01:00
Luca Boccassi 55eeb47631 Merge pull request #18264 from ssahani/net3
network: Use TAKE_PTR
2021-01-16 12:16:43 +00:00
Luca Boccassi 66e27e698e Merge pull request #18268 from ssahani/net5
network: tighten variable scope used in loop
2021-01-16 12:13:14 +00:00
Susant Sahani 995606ad5b network: manager tighten variable scope used in loop 2021-01-16 12:07:33 +00:00
Susant Sahani 8cb3465100 network: route - use ordered_set_ensure_put 2021-01-16 12:05:44 +00:00
Susant Sahani dea161d9a1 network: address label - use TAKE_PTR 2021-01-15 21:47:38 +01:00
Susant Sahani eccc11a47a network: mdb - use TAKE_PTR 2021-01-15 21:47:26 +01:00
Susant Sahani b48e277f47 networkctl: tighten variable scope used in loop 2021-01-15 21:44:16 +01:00
Daan De Meyer ef1bd2349b mkosi: Allow setting version-tag option via VERSION_TAG env variable
With https://github.com/systemd/mkosi/pull/630, we can set environment
variables for the build script in mkosi. Let's modify the build script
so we can set the version-tag option via an environment variable of the
same name. The default is the empty string which causes meson to fall
back to the default behavior (git version).
2021-01-15 21:42:30 +01:00
Frantisek Sumsal 2e445f4fe5 ci: bump the Semaphore CI badge to the v2 instance 2021-01-15 20:31:20 +00:00
Zbigniew Jędrzejewski-Szmek 3bc66bfa01 rpm: expose $systemd_util_dir also as rpm macro
This variable (a.k.a. rootlibexecdir), was exposed through the .pc file, but
not as rpm macro.

The .pc file must be located in the package that provides libraries, which
pulls in a lot of dependencies. In Fedora, the macros are split out to a
separate package so that other packages which need to refer to some systemd
path but don't otherwise require it, can only pull in the (much smaller and
dependency-less) macros package. zram-generator uses the path to specify the
location of systemd-makefs, so by using the rpm macro we'll be able to use
a much smaller buildroot.
2021-01-15 19:54:43 +00:00
Susant Sahani f4c6fcd766 network: macsec - tighten variable scope used in loop 2021-01-15 20:30:04 +01:00
Susant Sahani 6fa8acfb5a network: generator tighten variable scope used in loop 2021-01-15 20:26:25 +01:00
Lucas Werkmeister d15b1a6c22 man: document that truncate:file happens per command line 2021-01-15 20:22:29 +01:00
Lucas Werkmeister 58b65c6d6d test: fix exec-standardoutput-truncate test
The cmp in ExecStartPost= was actually failing – ExecStartPost= has the
same StandardOutput as the rest of the service, so the output file is
truncated before cmp can compare it with the expected output – but the
test still passed because test_exec_standardoutput_truncate() calls
test(), which only checks the main result, rather than test_service(),
which checks the result of the whole service. Fix the test by merging
the ExecStartPost= into the ExecStart= – the cmp has to be part of the
same command line as the cat so that the file is not truncated between
the two processes.
2021-01-15 20:22:29 +01:00
Frantisek Sumsal 01371e2cd8 ci: migrate to Semaphore CI 2.0 2021-01-15 20:18:29 +01:00
Lennart Poettering 41979f59d3 fs-util: make laccess() macro follow our usual error propagation
Functions defined by us are supposed to return negative errno-style
errors on errors. laccess() is for access() what lstat() is for stat(),
but defined by us as a macro. This led to some confusion regarding error
handling.

Let's return a negative errno code just in case. This means callers can
it use either way: like access(), i.e. checking for a negative return
value + looking at errno, or like our own code, i.e. using the negative
errno code it returns.
2021-01-15 19:14:10 +00:00
Daan De Meyer 064b8e2c99 meson: Use configure_file when version-tag is specified
vcs_tag() is slow. When the version-tag meson option is set,
we can use configure_file() directly to speed up incremental
builds.

Before (with version-tag set to v247):

```
‣ Running build script...
[1/418] Generating version.h with a custom command

real    0m0.521s
user    0m0.229s
sys     0m0.067s
```

After (with version-tag set to v247):

```
‣ Running build script...
ninja: no work to do.

real    0m0.094s
user    0m0.048s
sys     0m0.022s
```
2021-01-15 19:34:44 +01:00
Susant Sahani fb7a534f7f network: nexthop - use TAKE_PTR 2021-01-15 18:55:17 +01:00
Zbigniew Jędrzejewski-Szmek 35b42e5600 src/basic: generate missing syscall headers programatically
Getting the numbers right for all architectures has proven to be a
constant chore. Let's autogenerate the header from the tables that
were imported in one of the previous commits.

Fixes #18074. (Hopefully. I cannot verify this on all architectures.)

To update the lists, or to update the header after template changes:
ninja -C build update-syscall-tables update-syscall-header

Note: the generated file is saved in git. Initially I wanted to only
store the tables in git, and generate the header during each build.
Generation is quick enough, but the header is used in many many
places (wherever missing_syscall.h is included, directly or indirectly),
which means that we would need to declare the dependency in meson, so
the header would be generated early enough. This turned out to be very
noisy. Storing the generated header in version control avoids the hassle.
2021-01-15 18:36:16 +01:00
Zbigniew Jędrzejewski-Szmek 7975857079 tree-wide: use curl --fail
curl will save the 404 response page (or another error) if the page
download fails, which we never want. Let it error out instead.
2021-01-15 18:35:02 +01:00
Zbigniew Jędrzejewski-Szmek cfe01f7e0f syscalls: update tables
$ ninja -C build update-syscall-tables
2021-01-15 18:35:02 +01:00
Zbigniew Jędrzejewski-Szmek 9a6da617db meson: download full syscall tables from hrw/syscalls-table
The target is renamed to 'update-syscall-tables'. (Other targets
with similar names will be added later.)
2021-01-15 18:35:02 +01:00
Zbigniew Jędrzejewski-Szmek e363b0e4fc systemctl: avoid warning about signed-unsigned compare on 32 bits
../src/systemctl/systemctl-list-units.c: In function ‘output_units_list’:
../src/systemctl/systemctl-list-units.c:112:75: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
  112 |         for (const UnitInfo *u = unit_infos; unit_infos && u - unit_infos < c; u++) {
      |                                                                           ^

The pointer difference is signed. I don't know why gcc warns on 32bits, but
not otherwise.

gcc-10.2.1-9.fc33.x86_64, -m32
2021-01-15 18:35:02 +01:00
Gaël PORTAY 3ceb6913c7 man/systemd-veritysetup-generator: fix trailing space 2021-01-15 11:06:11 -05:00
Gaël PORTAY 371c8b5d05 veritysetup: remove unused globals
This removes the three global variables arg_root_hash, arg_data_what and
arg_hash_what which were presents since the beginning but were never
being used.
2021-01-15 11:06:11 -05:00
Gaël PORTAY 08b04ec7e7 veritysetup-generator: add support for veritytab
This adds the support for veritytab.

The veritytab file contains at most five fields, the first four are
mandatory, the last one is optional:
 - The first field contains the name of the resulting verity volume; its
   block device is set up /dev/mapper/</filename>.
 - The second field contains a path to the underlying block data device,
   or a specification of a block device via UUID= followed by the UUID.
 - The third field contains a path to the underlying block hash device,
   or a specification of a block device via UUID= followed by the UUID.
 - The fourth field is the roothash in hexadecimal.
 - The fifth field, if present, is a comma-delimited list of options.
   The following options are recognized only: ignore-corruption,
   restart-on-corruption, panic-on-corruption, ignore-zero-blocks,
   check-at-most-once and root-hash-signature. The others options will
   be implemented later.

Also, this adds support for the new kernel verity command line boolean
option "veritytab" which enables the read for veritytab, and the new
environment variable SYSTEMD_VERITYTAB which sets the path to the file
veritytab to read.
2021-01-15 11:06:11 -05:00
Luca Boccassi bf1868c8d7 Merge pull request #18254 from keszybz/trivial-cleanups
Assorted small cleanups
2021-01-15 14:00:06 +00:00
Susant Sahani 92a74c4744 udevd: Use hashmap_ensure_put 2021-01-15 14:32:22 +01:00
Susant Sahani 4f38ba3889 network: online - use hashmap_ensure_put 2021-01-15 14:32:16 +01:00
Susant Sahani 7a0c0e0e41 network: routing policy rule - Use hashmap_ensure_put 2021-01-15 14:29:42 +01:00
Susant Sahani ecd80ce26c network: route - Use hashmap_ensure_put 2021-01-15 14:29:42 +01:00
Susant Sahani b9eea0a753 network: radv - Use hashmap_ensure_put 2021-01-15 14:29:42 +01:00
Susant Sahani 700661ed75 network: neighbor - use hashmap_ensure_put 2021-01-15 14:29:42 +01:00
Susant Sahani f222165e3d network: mdb - use hashmap_ensure_put 2021-01-15 14:29:42 +01:00
Susant Sahani 190b3b5c30 network: link - use hashmap_ensure_put 2021-01-15 14:29:42 +01:00
Susant Sahani 967d72ed93 network: link - use hashmap_ensure_put 2021-01-15 14:29:42 +01:00
Susant Sahani 03d2d9e18f network: fdb - Use hashmap_ensure_put 2021-01-15 14:29:42 +01:00
Susant Sahani c75165cade network: dhcp6 - use hashmap_ensure_put 2021-01-15 14:29:42 +01:00
Susant Sahani fb8ac4cf3e network: address label - use hashmap_ensure_put 2021-01-15 14:29:42 +01:00
Susant Sahani b77071b898 network: wireguard - Use hashmap_ensure_put 2021-01-15 14:29:42 +01:00