mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-08-01 23:47:42 +00:00
systemd: rework network/tty units installation
The installation of the network.service and serial-getty.service unit files are now performed via the <pkg>_INIT_SYSTEMD mechanism instead of an installation hook. Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This commit is contained in:
parent
54a653f649
commit
a8139d5442
@ -101,6 +101,13 @@ ifeq ($(BR2_PACKAGE_SYSTEMD_NETWORKD),y)
|
|||||||
SYSTEMD_CONF_OPT += --enable-networkd
|
SYSTEMD_CONF_OPT += --enable-networkd
|
||||||
else
|
else
|
||||||
SYSTEMD_CONF_OPT += --disable-networkd
|
SYSTEMD_CONF_OPT += --disable-networkd
|
||||||
|
define SYSTEMD_INSTALL_SERVICE_NETWORK
|
||||||
|
$(INSTALL) -D -m 644 package/systemd/network.service \
|
||||||
|
$(TARGET_DIR)/etc/systemd/system/network.service
|
||||||
|
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
|
||||||
|
ln -fs ../network.service \
|
||||||
|
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/network.service
|
||||||
|
endef
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(BR2_PACKAGE_SYSTEMD_TIMESYNCD),y)
|
ifeq ($(BR2_PACKAGE_SYSTEMD_TIMESYNCD),y)
|
||||||
@ -131,11 +138,6 @@ define SYSTEMD_INSTALL_INIT_HOOK
|
|||||||
ln -fs ../../../lib/systemd/system/multi-user.target $(TARGET_DIR)/etc/systemd/system/default.target
|
ln -fs ../../../lib/systemd/system/multi-user.target $(TARGET_DIR)/etc/systemd/system/default.target
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define SYSTEMD_INSTALL_TTY_HOOK
|
|
||||||
rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty@tty1.service
|
|
||||||
ln -fs ../../../../lib/systemd/system/serial-getty@.service $(TARGET_DIR)/etc/systemd/system/getty.target.wants/serial-getty@$(BR2_TARGET_GENERIC_GETTY_PORT).service
|
|
||||||
endef
|
|
||||||
|
|
||||||
define SYSTEMD_INSTALL_MACHINEID_HOOK
|
define SYSTEMD_INSTALL_MACHINEID_HOOK
|
||||||
touch $(TARGET_DIR)/etc/machine-id
|
touch $(TARGET_DIR)/etc/machine-id
|
||||||
endef
|
endef
|
||||||
@ -145,28 +147,25 @@ define SYSTEMD_SANITIZE_PATH_IN_UNITS
|
|||||||
-exec $(SED) 's,$(HOST_DIR),,g' {} \;
|
-exec $(SED) 's,$(HOST_DIR),,g' {} \;
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define SYSTEMD_INSTALL_NETWORK_HOOK
|
|
||||||
$(INSTALL) -D -m 644 package/systemd/network.service \
|
|
||||||
$(TARGET_DIR)/etc/systemd/system/network.service
|
|
||||||
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
|
|
||||||
ln -fs ../network.service \
|
|
||||||
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/network.service
|
|
||||||
endef
|
|
||||||
|
|
||||||
SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
|
SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
|
||||||
SYSTEMD_INSTALL_INIT_HOOK \
|
SYSTEMD_INSTALL_INIT_HOOK \
|
||||||
SYSTEMD_INSTALL_TTY_HOOK \
|
|
||||||
SYSTEMD_INSTALL_MACHINEID_HOOK \
|
SYSTEMD_INSTALL_MACHINEID_HOOK \
|
||||||
SYSTEMD_SANITIZE_PATH_IN_UNITS
|
SYSTEMD_SANITIZE_PATH_IN_UNITS
|
||||||
|
|
||||||
ifeq ($(BR2_PACKAGE_SYSTEMD_NETWORKD),)
|
|
||||||
SYSTEMD_POST_INSTALL_TARGET_HOOKS += SYSTEMD_INSTALL_NETWORK_HOOK
|
|
||||||
endif
|
|
||||||
|
|
||||||
define SYSTEMD_USERS
|
define SYSTEMD_USERS
|
||||||
systemd-journal -1 systemd-journal -1 * /var/log/journal - - Journal
|
systemd-journal -1 systemd-journal -1 * /var/log/journal - - Journal
|
||||||
systemd-journal-gateway -1 systemd-journal-gateway -1 * /var/log/journal - - Journal Gateway
|
systemd-journal-gateway -1 systemd-journal-gateway -1 * /var/log/journal - - Journal Gateway
|
||||||
$(SYSTEMD_USER_TIMESYNC)
|
$(SYSTEMD_USER_TIMESYNC)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define SYSTEMD_INSTALL_SERVICE_TTY
|
||||||
|
rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty@tty1.service
|
||||||
|
ln -fs ../../../../lib/systemd/system/serial-getty@.service $(TARGET_DIR)/etc/systemd/system/getty.target.wants/serial-getty@$(BR2_TARGET_GENERIC_GETTY_PORT).service
|
||||||
|
endef
|
||||||
|
|
||||||
|
define SYSTEMD_INSTALL_INIT_SYSTEMD
|
||||||
|
$(SYSTEMD_INSTALL_SERVICE_TTY)
|
||||||
|
$(SYSTEMD_INSTALL_SERVICE_NETWORK)
|
||||||
|
endef
|
||||||
|
|
||||||
$(eval $(autotools-package))
|
$(eval $(autotools-package))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user