Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#2006762) resolved: synthesize option #64

Closed
wants to merge 450 commits into from

Conversation

jacekmigacz
Copy link
Member

It is currently possible to query with resolvectl and provide --synthesize=no flag for non-synthesized answers.

This patch provides systemd-resolved synthesize control switch and makes possible to disable synthesized answers for the regular DNS questions (like these emitted from nslookup or dig).

@systemd-rhel-bot systemd-rhel-bot added pr/needs-ci Formerly needs-ci pr/needs-review Formerly needs-review tracker/unapproved Formerly needs-acks labels Feb 1, 2022
@systemd-rhel-bot systemd-rhel-bot removed the pr/needs-ci Formerly needs-ci label Feb 1, 2022
@systemd-rhel-bot systemd-rhel-bot removed the tracker/unapproved Formerly needs-acks label Feb 22, 2022
@msekletar
Copy link
Contributor

@jacekmigacz You need to prepare upstream PR and get it merged. We can't merge this downstream before this lands in systemd/systemd. Thanks!

@jacekmigacz
Copy link
Member Author

@msekletar I've proposed it to the upstream at: systemd/systemd#22599.

@systemd-rhel-bot systemd-rhel-bot added the tracker/unapproved Formerly needs-acks label Feb 23, 2022
@systemd-rhel-bot systemd-rhel-bot changed the title (#2006762) resolved: synthesize option (#2006762) (#2006762) resolved: synthesize option Apr 28, 2022
@systemd-rhel-bot systemd-rhel-bot added pr/needs-ci Formerly needs-ci and removed pr/needs-ci Formerly needs-ci labels Apr 28, 2022
@jamacku jamacku changed the title (#2006762) (#2006762) resolved: synthesize option (#2006762) resolved: synthesize option May 11, 2022
keszybz and others added 14 commits May 11, 2022 16:05
…again

(cherry picked from commit a520d5d)

Related: #2065061
kernel-install would continue after errors… We don't want this, as it
makes the results totally unpredicatable. If we didn't install the kernel
or didn't do some important part of the setup, let's just return an error
and let the user deal with it.

When looking at output, the error was often hard to distinguish, esp.
with -v. Add "Error:" everywhere to make the output easier to parse.

(cherry picked from commit 680cec6)

Related: #2065061
The general approach of kernel-install was that each plugin would drop in some
files into the entry directory. But this doesn't scale well, because if we have
multiple initrd generators, or multiple initrds, each generator would need to
recreate the logic to put the generated files in the right place.

Also, effective cleanup is impossible if anything goes wrong on the way, so we
could end up with unused files in $BOOT.

So let's invert the process: plugins drop files into $KERNEL_INSTALL_STAGING_AREA,
and at the end 90-loaderentry.install DTRT with those files.

This allow new plugins like 50-mkosi-initrd.install to be significantly simpler.

(cherry picked from commit 367165a)

Related: #2065061
(cherry picked from commit 29f6041)

Related: #2065061
This reworks the how machine ID used by the boot loader spec snippet
generation logic. Instead of persisting it automatically to /etc/ we'll
append it via systemd.machined_id= to the kernel command line, and thus
persist it in the generated boot loader spec snippets instead. This has
nice benefits:

  1. We do not collide with read-only root
  2. The machine ID remains stable across factory reset, so that we can
     safely recognize the path in $BOOT we drop our kernel images in
     again, i.e. kernel updates will work correctly and safely across
     kernel factory resets.
  3. Previously regular systems had different machine IDs while in
     initrd and after booting into the host system. With this change
     they will now have the same.

This then drops implicit persisting of KERNEL_INSTALL_MACHINE_ID, as its
unnecessary then. The field is still honoured though, for compat
reasons.

This also drops the "Default" fallback previously used, as it actually
is without effect, the randomized ID generation already took precedence
in all cases. This means $MACHNE_ID/KERNEL_INSTALL_MACHINE_ID are now
guaranteed to look like a proper machine ID, which is useful for us,
given you need it that way to be able to pass it to the
systemd.machine_id= kernel command line option.

(cherry picked from commit 11ce3ea)

Related: #2065061
This cleans up naming of boot loader spec boot entries a bit (i.e. the
naming of the .conf snippet files, and the directory in $BOOT where the
kernel images and initrds are placed), and isolates it from the actual machine
ID concept.

Previously there was a sinlge concept for both things, because typically
the entries are just named after the machine ID. However one could also
use a different identifier, i.e. not a 128bit ID in which cases issues
pop up everywhere. For example, the "machine-id" field in the generated
snippets would not be a machine ID anymore, and the newly added
systemd.machine_id= kernel parameter would possibly get passed invalid
data.

Hence clean this up:

$MACHINE_ID → always a valid 128bit ID.

$ENTRY_TOKEN → usually the $MACHINE_ID but can be any other string too.
This is used to name the directory to put kernels/initrds in. It's also
used for naming the *.conf snippets that implement the Boot Loader Type
1 spec.

(cherry picked from commit 3907044)

Related: #2065061
… if used for naming the boot loader spec files/dirs

Now that we can distinguish the naming of the boot loader spec
dirs/files and the machine ID let's tweak the logic for suffixing the
kernel cmdline with systemd.boot_id=: let's only do that when we
actually need the boot ID for naming these dirs/files. If we don't,
let's not bother.

This should be beneficial for "golden" images that shall not carry any
machine IDs at all, i.e acquire their identity only once the final
userspace is actually reached.

(cherry picked from commit 953b610)

Related: #2065061
If not explicitly configured, let's search a bit harder for the
ENTRY_TOKEN, and let's try the machine ID, the IMAGE_ID and ID fields of
/etc/os-release and finally "Default", all below potential $XBOOTLDR.

(cherry picked from commit 6637cf9)

Related: #2065061
…we discovered

(cherry picked from commit c73cf41)

Related: #2065061
Add rules for `needs-ci` label management

RHEL-only

Related: #2087652
RHEL-only

Related: #2087652
Fixes #23317

(cherry picked from commit 2aaf6d4)
Related: #2087652
Empty files and empty strings seem to have triggered various
issues in the past so it seems they shouldn't be ignore by the
fuzzers just because fmemopen can't handle them.

Prompted by systemd/systemd#21939 (comment)

(cherry picked from commit 5df66d7)
Related: #2087652
We'd connect to the bus twice: the first time to check networkd namespace,
and then the second time to do the deed we were asked to do. It's nicer
to open the bus just once, for efficience and also to avoid the open call
in all functions.

An ASSERT_PTR helper is added:
- sd_bus *bus = userdata;
  ...
- assert(bus);
+ sd_bus *bus = ASSERT_PTR(userdata);
  ...

It can be used in other place too, but I'm leaving that for a later
refactoring.

(cherry picked from commit d821e40)
Related: #2087652
bluca and others added 13 commits August 18, 2022 12:57
(cherry picked from commit 5ea8bcd)

Related: #2087778
It has the same issue as the Google Hangouts Meet speakermic but a
different VID/PID.

(cherry picked from commit 1a2134f)

Related: #2087778
(cherry picked from commit cc9e3a5)

Related: #2087778
This enables the microphone mute and programmable hotkey for the HP Dev
One.

(cherry picked from commit 295e029)

Related: #2087778
The USB ID v0483pDF11 is used by the ROM code in many STMicroelectronics
devices (for firmware download) and not just signal analyzers.

(cherry picked from commit 5d049ff)

Related: #2087778
(cherry picked from commit c3b8113)

Related: #2087778
(cherry picked from commit 8170627)

Related: #2087778
Enables the power button on the Acer Aspire 3 A317-33

(cherry picked from commit 0216462)

Related: #2087778
(cherry picked from commit e18569c)

Related: #2087778
* Added DERE DBook D10

(cherry picked from commit 2d2efed)

Related: #2087778
(cherry picked from commit 838d0fd)

Related: #2087778
They're floppy disk flux readers and writers used in digital
preservation and can be broadly considered to be "analyzers" of magnetic
fluxes.

This will have the intended side-effect of giving access to the device
to users at the console, obsoleting:
https://github.com/keirf/greaseweazle/blob/master/scripts/49-greaseweazle.rules

(cherry picked from commit 9ab755d)

Related: #2087778
The cros-ec-accel and cros-ec-accel-legacy kernel modules internally
correct for the board-specific accelerometer mounting orientations.
Their sensor outputs are in a standard reference frame consistent across
different boards, so the orientation matrix already added for a number
of devices should apply to every device using cros-ec accelerometers.
The different matrix for the 'Nocturne' board seems to be an error.

Replace the existing hwdb rules for select Chromebooks with generic
rules that apply to all Chromebooks.

(cherry picked from commit 1800f70)

Related: #2087778
@systemd-rhel-bot systemd-rhel-bot changed the title (#2006762) resolved: synthesize option (#2006762) (#2006762) resolved: synthesize option Aug 20, 2022
@jamacku jamacku changed the title (#2006762) (#2006762) resolved: synthesize option (#2006762) resolved: synthesize option Aug 24, 2022
msekletar and others added 4 commits August 25, 2022 10:06
Previously it was possible to set delegate property for scope, but you
were not able to allow unprivileged process to manage the scope's cgroup
hierarchy. This is useful when launching manager process that  will run
unprivileged but is supposed to manage its own (scope) sub-hierarchy.

Fixes #21683

(cherry picked from commit 0386019)

Resolves: #2120604
RHEL-only

Resolves: #2121144
It performs differential ShellCheck scans and report results directly in
pull request.

documentation:
https://github.com/redhat-plumbers-in-action/differential-shellcheck

(inspired by commit
 systemd/systemd@3f3c718)

RHEL-only

Related: #2122500
@jacekmigacz
Copy link
Member Author

This is a lightweight version of the original patch; limited to controlling hostname synthesis.

@jamacku
Copy link
Member

jamacku commented Dec 8, 2022

This change should no longer be needed since the rebase to v252.

@jamacku jamacku closed this Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dont-merge pr/needs-ci Formerly needs-ci pr/needs-review Formerly needs-review tracker/unapproved Formerly needs-acks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet