Commit Graph
5701 Commits
Author SHA1 Message Date
Kevin Kuehler fc169a6fb2 basic/openssl-util: Add sha256 hash wrapper 2021-12-01 12:36:57 +01:00
Zbigniew Jędrzejewski-Szmek 57633d2376 meson: add config setting to select between openssl and gcrypt
This is not pretty, but it is supposed to be only a temporary measure.
2021-11-30 23:00:21 +01:00
Yu Watanabe b224530f5f Merge pull request #21559 from jcg190701/main
fix ConditionDirectoryNotEmpty when it comes to a Non-directory file
2021-11-30 22:34:21 +09:00
Yu Watanabe a6f44d610c tree-wide: fix typo 2021-11-30 12:30:07 +00:00
jiangchuangang 7c4c9948d0 fix ConditionPathIsReadWrite when path does not exist. 2021-11-30 16:47:54 +08:00
jiangchuangang 193105f2d0 fix ConditionDirectoryNotEmpty when it comes to a Non-directory file 2021-11-30 09:16:15 +08:00
Yu Watanabe b89931ba28 json: make JSON_BUILD_PAIR_IN_ADDR_NON_NULL or friends handle NULL gracefully
Fixes #21567.
2021-11-30 10:03:51 +09:00
Zbigniew Jędrzejewski-Szmek 8fb444011e Merge pull request #21534 from yuwata/udev-accept-longer-hw-address
udev/net: accept longer HW address
2021-11-29 14:00:52 +01:00
Yu Watanabe 613701a4e8 udev/net: introduce "struct Link" to store link attributes 2021-11-26 21:06:24 +09:00
Yu Watanabe 4bd2c4e8e0 netif-util: update log message
Follow-up for 37593b7c48.
2021-11-26 21:05:52 +09:00
Zbigniew Jędrzejewski-Szmek 993eeea0ef Merge pull request #21501 from medhefgo/test
test: Use TEST macro
2021-11-26 12:23:18 +01:00
Zbigniew Jędrzejewski-Szmek 66a8eddd6d Merge pull request #21360 from yuwata/network-json
network: json: add more information
2021-11-26 11:04:52 +01:00
Luca Boccassi 485c9e19e7 Merge pull request #21253 from poettering/homed-auto-grow-shrink
homed: automatic grow/shrink of LUKS home dirs
2021-11-25 22:14:17 +00:00
Zbigniew Jędrzejewski-Szmek 55a044dece Merge pull request #21517 from yuwata/network-long-hw-addr
network: make MACAddress= can take longer address
2021-11-25 20:21:38 +01:00
Yu Watanabe 5213507113 network,udev: make .network and .link file can match with hardware address longer or shorter than ETH_ALEN 2021-11-25 20:14:46 +01:00
Lennart Poettering d357b80d33 homed: add automatic grow/shrink ("rebalancing") 2021-11-25 18:28:44 +01:00
Lennart Poettering 9aa3e5ebdf user-record: add rebalanceWeight field 2021-11-25 18:28:44 +01:00
Lennart Poettering 7ff048a718 Merge pull request #21487 from DaanDeMeyer/dissect-image-other-arch
Allow dissect_image() to dissect images from architectures other than the native one
2021-11-25 17:36:57 +01:00
Jan Janssen a40b728e11 test: Slightly rework DEFINE_TEST_MAIN macros
- A lot of tests want a different log level
- Provides saved_argc/saved_argv to tests
- Separate intro/outro is more flexible
2021-11-25 14:56:33 +01:00
Yu Watanabe 7314084aa4 json: introduce several macros for building json object 2021-11-25 22:35:30 +09:00
Lennart Poettering 0cdf6b14a5 json: add new JSON_BUILD_CONST_STRING() macro
This macro is like JSON_BUILD_STRING() but uses our json library's
ability to use literal strings directly as JsonVariant objects.

The changes all our codebase to use this new macro whenever we build
JSON objects from literal strings.

