mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-28 21:56:31 +00:00
package/dbus: fix machine-id when using systemd
When systemd is used, /var/lib/dbus becomes dangling symlink, because nobody does mkdir /tmp/dbus, so /var/lib/dbus/machine-id could not be written. On SysVinit systems there is init script that creates /tmp/dbus. This patch preserves old behavior for SysVinit systems, and introduces new one for systemd-booted systems: /var/lib/dbus is a persistent directory, it holds symlink /var/lib/dbus/machine-id -> /etc/machine-id as machine-id(5) suggests, and /etc/machine-id is managed by systemd. Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This commit is contained in:
parent
b5fcf95827
commit
6921f45d0a
@ -73,17 +73,18 @@ endef
|
|||||||
|
|
||||||
DBUS_POST_INSTALL_TARGET_HOOKS += DBUS_REMOVE_DEVFILES
|
DBUS_POST_INSTALL_TARGET_HOOKS += DBUS_REMOVE_DEVFILES
|
||||||
|
|
||||||
define DBUS_INSTALL_TARGET_FIXUP
|
define DBUS_INSTALL_INIT_SYSV
|
||||||
|
$(INSTALL) -m 0755 -D package/dbus/S30dbus \
|
||||||
|
$(TARGET_DIR)/etc/init.d/S30dbus
|
||||||
|
|
||||||
mkdir -p $(TARGET_DIR)/var/lib
|
mkdir -p $(TARGET_DIR)/var/lib
|
||||||
rm -rf $(TARGET_DIR)/var/lib/dbus
|
rm -rf $(TARGET_DIR)/var/lib/dbus
|
||||||
ln -sf /tmp/dbus $(TARGET_DIR)/var/lib/dbus
|
ln -sf /tmp/dbus $(TARGET_DIR)/var/lib/dbus
|
||||||
endef
|
endef
|
||||||
|
|
||||||
DBUS_POST_INSTALL_TARGET_HOOKS += DBUS_INSTALL_TARGET_FIXUP
|
define DBUS_INSTALL_INIT_SYSTEMD
|
||||||
|
mkdir -p $(TARGET_DIR)/var/lib/dbus
|
||||||
define DBUS_INSTALL_INIT_SYSV
|
ln -sf /etc/machine-id $(TARGET_DIR)/var/lib/dbus/machine-id
|
||||||
$(INSTALL) -m 0755 -D package/dbus/S30dbus \
|
|
||||||
$(TARGET_DIR)/etc/init.d/S30dbus
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
HOST_DBUS_DEPENDENCIES = host-pkgconf host-expat
|
HOST_DBUS_DEPENDENCIES = host-pkgconf host-expat
|
||||||
|
Loading…
x
Reference in New Issue
Block a user