]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 years agoupdate-dbus-docs: use argparse
Zbigniew Jędrzejewski-Szmek [Thu, 27 Aug 2020 17:27:18 +0000 (19:27 +0200)] 
update-dbus-docs: use argparse

5 years agoupdate-dbus-docs: print statistics at the end
Zbigniew Jędrzejewski-Szmek [Thu, 27 Aug 2020 17:21:21 +0000 (19:21 +0200)] 
update-dbus-docs: print statistics at the end

Right now:
org.freedesktop.LogControl1.xml: 3/3
org.freedesktop.home1.xml:       44/44
org.freedesktop.hostname1.xml:   21/21
org.freedesktop.import1.xml:     17/19
org.freedesktop.locale1.xml:     10/10
org.freedesktop.login1.xml:      172/172
org.freedesktop.machine1.xml:    49/65
org.freedesktop.resolve1.xml:    25/61
org.freedesktop.systemd1.xml:    214/1468
org.freedesktop.timedate1.xml:   12/12
total:                           567/1875

:(

5 years agobasic/missing_capability: clean up our defines and check that our fallback is up...
Zbigniew Jędrzejewski-Szmek [Thu, 27 Aug 2020 16:22:45 +0000 (18:22 +0200)] 
basic/missing_capability: clean up our defines and check that our fallback is up-to-date

There is little point in #defining and #undefining CAP_LAST_CAP multiple times.

The check is only done in developer mode. After all, it's not an error to
compile on a newer kernel, and we shouldn't even warn in that case.

5 years agomeson: add "develop mode" config switch
Zbigniew Jędrzejewski-Szmek [Thu, 27 Aug 2020 15:26:49 +0000 (17:26 +0200)] 
meson: add "develop mode" config switch

5 years agotest-path: remove unnecessary check
Zbigniew Jędrzejewski-Szmek [Thu, 27 Aug 2020 07:58:58 +0000 (09:58 +0200)] 
test-path: remove unnecessary check

test points to an array, so it canont be NULL at this point.

5 years agoMerge pull request #16864 from yuwata/coverity-fixes
Lennart Poettering [Thu, 27 Aug 2020 14:36:40 +0000 (16:36 +0200)] 
Merge pull request #16864 from yuwata/coverity-fixes

Two coverity fixes

5 years agoMerge pull request #16866 from yuwata/networkctl-tiny-cleanups
Lennart Poettering [Thu, 27 Aug 2020 14:34:43 +0000 (16:34 +0200)] 
Merge pull request #16866 from yuwata/networkctl-tiny-cleanups

networkctl: tiny cleanups

5 years agomissing: Add new Linux capability
Michal Koutný [Wed, 26 Aug 2020 13:37:21 +0000 (15:37 +0200)] 
missing: Add new Linux capability

Yet another new capability coming in Linux kernel v5.9.
Make sure we can recongize them even when built with older kernel headers.

5 years agotest: remove executable bit from testsuite-52.service
Michael Biebl [Thu, 27 Aug 2020 10:09:08 +0000 (12:09 +0200)] 
test: remove executable bit from testsuite-52.service

5 years agojournal: fix divide-by-zero warning 16864/head
Yu Watanabe [Thu, 27 Aug 2020 05:02:33 +0000 (14:02 +0900)] 
journal: fix divide-by-zero warning

Fixes CID#1430209.

5 years agocore: clear bind mounts on error
Yu Watanabe [Thu, 27 Aug 2020 04:49:21 +0000 (13:49 +0900)] 
core: clear bind mounts on error

Follow-up for bbb4e7f39f2c68c719c26c2c65f8b7b91b009e92.

Fixes CID#1431998.

5 years agoMerge pull request #16860 from poettering/tty-ask-pw-agent-list-fix
Zbigniew Jędrzejewski-Szmek [Thu, 27 Aug 2020 08:58:13 +0000 (10:58 +0200)] 
Merge pull request #16860 from poettering/tty-ask-pw-agent-list-fix

tty-ask-password-agent: three fixes

5 years agoAdd sensor configuration for Acer SW5-017-17BU
Njibhu [Wed, 26 Aug 2020 23:46:30 +0000 (01:46 +0200)] 
Add sensor configuration for Acer SW5-017-17BU

5 years agoMerge pull request #16847 from olivierlemoal/master
Zbigniew Jędrzejewski-Szmek [Thu, 27 Aug 2020 08:27:01 +0000 (10:27 +0200)] 
Merge pull request #16847 from olivierlemoal/master

shell-completion/zsh: add missing verbs for networkctl

5 years agoadd "list" verb to autocompleted commands 16847/head
Olivier Le Moal [Thu, 27 Aug 2020 08:01:36 +0000 (10:01 +0200)] 
add "list" verb to autocompleted commands

5 years agoman: clarify that several networkctl commands takes device names 16866/head
Yu Watanabe [Thu, 27 Aug 2020 07:35:25 +0000 (16:35 +0900)] 
man: clarify that several networkctl commands takes device names

5 years agonetworkctl: label command does not take any argument
Yu Watanabe [Thu, 27 Aug 2020 07:32:13 +0000 (16:32 +0900)] 
networkctl: label command does not take any argument

5 years agoudev: use path_startswith() instead of startswith() in two more cases
Lennart Poettering [Wed, 26 Aug 2020 15:22:06 +0000 (17:22 +0200)] 
udev: use path_startswith() instead of startswith() in two more cases

5 years agoReplace gendered pronouns with gender neutral ones. (#16844)
PhoenixDiscord [Thu, 27 Aug 2020 02:52:48 +0000 (04:52 +0200)] 
Replace gendered pronouns with gender neutral ones. (#16844)

5 years agopath: Improve $PATH search directory case
Chris Down [Wed, 26 Aug 2020 17:49:27 +0000 (18:49 +0100)] 
path: Improve $PATH search directory case

Previously:

1. last_error wouldn't be updated with errors from is_dir;
2. We'd always issue a stat(), even for binaries without execute;
3. We used stat() instead of access(), which is cheaper.

This change avoids all of those, by only checking inside X_OK-positive
case whether access() works on the path with an extra slash appended.
Thanks to Lennart for the suggestion.

5 years agotty-ask-pw-agent: properly propagate error 16860/head
Lennart Poettering [Wed, 26 Aug 2020 21:10:50 +0000 (23:10 +0200)] 
tty-ask-pw-agent: properly propagate error

5 years agotty-ask-pw-agent: the message string might not be set
Lennart Poettering [Wed, 26 Aug 2020 21:05:46 +0000 (23:05 +0200)] 
tty-ask-pw-agent: the message string might not be set

5 years agotty-ask-pw-agent: make sure "--list" works correctly
Lennart Poettering [Wed, 26 Aug 2020 21:02:13 +0000 (23:02 +0200)] 
tty-ask-pw-agent: make sure "--list" works correctly

Fixes: #16836
5 years agoMerge pull request #16757 from poettering/nss-resolve-varlink
Zbigniew Jędrzejewski-Szmek [Wed, 26 Aug 2020 20:07:34 +0000 (22:07 +0200)] 
Merge pull request #16757 from poettering/nss-resolve-varlink

resolved: use varlink for communication between nss-resolve and resolved

5 years agonss-resolve: port over to new varlink interface 16757/head
Lennart Poettering [Sun, 16 Aug 2020 17:05:37 +0000 (19:05 +0200)] 
nss-resolve: port over to new varlink interface

5 years agoresolved: add minimal varlink api for resolving hostnames/addresses
Lennart Poettering [Sun, 16 Aug 2020 11:45:55 +0000 (13:45 +0200)] 
resolved: add minimal varlink api for resolving hostnames/addresses

This allows us to later port nss-resolve to use Varlink rather than
D-Bus for resolution. This has the benefit that nss-resolve based
resoluton works even without D-Bus being up. And it's faster too.

5 years agoresolved: minor clean-ups for resolved-bus.c
Lennart Poettering [Sun, 16 Aug 2020 12:36:20 +0000 (14:36 +0200)] 
resolved: minor clean-ups for resolved-bus.c

5 years agoresolved: move query bus tracking to resolved-bus.c
Lennart Poettering [Sun, 16 Aug 2020 11:43:51 +0000 (13:43 +0200)] 
resolved: move query bus tracking to resolved-bus.c

It's strictly bus-specific, hence let's move this to resolved-bus.c like
the rest of the bus specific logic.

This is also in preparation for adding an alternative varlink transport,
which needs similar functionality, but varlink instead of bus-specific.

5 years agoresolved: rename request → bus_request
Lennart Poettering [Sun, 16 Aug 2020 09:29:55 +0000 (11:29 +0200)] 
resolved: rename request → bus_request

Let's prepare for adding a new varlink interface, and thus rename the
"request" field to "bus_request", so that we can later add a
varlink_request field too.

5 years agoresolved: drop suppress_unroutable_family field
Lennart Poettering [Sun, 16 Aug 2020 11:35:14 +0000 (13:35 +0200)] 
resolved: drop suppress_unroutable_family field

It's unused since 90bdc8be66765df09bbc355783cee7204a5ebb31.

5 years agojson: also add explicit dispatchers for 'int' and 'unsigned'
Lennart Poettering [Mon, 17 Aug 2020 06:53:05 +0000 (08:53 +0200)] 
json: also add explicit dispatchers for 'int' and 'unsigned'

5 years agojson: add support for byte arrays to json builder
Lennart Poettering [Sun, 16 Aug 2020 12:34:38 +0000 (14:34 +0200)] 
json: add support for byte arrays to json builder

5 years agovarlink: add helper for generating errno errors
Lennart Poettering [Sun, 16 Aug 2020 11:45:25 +0000 (13:45 +0200)] 
varlink: add helper for generating errno errors

5 years agoin-addr-util: add byte accessor array to union in_addr_union
Lennart Poettering [Sun, 16 Aug 2020 09:28:34 +0000 (11:28 +0200)] 
in-addr-util: add byte accessor array to union in_addr_union

It's pretty useful to be able to access the bytes generically, without
acknowledging a specific family, hence let's a third way to access an
in_addr_union.

5 years agoshell-completion/zsh: add missing verbs for networkctl
Olivier Le Moal [Wed, 26 Aug 2020 14:03:35 +0000 (16:03 +0200)] 
shell-completion/zsh: add missing verbs for networkctl

5 years agoMerge pull request #16568 from poettering/creds-store
Zbigniew Jędrzejewski-Szmek [Wed, 26 Aug 2020 08:32:30 +0000 (10:32 +0200)] 
Merge pull request #16568 from poettering/creds-store

credentials logic to pass privileged data to services

5 years agopath: Skip directories when finalising $PATH search
Chris Down [Tue, 25 Aug 2020 20:59:11 +0000 (21:59 +0100)] 
path: Skip directories when finalising $PATH search

Imagine $PATH /a:/b. There is an echo command at /b/echo. Under this
configuration, this works fine:

    % systemd-run --user --scope echo .
    Running scope as unit: run-rfe98e0574b424d63a641644af511ff30.scope
    .

However, if I do `mkdir /a/echo`, this happens:

    % systemd-run --user --scope echo .
    Running scope as unit: run-rcbe9369537ed47f282ee12ce9f692046.scope
    Failed to execute: Permission denied

We check whether the resulting file is executable for the performing
user, but of course, most directories are anyway, since that's needed to
list within it. As such, another is_dir() check is needed prior to
considering the search result final.

Another approach might be to check S_ISREG, but there may be more gnarly
edge cases there than just eliminating this obviously pathological
example, so let's just do this for now.

5 years agosd-journal: narrow scope of boot id variable
Vito Caputo [Tue, 25 Aug 2020 18:56:27 +0000 (11:56 -0700)] 
sd-journal: narrow scope of boot id variable

Something trivial I noticed during some unrelated code spelunking

5 years agoMerge pull request #16765 from poettering/homed-recovery
Lennart Poettering [Tue, 25 Aug 2020 20:01:40 +0000 (22:01 +0200)] 
Merge pull request #16765 from poettering/homed-recovery

homed: add "recovery key" concept plus track "dirty" state of LUKS volumes

5 years agoupdate TODO 16568/head
Lennart Poettering [Thu, 23 Jul 2020 06:46:43 +0000 (08:46 +0200)] 
update TODO

5 years agotest: add test suite for new credentials logic
Lennart Poettering [Tue, 11 Aug 2020 15:08:41 +0000 (17:08 +0200)] 
test: add test suite for new credentials logic

5 years agoman: document credentials passing in the container interface
Lennart Poettering [Tue, 28 Jul 2020 07:10:18 +0000 (09:10 +0200)] 
man: document credentials passing in the container interface

5 years agoman: document nspawn's new credential switches
Lennart Poettering [Thu, 23 Jul 2020 15:43:18 +0000 (17:43 +0200)] 
man: document nspawn's new credential switches

5 years agoman: document pid1's new credentials logic
Lennart Poettering [Thu, 23 Jul 2020 16:05:54 +0000 (18:05 +0200)] 
man: document pid1's new credentials logic

5 years agonspawn: add --set-credential= and --load-credential=
Lennart Poettering [Thu, 23 Jul 2020 06:47:08 +0000 (08:47 +0200)] 
nspawn: add --set-credential= and --load-credential=

Let's allow passing in creds to containers, so that PID 1 inside the
container can pick them up.

5 years agocore: hide /run/credentials whenever namespacing is requested
Lennart Poettering [Fri, 14 Aug 2020 13:54:48 +0000 (15:54 +0200)] 
core: hide /run/credentials whenever namespacing is requested

Ideally we would like to hide all other service's credentials for all
services. That would imply for us to enable mount namespacing for all
services, which is something we cannot do, both due to compatibility
with the status quo ante, and because a number of services legitimately
should be able to install mounts in the host hierarchy.

Hence we do the second best thing, we hide the credentials automatically
for all services that opt into mount namespacing otherwise. This is
quite different from other mount sandboxing options: usually you have to
explicitly opt into each. However, given that the credentials logic is a
brand new concept we invented right here and now, and particularly
security sensitive it's OK to reverse this, and by default hide
credentials whenever we can (i.e. whenever mount namespacing is
otherwise opt-ed in to).

Long story short: if you want to hide other service's credentials, the
most basic options is to just turn on PrivateMounts= and there you go,
they should all be gone.

5 years agocore: add credentials logic
Lennart Poettering [Thu, 23 Jul 2020 06:49:52 +0000 (08:49 +0200)] 
core: add credentials logic

Fixes: #15778 #16060
5 years agoacl-util: beef up add_acls_for_user()
Lennart Poettering [Tue, 21 Jul 2020 20:14:57 +0000 (22:14 +0200)] 
acl-util: beef up add_acls_for_user()

Let's add support for controlling r/w/x bits separetely. This is useful
for using it to control access to directories, where r + x shall be
enabled.

5 years agoacl-util: make sure acl_find_uid() initializes return parameters on success
Lennart Poettering [Tue, 21 Jul 2020 20:13:12 +0000 (22:13 +0200)] 
acl-util: make sure acl_find_uid() initializes return parameters on success

Let's follow our usual coding style and initialize return parameters on
success in all cases.

5 years agorm-rf: add new flag REMOVE_CHMOD
Lennart Poettering [Thu, 23 Jul 2020 13:24:54 +0000 (15:24 +0200)] 
rm-rf: add new flag REMOVE_CHMOD

When removing a directory tree as unprivileged user we might encounter
files owned by us but not deletable since the containing directory might
have the "r" bit missing in its access mode. Let's try to deal with
this: optionally if we get EACCES try to set the bit and see if it works
then.

5 years agoupdate TODO 16765/head
Lennart Poettering [Mon, 17 Aug 2020 17:46:14 +0000 (19:46 +0200)] 
update TODO

5 years agohomed: report a home directory as "dirty" if image file has dirty flag
Lennart Poettering [Mon, 17 Aug 2020 20:08:29 +0000 (22:08 +0200)] 
homed: report a home directory as "dirty" if image file has dirty flag

5 years agohomed: mark LUKS loopback file as "dirty" via xattr when in use
Lennart Poettering [Mon, 17 Aug 2020 18:37:04 +0000 (20:37 +0200)] 
homed: mark LUKS loopback file as "dirty" via xattr when in use

Let's track the "dirty" state of a home directory backed by a LUKS
volume by setting a new xattr "home.home-dirty" on the backing file
whenever it is in use.

This allows us to later user this information to show a home directory
as "dirty". This is useful because we trim/allocate on log-out, and
if we don't do that a home directory will be larger than necessary. This
fact is something we should communicate to the admin.

The idea is that when an admin sees a user with a "dirty" home directory
they can ask them to log in, to clean up the dirty state, and thus trim
everything again.

5 years agoman: document new homectl --recovery-key= switch
Lennart Poettering [Tue, 18 Aug 2020 07:33:10 +0000 (09:33 +0200)] 
man: document new homectl --recovery-key= switch

5 years agodocs: document new recovery key user record fields
Lennart Poettering [Tue, 18 Aug 2020 07:28:54 +0000 (09:28 +0200)] 
docs: document new recovery key user record fields

5 years agohomectl: teach homectl to generate recovery keys
Lennart Poettering [Mon, 17 Aug 2020 13:51:17 +0000 (15:51 +0200)] 
homectl: teach homectl to generate recovery keys

5 years agohomed: support recovery keys
Lennart Poettering [Mon, 17 Aug 2020 16:19:13 +0000 (18:19 +0200)] 
homed: support recovery keys

For discussion around this see: https://pagure.io/fedora-workstation/issue/82

Recovery keys for homed are very similar to regular passwords, except
that they are exclusively generated by the computer, and not chosen by
the user. The idea is that they are printed or otherwise stored
externally and not what users type in every day.

Taking inspiration from Windows and MacOS this uses 256bit keys. We
format them in 64 yubikey modhex characters, in groups of 8 chars
separated by dashes.

Why yubikey modhex? modhex only uses characters that are are located at
the same place in western keyboard designs. This should reduce the
chance for incorrect inputs for a major chunk of our users, though
certainly not all. This is particular relevant during early boot and
recovery situations, where there's a good chance the keyboard mapping is
not correctly set up.

5 years agohome: add helper to process/normalize modhex64 recovery keys
Lennart Poettering [Mon, 17 Aug 2020 16:18:00 +0000 (18:18 +0200)] 
home: add helper to process/normalize modhex64 recovery keys

5 years agojournal: move qrcode printing code to src/shared/
Lennart Poettering [Mon, 17 Aug 2020 13:59:00 +0000 (15:59 +0200)] 
journal: move qrcode printing code to src/shared/

That way we can make use of it in homctl, too.

5 years agouser-record: add recovery key fields to user record
Lennart Poettering [Mon, 17 Aug 2020 12:28:14 +0000 (14:28 +0200)] 
user-record: add recovery key fields to user record

5 years agoMerge pull request #15662 from Werkov/fix-cgroup-disable
Lennart Poettering [Tue, 25 Aug 2020 15:36:07 +0000 (17:36 +0200)] 
Merge pull request #15662 from Werkov/fix-cgroup-disable

Fix unsetting cgroup restrictions

5 years agoAdded sensor configuration for One-netbook OneMix 3 Pro
Andrew Hangsleben [Tue, 25 Aug 2020 03:08:08 +0000 (22:08 -0500)] 
Added sensor configuration for One-netbook OneMix 3 Pro

5 years agoMerge pull request #16833 from JackFangXN/master
Lennart Poettering [Tue, 25 Aug 2020 11:20:11 +0000 (13:20 +0200)] 
Merge pull request #16833 from JackFangXN/master

analyze-verify: drop pointless zero initialization

5 years agoMerge pull request #16676 from poettering/repart-mkfs
Zbigniew Jędrzejewski-Szmek [Tue, 25 Aug 2020 10:19:46 +0000 (12:19 +0200)] 
Merge pull request #16676 from poettering/repart-mkfs

repart: add new settings Format=, CopyFiles=, Encrypt= and teach --size= a new value "auto"

5 years agorules: don't install 80-drivers.rules when kmod is disabled
Alec Moskvin [Sat, 1 Aug 2020 13:25:05 +0000 (09:25 -0400)] 
rules: don't install 80-drivers.rules when kmod is disabled

5 years agoMerge pull request #16777 from DaanDeMeyer/kernel-install-followup
Zbigniew Jędrzejewski-Szmek [Tue, 25 Aug 2020 07:30:44 +0000 (09:30 +0200)] 
Merge pull request #16777 from DaanDeMeyer/kernel-install-followup

kernel-install: "Linux" => "Default" and reuse $BOOT/Default if it already exists

5 years agozsh: correct journalctl command completion parsing
Ronan Pigott [Tue, 25 Aug 2020 02:33:37 +0000 (19:33 -0700)] 
zsh: correct journalctl command completion parsing

5 years agoMerge pull request #16767 from keszybz/missing-syscall-cleanup
Zbigniew Jędrzejewski-Szmek [Tue, 25 Aug 2020 07:21:32 +0000 (09:21 +0200)] 
Merge pull request #16767 from keszybz/missing-syscall-cleanup

missing_syscall: verify our fallback numbers when possible

5 years agoMerge pull request #16816 from keszybz/install-templated-presets
Zbigniew Jędrzejewski-Szmek [Tue, 25 Aug 2020 07:20:07 +0000 (09:20 +0200)] 
Merge pull request #16816 from keszybz/install-templated-presets

Fix preset operation for non-service templates

5 years agoMerge pull request #16819 from keszybz/seccomp-enosys
Zbigniew Jędrzejewski-Szmek [Tue, 25 Aug 2020 07:18:46 +0000 (09:18 +0200)] 
Merge pull request #16819 from keszybz/seccomp-enosys

Return ENOSYS in nspawn for "unknown" syscalls

5 years agoanalyze: drop pointless zero initialization 16833/head
fangxiuning [Tue, 25 Aug 2020 07:17:52 +0000 (15:17 +0800)] 
analyze: drop pointless zero initialization

5 years agoMerge pull request #16824 from keszybz/no-such-unit-error
Zbigniew Jędrzejewski-Szmek [Tue, 25 Aug 2020 07:16:25 +0000 (09:16 +0200)] 
Merge pull request #16824 from keszybz/no-such-unit-error

Add sd_bus_error_has_names() and use it to catch BUS_ERROR_NO_SUCH_UNIT

5 years agoanalyze-verify: drop pointless zero initialization
fangxiuning [Tue, 25 Aug 2020 07:10:15 +0000 (15:10 +0800)] 
analyze-verify: drop pointless zero initialization

5 years agocore: drop redundant comment
Lennart Poettering [Mon, 24 Aug 2020 18:03:49 +0000 (20:03 +0200)] 
core: drop redundant comment

Since 625a164069aff9efb61dcc5916c572f53c2a7ab0 we don't need to update
analyze-condition.c separately anymore, hence drop the comment
suggesting otherwise.

5 years agoMerge pull request #16681 from poettering/hidepid
Lennart Poettering [Tue, 25 Aug 2020 05:47:05 +0000 (07:47 +0200)] 
Merge pull request #16681 from poettering/hidepid

core: introduce ProtectProc= unit file setting for exposing procfs' hidepid= mount option

5 years agoloop-util: LOOP_CONFIGURE ignores lo_sizelimit 16676/head
Lennart Poettering [Mon, 24 Aug 2020 16:11:06 +0000 (18:11 +0200)] 
loop-util: LOOP_CONFIGURE ignores lo_sizelimit

It appears LOOP_CONFIGURE in 5.8 is even more broken than initially
thought: it doesn't properly propgate lo_sizelimit to the block device
layer. :-(

Let's hence check the block device size immediately after issuing
LOOP_CONFIGURE, and if it doesn't match what we just set let's fallback
to the old ioctls.

This means LOOP_CONFIGURE currently works correctly only for the most
simply case: no partition table logic and no size limit. Sad!

(Kernel people should really be told about the concepts of tests and
even CI, one day!)

5 years agoupdate TODO
Lennart Poettering [Tue, 4 Aug 2020 06:56:54 +0000 (08:56 +0200)] 
update TODO

5 years agoman: document new repart features
Lennart Poettering [Wed, 5 Aug 2020 15:53:39 +0000 (17:53 +0200)] 
man: document new repart features

5 years agotest: add test for new repart features
Lennart Poettering [Wed, 5 Aug 2020 16:52:12 +0000 (18:52 +0200)] 
test: add test for new repart features

5 years agorepart: if --size= is specified as "auto" determine minimal size for disk image
Lennart Poettering [Wed, 5 Aug 2020 14:59:27 +0000 (16:59 +0200)] 
repart: if --size= is specified as "auto" determine minimal size for disk image

When assembling a disk image locally, using --size=auto can be used to
generate the minimal image based on the provided definitions. THis is
useful to prepare images that are grown on first boot.

5 years agorepart: add support for optionally encrypting partitions we create
Lennart Poettering [Tue, 4 Aug 2020 06:57:29 +0000 (08:57 +0200)] 
repart: add support for optionally encrypting partitions we create

5 years agorepart: add new CopyFiles= setting, for copying files into freshly made file systems
Lennart Poettering [Mon, 3 Aug 2020 10:34:40 +0000 (12:34 +0200)] 
repart: add new CopyFiles= setting, for copying files into freshly made file systems

This makes the tool a lot more useful for streaming OS images onto
disks.

5 years agodissect: create directories we want to mount on
Lennart Poettering [Mon, 3 Aug 2020 10:30:42 +0000 (12:30 +0200)] 
dissect: create directories we want to mount on

This matches how we handle things everywhere else, i.e. in .mount units,
and similar: when a mount point dir is missing, we create it, let's do
so too when dealing with disk images.

This makes things a lot simpler, more robust, and systematic.

5 years agorepart: wipe partition first, then discard
Lennart Poettering [Thu, 30 Jul 2020 20:22:21 +0000 (22:22 +0200)] 
repart: wipe partition first, then discard

Wiping means writing zero sectors to disk. Hence it's better to do this
before we discard, so that the zeroes we use to overwrite are properly
discarded. If we'd do it the other way round we'd discard the data and
then reallocte it just to write zeroes.

5 years agorepart: talk about future partitions
Lennart Poettering [Thu, 30 Jul 2020 16:47:04 +0000 (18:47 +0200)] 
repart: talk about future partitions

We initialize the partition contents before the partitions actually
exist, hence to reduce confusion let's talk about "future partitions" up
to the point where they are actually realized.

5 years agorepart: let's wipe the partition table ourselves
Lennart Poettering [Thu, 30 Jul 2020 16:46:42 +0000 (18:46 +0200)] 
repart: let's wipe the partition table ourselves

Let's issue the wiping ourselves, so that we know it's done before we
write partition data onto the disk, and before the disk label
is written. Before this commit the writing of the disk label would imply
the wiping step, potentially overriding again what we just wrote into
the disk data section.

(Normally this shouldn't matter, since the partition table metadata
that the wiping process deletes is at the start and end of the disk
while we write our data to the middle, but you never know what kind of
weird signatures might exist that depart from that.)

(And effectively this ends up using the same wiping code, since that's
implemented in libblkkid, and libfdisk just acts as frontend to that
anyway. We now simply call it directly.)

5 years agorepart: split out code that mangles part table entries into function of its own
Lennart Poettering [Thu, 30 Jul 2020 14:35:15 +0000 (16:35 +0200)] 
repart: split out code that mangles part table entries into function of its own

Just some refactoring, no actual code change.

5 years agomkfs-util: add support for making vfat partitions
Lennart Poettering [Thu, 30 Jul 2020 20:29:48 +0000 (22:29 +0200)] 
mkfs-util: add support for making vfat partitions

fat is a bit more limited in volume name length and UUID support. Let's
add some special support for it.

This is particularly useful to generate EFI system partitions.

5 years agorepart: add support for formatting newly created partitions
Lennart Poettering [Thu, 30 Jul 2020 08:09:57 +0000 (10:09 +0200)] 
repart: add support for formatting newly created partitions

5 years agorepart: make error code when operating on non-existing file a bit more useful
Lennart Poettering [Tue, 4 Aug 2020 13:54:25 +0000 (15:54 +0200)] 
repart: make error code when operating on non-existing file a bit more useful

5 years agomakefs: port to generic make_filesystem() call
Lennart Poettering [Wed, 29 Jul 2020 17:10:33 +0000 (19:10 +0200)] 
makefs: port to generic make_filesystem() call

5 years agoshared: introduce mkfs-util.c/.h
Lennart Poettering [Wed, 29 Jul 2020 16:36:26 +0000 (18:36 +0200)] 
shared: introduce mkfs-util.c/.h

Let's move the "mkfs" code from homed there, plus other related code.

This way we can easily reuse it from other places.

5 years agoloop-util: define API for syncing loopback device
Lennart Poettering [Thu, 30 Jul 2020 16:48:52 +0000 (18:48 +0200)] 
loop-util: define API for syncing loopback device

5 years agomkdir: add new mkdir_p_root() helper
Lennart Poettering [Mon, 3 Aug 2020 10:05:37 +0000 (12:05 +0200)] 
mkdir: add new mkdir_p_root() helper

5 years agorepart: don't unload data we configured explicitly, and fully free all data we match...
Lennart Poettering [Tue, 11 Aug 2020 12:50:36 +0000 (14:50 +0200)] 
repart: don't unload data we configured explicitly, and fully free all data we match to disk

The context_unload_partition_table() call is supposed to remove all
data from the loaded partitions about how we mapped it to existing
partitions on disk, but it should leave everything we parsed from the
definition files in place.

We mostly got this right, except for two cases:

1. new_uuid is parsed from the definition files and should stay

2. current_label is read from the existing partition table and should be
   freed

5 years agokernel-install: Reuse $BOOT/Default if it already exists 16777/head
Daan De Meyer [Tue, 18 Aug 2020 19:16:48 +0000 (20:16 +0100)] 
kernel-install: Reuse $BOOT/Default if it already exists

Avoids duplicate installation problems when the machine ID is
initialized after a kernel is already installed under $BOOT/Default.

5 years agokernel-install: Use "Default" as fallback instead of "Linux"
Daan De Meyer [Mon, 24 Aug 2020 18:22:11 +0000 (19:22 +0100)] 
kernel-install: Use "Default" as fallback instead of "Linux"

"Linux" conflicts /efi/Linux when /efi is the install location.
/efi/Linux is already reserved for unified kernel images so we can't use
it for type #1 images. Instead, we use "Default".

5 years agoman: document ProtectProc= and ProcSubset= 16681/head
Lennart Poettering [Thu, 6 Aug 2020 13:26:53 +0000 (15:26 +0200)] 
man: document ProtectProc= and ProcSubset=

5 years agounits: turn on ProtectProc= wherever suitable
Lennart Poettering [Thu, 6 Aug 2020 12:50:38 +0000 (14:50 +0200)] 
units: turn on ProtectProc= wherever suitable

5 years agoanalyze-security: check for ProtectProc=/ProcSubset=
Lennart Poettering [Thu, 6 Aug 2020 12:38:43 +0000 (14:38 +0200)] 
analyze-security: check for ProtectProc=/ProcSubset=