summaryrefslogtreecommitdiff
path: root/src/machine-id-setup
Commit message (Collapse)AuthorAgeFilesLines
* 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-031-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
|
* main: we want all setup functions to be in files called xxx-setup.[ch]Lennart Poettering2012-04-121-0/+35