summaryrefslogtreecommitdiffstats
path: root/src/machine-id-setup (follow)
Commit message (Collapse)AuthorAgeFilesLines
* machine-id: Add cmdline argument to use VM behaviour on bare metal (#32086)Merlin Jehli2024-07-131-1/+1
| | | Closes #30707
* tree-wide: Use log_setup() everywhereDaan De Meyer2024-04-251-2/+1
| | | | | Otherwise the default log target is the console and we won't use the journal socket even if it is available.
* dissect-image: add flag for explicitly enabling userspace verity signature ↵Lennart Poettering2024-02-281-1/+2
| | | | | | | | | | checking let's make userspace verity signature checking optional. This adds a dissection flag to enable the logic and patches through all our users to enable it by default, thus effectively not changing anything from the status quo ante. However, know we have a knob to turn this off in certain scenarios.
* meson: move declarations of fsck, firstboot, machine-id-setup, and remount-fsYu Watanabe2023-08-011-0/+8
|
* dissect-image: port mount_image_privately_interactively() to use ↵Lennart Poettering2023-05-161-3/+3
| | | | | | | | | | /run/systemd/mount-rootfs/ too Let's use the same common directory as the unit logic uses. This means we have less to clean up, and opens the door to eventually allow unprivileged operation of the mount_image_privately_interactively() logic.
* machine-id-setup: Do not overwrite if /etc/machine-id contains uninitializedDaan De Meyer2023-05-151-4/+14
| | | | | | | | When we're building OS images, we never want /etc/machine-id to contain anything other than "uninitialized" until we actually boot the image. So let's allow image builders to write "uninitialized" to /etc/machine-id and if systemd-machine-id-setup is called after, make sure we don't overwrite it.
* image-policy: introduce parse_image_policy_argument() helperYu Watanabe2023-04-131-13/+8
| | | | | | | | | Addresses https://github.com/systemd/systemd/pull/25608/commits/84be0c710d9d562f6d2cf986cc2a8ff4c98a138b#r1060130312, https://github.com/systemd/systemd/pull/25608/commits/84be0c710d9d562f6d2cf986cc2a8ff4c98a138b#r1067927293, and https://github.com/systemd/systemd/pull/25608/commits/84be0c710d9d562f6d2cf986cc2a8ff4c98a138b#r1067926416. Follow-up for 84be0c710d9d562f6d2cf986cc2a8ff4c98a138b.
* tree-wide: hook up image dissection policy logic everywhereLennart Poettering2023-04-051-12/+29
|
* machine-id-setup: use id128_get_machine() at one more placeYu Watanabe2023-04-041-4/+1
|
* Revert "sd-id128: make id128_read() optionally take root directory"Yu Watanabe2023-04-041-1/+4
| | | | This reverts commit 830e52caa2bf1a29f56cb93e7ed85acb1bda11c3.
* sd-id128: make id128_read() optionally take root directoryYu Watanabe2023-03-271-4/+1
|
* dissect-image: Return mount point fd if requestedDaan De Meyer2023-02-171-0/+1
|
* sd-id128: make id128_read() or friends return -ENOPKG when the file contents ↵Yu Watanabe2022-12-121-1/+1
| | | | | | | | | is "uninitialized" Then, this drops ID128_PLAIN_OR_UNINIT. Also, this renames Id128Format -> Id128FormatFlag, and make it bitfield. Fixes #25634.
* basic: move version() to build.h+cZbigniew Jędrzejewski-Szmek2022-11-081-1/+1
|
* tree-wide: drop unused reference to DecryptedImageYu Watanabe2022-09-181-3/+1
|
* tree-wide: port everything over to new sd-id128 compund literal blissLennart Poettering2021-08-201-2/+1
|
* Drop the text argument from assert_not_reached()Zbigniew Jędrzejewski-Szmek2021-08-031-1/+1
| | | | | | | | | | | | | | | | | In general we almost never hit those asserts in production code, so users see them very rarely, if ever. But either way, we just need something that users can pass to the developers. We have quite a few of those asserts, and some have fairly nice messages, but many are like "WTF?" or "???" or "unexpected something". The error that is printed includes the file location, and function name. In almost all functions there's at most one assert, so the function name alone is enough to identify the failure for a developer. So we don't get much extra from the message, and we might just as well drop them. Dropping them makes our code a tiny bit smaller, and most importantly, improves development experience by making it easy to insert such an assert in the code without thinking how to phrase the argument.
* tree-wide: enable automatic growing of file systems in images in various ↵Lennart Poettering2021-04-231-1/+2
| | | | | | | | | | tools that deal with OS images Let's enable this in all tools that intend to write to the OS images. It's not conditionalized for now, as there already is conditionalization in the existance or absence of the flag in the GPT partition table (and it's opt-in), hence it should be OK to just enable this by default for now if the flag is set.
* machine-id-setup: support --image= modeLennart Poettering2021-03-311-3/+45
|
* Move and rename parse_path_argument() functionZbigniew Jędrzejewski-Szmek2021-02-151-1/+2
| | | | | This fits better in shared/, and the new parse-argument.c file is a good home for it.
* tree-wide: Drop custom formatting for print() help messagesDaan De Meyer2021-01-311-4/+3
| | | | | | | | | | | | I think this formatting was originally used because it simplified adding new options to the help messages. However, these days, most tools their help message end with "\nSee the %s for details.\n" so the final line almost never has to be edited which eliminates the benefit of the custom formatting used for printf() help messages. Let's make things more consistent and use the same formatting for printf() help messages that we use everywhere else. Prompted by https://github.com/systemd/systemd/pull/18355#discussion_r567241580
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* core: keep machine-id transient until first boot completesHarald Seiler2020-10-191-1/+1
| | | | | | | | | | | | | | | | | | Currently, a loss of power after the machine-id was written but before all units with ConditionFirstBoot=yes ran would lead to the next boot finding a valid machine-id, thus not being marked first boot and not re-running these units. To make the first boot mechanism more robust, instead of writing /etc/machine-id very early, fill it with a marker value "uninitialized" and overmount it with a transiently provisioned machine-id. Then, after the first boots completes (when systemd-machine-id-commit.service runs), write the real machine-id to disk. This mechanism is of course only invoked on first boot. If a first boot is not detected, the machine-id is handled as previously. Fixes: #4511
* machine-id-setup: avoid unexpected abortingChen Qi2019-10-251-1/+1
| | | | | | | | | Code should not be reached 'Unhandled option' at src/machine-id-setup/machine-id-setup-main.c:97, function parse_argv(). Aborting. Aborted This behaviour is not good and will confuse user. Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
* coccinelle: make use of SYNTHETIC_ERRNOZbigniew Jędrzejewski-Szmek2018-11-221-4/+3
| | | | | | | | | | | Ideally, coccinelle would strip unnecessary braces too. But I do not see any option in coccinelle for this, so instead, I edited the patch text using search&replace to remove the braces. Unfortunately this is not fully automatic, in particular it didn't deal well with if-else-if-else blocks and ifdefs, so there is an increased likelikehood be some bugs in such spots. I also removed part of the patch that coccinelle generated for udev, where we returns -1 for failure. This should be fixed independently.
* Split out pretty-print.c and move pager.c and main-func.h to shared/Zbigniew Jędrzejewski-Szmek2018-11-201-1/+1
| | | | | This is high-level functionality, and fits better in shared/ (which is for our executables), than in basic/ (which is also for libraries).
* machine-id: use static destructor and DEFINE_MAIN_FUNCTION() macroYu Watanabe2018-11-201-11/+12
|
* tree-wide: add clickable man page link to all --help textsLennart Poettering2018-08-201-4/+17
| | | | | | | | | | This is a bit like the info link in most of GNU's --help texts, but we don't do info but man pages, and we make them properly clickable on terminal supporting that, because awesome. I think it's generally advisable to link up our (brief) --help texts and our (more comprehensive) man pages a bit, so this should be an easy and straight-forward way to do it.
* tree-wide: remove Lennart's copyright linesLennart Poettering2018-06-141-3/+0
| | | | | | | | | | | These lines are generally out-of-date, incomplete and unnecessary. With SPDX and git repository much more accurate and fine grained information about licensing and authorship is available, hence let's drop the per-file copyright notice. Of course, removing copyright lines of others is problematic, hence this commit only removes my own lines and leaves all others untouched. It might be nicer if sooner or later those could go away too, making git the only and accurate source of authorship information.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-06-141-2/+0
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-061-13/+0
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* Add SPDX license identifiers to source files under the LGPLZbigniew Jędrzejewski-Szmek2017-11-191-0/+1
| | | | | This follows what the kernel is doing, c.f. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
* build-sys: drop automake supportZbigniew Jędrzejewski-Szmek2017-07-181-1/+0
| | | | | v2: - also mention m4
* machine-id-setup: `--print --commit` respects the --root optionEvgeny Vereshchagin2016-12-131-1/+5
|
* machine-id-setup: add new --print switchLennart Poettering2016-07-221-3/+27
| | | | If specified we'll simply output the used machine ID.
* core: rework machine-id-setup.c to use the calls from id128-util.[ch]Lennart Poettering2016-07-221-1/+1
| | | | | This allows us to delete quite a bit of code and make the whole thing a lot shorter.
* tree-wide: remove Emacs lines from all filesDaniel Mack2016-02-101-2/+0
| | | | | This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
* core: Add machine-id settingNils Carlson2016-01-121-1/+1
| | | | | | | | | | Allow for overriding all other machine-ids which may be present on the system using a kernel command line systemd.machine_id or --machine-id= option. This is especially useful for network booted systems where the machine-id needs to be static, or for containers where a specific machine-id is wanted.
* tree-wide: sort includesThomas Hindoe Paaboel Andersen2015-11-161-1/+1
| | | | Sort the includes accoding to the new coding style.
* path-util: unify how we process paths specified on the command lineLennart Poettering2015-10-241-5/+9
| | | | | Let's introduce a common function that makes relative paths absolute and warns about any errors while doing so.
* machine-id-commit: merge machine-id-commit functionality into machine-id-setupLennart Poettering2015-09-291-4/+18
| | | | | | | | | | | | | And remove machine-id-commit as separate binary. There's really no point in keeping this separate, as the sources are pretty much identical, and have pretty identical interfaces. Let's unify this in one binary. Given that machine-id-commit was a private binary of systemd (shipped in /usr/lib/) removing the tool is not an API break. While we are at it, improve the documentation of the command substantially.
* util: introduce common version() implementation and use it everywhereLennart Poettering2015-09-291-8/+6
| | | | | | This also allows us to drop build.h from a ton of files, hence do so. Since we touched the #includes of those files, let's order them properly according to CODING_STYLE.
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-231-1/+0
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* Unify parse_argv styleZbigniew Jędrzejewski-Szmek2014-08-041-7/+4
| | | | | | | | | | | | | | | | getopt is usually good at printing out a nice error message when commandline options are invalid. It distinguishes between an unknown option and a known option with a missing arg. It is better to let it do its job and not use opterr=0 unless we actually want to suppress messages. So remove opterr=0 in the few places where it wasn't really useful. When an error in options is encountered, we should not print a lengthy help() and overwhelm the user, when we know precisely what is wrong with the commandline. In addition, since help() prints to stdout, it should not be used except when requested with -h or --help. Also, simplify things here and there.
* machine-id-setup: use path_kill_slashes and modernizationsZbigniew Jędrzejewski-Szmek2014-03-141-2/+2
|
* machine-id: add --root option to operate on an alternate fs treeGreg KH2014-03-141-3/+12
| | | | | | | | | This makes it possible to initialize the /etc/machine-id file on an arbitrary filesystem hierarchy. This helps systems that wish to run this at image creation time in a subdirectory, or from initramfs before pivot-root is called. [tomegun: converted to using _cleanup_free_ macros]
* clients: unify how we invoke getopt_long()Lennart Poettering2013-11-061-5/+3
| | | | | Among other things this makes sure we always expose a --version command and show it in the help texts.
* build-sys: drop all distribution specfic checksLennart Poettering2013-01-041-1/+0
| | | | Yay, we now have a completely generic systemd. No distribution specific checks anymore!
* log: correct usage of logging API at a few placesLennart Poettering2012-07-131-1/+0
|
* machine-id-setup: add the usual command line parametersLennart Poettering2012-04-122-0/+69
|