(I tried to make this automatic, i.e. to detect in JSON_BUILD_STRING()
whether something is a literal string nicely and thus do this stuff
automatically, but I couldn't find a way.)

This should reduce memory usage of our JSON code a bit. Constant strings
we use very often will now be shared and mapped directly from the ELF
image.
2021-11-25 14:22:31 +01:00
Lennart Poettering e2c7efd329 json: don't assert() if we add a NULL element via json_variant_set_field()
The rest of our JSON code tries hard to magically convert NULL inputs
into "null" JSON objects, let's make sure this also works with
json_variant_set_field().
2021-11-25 14:21:54 +01:00
Yu Watanabe 37593b7c48 netif-util: introduce net_verify_hardware_address() 2021-11-25 21:07:32 +09:00
Lennart Poettering 4dc07c3a9a repart,homed: split out disk cleanup macros into generic header 2021-11-25 12:10:34 +01:00
Yu Watanabe c8e16339f1 Merge pull request #21503 from poettering/ioprio-fix
work around linux 5.15 ioprio API breakage
2021-11-25 14:23:02 +09:00
Dominique Martinet 7a8288f6ed build: fix build without seccomp
- execute.c: bpf functions were in the middle of an #if HAVE_SECCOMP
  block for no reason
- test-fd-util.c: make seccomp-util.h includable without depending on
  <seccomp.h>, and make is_seccomp_available() hardcoded to returning
  false in this case.
  Also fix a stray DEFINED() -- HAVE_SECCOMP is defined as 0, so normal
  #if should be used like everywhere else.
2021-11-25 13:22:32 +09:00
Zbigniew Jędrzejewski-Szmek f6048e5e56 dissect-image: always say "file of image" when reporting about the image
We give a path, but the path is only meaningful inside of the image.
Some messages made it clear that it's a path in the image, let's make
them all do that.
2021-11-24 17:43:01 +01:00
Zbigniew Jędrzejewski-Szmek 48084df6ed dissect-image: provide a more useful message when ENOMEDIUM is returned 2021-11-24 17:43:01 +01:00
Zbigniew Jędrzejewski-Szmek 2284750820 dissect-image: do not enable "verification" when trying to acquire metadata
The whole point of acquiring metadata is quite often to figure out why the
image does not pass verification. Refusing to provide metadata is just being
hostile to the user.

When called from other places (e.g. image_read_metadata()), verification is
still performed.
2021-11-24 17:42:19 +01:00
Lennart Poettering 032b3afbf4 shared: split out ioprio related stuff into ioprio-util.[ch]
No actual code changes, just some splitting out.
2021-11-24 16:12:15 +01:00
Zbigniew Jędrzejewski-Szmek 03ae68f419 dissect-image: reuse common exit path 2021-11-24 15:55:58 +01:00
Zbigniew Jędrzejewski-Szmek 73c2c5255d shared/format-table: drop unnecessary _cleanup_ 2021-11-24 15:55:58 +01:00
Daan De Meyer 49ae9d91f9 shared: Add support for non-native architectures to dissect_image()
To allow dissecting images of architectures other than the native
(or secondary) one, we add a third designator 'OTHER' to represent
architectures other than the native or secondary one.

If no partitions of the native or secondary arch are available, we
check if a root partition of any other arch is available and use that
instead if we found one.
2021-11-24 15:06:38 +01:00
Daan De Meyer 6ddd80ae18 gpt: Store the partition type in GptPartitionType
This replaces the _GPT_ALL_ARCHES macro.
2021-11-24 14:47:57 +01:00
Daan De Meyer 51d1c8f2fe gpt: Store the architecture in GptPartitionType
We also add a function gpt_partition_type_uuid_to_arch() to get the
architecture of a partition type uuid.
2021-11-24 14:47:21 +01:00
Daan De Meyer 3c58ae1313 basic: Rename SECONDARY_ARCHITECTURE to ARCHITECTURE_SECONDARY
For easier integration with the _GPT_ALL_ARCHES macro in a future
commit.
2021-11-24 12:00:41 +01:00
Daan De Meyer 6d4c80ddbb gpt: Rename PPC64LE TO PPC64_LE
For consistency with ARCHITECTURE_PPC64_LE
2021-11-24 12:00:41 +01:00
Lennart Poettering 60c5f7002b extension-release.d/: add a new field SYSEXT_SCOPE= for clarifying what a system extension is for
This should make things a bit more robust since it ensures system
extension can only applied to the right environments. Right now three
different "scopes" are defined:

1. "system" (for regular OS systems, after the initrd transition)
2. "initrd" (for sysext images that apply to the initrd environment)
3. "portable" (for sysext images that apply to portable images)

If not specified we imply a default of "system portable", i.e. any image
where the field is not specified is implicitly OK for application to OS
images and for portable services – but not for initrds.
2021-11-23 22:55:11 +01:00
Lennart Poettering a4e0d61713 dissect-image: when extracting metadata from image also check if it contains init system
It's good to know whether we can boot the image.
2021-11-23 22:55:11 +01:00
Lennart Poettering 3131c24bd6 pretty-print: add helper for quickly outputting red/green cross/check marks
Compound constructors FTW!
2021-11-23 22:40:15 +01:00
Lennart Poettering 383c6f41e8 Merge pull request #21479 from keszybz/cosmetic-initialization-adjustments
Cosmetic initialization adjustments
2021-11-23 18:42:45 +01:00
Zbigniew Jędrzejewski-Szmek b2d781ec86 shared/format-table: add cosmetic initialization
p is unconditionally initialized below, but our coding style says that
initialization should be added anyway.
2021-11-23 16:20:14 +01:00
Lennart Poettering 244cab4a65 Merge pull request #21443 from poettering/homed-grow-shrink-on-login-logout
homed: add ability to auto-grow home dir in login and auto-shrink on logout (if luks2+btrfs is used)
2021-11-23 13:13:06 +01:00
Andrew Stone 7c5cef2211 core/automount: Add ExtraOptions field 2021-11-23 09:44:35 +01:00
Lennart Poettering 8bec643c8f user-record: add auto-resize property 2021-11-23 08:04:10 +01:00
Lennart Poettering a8d0906344 resolved: add "proxy-only" stub on 127.0.0.54
This beefs up the DNS stub logic to listen on two IP addresses:
127.0.0.53 (as before) + 127.0.0.54 (new). When the latter is contact
our stub will operate in "bypass" mode only, i.e we'll try to pass DNS
requests as unmodified upstream as we can (and not do mDNS/LLMNR and
such, also no DNSSEC validation – but we'll still do DNS-over-TLS
wrapping).

This is supposed to be useful for container environments or tethering:
this stub could be exposed (via NAT redirect) to clients of this system
and we'll try to stay out of the way with doing too much DNS magic
ourselves, but still expose whatever the current DNS server is from
upstream under a stable address/port.

How to use this:

  # iptables -t nat -I PREROUTING -p udp -i <interface> --dport 53 -j DNAT --to 127.0.0.54:53
  # echo 1 > /proc/sys/net/ipv4/conf/<interface>/route_localnet
2021-11-22 22:33:24 +01:00
Lennart Poettering 494876ce38 Merge pull request #21425 from keszybz/ppc64-fixes
Add base-filesystem defines for arm64/ppc64el/riscv64 and make build quiet again
2021-11-22 10:10:05 +01:00
Zbigniew Jędrzejewski-Szmek 0895e87348 analyze: fix printing config when there is no main config file
Since 8b8024f1c2 and the follow-up commits, the
main config file may be located in /usr or in other paths. But the code in
analyze.c was still assuming that it must be in /etc. Things mostly worked for
our own config files because we usually install a comments-only file in /etc,
but was not correct in the general case.

This fixes in particular 'systemd-analyze cat-config systemd/zram-generator.conf'.
In Fedora we distribute a config file in zram-generator-defaults.rpm that is in
/usr/lib, and 'cat-config' would refuse to show it because
/etc/systemd/zram-generator.conf does not exist.

The main config file is optional, but let's print an informative message
because this is a slightly unusual case.

The file paths that we printed were missing the root prefix.
2021-11-21 12:10:51 +00:00
Zbigniew Jędrzejewski-Szmek a965a3191e shared/base-filesystem: use LIB_ARCH_TUPLE instead of string 2021-11-19 18:49:46 +01:00
Zbigniew Jędrzejewski-Szmek 91f658cc03 shared/gpt: fix bit-flip in LoongArch root partition UUID
4e76715489 added a slightly different UUID
in the header and in the docs. This makes the code match the docs.

> As some downstream projects are already using the UUID as in the docs, most
> notably util-linux [1], we should adjust code to match doc; no shipping
> LoongArch systems are using upstream systemd, and no open-source distro is
> merging LoongArch support yet, so the change should break no one. This also
> matches the work being done by @yetist at loongarch64/systemd#7.

[1] https://github.com/util-linux/util-linux/commit/2d29fccaad267d1b003dc0ed2bb9634ff76f3e49
2021-11-19 18:49:46 +01:00