Skip to content

Commit

Permalink
package/systemd: add setting for systemd default.target
Browse files Browse the repository at this point in the history
This adds the option to set systemd's default.target in
the System Configuration subheading if systemd is
specified as the init system.

The argument for default.target is specified pre-build
as opposed to overriding the hardcoded "multi-user.target"
symlink with post-build scripts or a rootfs overlay

Signed-off-by: Sen Hastings <[email protected]>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <[email protected]>
  • Loading branch information
sen-h authored and arnout committed May 2, 2022
1 parent 4b12336 commit 985e9f7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package/systemd/systemd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ SYSTEMD_CONF_OPTS += -Dfallback-hostname=$(SYSTEMD_FALLBACK_HOSTNAME)
endif

define SYSTEMD_INSTALL_INIT_HOOK
ln -fs multi-user.target \
ln -fs "$(call qstrip,$(BR2_PACKAGE_SYSTEMD_DEFAULT_TARGET))" \
$(TARGET_DIR)/usr/lib/systemd/system/default.target
endef

Expand Down
11 changes: 11 additions & 0 deletions system/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,17 @@ source "$BR2_BASE_DIR/.br2-external.in.init"

endchoice

config BR2_PACKAGE_SYSTEMD_DEFAULT_TARGET
string "The default unit systemd starts at bootup"
default "multi-user.target"
depends on BR2_INIT_SYSTEMD
help
Specify the name of the unit configuration file to be started
at bootup by systemd. Should end in ".target".
ex: multi-user.target

https://www.freedesktop.org/software/systemd/man/systemd.special.html#default.target

choice
prompt "/dev management" if !BR2_INIT_SYSTEMD
default BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS
Expand Down

0 comments on commit 985e9f7

Please sign in to comment.