From 4c32f2c96b83ffc24586191aebadb54d86ea300c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 2 Feb 2016 14:24:58 -0500 Subject: [PATCH 1/6] build-sys: move CLEANFILES additions out from under HAVE_GNUEFI It's better to always include them in 'make clean'. It is also easier to read Makefile.am when less stuff is conditional. --- Makefile.am | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Makefile.am b/Makefile.am index 0b4a6b9e2e..a7d1615d97 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2717,14 +2717,13 @@ systemd_boot_sources = \ EXTRA_DIST += $(systemd_boot_sources) $(systemd_boot_headers) -if ENABLE_EFI -if HAVE_GNUEFI systemd_boot_objects = $(addprefix $(top_builddir)/,$(systemd_boot_sources:.c=.o)) systemd_boot_solib = $(top_builddir)/src/boot/efi/systemd_boot.so systemd_boot = systemd-boot$(EFI_MACHINE_TYPE_NAME).efi +if ENABLE_EFI +if HAVE_GNUEFI bootlib_DATA = $(systemd_boot) -CLEANFILES += $(systemd_boot_objects) $(systemd_boot_solib) $(systemd_boot) $(top_builddir)/src/boot/efi/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(top_srcdir)/,$(systemd_boot_headers)) @$(MKDIR_P) $(top_builddir)/src/boot/efi/ @@ -2741,6 +2740,8 @@ $(systemd_boot): $(systemd_boot_solib) endif endif +CLEANFILES += $(systemd_boot_objects) $(systemd_boot_solib) $(systemd_boot) + # ------------------------------------------------------------------------------ stub_headers = \ src/boot/efi/util.h \ @@ -2764,14 +2765,13 @@ EXTRA_DIST += \ $(stub_headers) \ test/splash.bmp -if ENABLE_EFI -if HAVE_GNUEFI stub_objects = $(addprefix $(top_builddir)/,$(stub_sources:.c=.o)) stub_solib = $(top_builddir)/src/boot/efi/stub.so stub = linux$(EFI_MACHINE_TYPE_NAME).efi.stub +if ENABLE_EFI +if HAVE_GNUEFI bootlib_DATA += $(stub) -CLEANFILES += $(stub_objects) $(stub_solib) $(stub) $(top_builddir)/src/boot/efi/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(top_srcdir)/,$(stub_headers)) @$(MKDIR_P) $(top_builddir)/src/boot/efi/ @@ -2785,6 +2785,11 @@ $(stub_solib): $(stub_objects) $(stub): $(stub_solib) $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \ -j .dynsym -j .rel -j .rela -j .reloc $(EFI_FORMAT) $< $@ +endif +endif + +CLEANFILES += $(stub_objects) $(stub_solib) $(stub) + # ------------------------------------------------------------------------------ CLEANFILES += test-efi-disk.img @@ -2794,8 +2799,6 @@ test-efi-disk.img: $(systemd_boot) $(stub) test/test-efi-create-disk.sh test-efi: test-efi-disk.img $(QEMU) -machine accel=kvm -m 1024 -bios $(QEMU_BIOS) -snapshot test-efi-disk.img -endif -endif EXTRA_DIST += test/test-efi-create-disk.sh From 17163897d49445ebf9f87ef898cbdd5fdc21f880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 2 Feb 2016 16:10:36 -0500 Subject: [PATCH 2/6] build-sys: simplify conditionals around shell completion files Repeating those conditionals for every program is annoying. Use a helper variable to avoid conditionals. Also always add generated completion files to CLEANFILES. --- Makefile.am | 94 ++++++++++++++++++----------------------------------- 1 file changed, 32 insertions(+), 62 deletions(-) diff --git a/Makefile.am b/Makefile.am index a7d1615d97..db95b109ce 100644 --- a/Makefile.am +++ b/Makefile.am @@ -155,6 +155,14 @@ else noinst_PROGRAMS = TESTS = endif +if ENABLE_BASH_COMPLETION +dist_bashcompletion_DATA = $(dist_bashcompletion_data) +nodist_bashcompletion_DATA = $(nodist_bashcompletion_data) +endif +if ENABLE_ZSH_COMPLETION +dist_zshcompletion_DATA = $(dist_zshcompletion_data) +nodist_zshcompletion_DATA = $(nodist_zshcompletion_data) +endif udevlibexec_PROGRAMS = gperf_gperf_sources = @@ -165,6 +173,8 @@ m4_files = $(filter %.m4,$(EXTRA_DIST) $(in_files:.m4.in=.m4)) CLEANFILES = $(BUILT_SOURCES) \ $(pkgconfigdata_DATA) \ $(pkgconfiglib_DATA) \ + $(nodist_bashcompletion_data) \ + $(nodist_zshcompletion_data) \ $(in_files:.in=) $(in_in_files:.in.in=) \ $(m4_files:.m4=) @@ -416,8 +426,7 @@ systemgenerator_PROGRAMS = \ systemd-system-update-generator \ systemd-debug-generator -if ENABLE_BASH_COMPLETION -dist_bashcompletion_DATA = \ +dist_bashcompletion_data = \ shell-completion/bash/busctl \ shell-completion/bash/journalctl \ shell-completion/bash/systemd-analyze \ @@ -432,12 +441,10 @@ dist_bashcompletion_DATA = \ shell-completion/bash/udevadm \ shell-completion/bash/kernel-install -nodist_bashcompletion_DATA = \ +nodist_bashcompletion_data = \ shell-completion/bash/systemctl -endif -if ENABLE_ZSH_COMPLETION -dist_zshcompletion_DATA = \ +dist_zshcompletion_data = \ shell-completion/zsh/_busctl \ shell-completion/zsh/_journalctl \ shell-completion/zsh/_udevadm \ @@ -451,18 +458,13 @@ dist_zshcompletion_DATA = \ shell-completion/zsh/_systemd-delta \ shell-completion/zsh/_systemd -nodist_zshcompletion_DATA = \ +nodist_zshcompletion_data = \ shell-completion/zsh/_systemctl -endif EXTRA_DIST += \ shell-completion/bash/systemctl.in \ shell-completion/zsh/_systemctl.in -CLEANFILES += \ - $(nodist_bashcompletion_DATA) \ - $(nodist_zshcompletion_DATA) - dist_sysctl_DATA = \ sysctl.d/50-default.conf @@ -2396,10 +2398,8 @@ SYSINIT_TARGET_WANTS += \ systemd-tmpfiles-setup-dev.service \ systemd-tmpfiles-setup.service -if ENABLE_ZSH_COMPLETION -dist_zshcompletion_DATA += \ +dist_zshcompletion_data += \ shell-completion/zsh/_systemd-tmpfiles -endif TIMERS_TARGET_WANTS += \ systemd-tmpfiles-clean.timer @@ -2627,16 +2627,12 @@ bootctl_LDADD = \ bin_PROGRAMS += \ bootctl -if ENABLE_BASH_COMPLETION -dist_bashcompletion_DATA += \ +dist_bashcompletion_data += \ shell-completion/bash/bootctl -endif -if ENABLE_ZSH_COMPLETION -dist_zshcompletion_DATA += \ +dist_zshcompletion_data += \ shell-completion/zsh/_bootctl endif -endif # ------------------------------------------------------------------------------ if HAVE_GNUEFI @@ -4440,15 +4436,11 @@ test_coredump_vacuum_SOURCES = \ test_coredump_vacuum_LDADD = \ libshared.la -if ENABLE_BASH_COMPLETION -dist_bashcompletion_DATA += \ +dist_bashcompletion_data += \ shell-completion/bash/coredumpctl -endif -if ENABLE_ZSH_COMPLETION -dist_zshcompletion_DATA += \ +dist_zshcompletion_data += \ shell-completion/zsh/_coredumpctl -endif nodist_sysctl_DATA = \ sysctl.d/50-coredump.conf @@ -4699,16 +4691,12 @@ hostnamectl_LDADD = \ bin_PROGRAMS += \ hostnamectl -if ENABLE_BASH_COMPLETION -dist_bashcompletion_DATA += \ +dist_bashcompletion_data += \ shell-completion/bash/hostnamectl -endif -if ENABLE_ZSH_COMPLETION -dist_zshcompletion_DATA += \ +dist_zshcompletion_data += \ shell-completion/zsh/_hostnamectl endif -endif polkitpolicy_in_files += \ src/hostname/org.freedesktop.hostname1.policy.in @@ -4773,16 +4761,12 @@ localectl_LDADD = \ bin_PROGRAMS += \ localectl -if ENABLE_BASH_COMPLETION -dist_bashcompletion_DATA += \ +dist_bashcompletion_data += \ shell-completion/bash/localectl -endif -if ENABLE_ZSH_COMPLETION -dist_zshcompletion_DATA += \ +dist_zshcompletion_data += \ shell-completion/zsh/_localectl endif -endif .PHONY: update-kbd-model-map @@ -4833,16 +4817,12 @@ timedatectl_LDADD = \ bin_PROGRAMS += \ timedatectl -if ENABLE_BASH_COMPLETION -dist_bashcompletion_DATA += \ +dist_bashcompletion_data += \ shell-completion/bash/timedatectl -endif -if ENABLE_ZSH_COMPLETION -dist_zshcompletion_DATA += \ +dist_zshcompletion_data += \ shell-completion/zsh/_timedatectl endif -endif polkitpolicy_in_files += \ src/timedate/org.freedesktop.timedate1.policy.in @@ -4948,11 +4928,6 @@ machinectl_LDADD = \ rootbin_PROGRAMS += \ machinectl -if ENABLE_BASH_COMPLETION -dist_bashcompletion_DATA += \ - shell-completion/bash/machinectl -endif - test_machine_tables_SOURCES = \ src/machine/test-machine-tables.c @@ -4980,11 +4955,12 @@ dist_dbuspolicy_DATA += \ polkitpolicy_files += \ src/machine/org.freedesktop.machine1.policy -if ENABLE_ZSH_COMPLETION -dist_zshcompletion_DATA += \ +dist_bashcompletion_data += \ + shell-completion/bash/machinectl + +dist_zshcompletion_data += \ shell-completion/zsh/_machinectl \ shell-completion/zsh/_sd_machines -endif SYSTEM_UNIT_ALIASES += \ systemd-machined.service dbus-org.freedesktop.machine1.service @@ -5474,10 +5450,8 @@ networkctl_LDADD = \ libshared.la \ libsystemd-network.la -if ENABLE_BASH_COMPLETION -dist_bashcompletion_DATA += \ +dist_bashcompletion_data += \ shell-completion/bash/networkctl -endif test_network_SOURCES = \ src/network/test-network.c @@ -5607,16 +5581,12 @@ loginctl_LDADD = \ rootbin_PROGRAMS += \ loginctl -if ENABLE_BASH_COMPLETION -dist_bashcompletion_DATA += \ +dist_bashcompletion_data += \ shell-completion/bash/loginctl -endif -if ENABLE_ZSH_COMPLETION -dist_zshcompletion_DATA += \ +dist_zshcompletion_data += \ shell-completion/zsh/_loginctl \ shell-completion/zsh/_systemd-inhibit -endif systemd_inhibit_SOURCES = \ src/login/inhibit.c From 75f2310f21b82ed626cdae5590f94debb028b472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 3 Feb 2016 11:25:19 -0500 Subject: [PATCH 3/6] man/hostname: remove obsolete text All distribution-specific code was removed ages ago. --- man/hostname.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/man/hostname.xml b/man/hostname.xml index 9688450e1c..8a4c0d5ac0 100644 --- a/man/hostname.xml +++ b/man/hostname.xml @@ -64,10 +64,6 @@ for DNS domain name labels, even though this is not a strict requirement. - Depending on the operating system, other configuration files - might be checked for configuration of the hostname as well, - however only as fallback. - You may use hostnamectl1 to change the value of this file during runtime from the command From 89a1675845a3aef3f2238d6f391629ea0f96986f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 3 Feb 2016 11:29:04 -0500 Subject: [PATCH 4/6] man/hostnamectl: refer to transient hostname as "fallback" Saying it is the "default" is misleading, because it is almost never used. --- man/hostnamectl.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/man/hostnamectl.xml b/man/hostnamectl.xml index b1f038156d..60004e9d04 100644 --- a/man/hostnamectl.xml +++ b/man/hostnamectl.xml @@ -66,10 +66,10 @@ high-level "pretty" hostname which might include all kinds of special characters (e.g. "Lennart's Laptop"), the static hostname which is used to initialize the kernel hostname at boot (e.g. - "lennarts-laptop"), and the transient hostname which is a default - received from network configuration. If a static hostname is set, - and is valid (something other than localhost), then the transient - hostname is not used. + "lennarts-laptop"), and the transient hostname which is a fallback + value received from network configuration. If a static hostname is + set, and is valid (something other than localhost), then the + transient hostname is not used. Note that the pretty hostname has little restrictions on the characters used, while the static and transient hostnames are From 89fc708c0ae9ea8ab31f04bc27e845038d30b543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 6 Feb 2016 17:53:31 -0500 Subject: [PATCH 5/6] man: clarify that generators are run before /var Just a clarification. At least systemd-openqa-generator from openqa gets this wrong. --- man/systemd.generator.xml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/man/systemd.generator.xml b/man/systemd.generator.xml index 62658fb115..4b80dab108 100644 --- a/man/systemd.generator.xml +++ b/man/systemd.generator.xml @@ -164,13 +164,16 @@ Generators are run very early at boot and cannot rely on any external services. They may not talk to any other process. That includes simple things such as logging to - syslog3, + syslog3, or systemd itself (this means: no - systemctl1!). They - can however rely on the most basic kernel functionality to - be available, including a mounted /sys, - /proc, /dev. + systemctl1)!. + Non-essential file systems like + /var and /home + are mounted after generators have run. Generators + can however rely on the most basic kernel functionality to be + available, including a mounted /sys, + /proc, /dev, + /usr. From 8cd095cc2724dac7523eda400522bbda41219d43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 6 Feb 2016 17:54:18 -0500 Subject: [PATCH 6/6] shell-completion: fix header --- shell-completion/zsh/_busctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell-completion/zsh/_busctl b/shell-completion/zsh/_busctl index ef790e558f..a425b8c700 100644 --- a/shell-completion/zsh/_busctl +++ b/shell-completion/zsh/_busctl @@ -1,6 +1,6 @@ #compdef busctl -# hostnamectl(1) completion -*- shell-script -*- +# busctl(1) completion -*- shell-script -*- # # This file is part of systemd. #