Commit Graph

46348 Commits

Author SHA1 Message Date
Lennart Poettering 594191761a update TODO 2020-08-25 18:18:56 +02:00
Lennart Poettering 9be99f81a7 homed: report a home directory as "dirty" if image file has dirty flag 2020-08-25 18:18:56 +02:00
Lennart Poettering 565ac8b1c8 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.
2020-08-25 18:18:46 +02:00
Lennart Poettering 05c8e12c47 man: document new homectl --recovery-key= switch 2020-08-25 18:14:55 +02:00
Lennart Poettering 64abd37a60 docs: document new recovery key user record fields 2020-08-25 18:14:55 +02:00
Lennart Poettering 80c41552a8 homectl: teach homectl to generate recovery keys 2020-08-25 18:14:55 +02:00
Lennart Poettering 87d7893cfb 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.
2020-08-25 18:14:55 +02:00
Lennart Poettering aecbc87df4 home: add helper to process/normalize modhex64 recovery keys 2020-08-25 18:14:55 +02:00
Lennart Poettering da3920c3a4 journal: move qrcode printing code to src/shared/
That way we can make use of it in homctl, too.
2020-08-25 17:58:02 +02:00
Lennart Poettering b3a97fd3ae user-record: add recovery key fields to user record 2020-08-25 17:58:02 +02:00
Lennart Poettering 45374f6503
Merge pull request #15662 from Werkov/fix-cgroup-disable
Fix unsetting cgroup restrictions
2020-08-25 17:36:07 +02:00
Andrew Hangsleben b2c185bae9 Added sensor configuration for One-netbook OneMix 3 Pro 2020-08-25 14:11:15 +02:00
Lennart Poettering 47d0644e1a
Merge pull request #16833 from JackFangXN/master
analyze-verify: drop pointless zero initialization
2020-08-25 13:20:11 +02:00
Zbigniew Jędrzejewski-Szmek 3b9d671754
Merge pull request #16676 from poettering/repart-mkfs
repart: add new settings Format=, CopyFiles=, Encrypt= and teach --size= a new value "auto"
2020-08-25 12:19:46 +02:00
Alec Moskvin dd47b25220 rules: don't install 80-drivers.rules when kmod is disabled 2020-08-25 09:35:49 +02:00
Zbigniew Jędrzejewski-Szmek c3bbc90b4a
Merge pull request #16777 from DaanDeMeyer/kernel-install-followup
kernel-install: "Linux" => "Default" and reuse $BOOT/Default if it already exists
2020-08-25 09:30:44 +02:00
Ronan Pigott 45b156c155 zsh: correct journalctl command completion parsing 2020-08-25 09:29:13 +02:00
Zbigniew Jędrzejewski-Szmek 2c7d33d9e3
Merge pull request #16767 from keszybz/missing-syscall-cleanup
missing_syscall: verify our fallback numbers when possible
2020-08-25 09:21:32 +02:00
Zbigniew Jędrzejewski-Szmek b20f00599d
Merge pull request #16816 from keszybz/install-templated-presets
Fix preset operation for non-service templates
2020-08-25 09:20:07 +02:00
Zbigniew Jędrzejewski-Szmek 9f56c88aeb
Merge pull request #16819 from keszybz/seccomp-enosys
Return ENOSYS in nspawn for "unknown" syscalls
2020-08-25 09:18:46 +02:00
fangxiuning 05f7a0689e analyze: drop pointless zero initialization 2020-08-25 15:17:52 +08:00
Zbigniew Jędrzejewski-Szmek d521e6993d
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
2020-08-25 09:16:25 +02:00
fangxiuning 6f32f8e037 analyze-verify: drop pointless zero initialization 2020-08-25 15:10:15 +08:00
Lennart Poettering f053c9477b core: drop redundant comment
Since 625a164069 we don't need to update
analyze-condition.c separately anymore, hence drop the comment
suggesting otherwise.
2020-08-25 07:47:50 +02:00
Lennart Poettering 6944adbbe0
Merge pull request #16681 from poettering/hidepid
core: introduce ProtectProc= unit file setting for exposing procfs' hidepid= mount option
2020-08-25 07:47:05 +02:00
Lennart Poettering bb2551bdcb 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!)
2020-08-24 22:01:13 +02:00
Lennart Poettering c2f418d595 update TODO 2020-08-24 22:01:09 +02:00
Lennart Poettering dfb4d0ae0d man: document new repart features 2020-08-24 22:00:52 +02:00
Lennart Poettering f7011e17f1 test: add test for new repart features 2020-08-24 22:00:49 +02:00
Lennart Poettering 170c982345 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.
2020-08-24 22:00:45 +02:00
Lennart Poettering b9df353689 repart: add support for optionally encrypting partitions we create 2020-08-24 22:00:42 +02:00
Lennart Poettering 8a794850e7 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.
2020-08-24 22:00:38 +02:00
Lennart Poettering 1f0f82f131 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.
2020-08-24 22:00:35 +02:00
Lennart Poettering f0cb1b951c 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.
2020-08-24 22:00:31 +02:00
Lennart Poettering 5b5109e225 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.
2020-08-24 22:00:28 +02:00
Lennart Poettering 81873a6b6c 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.)
2020-08-24 22:00:24 +02:00
Lennart Poettering f28d4f42f4 repart: split out code that mangles part table entries into function of its own
Just some refactoring, no actual code change.
2020-08-24 22:00:21 +02:00
Lennart Poettering 0f2b2c483f 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.
2020-08-24 22:00:17 +02:00
Lennart Poettering 53171c0453 repart: add support for formatting newly created partitions 2020-08-24 22:00:14 +02:00
Lennart Poettering aa2a74ad9d repart: make error code when operating on non-existing file a bit more useful 2020-08-24 22:00:10 +02:00
Lennart Poettering da49710ef2 makefs: port to generic make_filesystem() call 2020-08-24 22:00:07 +02:00
Lennart Poettering c95f9a2351 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.
2020-08-24 21:59:49 +02:00
Lennart Poettering 8dbc208cc1 loop-util: define API for syncing loopback device 2020-08-24 21:59:35 +02:00
Lennart Poettering 0de3c4f4b7 mkdir: add new mkdir_p_root() helper 2020-08-24 21:59:21 +02:00
Lennart Poettering 15d43e3065 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
2020-08-24 21:58:53 +02:00
Daan De Meyer 2c46d523ac 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.
2020-08-24 19:24:19 +01:00
Daan De Meyer 6426c98ac5 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".
2020-08-24 19:22:11 +01:00
Lennart Poettering a54342b371 man: document ProtectProc= and ProcSubset= 2020-08-24 20:11:24 +02:00
Lennart Poettering 24da96a1bd units: turn on ProtectProc= wherever suitable 2020-08-24 20:11:14 +02:00
Lennart Poettering ed125c936c analyze-security: check for ProtectProc=/ProcSubset= 2020-08-24 20:11:10 +02:00