Skip to contentSkip to conversation

Different enhancements, primarily for systemd

PATCH New Maxim Mikityanskiy 8 participants 60 messages Jan 19, 2015 – Jul 27, 2015

lore
Share & tools
lore
#0 lore raw

cover Different enhancements, primarily for systemd

Hello,

There are some enhancements, primarily targeted on better systemd support, adding some little features to buildroot, and of course some small fixes.

Please review these patches; if things will go fine, I have plans on sending a little more enhancements here :)

Maxim Mikityanskiy (16):
package/busybox: optional udhcpc script
package: install bash-completion files only with bash package/dbus: fix machine-id when using systemd package/systemd: add missing dependencies package/systemd: apply locale settings in user shells package/dosfstools: add missing symlinks package/dropbear: install dropbear.service to correct dir package/e2fsprogs: make /sbin/fsck available package/minidlna: improve systemd support package/transmission: improve systemd support package/samba: use FHS dirs
package/samba: add systemd support
package/tar: add support for acl and xattr package/util-linux: add more tool select options package/vim: add default vimrc package/rng-tools: add systemd support for rngd

 package/busybox/Config.in                        |  5 ++
 package/busybox/busybox.mk                       | 15 +++--
 package/dbus/dbus.mk                             | 13 +++--
 package/dosfstools/dosfstools.mk                 | 13 +++++
 package/dropbear/dropbear.mk                     |  4 +-
 package/e2fsprogs/e2fsprogs.mk                   |  8 +++
 package/kmod/kmod.mk                             |  4 ++
 package/minidlna/minidlna.conf                   | 74 ++++++++++++++++++++++++
 package/minidlna/minidlna.mk                     | 37 ++++++++++++
 package/minidlna/minidlna.service                | 12 ++++
 package/minidlna/minidlna_sysctl.conf            |  1 +
 package/minidlna/minidlna_sysusers.conf          |  1 +
 package/minidlna/minidlna_tmpfiles.conf          |  3 +
 package/rng-tools/rng-tools.mk                   |  8 +++
 package/rng-tools/rngd-exit-code.patch           | 11 ++++
 package/rng-tools/rngd.service                   |  9 +++
 package/samba/S91smb                             |  5 +-
 package/samba/nmbd.service                       | 12 ++++
 package/samba/samba.mk                           | 33 +++++++++--
 package/samba/samba_tmpfiles.conf                |  4 ++
 package/samba/smbd.service                       | 12 ++++
 package/samba/winbindd.service                   | 12 ++++
 package/systemd/Config.in                        |  3 +
 package/systemd/locale.sh                        | 26 +++++++++
 package/systemd/systemd.mk                       | 15 +++++
 package/tar/tar.mk                               | 10 ++++
 package/transmission/transmission-daemon.service | 12 ++++
 package/transmission/transmission.mk             | 45 ++++++++++++++
 package/transmission/transmission_sysctl.conf    |  2 +
 package/transmission/transmission_sysusers.conf  |  1 +
 package/transmission/transmission_tmpfiles.conf  |  1 +
 package/util-linux/Config.in                     | 64 +++++++++++++++++++-
 package/util-linux/util-linux.mk                 | 24 +++++++-
 package/vim/vim.mk                               | 11 ++++
 package/vim/vimrc                                | 14 +++++
 35 files changed, 501 insertions(+), 23 deletions(-)
 create mode 100644 package/minidlna/minidlna.conf
 create mode 100644 package/minidlna/minidlna.service
 create mode 100644 package/minidlna/minidlna_sysctl.conf
 create mode 100644 package/minidlna/minidlna_sysusers.conf
 create mode 100644 package/minidlna/minidlna_tmpfiles.conf
 create mode 100644 package/rng-tools/rngd-exit-code.patch
 create mode 100644 package/rng-tools/rngd.service
 create mode 100644 package/samba/nmbd.service
 create mode 100644 package/samba/samba_tmpfiles.conf
 create mode 100644 package/samba/smbd.service
 create mode 100644 package/samba/winbindd.service
 create mode 100644 package/systemd/locale.sh
 create mode 100644 package/transmission/transmission-daemon.service
 create mode 100644 package/transmission/transmission_sysctl.conf
 create mode 100644 package/transmission/transmission_sysusers.conf
 create mode 100644 package/transmission/transmission_tmpfiles.conf
 create mode 100644 package/vim/vimrc
Signature · 1 line
2.2.1
#1 lore raw

PATCH 1/16 package/busybox: optional udhcpc script

Create new config option BR2_PACKAGE_BUSYBOX_UDHCPC_SCRIPT to control whether to install optional udhcpc default.script. It is possible that udhcpc is not enabled in busybox config, so default.script is useless in that case.

---
 package/busybox/Config.in  |  5 +++++
 package/busybox/busybox.mk | 15 +++++++++++----
 2 files changed, 16 insertions(+), 4 deletions(-)
package/busybox/Config.in +5 -0
index f2f2990..626faf5 100644
@@ -26,6 +26,11 @@ config BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	  Show packages in menuconfig that are potentially also provided
 	  by busybox.
 
+config BR2_PACKAGE_BUSYBOX_UDHCPC_SCRIPT
+	bool "Install the udhcpc default script"
+	help
+	  Install /usr/share/udhcp/default.script for udhcpc.
+
 config BR2_PACKAGE_BUSYBOX_WATCHDOG
 	bool "Install the watchdog daemon startup script"
 	help
package/busybox/busybox.mk +11 -4
index f68a2f8..fbdde62 100644
@@ -49,10 +49,20 @@ BUSYBOX_KCONFIG_FILE = $(BUSYBOX_CONFIG_FILE)
 BUSYBOX_KCONFIG_EDITORS = menuconfig xconfig gconfig
 BUSYBOX_KCONFIG_OPTS = $(BUSYBOX_MAKE_OPTS)
 
+ifeq ($(BR2_PACKAGE_BUSYBOX_UDHCPC_SCRIPT),y)
+define BUSYBOX_INSTALL_UDHCPC_SCRIPT
+	$(INSTALL) -m 0755 -D package/busybox/udhcpc.script \
+		$(TARGET_DIR)/usr/share/udhcpc/default.script; \
+endef
 define BUSYBOX_PERMISSIONS
 	/bin/busybox                     f 4755 0  0 - - - - -
 	/usr/share/udhcpc/default.script f 755  0  0 - - - - -
 endef
+else
+define BUSYBOX_PERMISSIONS
+	/bin/busybox                     f 4755 0  0 - - - - -
+endef
+endif
 
 # If mdev will be used for device creation enable it and copy S10mdev to /etc/init.d
 ifeq ($(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV),y)
@@ -210,10 +220,7 @@ endef
 
 define BUSYBOX_INSTALL_TARGET_CMDS
 	$(BUSYBOX_MAKE_ENV) $(MAKE) $(BUSYBOX_MAKE_OPTS) -C $(@D) install
-	$(INSTALL) -m 0755 -D package/busybox/udhcpc.script \
-		$(TARGET_DIR)/usr/share/udhcpc/default.script
-	$(INSTALL) -m 0755 -d \
-		$(TARGET_DIR)/usr/share/udhcpc/default.script.d
+	$(BUSYBOX_INSTALL_UDHCPC_SCRIPT)
 	$(BUSYBOX_INSTALL_MDEV_CONF)
 endef
 
Signature · 1 line
2.2.1
#2 lore raw

PATCH 1/16 package/busybox: optional udhcpc script

Dear Maxim Mikityanskiy,

Quoted 6 lines · Maxim Mikityanskiy

Create new config option BR2_PACKAGE_BUSYBOX_UDHCPC_SCRIPT to control whether to install optional udhcpc default.script. It is possible that udhcpc is not enabled in busybox config, so default.script is useless in that case.

Thanks for this patch. However, rather than using a new option, can we instead simply test if udhcpc is enabled in the Busybox configuration?

Quoted 12 lines
package/busybox/busybox.mk +4 -0
index f68a2f8..fbdde62 100644
@@ -49,10 +49,20 @@ BUSYBOX_KCONFIG_FILE = $(BUSYBOX_CONFIG_FILE)
 BUSYBOX_KCONFIG_EDITORS = menuconfig xconfig gconfig
 BUSYBOX_KCONFIG_OPTS = $(BUSYBOX_MAKE_OPTS)
 
+ifeq ($(BR2_PACKAGE_BUSYBOX_UDHCPC_SCRIPT),y)
+define BUSYBOX_INSTALL_UDHCPC_SCRIPT
+	$(INSTALL) -m 0755 -D package/busybox/udhcpc.script \
+		$(TARGET_DIR)/usr/share/udhcpc/default.script; \

package/busybox/busybox.mk BUSYBOX_KCONFIG_FILE = $(BUSYBOX_CONFIG_FILE) · line 65

Quoted 10 lines
package/busybox/busybox.mk +6 -0
+endef
 define BUSYBOX_PERMISSIONS
 	/bin/busybox                     f 4755 0  0 - - - - -
 	/usr/share/udhcpc/default.script f 755  0  0 - - - - -
 endef
+else
+define BUSYBOX_PERMISSIONS
+	/bin/busybox                     f 4755 0  0 - - - - -
+endef
+endif

I believe we can remove /usr/share/udhcpc/default.script entirely from
BUSYBOX_PERMISSIONS: it doesn't need any special permission or ownership, so the default done by Buildroot will be fine in terms of ownership, and in terms of permissions, 755 is already enforced by the install command below.

package/busybox/busybox.mk endef · line 225

Quoted 13 lines
package/busybox/busybox.mk +1 -4
 # If mdev will be used for device creation enable it and copy S10mdev to /etc/init.d
 ifeq ($(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV),y)
@@ -210,10 +220,7 @@ endef
 
 define BUSYBOX_INSTALL_TARGET_CMDS
 	$(BUSYBOX_MAKE_ENV) $(MAKE) $(BUSYBOX_MAKE_OPTS) -C $(@D) install
-	$(INSTALL) -m 0755 -D package/busybox/udhcpc.script \
-		$(TARGET_DIR)/usr/share/udhcpc/default.script
-	$(INSTALL) -m 0755 -d \
-		$(TARGET_DIR)/usr/share/udhcpc/default.script.d
+	$(BUSYBOX_INSTALL_UDHCPC_SCRIPT)
 	$(BUSYBOX_INSTALL_MDEV_CONF)
 endef

Here I'd prefer something like:

	if grep -q CONFIG_UDHCPC=y $(BUSYBOX_BUILD_CONFIG) ; then
		... do the udhcpc scripts installation
	fi

Which allows to get rid of the new Config.in option.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 1/16 package/busybox: optional udhcpc script

Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Dear Maxim Mikityanskiy,

Quoted 5 lines · Maxim Mikityanskiy

Create new config option BR2_PACKAGE_BUSYBOX_UDHCPC_SCRIPT to control whether to install optional udhcpc default.script. It is possible that udhcpc is not enabled in busybox config, so default.script is useless in that case.

Quoted 4 lines
Quoted 1 line

Thanks for this patch. However, rather than using a new option, can we instead simply test if udhcpc is enabled in the Busybox configuration?

Agreed, that would be a lot nicer.

Quoted 10 lines

package/busybox/busybox.mk BUSYBOX_KCONFIG_FILE = $(BUSYBOX_CONFIG_FILE) · line 65

Quoted 4 lines
package/busybox/busybox.mk +4 -0
+define BUSYBOX_PERMISSIONS
+	/bin/busybox                     f 4755 0  0 - - - - -
+endef
+endif

I believe we can remove /usr/share/udhcpc/default.script entirely from
BUSYBOX_PERMISSIONS: it doesn't need any special permission or ownership, so the default done by Buildroot will be fine in terms of ownership, and in terms of permissions, 755 is already enforced by the install command below.

Exactly.

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw

PATCH 2/16 package: install bash-completion files only with bash

In reply to Maxim Mikityanskiy

package/systemd, package/kmod, package/util-linux: don't install bash-completion files if bash is not selected to be installed. Otherwise, install bash-completion files.

package/systemd: don't install zsh-completion files is zsh is not selected to be installed. Otherwise, install zsh-completion files.

package/util-linux: don't install empty /usr/share/bash-completion/completions directory if bash is not going to be installed, and install bash-completion files if bash is selected to be installed.

---
 package/kmod/kmod.mk             | 4 ++++
 package/systemd/systemd.mk       | 8 ++++++++
 package/util-linux/util-linux.mk | 7 ++++++-
 3 files changed, 18 insertions(+), 1 deletion(-)
package/kmod/kmod.mk +4 -0
index cc185c8..ff07c78 100644
@@ -64,6 +64,10 @@ else
 KMOD_CONF_OPTS += --disable-tools
 endif
 
+ifeq ($(BR2_PACKAGE_BASH),)
+KMOD_CONF_OPTS += --with-bashcompletiondir=
+endif
+
 # We only install depmod, since that's the only tool used for the
 # host.
 define HOST_KMOD_INSTALL_TOOLS
package/systemd/systemd.mk +8 -0
index dbfce71..92f99c2 100644
@@ -133,6 +133,14 @@ else
 SYSTEMD_CONF_OPTS += --disable-smack
 endif
 
+ifeq ($(BR2_PACKAGE_BASH),)
+SYSTEMD_CONF_OPTS += --with-bashcompletiondir=
+endif
+
+ifeq ($(BR2_PACKAGE_ZSH),)
+SYSTEMD_CONF_OPTS += --with-zshcompletiondir=
+endif
+
 # mq_getattr needs -lrt
 SYSTEMD_MAKE_OPTS += LIBS=-lrt
 SYSTEMD_MAKE_OPTS += LDFLAGS+=-ldl
package/util-linux/util-linux.mk +6 -1
index a530596..c8fb77c 100644
@@ -21,9 +21,14 @@ UTIL_LINUX_CONF_ENV = scanf_cv_type_modifier=no
 UTIL_LINUX_CONF_OPTS += \
 	--disable-rpath \
 	--disable-makeinstall-chown \
-	--disable-bash-completion \
 	--without-python
 
+ifeq ($(BR2_PACKAGE_BASH),)
+UTIL_LINUX_CONF_OPTS += \
+	--disable-bash-completion \
+	--with-bashcompletiondir=
+endif
+
 # We don't want the host-busybox dependency to be added automatically
 HOST_UTIL_LINUX_DEPENDENCIES = host-pkgconf
 
Signature · 1 line
2.2.1
#5 lore raw

PATCH 2/16 package: install bash-completion files only with bash

Dear Maxim Mikityanskiy,

Quoted 7 lines · Maxim Mikityanskiy

package/systemd, package/kmod, package/util-linux: don't install bash-completion files if bash is not selected to be installed. Otherwise, install bash-completion files.

package/systemd: don't install zsh-completion files is zsh is not selected to be installed. Otherwise, install zsh-completion files.

Quoted 6 lines

package/util-linux: don't install empty /usr/share/bash-completion/completions directory if bash is not going to be installed, and install bash-completion files if bash is selected to be installed.

Thanks, applied.

However, long term I wonder if we shouldn't think of a more centralized and radical solution. In package/bash/bash.mk:

ifeq ($(BR2_PACKAGE_BASH),)
define BASH_REMOVE_COMPLETION_FILES

	$(RM) -rf $(TARGET_DIR)/usr/share/bash-completion/

endef
TARGET_FINALIZE_HOOKS += BASH_REMOVE_COMPLETION_FILES endif

This way, as long as bash is not enabled, all bash completion files are removed. We could do the same with zsh.

The only trick here is that such a solution relies on package/bash/bash.mk being included/parsed unconditionally. This is currently the case today: regardless of whether a package is enabled or not, its .mk file is always included/parsed. But at some point in the past, we have been talking on changing this, in order to speed up the parsing time of all the .mk files, which linearly increases with the number of packages we add in Buildroot. But oh well, if we ever want to do that, we can always change the way to handle the bash completion thing, and other similar target finalization stuff that needs to be done if a package is *not* installed.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#6 lore raw

PATCH 3/16 package/dbus: fix machine-id when using systemd

In reply to Maxim Mikityanskiy

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.

---
 package/dbus/dbus.mk | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
package/dbus/dbus.mk +7 -6
index faad2b5..266e27b 100644
@@ -73,17 +73,18 @@ endef
 
 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
 	rm -rf $(TARGET_DIR)/var/lib/dbus
 	ln -sf /tmp/dbus $(TARGET_DIR)/var/lib/dbus
 endef
 
-DBUS_POST_INSTALL_TARGET_HOOKS += DBUS_INSTALL_TARGET_FIXUP
-
-define DBUS_INSTALL_INIT_SYSV
-	$(INSTALL) -m 0755 -D package/dbus/S30dbus \
-		$(TARGET_DIR)/etc/init.d/S30dbus
+define DBUS_INSTALL_INIT_SYSTEMD
+	mkdir -p $(TARGET_DIR)/var/lib/dbus
+	ln -sf /etc/machine-id $(TARGET_DIR)/var/lib/dbus/machine-id
 endef
 
 HOST_DBUS_DEPENDENCIES = host-pkgconf host-expat
Signature · 1 line
2.2.1
#7 lore raw

PATCH 3/16 package/dbus: fix machine-id when using systemd

Hi Maxim,

Quoted 4 lines · Maxim Mikityanskiy

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.

Maybe we should add /tmp/dbus to a tmpfiles config file (see [1]).

Quoted 5 lines

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.

This assumes that /etc is witable... which is not necessary the case :-/

Quoted 36 lines
---
 package/dbus/dbus.mk | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
package/dbus/dbus.mk +7 -7
index faad2b5..266e27b 100644
@@ -73,17 +73,18 @@ endef
 
 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
        rm -rf $(TARGET_DIR)/var/lib/dbus
        ln -sf /tmp/dbus $(TARGET_DIR)/var/lib/dbus
 endef
 
-DBUS_POST_INSTALL_TARGET_HOOKS += DBUS_INSTALL_TARGET_FIXUP
-
-define DBUS_INSTALL_INIT_SYSV
-       $(INSTALL) -m 0755 -D package/dbus/S30dbus \
-               $(TARGET_DIR)/etc/init.d/S30dbus
+define DBUS_INSTALL_INIT_SYSTEMD
+       mkdir -p $(TARGET_DIR)/var/lib/dbus
+       ln -sf /etc/machine-id $(TARGET_DIR)/var/lib/dbus/machine-id
 endef
 
 HOST_DBUS_DEPENDENCIES = host-pkgconf host-expat
--
Quoted 1 line

2.2.1

I'd prefer keeping the filesystem layout as close as possible between sysVinit and systemd.
So, adding a symlink /etc/machine-id pointing to /var/lib/dbus/machine-id (which will ends up in /tmp/dbus/machine-id thanks to the tmpfiles.d stuff) should be enough.

Then the last thing to check is that systemd-machine-id-setup correctly generates the machine-id file even if /etc/machine-id is a symlink pointing to a non-existing file.

[1] http://www.freedesktop.org/software/systemd/man/tmpfiles.d.html

Regards,

Signature · 1 line
Samuel
#8 lore raw

PATCH 3/16 package/dbus: fix machine-id when using systemd

Sorry, resending my last message, I've answered off-the-list. My fault :(

Hi Samuel,

2015-02-02 16:50 GMT+02:00 Samuel Martin <[email protected]>:

Quoted 11 lines

Hi Maxim,

Quoted 4 lines · Maxim Mikityanskiy

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.

Maybe we should add /tmp/dbus to a tmpfiles config file (see [1]).

Quoted 1 line
Quoted 6 lines
Quoted 4 lines

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.

This assumes that /etc is witable... which is not necessary the case :-/

No, this doesn't assume that /etc is writable. Let me explain.

When systemd is installed, it creates empty /etc/machine-id file (look at SYSTEMD_INSTALL_MACHINEID_HOOK in package/systemd/systemd.mk). If /etc is writable, /etc/machine-id is populated at first boot, and /var/lib/dbus/machine-id symlink just points at this file, as machine-id(5) man page suggests. If /etc is read-only, systemd does bind mount /run/machine-id to /etc/machine-id and populates temporary file. /var/lib/dbus/machine-id also just points at this file. So no problem with read-only /etc.
I'm afraid it is wrong solution. At first, we can't just add /etc/machine-id -> /var/lib/dbus/machine-id symlink, because package/systemd/systemd.mk creates empty file /etc/machine-id ;)

At second, if /etc/machine-id will always point to temporary location, it will be regenerated at every boot even if /etc is writable. It leads to wrong behavior of systemd-journald: it will create new 16 MiB journal file at every boot because of changing machine-id.

Quoted 10 lines

Then the last thing to check is that systemd-machine-id-setup correctly generates the machine-id file even if /etc/machine-id is a symlink pointing to a non-existing file.

[1] http://www.freedesktop.org/software/systemd/man/tmpfiles.d.html

Regards,

--
Samuel

/etc/machine-id is such file that should be invariant from boot to boot, so placing it to temporary location is wrong (at least it causes problems with systemd-journald). But if /etc is read-only (and /etc/machine-id is not populated in post-build scripts), systemd will also handle this and bind mount temporary /run/machine-id to /etc/machine-id. /var/lib/dbus/machine-id just points to /etc/machine-id that is always populated on systemd systems.

What about keeping similar filesystem layout on SysVinit and systemd systems, it would be nice if there was some simple way to support /etc/machine-id on SysVinit systems. But it is easier to preserve old behavior, because it works and causes no troubles on SysVinit systems.

Cheers,
Maxim

#9 lore raw

PATCH 3/16 package/dbus: fix machine-id when using systemd

In reply to Maxim Mikityanskiy

Dear Maxim Mikityanskiy,

Quoted 10 lines · Maxim Mikityanskiy

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.

Quoted 4 lines
---
 package/dbus/dbus.mk | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#10 lore raw

PATCH 4/16 package/systemd: add missing dependencies

In reply to Maxim Mikityanskiy

Systemd depends on mount and nologin from util-linux. Mount from busybox is not fine, because its behavior differs from util-linux mount. Busybox mount does not handle correctly 'mount / -o remount' (should apply options from /etc/fstab). Nologin should be present, because systemd-sysusers uses it as shell for newly created system users.

---
 package/systemd/Config.in | 3 +++
 1 file changed, 3 insertions(+)
package/systemd/Config.in +3 -0
index ed59c8d..8a73398 100644
@@ -22,6 +22,9 @@ config BR2_PACKAGE_SYSTEMD
 	select BR2_PACKAGE_UTIL_LINUX
 	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
 	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+	select BR2_PACKAGE_UTIL_LINUX_BINARIES
+	select BR2_PACKAGE_UTIL_LINUX_MOUNT
+	select BR2_PACKAGE_UTIL_LINUX_NOLOGIN
 	select BR2_PACKAGE_KMOD
 	select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # kmod-tools
 	select BR2_PACKAGE_KMOD_TOOLS
Signature · 1 line
2.2.1
#11 lore raw

PATCH 4/16 package/systemd: add missing dependencies

Quoted 7 lines · Maxim Mikityanskiy

Systemd depends on mount and nologin from util-linux. Mount from busybox is not fine, because its behavior differs from util-linux mount. Busybox mount does not handle correctly 'mount / -o remount' (should apply options from /etc/fstab). Nologin should be present, because systemd-sysusers uses it as shell for newly created system users.

Regards,

Signature · 1 line
Samuel
#12 lore raw

PATCH 4/16 package/systemd: add missing dependencies

In reply to Maxim Mikityanskiy

Dear Maxim Mikityanskiy,

Quoted 10 lines · Maxim Mikityanskiy

Systemd depends on mount and nologin from util-linux. Mount from busybox is not fine, because its behavior differs from util-linux mount. Busybox mount does not handle correctly 'mount / -o remount' (should apply options from /etc/fstab). Nologin should be present, because systemd-sysusers uses it as shell for newly created system users.

---
 package/systemd/Config.in | 3 +++
 1 file changed, 3 insertions(+)

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#13 lore raw

PATCH 5/16 package/systemd: apply locale settings in user shells

In reply to Maxim Mikityanskiy

Add /etc/profile.d/locale.sh script from Arch Linux to apply systemd locale settings in user shells.

---
 package/systemd/locale.sh  | 26 ++++++++++++++++++++++++++
 package/systemd/systemd.mk |  7 +++++++
 2 files changed, 33 insertions(+)
 create mode 100644 package/systemd/locale.sh
package/systemd/locale.sh new file +26 -0
new file mode 100644
index 0000000..b665872
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+if [ -z "$LANG" ]; then
+  if [ -n "$XDG_CONFIG_HOME" ] && [ -r "$XDG_CONFIG_HOME/locale.conf" ]; then
+    . "$XDG_CONFIG_HOME/locale.conf"
+  elif [ -n $HOME ] && [ -r $HOME/.config/locale.conf ]; then
+    . "$HOME/.config/locale.conf"
+  elif [ -r /etc/locale.conf ]; then
+    . /etc/locale.conf
+  fi
+fi
+
+LANG=${LANG:-C}
+export LANG
+[ -n "$LC_CTYPE" ]          && export LC_CTYPE
+[ -n "$LC_NUMERIC" ]        && export LC_NUMERIC
+[ -n "$LC_TIME" ]           && export LC_TIME
+[ -n "$LC_COLLATE" ]        && export LC_COLLATE
+[ -n "$LC_MONETARY" ]       && export LC_MONETARY
+[ -n "$LC_MESSAGES" ]       && export LC_MESSAGES
+[ -n "$LC_PAPER" ]          && export LC_PAPER
+[ -n "$LC_NAME" ]           && export LC_NAME
+[ -n "$LC_ADDRESS" ]        && export LC_ADDRESS
+[ -n "$LC_TELEPHONE" ]      && export LC_TELEPHONE
+[ -n "$LC_MEASUREMENT" ]    && export LC_MEASUREMENT
+[ -n "$LC_IDENTIFICATION" ] && export LC_IDENTIFICATION
package/systemd/systemd.mk +7 -0
index 92f99c2..ef14c76 100644
@@ -158,6 +158,12 @@ define SYSTEMD_INSTALL_MACHINEID_HOOK
 	touch $(TARGET_DIR)/etc/machine-id
 endef
 
+define SYSTEMD_INSTALL_LOCALE_SH_HOOK
+	mkdir -p $(TARGET_DIR)/etc/profile.d
+	$(INSTALL) -D -m 644 package/systemd/locale.sh \
+		$(TARGET_DIR)/etc/profile.d/locale.sh
+endef
+
 define SYSTEMD_SANITIZE_PATH_IN_UNITS
 	find $(TARGET_DIR)/lib/systemd/system -name '*.service' \
 		-exec $(SED) 's,$(HOST_DIR),,g' {} \;
@@ -172,6 +178,7 @@ endef
 SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
 	SYSTEMD_INSTALL_INIT_HOOK \
 	SYSTEMD_INSTALL_MACHINEID_HOOK \
+	SYSTEMD_INSTALL_LOCALE_SH_HOOK \
 	SYSTEMD_INSTALL_RESOLVCONF_HOOK \
 	SYSTEMD_DISABLE_LDCONFIG_SERVICE_HOOK \
 	SYSTEMD_SANITIZE_PATH_IN_UNITS
Signature · 1 line
2.2.1
#14 lore raw

PATCH 5/16 package/systemd: apply locale settings in user shells

Hi Maxim,

Quoted 2 lines · Maxim Mikityanskiy

Add /etc/profile.d/locale.sh script from Arch Linux to apply systemd locale settings in user shells.

I don't really see the point of doing it especially when systemd is used. This configuration file is for shell, even busybox should support it...

Why not putting it in the default skeleton? Any thought about this from other users/developpers?

Quoted 68 lines
---
 package/systemd/locale.sh  | 26 ++++++++++++++++++++++++++
 package/systemd/systemd.mk |  7 +++++++
 2 files changed, 33 insertions(+)
 create mode 100644 package/systemd/locale.sh
package/systemd/locale.sh new file +26 -0
new file mode 100644
index 0000000..b665872
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+if [ -z "$LANG" ]; then
+  if [ -n "$XDG_CONFIG_HOME" ] && [ -r "$XDG_CONFIG_HOME/locale.conf" ]; then
+    . "$XDG_CONFIG_HOME/locale.conf"
+  elif [ -n $HOME ] && [ -r $HOME/.config/locale.conf ]; then
+    . "$HOME/.config/locale.conf"
+  elif [ -r /etc/locale.conf ]; then
+    . /etc/locale.conf
+  fi
+fi
+
+LANG=${LANG:-C}
+export LANG
+[ -n "$LC_CTYPE" ]          && export LC_CTYPE
+[ -n "$LC_NUMERIC" ]        && export LC_NUMERIC
+[ -n "$LC_TIME" ]           && export LC_TIME
+[ -n "$LC_COLLATE" ]        && export LC_COLLATE
+[ -n "$LC_MONETARY" ]       && export LC_MONETARY
+[ -n "$LC_MESSAGES" ]       && export LC_MESSAGES
+[ -n "$LC_PAPER" ]          && export LC_PAPER
+[ -n "$LC_NAME" ]           && export LC_NAME
+[ -n "$LC_ADDRESS" ]        && export LC_ADDRESS
+[ -n "$LC_TELEPHONE" ]      && export LC_TELEPHONE
+[ -n "$LC_MEASUREMENT" ]    && export LC_MEASUREMENT
+[ -n "$LC_IDENTIFICATION" ] && export LC_IDENTIFICATION
package/systemd/systemd.mk +7 -1
index 92f99c2..ef14c76 100644
@@ -158,6 +158,12 @@ define SYSTEMD_INSTALL_MACHINEID_HOOK
        touch $(TARGET_DIR)/etc/machine-id
 endef
 
+define SYSTEMD_INSTALL_LOCALE_SH_HOOK
+       mkdir -p $(TARGET_DIR)/etc/profile.d
+       $(INSTALL) -D -m 644 package/systemd/locale.sh \
+               $(TARGET_DIR)/etc/profile.d/locale.sh
+endef
+
 define SYSTEMD_SANITIZE_PATH_IN_UNITS
        find $(TARGET_DIR)/lib/systemd/system -name '*.service' \
                -exec $(SED) 's,$(HOST_DIR),,g' {} \;
@@ -172,6 +178,7 @@ endef
 SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
        SYSTEMD_INSTALL_INIT_HOOK \
        SYSTEMD_INSTALL_MACHINEID_HOOK \
+       SYSTEMD_INSTALL_LOCALE_SH_HOOK \
        SYSTEMD_INSTALL_RESOLVCONF_HOOK \
        SYSTEMD_DISABLE_LDCONFIG_SERVICE_HOOK \
        SYSTEMD_SANITIZE_PATH_IN_UNITS
--

2.2.1

Quoted 4 lines

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Regards,

Signature · 1 line
Samuel
#15 lore raw

PATCH 5/16 package/systemd: apply locale settings in user shells

Hi Samuel,

2015-02-02 17:20 GMT+02:00 Samuel Martin <[email protected]>:

Quoted 8 lines

Hi Maxim,

Quoted 2 lines · Maxim Mikityanskiy

Add /etc/profile.d/locale.sh script from Arch Linux to apply systemd locale settings in user shells.

I don't really see the point of doing it especially when systemd is used. This configuration file is for shell, even busybox should support it...

This /etc/profile.d/locale.sh file reads locale settings from /etc/locale.conf (and possibly user-specific files) and applies these settings on shell logins. /etc/locale.conf was introduced with systemd, it is written by localectl tool from systemd, so I decided to install /etc/profile.d/locale.sh when systemd is used.

Quoted 1 line

Why not putting it in the default skeleton?

Of course, /etc/locale.conf is just a text file, it is not necessary should be generated by localectl, it could be written in text editor, so /etc/profile.d/locale.sh could be put in the default skeleton, so there will be convenient place for storing locale settings on both systemd and SysVinit systems. I just didn't think about this before.

Quoted 77 lines

Any thought about this from other users/developpers?

Quoted 68 lines
---
 package/systemd/locale.sh  | 26 ++++++++++++++++++++++++++
 package/systemd/systemd.mk |  7 +++++++
 2 files changed, 33 insertions(+)
 create mode 100644 package/systemd/locale.sh
package/systemd/locale.sh new file +26 -0
new file mode 100644
index 0000000..b665872
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+if [ -z "$LANG" ]; then
+  if [ -n "$XDG_CONFIG_HOME" ] && [ -r "$XDG_CONFIG_HOME/locale.conf" ]; then
+    . "$XDG_CONFIG_HOME/locale.conf"
+  elif [ -n $HOME ] && [ -r $HOME/.config/locale.conf ]; then
+    . "$HOME/.config/locale.conf"
+  elif [ -r /etc/locale.conf ]; then
+    . /etc/locale.conf
+  fi
+fi
+
+LANG=${LANG:-C}
+export LANG
+[ -n "$LC_CTYPE" ]          && export LC_CTYPE
+[ -n "$LC_NUMERIC" ]        && export LC_NUMERIC
+[ -n "$LC_TIME" ]           && export LC_TIME
+[ -n "$LC_COLLATE" ]        && export LC_COLLATE
+[ -n "$LC_MONETARY" ]       && export LC_MONETARY
+[ -n "$LC_MESSAGES" ]       && export LC_MESSAGES
+[ -n "$LC_PAPER" ]          && export LC_PAPER
+[ -n "$LC_NAME" ]           && export LC_NAME
+[ -n "$LC_ADDRESS" ]        && export LC_ADDRESS
+[ -n "$LC_TELEPHONE" ]      && export LC_TELEPHONE
+[ -n "$LC_MEASUREMENT" ]    && export LC_MEASUREMENT
+[ -n "$LC_IDENTIFICATION" ] && export LC_IDENTIFICATION
package/systemd/systemd.mk +7 -1
index 92f99c2..ef14c76 100644
@@ -158,6 +158,12 @@ define SYSTEMD_INSTALL_MACHINEID_HOOK
        touch $(TARGET_DIR)/etc/machine-id
 endef
 
+define SYSTEMD_INSTALL_LOCALE_SH_HOOK
+       mkdir -p $(TARGET_DIR)/etc/profile.d
+       $(INSTALL) -D -m 644 package/systemd/locale.sh \
+               $(TARGET_DIR)/etc/profile.d/locale.sh
+endef
+
 define SYSTEMD_SANITIZE_PATH_IN_UNITS
        find $(TARGET_DIR)/lib/systemd/system -name '*.service' \
                -exec $(SED) 's,$(HOST_DIR),,g' {} \;
@@ -172,6 +178,7 @@ endef
 SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
        SYSTEMD_INSTALL_INIT_HOOK \
        SYSTEMD_INSTALL_MACHINEID_HOOK \
+       SYSTEMD_INSTALL_LOCALE_SH_HOOK \
        SYSTEMD_INSTALL_RESOLVCONF_HOOK \
        SYSTEMD_DISABLE_LDCONFIG_SERVICE_HOOK \
        SYSTEMD_SANITIZE_PATH_IN_UNITS
--

2.2.1

Quoted 4 lines

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Regards,

Quoted 2 lines

--
Samuel

Cheers,
Maxim

#16 lore raw

PATCH v2 1/1 skeleton: apply locale settings in user shells

In reply to Maxim Mikityanskiy

From: Maxim Mikityanskiy <[email protected]>

Add /etc/profile.d/locale.sh script from Arch Linux to /etc/profile. This script looks for locale.conf, sources it, and exports the LANG and LC_* variables.

[Arnout: put in /etc/profile in the skeleton rather than making it
systemd specific.]

---
v2 [Arnout]: make the modification to /etc/profile in the skeleton rather than something systemd-specific - proposed by Samuel Martin.

---
 system/skeleton/etc/profile | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
system/skeleton/etc/profile +23 -0
index 3812dda..c7438fe 100644
@@ -35,6 +35,29 @@ if [ "$PS1" ]; then
 
 fi;
 
+if [ -z "$LANG" ]; then
+  if [ -n $HOME ] && [ -r $HOME/.config/locale.conf ]; then
+    . "$HOME/.config/locale.conf"
+  elif [ -r /etc/locale.conf ]; then
+    . /etc/locale.conf
+  fi
+fi
+
+LANG=${LANG:-C}
+export LANG
+[ -n "$LC_CTYPE" ]          && export LC_CTYPE
+[ -n "$LC_NUMERIC" ]        && export LC_NUMERIC
+[ -n "$LC_TIME" ]           && export LC_TIME
+[ -n "$LC_COLLATE" ]        && export LC_COLLATE
+[ -n "$LC_MONETARY" ]       && export LC_MONETARY
+[ -n "$LC_MESSAGES" ]       && export LC_MESSAGES
+[ -n "$LC_PAPER" ]          && export LC_PAPER
+[ -n "$LC_NAME" ]           && export LC_NAME
+[ -n "$LC_ADDRESS" ]        && export LC_ADDRESS
+[ -n "$LC_TELEPHONE" ]      && export LC_TELEPHONE
+[ -n "$LC_MEASUREMENT" ]    && export LC_MEASUREMENT
+[ -n "$LC_IDENTIFICATION" ] && export LC_IDENTIFICATION
+
 # Source configuration files from /etc/profile.d
 for i in /etc/profile.d/*.sh ; do
     if [ -r "$i" ]; then
Signature · 1 line
2.1.4
#17 lore raw

PATCH v2 1/1 skeleton: apply locale settings in user shells

Dear Arnout Vandecappelle (Essensium/Mind),

Quoted 9 lines · Arnout Vandecappelle (Essensium/Mind)

From: Maxim Mikityanskiy <[email protected]>

Add /etc/profile.d/locale.sh script from Arch Linux to /etc/profile. This script looks for locale.conf, sources it, and exports the LANG and LC_* variables.

[Arnout: put in /etc/profile in the skeleton rather than making it
systemd specific.]

Quoted 8 lines

---
v2 [Arnout]: make the modification to /etc/profile in the skeleton rather than something systemd-specific - proposed by Samuel Martin.

---
 system/skeleton/etc/profile | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#18 lore raw

PATCH 6/16 package/dosfstools: add missing symlinks

In reply to Maxim Mikityanskiy

Install alternative symlinks for dosfstools mkfs.fat, fsck.fat and fatlabel. Those symlinks are generally installed by make install, but buildroot does not use make install for dosfstools, but symlinks should be installed anyway.

---
 package/dosfstools/dosfstools.mk | 13 +++++++++++++
 1 file changed, 13 insertions(+)
package/dosfstools/dosfstools.mk +13 -0
index a9d8392..f768c97 100644
@@ -37,6 +37,19 @@ define DOSFSTOOLS_INSTALL_TARGET_CMDS
 	test -z "$(DOSFSTOOLS_INSTALL_BIN_FILES_y)" || \
 	$(INSTALL) -m 755 $(addprefix $(@D)/,$(DOSFSTOOLS_INSTALL_BIN_FILES_y)) \
 		$(TARGET_DIR)/sbin/
+	if [[ "$(BR2_PACKAGE_DOSFSTOOLS_FATLABEL)" = y ]]; then \
+		ln -fs fatlabel $(TARGET_DIR)/sbin/dosfslabel; \
+	fi
+	if [[ "$(BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT)" = y ]]; then \
+		ln -fs fsck.fat $(TARGET_DIR)/sbin/dosfsck; \
+		ln -fs fsck.fat $(TARGET_DIR)/sbin/fsck.msdos; \
+		ln -fs fsck.fat $(TARGET_DIR)/sbin/fsck.vfat; \
+	fi
+	if [[ "$(BR2_PACKAGE_DOSFSTOOLS_MKFS_FAT)" = y ]]; then \
+		ln -fs mkfs.fat $(TARGET_DIR)/sbin/mkdosfs; \
+		ln -fs mkfs.fat $(TARGET_DIR)/sbin/mkfs.msdos; \
+		ln -fs mkfs.fat $(TARGET_DIR)/sbin/mkfs.vfat; \
+	fi
 endef
 
 define HOST_DOSFSTOOLS_BUILD_CMDS
Signature · 1 line
2.2.1
#19 lore raw

PATCH 6/16 package/dosfstools: add missing symlinks

Quoted 6 lines · Maxim Mikityanskiy

Install alternative symlinks for dosfstools mkfs.fat, fsck.fat and fatlabel. Those symlinks are generally installed by make install, but buildroot does not use make install for dosfstools, but symlinks should be installed anyway.

Regards,

Signature · 1 line
Samuel
#20 lore raw

PATCH 6/16 package/dosfstools: add missing symlinks

In reply to Maxim Mikityanskiy

Dear Maxim Mikityanskiy,

Quoted 6 lines · Maxim Mikityanskiy

Install alternative symlinks for dosfstools mkfs.fat, fsck.fat and fatlabel. Those symlinks are generally installed by make install, but buildroot does not use make install for dosfstools, but symlinks should be installed anyway.

Thanks, I've applied your patch, but I've basically rewritten entirely the installation logic to use makefile code instead of shell code. See
http://git.buildroot.net/buildroot/commit/?id=cef6a787cad4d5417b8672c8fd4c200bf29655ac.

To be honest, I wonder why dosfstools provides such sub-options to select which binaries should be installed. The binaries are really small:

-rwxr-xr-x 1 thomas thomas 40780 mars   8 22:59 fatlabel
-rwxr-xr-x 1 thomas thomas 42816 mars   8 22:59 fsck.fat
-rwxr-xr-x 1 thomas thomas 24432 mars   8 22:59 mkfs.fat

So I believe we could probably just install all of them unconditionally.

But oh, well, this is for another patch.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#21 lore raw

PATCH 7/16 package/dropbear: install dropbear.service to correct dir

In reply to Maxim Mikityanskiy

The place for package-provided systemd units is /lib/systemd/system. /etc/systemd/system is for custom units.

---
 package/dropbear/dropbear.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/dropbear/dropbear.mk +2 -2
index 696095d..2230c61 100644
@@ -46,9 +46,9 @@ endef
 
 define DROPBEAR_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/dropbear/dropbear.service \
-		$(TARGET_DIR)/etc/systemd/system/dropbear.service
+		$(TARGET_DIR)/lib/systemd/system/dropbear.service
 	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-	ln -fs ../dropbear.service \
+	ln -fs /lib/systemd/system/dropbear.service \
 		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/dropbear.service
 endef
 
Signature · 1 line
2.2.1
#22 lore raw

PATCH 7/16 package/dropbear: install dropbear.service to correct dir

Hi Maxim,

Looks like you forget your sob-line here ;-)

Anyway, you got my:

Quoted 11 lines · Maxim Mikityanskiy

The place for package-provided systemd units is /lib/systemd/system. /etc/systemd/system is for custom units.

---
 package/dropbear/dropbear.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/dropbear/dropbear.mk +0 -0
index 696095d..2230c61 100644

package/dropbear/dropbear.mk endef · line 52

Quoted 9 lines
package/dropbear/dropbear.mk +2 -2
@@ -46,9 +46,9 @@ endef
 
 define DROPBEAR_INSTALL_INIT_SYSTEMD
        $(INSTALL) -D -m 644 package/dropbear/dropbear.service \
-               $(TARGET_DIR)/etc/systemd/system/dropbear.service
+               $(TARGET_DIR)/lib/systemd/system/dropbear.service
        mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
-       ln -fs ../dropbear.service \
+       ln -fs /lib/systemd/system/dropbear.service \
                $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/dropbear.service

Though, you might often find relative symlinks, so they are correctly resolved when looking at $(TARGET_DIR).

Quoted 4 lines
package/dropbear/dropbear.mk +0 -1
 endef
 
--

2.2.1

Regards,

Signature · 1 line
Samuel
#23 lore raw

PATCH 7/16 package/dropbear: install dropbear.service to correct dir

In reply to Maxim Mikityanskiy

Dear Maxim Mikityanskiy,

Quoted 5 lines · Maxim Mikityanskiy

The place for package-provided systemd units is /lib/systemd/system. /etc/systemd/system is for custom units.

---
 package/dropbear/dropbear.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied to next, thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#24 lore raw

PATCH 8/16 package/e2fsprogs: make /sbin/fsck available

In reply to Maxim Mikityanskiy

systemd looks for fsck in /sbin, so make symlink:
/sbin/fsck -> /usr/sbin/fsck

---
 package/e2fsprogs/e2fsprogs.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/e2fsprogs/e2fsprogs.mk +8 -0
index b4f0950..9f0310d 100644
@@ -117,5 +117,13 @@ ifeq ($(BR2_PACKAGE_E2FSPROGS_FINDFS),y)
 E2FSPROGS_POST_INSTALL_TARGET_HOOKS += E2FSPROGS_TARGET_FINDFS_SYMLINK
 endif
 
+define E2FSPROGS_TARGET_FSCK_SYMLINK
+	ln -sf ../usr/sbin/fsck $(TARGET_DIR)/sbin/fsck
+endef
+
+ifeq ($(BR2_PACKAGE_E2FSPROGS_FSCK),y)
+E2FSPROGS_POST_INSTALL_TARGET_HOOKS += E2FSPROGS_TARGET_FSCK_SYMLINK
+endif
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
Signature · 1 line
2.2.1
#25 lore raw

PATCH 8/16 package/e2fsprogs: make /sbin/fsck available

Quoted 4 lines · Maxim Mikityanskiy

systemd looks for fsck in /sbin, so make symlink:
/sbin/fsck -> /usr/sbin/fsck

Quoted 25 lines
---
 package/e2fsprogs/e2fsprogs.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/e2fsprogs/e2fsprogs.mk +8 -1
index b4f0950..9f0310d 100644
@@ -117,5 +117,13 @@ ifeq ($(BR2_PACKAGE_E2FSPROGS_FINDFS),y)
 E2FSPROGS_POST_INSTALL_TARGET_HOOKS += E2FSPROGS_TARGET_FINDFS_SYMLINK
 endif
 
+define E2FSPROGS_TARGET_FSCK_SYMLINK
+       ln -sf ../usr/sbin/fsck $(TARGET_DIR)/sbin/fsck
+endef
+
+ifeq ($(BR2_PACKAGE_E2FSPROGS_FSCK),y)
+E2FSPROGS_POST_INSTALL_TARGET_HOOKS += E2FSPROGS_TARGET_FSCK_SYMLINK
+endif
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
--

2.2.1

Quoted 4 lines

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Regards,

Signature · 1 line
Samuel
#26 lore raw

PATCH 8/16 package/e2fsprogs: make /sbin/fsck available

In reply to Maxim Mikityanskiy

Dear Maxim Mikityanskiy,

Quoted 7 lines · Maxim Mikityanskiy

systemd looks for fsck in /sbin, so make symlink:
/sbin/fsck -> /usr/sbin/fsck

---
 package/e2fsprogs/e2fsprogs.mk | 8 ++++++++
 1 file changed, 8 insertions(+)

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#27 lore raw

PATCH 9/16 package/minidlna: improve systemd support

In reply to Maxim Mikityanskiy

Support running minidlna in system-wide mode using systemd:

1. Set --with-db-path and --with-log-path configure options to make default minidlna directories comply with FHS.

2. Install suitable minidlna.conf for system-wide mode.

3. Install sysctl.d config file to increase inotify watches count.

4. Install tmpfiles.d config file to mkdir and chmod necessary directories for minidlna running in system-wide mode.

5. Install sysusers.d config file to create minidlna user when using systemd.

6. Install minidlna.service for systemd.

Note: User=minidlna should be set in minidlna.service, not in minidlna.conf, because minidlna is unable to drop privileges correctly by itself: it does not get any privileges provided by groups of minidlna user. Systemd drops privileges correctly in that case.

---
 package/minidlna/minidlna.conf          | 74 +++++++++++++++++++++++++++++++++
 package/minidlna/minidlna.mk            | 37 +++++++++++++++++
 package/minidlna/minidlna.service       | 12 ++++++
 package/minidlna/minidlna_sysctl.conf   |  1 +
 package/minidlna/minidlna_sysusers.conf |  1 +
 package/minidlna/minidlna_tmpfiles.conf |  3 ++
 6 files changed, 128 insertions(+)
 create mode 100644 package/minidlna/minidlna.conf
 create mode 100644 package/minidlna/minidlna.service
 create mode 100644 package/minidlna/minidlna_sysctl.conf
 create mode 100644 package/minidlna/minidlna_sysusers.conf
 create mode 100644 package/minidlna/minidlna_tmpfiles.conf
package/minidlna/minidlna.conf new file +74 -0
new file mode 100644
index 0000000..9e4fbc9
@@ -0,0 +1,74 @@
+# port for HTTP (descriptions, SOAP, media transfer) traffic
+port=8200
+
+# network interfaces to serve, comma delimited
+#network_interface=eth0
+
+# set this to the directory you want scanned.
+# * if you want multiple directories, you can have multiple media_dir= lines
+# * if you want to restrict a media_dir to specific content types, you
+#   can prepend the types, followed by a comma, to the directory:
+#   + "A" for audio  (eg. media_dir=A,/home/jmaggard/Music)
+#   + "V" for video  (eg. media_dir=V,/home/jmaggard/Videos)
+#   + "P" for images (eg. media_dir=P,/home/jmaggard/Pictures)
+#   + "PV" for pictures and video (eg. media_dir=PV,/home/jmaggard/digital_camera)
+#media_dir=/home
+
+# set this to merge all media_dir base contents into the root container
+# note: the default is no
+#merge_media_dirs=no
+
+# set this if you want to customize the name that shows up on your clients
+friendly_name=Buildroot DLNA Server
+
+# set this to change the verbosity of the information that is logged
+# each section can use a different level: off, fatal, error, warn, info, or debug
+#log_level=general,artwork,database,inotify,scanner,metadata,http,ssdp,tivo=warn
+
+# this should be a list of file names to check for when searching for album art
+# note: names should be delimited with a forward slash ("/")
+album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg
+
+# set this to no to disable inotify monitoring to automatically discover new files
+# note: the default is yes
+inotify=yes
+
+# set this to yes to enable support for streaming .jpg and .mp3 files to a TiVo supporting HMO
+enable_tivo=no
+
+# set this to strictly adhere to DLNA standards.
+# * This will allow server-side downscaling of very large JPEG images,
+#   which may hurt JPEG serving performance on (at least) Sony DLNA products.
+strict_dlna=no
+
+# default presentation url is http address on port 80
+#presentation_url=http://www.mylan/index.php
+
+# notify interval in seconds. default is 895 seconds.
+notify_interval=900
+
+# serial and model number the daemon will report to clients
+# in its XML description
+serial=12345678
+model_number=1
+
+# specify the path to the MiniSSDPd socket
+#minissdpdsocket=/var/run/minissdpd.sock
+
+# use different container as root of the tree
+# possible values:
+#   + "." - use standard container (this is the default)
+#   + "B" - "Browse Directory"
+#   + "M" - "Music"
+#   + "V" - "Video"
+#   + "P" - "Pictures"
+#   + Or, you can specify the ObjectID of your desired root container (eg. 1$F for Music/Playlists)
+# if you specify "B" and client device is audio-only then "Music/Folders" will be used as root
+#root_container=.
+
+# always force SortCriteria to this value, regardless of the SortCriteria passed by the client
+#force_sort_criteria=+upnp:class,+upnp:originalTrackNumber,+dc:title
+
+# maximum number of simultaneous connections
+# note: many clients open several simultaneous connections while streaming
+#max_connections=50
package/minidlna/minidlna.mk +37 -0
index bcbe5fa..fcc9d06 100644
@@ -24,4 +24,41 @@ MINIDLNA_CONF_OPTS = \
 	--disable-static
 endif
 
+MINIDLNA_CONF_OPTS += \
+	--with-db-path=/var/cache/minidlna \
+	--with-log-path=/var/log/minidlna
+
+define MINIDLNA_INSTALL_CONF_HOOK
+	$(INSTALL) -D -m 644 package/minidlna/minidlna.conf \
+		$(TARGET_DIR)/etc/minidlna.conf
+endef
+
+define MINIDLNA_INSTALL_SYSUSERS_HOOK
+	$(INSTALL) -D -m 644 package/minidlna/minidlna_sysusers.conf \
+		$(TARGET_DIR)/usr/lib/sysusers.d/minidlna.conf
+endef
+
+define MINIDLNA_INSTALL_TMPFILES_HOOK
+	$(INSTALL) -D -m 644 package/minidlna/minidlna_tmpfiles.conf \
+		$(TARGET_DIR)/usr/lib/tmpfiles.d/minidlna.conf
+endef
+
+define MINIDLNA_INSTALL_SYSCTL_HOOK
+	$(INSTALL) -D -m 644 package/minidlna/minidlna_sysctl.conf \
+		$(TARGET_DIR)/usr/lib/sysctl.d/20-minidlna.conf
+endef
+
+ifeq ($(BR2_INIT_SYSTEMD),y)
+MINIDLNA_POST_INSTALL_TARGET_HOOKS += \
+	MINIDLNA_INSTALL_CONF_HOOK \
+	MINIDLNA_INSTALL_SYSUSERS_HOOK \
+	MINIDLNA_INSTALL_TMPFILES_HOOK \
+	MINIDLNA_INSTALL_SYSCTL_HOOK
+endif
+
+define MINIDLNA_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 644 package/minidlna/minidlna.service \
+		$(TARGET_DIR)/lib/systemd/system/minidlna.service
+endef
+
 $(eval $(autotools-package))
package/minidlna/minidlna.service new file +12 -0
new file mode 100644
index 0000000..45b72f0
@@ -0,0 +1,12 @@
+[Unit]
+Description=minidlna server
+After=network.target
+
+[Service]
+User=minidlna
+Type=forking
+ExecStart=/usr/sbin/minidlnad -P /run/minidlna/minidlna.pid
+PIDFile=/run/minidlna/minidlna.pid
+
+[Install]
+WantedBy=multi-user.target
package/minidlna/minidlna_sysctl.conf new file +1 -0
new file mode 100644
index 0000000..0745b37
@@ -0,0 +1 @@
+fs.inotify.max_user_watches = 65536
package/minidlna/minidlna_sysusers.conf new file +1 -0
new file mode 100644
index 0000000..1dc06f3
@@ -0,0 +1 @@
+u minidlna - "DLNA server"
package/minidlna/minidlna_tmpfiles.conf new file +3 -0
new file mode 100644
index 0000000..a6e66e7
@@ -0,0 +1,3 @@
+d /var/run/minidlna 0755 minidlna minidlna -
+d /var/cache/minidlna 0700 minidlna minidlna -
+d /var/log/minidlna 0755 minidlna minidlna -
Signature · 1 line
2.2.1
#28 lore raw

PATCH 9/16 package/minidlna: improve systemd support

Hi Maxim,

Quoted 7 lines · Maxim Mikityanskiy

Support running minidlna in system-wide mode using systemd:

1. Set --with-db-path and --with-log-path configure options to make default minidlna directories comply with FHS.

2. Install suitable minidlna.conf for system-wide mode.

Quoted 7 lines

3. Install sysctl.d config file to increase inotify watches count.

4. Install tmpfiles.d config file to mkdir and chmod necessary directories for minidlna running in system-wide mode.

5. Install sysusers.d config file to create minidlna user when using systemd.

To make minidlna compliant with non-systemd ssytem, you should add the user using _USERS infra [1].

Quoted 93 lines

6. Install minidlna.service for systemd.

Note: User=minidlna should be set in minidlna.service, not in minidlna.conf, because minidlna is unable to drop privileges correctly by itself: it does not get any privileges provided by groups of minidlna user. Systemd drops privileges correctly in that case.

---
 package/minidlna/minidlna.conf          | 74 +++++++++++++++++++++++++++++++++
 package/minidlna/minidlna.mk            | 37 +++++++++++++++++
 package/minidlna/minidlna.service       | 12 ++++++
 package/minidlna/minidlna_sysctl.conf   |  1 +
 package/minidlna/minidlna_sysusers.conf |  1 +
 package/minidlna/minidlna_tmpfiles.conf |  3 ++
 6 files changed, 128 insertions(+)
 create mode 100644 package/minidlna/minidlna.conf
 create mode 100644 package/minidlna/minidlna.service
 create mode 100644 package/minidlna/minidlna_sysctl.conf
 create mode 100644 package/minidlna/minidlna_sysusers.conf
 create mode 100644 package/minidlna/minidlna_tmpfiles.conf
package/minidlna/minidlna.conf new file +64 -0
new file mode 100644
index 0000000..9e4fbc9
@@ -0,0 +1,74 @@
+# port for HTTP (descriptions, SOAP, media transfer) traffic
+port=8200
+
+# network interfaces to serve, comma delimited
+#network_interface=eth0
+
+# set this to the directory you want scanned.
+# * if you want multiple directories, you can have multiple media_dir= lines
+# * if you want to restrict a media_dir to specific content types, you
+#   can prepend the types, followed by a comma, to the directory:
+#   + "A" for audio  (eg. media_dir=A,/home/jmaggard/Music)
+#   + "V" for video  (eg. media_dir=V,/home/jmaggard/Videos)
+#   + "P" for images (eg. media_dir=P,/home/jmaggard/Pictures)
+#   + "PV" for pictures and video (eg. media_dir=PV,/home/jmaggard/digital_camera)
+#media_dir=/home
+
+# set this to merge all media_dir base contents into the root container
+# note: the default is no
+#merge_media_dirs=no
+
+# set this if you want to customize the name that shows up on your clients
+friendly_name=Buildroot DLNA Server
+
+# set this to change the verbosity of the information that is logged
+# each section can use a different level: off, fatal, error, warn, info, or debug
+#log_level=general,artwork,database,inotify,scanner,metadata,http,ssdp,tivo=warn
+
+# this should be a list of file names to check for when searching for album art
+# note: names should be delimited with a forward slash ("/")
+album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg
+
+# set this to no to disable inotify monitoring to automatically discover new files
+# note: the default is yes
+inotify=yes
+
+# set this to yes to enable support for streaming .jpg and .mp3 files to a TiVo supporting HMO
+enable_tivo=no
+
+# set this to strictly adhere to DLNA standards.
+# * This will allow server-side downscaling of very large JPEG images,
+#   which may hurt JPEG serving performance on (at least) Sony DLNA products.
+strict_dlna=no
+
+# default presentation url is http address on port 80
+#presentation_url=http://www.mylan/index.php
+
+# notify interval in seconds. default is 895 seconds.
+notify_interval=900
+
+# serial and model number the daemon will report to clients
+# in its XML description
+serial=12345678
+model_number=1
+
+# specify the path to the MiniSSDPd socket
+#minissdpdsocket=/var/run/minissdpd.sock
+
+# use different container as root of the tree
+# possible values:
+#   + "." - use standard container (this is the default)
+#   + "B" - "Browse Directory"
+#   + "M" - "Music"
+#   + "V" - "Video"
+#   + "P" - "Pictures"

package/minidlna/minidlna.conf line 74

Quoted 10 lines
package/minidlna/minidlna.conf new file +10 -0
+#   + Or, you can specify the ObjectID of your desired root container (eg. 1$F for Music/Playlists)
+# if you specify "B" and client device is audio-only then "Music/Folders" will be used as root
+#root_container=.
+
+# always force SortCriteria to this value, regardless of the SortCriteria passed by the client
+#force_sort_criteria=+upnp:class,+upnp:originalTrackNumber,+dc:title
+
+# maximum number of simultaneous connections
+# note: many clients open several simultaneous connections while streaming
+#max_connections=50

We usually prefer minmal default configuration files, with only necessary stuff (i.e. no comments), letting the user browsing the package manual to set all config he/she needs.

Quoted 25 lines
package/minidlna/minidlna.mk +17 -0
index bcbe5fa..fcc9d06 100644
@@ -24,4 +24,41 @@ MINIDLNA_CONF_OPTS = \
        --disable-static
 endif
 
+MINIDLNA_CONF_OPTS += \
+       --with-db-path=/var/cache/minidlna \
+       --with-log-path=/var/log/minidlna
+
+define MINIDLNA_INSTALL_CONF_HOOK
+       $(INSTALL) -D -m 644 package/minidlna/minidlna.conf \
+               $(TARGET_DIR)/etc/minidlna.conf
+endef
+
+define MINIDLNA_INSTALL_SYSUSERS_HOOK
+       $(INSTALL) -D -m 644 package/minidlna/minidlna_sysusers.conf \
+               $(TARGET_DIR)/usr/lib/sysusers.d/minidlna.conf
+endef
+
+define MINIDLNA_INSTALL_TMPFILES_HOOK
+       $(INSTALL) -D -m 644 package/minidlna/minidlna_tmpfiles.conf \
+               $(TARGET_DIR)/usr/lib/tmpfiles.d/minidlna.conf

package/minidlna/minidlna.mk MINIDLNA_CONF_OPTS = \ · line 53

Quoted 10 lines
package/minidlna/minidlna.mk +10 -0
+endef
+
+define MINIDLNA_INSTALL_SYSCTL_HOOK
+       $(INSTALL) -D -m 644 package/minidlna/minidlna_sysctl.conf \
+               $(TARGET_DIR)/usr/lib/sysctl.d/20-minidlna.conf
+endef
+
+ifeq ($(BR2_INIT_SYSTEMD),y)
+MINIDLNA_POST_INSTALL_TARGET_HOOKS += \
+       MINIDLNA_INSTALL_CONF_HOOK \

This hook could be run even if init is not systemd, no?

package/minidlna/minidlna.mk MINIDLNA_CONF_OPTS = \ · line 56

Quoted 3 lines
package/minidlna/minidlna.mk +3 -0
+       MINIDLNA_INSTALL_SYSUSERS_HOOK \
+       MINIDLNA_INSTALL_TMPFILES_HOOK \
+       MINIDLNA_INSTALL_SYSCTL_HOOK

Maybe you could put all systemd stuff in 1 and single hook.

Quoted 50 lines
package/minidlna/minidlna.mk +7 -0
+endif
+
+define MINIDLNA_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 644 package/minidlna/minidlna.service \
+               $(TARGET_DIR)/lib/systemd/system/minidlna.service
+endef
+
 $(eval $(autotools-package))
package/minidlna/minidlna.service new file +12 -0
new file mode 100644
index 0000000..45b72f0
@@ -0,0 +1,12 @@
+[Unit]
+Description=minidlna server
+After=network.target
+
+[Service]
+User=minidlna
+Type=forking
+ExecStart=/usr/sbin/minidlnad -P /run/minidlna/minidlna.pid
+PIDFile=/run/minidlna/minidlna.pid
+
+[Install]
+WantedBy=multi-user.target
package/minidlna/minidlna_sysctl.conf new file +1 -0
new file mode 100644
index 0000000..0745b37
@@ -0,0 +1 @@
+fs.inotify.max_user_watches = 65536
package/minidlna/minidlna_sysusers.conf new file +1 -0
new file mode 100644
index 0000000..1dc06f3
@@ -0,0 +1 @@
+u minidlna - "DLNA server"
package/minidlna/minidlna_tmpfiles.conf new file +3 -1
new file mode 100644
index 0000000..a6e66e7
@@ -0,0 +1,3 @@
+d /var/run/minidlna 0755 minidlna minidlna -
+d /var/cache/minidlna 0700 minidlna minidlna -
+d /var/log/minidlna 0755 minidlna minidlna -
--
Quoted 2 lines

2.2.1

[1] http://nightly.buildroot.org/manual.html#customize-users

Regards,

Signature · 1 line
Samuel
#29 lore raw

PATCH 9/16 package/minidlna: improve systemd support

Hi Samuel,

2015-02-02 23:12 GMT+02:00 Samuel Martin <[email protected]>:

Quoted 12 lines

Hi Maxim,

Quoted 9 lines · Maxim Mikityanskiy

Support running minidlna in system-wide mode using systemd:

1. Set --with-db-path and --with-log-path configure options to make default minidlna directories comply with FHS.

2. Install suitable minidlna.conf for system-wide mode.

3. Install sysctl.d config file to increase inotify watches count.

Quoted 8 lines
Quoted 5 lines

4. Install tmpfiles.d config file to mkdir and chmod necessary directories for minidlna running in system-wide mode.

5. Install sysusers.d config file to create minidlna user when using systemd.

To make minidlna compliant with non-systemd ssytem, you should add the user using _USERS infra [1].

There were two reasons I preferred sysusers over _USERS. At first, my patch only adds systemd unit file and doesn't add initscript for SysVinit-based systems. So minidlna user will be useless on non-systemd systems. At second, I've noticed that _USERS create users with UID >= 1000. UIDs < 1000 are reserved for system users, and UIDs

Quoted 1 line

= 1000 are for real users. Systemd-sysusers, however, creates users

with UID < 1000. I think minidlna user should have UID < 1000. So should I really replace sysusers with _USERS for creating minidlna user here?

Quoted 99 lines
Quoted 99 lines

6. Install minidlna.service for systemd.

Note: User=minidlna should be set in minidlna.service, not in minidlna.conf, because minidlna is unable to drop privileges correctly by itself: it does not get any privileges provided by groups of minidlna user. Systemd drops privileges correctly in that case.

---
 package/minidlna/minidlna.conf          | 74 +++++++++++++++++++++++++++++++++
 package/minidlna/minidlna.mk            | 37 +++++++++++++++++
 package/minidlna/minidlna.service       | 12 ++++++
 package/minidlna/minidlna_sysctl.conf   |  1 +
 package/minidlna/minidlna_sysusers.conf |  1 +
 package/minidlna/minidlna_tmpfiles.conf |  3 ++
 6 files changed, 128 insertions(+)
 create mode 100644 package/minidlna/minidlna.conf
 create mode 100644 package/minidlna/minidlna.service
 create mode 100644 package/minidlna/minidlna_sysctl.conf
 create mode 100644 package/minidlna/minidlna_sysusers.conf
 create mode 100644 package/minidlna/minidlna_tmpfiles.conf
package/minidlna/minidlna.conf new file +70 -0
new file mode 100644
index 0000000..9e4fbc9
@@ -0,0 +1,74 @@
+# port for HTTP (descriptions, SOAP, media transfer) traffic
+port=8200
+
+# network interfaces to serve, comma delimited
+#network_interface=eth0
+
+# set this to the directory you want scanned.
+# * if you want multiple directories, you can have multiple media_dir= lines
+# * if you want to restrict a media_dir to specific content types, you
+#   can prepend the types, followed by a comma, to the directory:
+#   + "A" for audio  (eg. media_dir=A,/home/jmaggard/Music)
+#   + "V" for video  (eg. media_dir=V,/home/jmaggard/Videos)
+#   + "P" for images (eg. media_dir=P,/home/jmaggard/Pictures)
+#   + "PV" for pictures and video (eg. media_dir=PV,/home/jmaggard/digital_camera)
+#media_dir=/home
+
+# set this to merge all media_dir base contents into the root container
+# note: the default is no
+#merge_media_dirs=no
+
+# set this if you want to customize the name that shows up on your clients
+friendly_name=Buildroot DLNA Server
+
+# set this to change the verbosity of the information that is logged
+# each section can use a different level: off, fatal, error, warn, info, or debug
+#log_level=general,artwork,database,inotify,scanner,metadata,http,ssdp,tivo=warn
+
+# this should be a list of file names to check for when searching for album art
+# note: names should be delimited with a forward slash ("/")
+album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg
+
+# set this to no to disable inotify monitoring to automatically discover new files
+# note: the default is yes
+inotify=yes
+
+# set this to yes to enable support for streaming .jpg and .mp3 files to a TiVo supporting HMO
+enable_tivo=no
+
+# set this to strictly adhere to DLNA standards.
+# * This will allow server-side downscaling of very large JPEG images,
+#   which may hurt JPEG serving performance on (at least) Sony DLNA products.
+strict_dlna=no
+
+# default presentation url is http address on port 80
+#presentation_url=http://www.mylan/index.php
+
+# notify interval in seconds. default is 895 seconds.
+notify_interval=900
+
+# serial and model number the daemon will report to clients
+# in its XML description
+serial=12345678
+model_number=1
+
+# specify the path to the MiniSSDPd socket
+#minissdpdsocket=/var/run/minissdpd.sock
+
+# use different container as root of the tree
+# possible values:
+#   + "." - use standard container (this is the default)
+#   + "B" - "Browse Directory"
+#   + "M" - "Music"
+#   + "V" - "Video"
+#   + "P" - "Pictures"
+#   + Or, you can specify the ObjectID of your desired root container (eg. 1$F for Music/Playlists)
+# if you specify "B" and client device is audio-only then "Music/Folders" will be used as root
+#root_container=.
+
+# always force SortCriteria to this value, regardless of the SortCriteria passed by the client
+#force_sort_criteria=+upnp:class,+upnp:originalTrackNumber,+dc:title
Quoted 8 lines

package/minidlna/minidlna.conf line 74

Quoted 4 lines
package/minidlna/minidlna.conf new file +4 -0
+
+# maximum number of simultaneous connections
+# note: many clients open several simultaneous connections while streaming
+#max_connections=50

We usually prefer minmal default configuration files, with only necessary stuff (i.e. no comments), letting the user browsing the package manual to set all config he/she needs.

OK, I'll consider it. This config has lots of comments because it's based on default one shipped with package.

Quoted 29 lines
Quoted 29 lines
package/minidlna/minidlna.mk +21 -0
index bcbe5fa..fcc9d06 100644
@@ -24,4 +24,41 @@ MINIDLNA_CONF_OPTS = \
        --disable-static
 endif
 
+MINIDLNA_CONF_OPTS += \
+       --with-db-path=/var/cache/minidlna \
+       --with-log-path=/var/log/minidlna
+
+define MINIDLNA_INSTALL_CONF_HOOK
+       $(INSTALL) -D -m 644 package/minidlna/minidlna.conf \
+               $(TARGET_DIR)/etc/minidlna.conf
+endef
+
+define MINIDLNA_INSTALL_SYSUSERS_HOOK
+       $(INSTALL) -D -m 644 package/minidlna/minidlna_sysusers.conf \
+               $(TARGET_DIR)/usr/lib/sysusers.d/minidlna.conf
+endef
+
+define MINIDLNA_INSTALL_TMPFILES_HOOK
+       $(INSTALL) -D -m 644 package/minidlna/minidlna_tmpfiles.conf \
+               $(TARGET_DIR)/usr/lib/tmpfiles.d/minidlna.conf
+endef
+
+define MINIDLNA_INSTALL_SYSCTL_HOOK
+       $(INSTALL) -D -m 644 package/minidlna/minidlna_sysctl.conf \
Quoted 8 lines

package/minidlna/minidlna.mk MINIDLNA_CONF_OPTS = \ · line 53

Quoted 6 lines
package/minidlna/minidlna.mk +6 -0
+               $(TARGET_DIR)/usr/lib/sysctl.d/20-minidlna.conf
+endef
+
+ifeq ($(BR2_INIT_SYSTEMD),y)
+MINIDLNA_POST_INSTALL_TARGET_HOOKS += \
+       MINIDLNA_INSTALL_CONF_HOOK \

This hook could be run even if init is not systemd, no?

It could be run, but it will be useless because there is no initscript for non-systemd systems anyway. Maybe I should resend this patch with initscript added.

Quoted 61 lines

package/minidlna/minidlna.mk MINIDLNA_CONF_OPTS = \ · line 56

Quoted 3 lines
package/minidlna/minidlna.mk +3 -0
+       MINIDLNA_INSTALL_SYSUSERS_HOOK \
+       MINIDLNA_INSTALL_TMPFILES_HOOK \
+       MINIDLNA_INSTALL_SYSCTL_HOOK

Maybe you could put all systemd stuff in 1 and single hook.

Quoted 50 lines
package/minidlna/minidlna.mk +7 -0
+endif
+
+define MINIDLNA_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 644 package/minidlna/minidlna.service \
+               $(TARGET_DIR)/lib/systemd/system/minidlna.service
+endef
+
 $(eval $(autotools-package))
package/minidlna/minidlna.service new file +12 -0
new file mode 100644
index 0000000..45b72f0
@@ -0,0 +1,12 @@
+[Unit]
+Description=minidlna server
+After=network.target
+
+[Service]
+User=minidlna
+Type=forking
+ExecStart=/usr/sbin/minidlnad -P /run/minidlna/minidlna.pid
+PIDFile=/run/minidlna/minidlna.pid
+
+[Install]
+WantedBy=multi-user.target
package/minidlna/minidlna_sysctl.conf new file +1 -0
new file mode 100644
index 0000000..0745b37
@@ -0,0 +1 @@
+fs.inotify.max_user_watches = 65536
package/minidlna/minidlna_sysusers.conf new file +1 -0
new file mode 100644
index 0000000..1dc06f3
@@ -0,0 +1 @@
+u minidlna - "DLNA server"
package/minidlna/minidlna_tmpfiles.conf new file +3 -1
new file mode 100644
index 0000000..a6e66e7
@@ -0,0 +1,3 @@
+d /var/run/minidlna 0755 minidlna minidlna -
+d /var/cache/minidlna 0700 minidlna minidlna -
+d /var/log/minidlna 0755 minidlna minidlna -
--
Quoted 2 lines

2.2.1

[1] http://nightly.buildroot.org/manual.html#customize-users

Quoted 4 lines

Regards,

--
Samuel

Cheers,
Maxim

#30 lore raw

PATCH 9/16 package/minidlna: improve systemd support

Maxim,

Quoted 21 lines · Maxim Mikityanskiy

Hi Samuel,

2015-02-02 23:12 GMT+02:00 Samuel Martin <[email protected]>:

Quoted 18 lines

Hi Maxim,

Quoted 14 lines · Maxim Mikityanskiy

Support running minidlna in system-wide mode using systemd:

1. Set --with-db-path and --with-log-path configure options to make default minidlna directories comply with FHS.

2. Install suitable minidlna.conf for system-wide mode.

3. Install sysctl.d config file to increase inotify watches count.

4. Install tmpfiles.d config file to mkdir and chmod necessary directories for minidlna running in system-wide mode.

5. Install sysusers.d config file to create minidlna user when using systemd.

Quoted 6 lines
Quoted 2 lines

To make minidlna compliant with non-systemd ssytem, you should add the user using _USERS infra [1].

There were two reasons I preferred sysusers over _USERS. At first, my patch only adds systemd unit file and doesn't add initscript for SysVinit-based systems.

Indeed, but if we are adding initscript for systemd, why not adding it for sysV as well? ;)

Quoted 4 lines

So minidlna user will be useless on
non-systemd systems. At second, I've noticed that _USERS create users with UID >= 1000. UIDs < 1000 are reserved for system users, and UIDs

Quoted 1 line

= 1000 are for real users.

This more a convention, that something enforced by systemd itself or any program runs as daemon.

Quoted 4 lines

Systemd-sysusers, however, creates users
with UID < 1000. I think minidlna user should have UID < 1000. So should I really replace sysusers with _USERS for creating minidlna user here?

The _USERS infra will pick-up a uid >=1000 only if you let the infra pic-up a uid, if you set it, you can set anything you want ;-)

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

6. Install minidlna.service for systemd.

Note: User=minidlna should be set in minidlna.service, not in minidlna.conf, because minidlna is unable to drop privileges correctly by itself: it does not get any privileges provided by groups of minidlna user. Systemd drops privileges correctly in that case.

---

[...]

Quoted 46 lines
Quoted 4 lines

We usually prefer minmal default configuration files, with only necessary stuff (i.e. no comments), letting the user browsing the package manual to set all config he/she needs.

OK, I'll consider it. This config has lots of comments because it's based on default one shipped with package.

Quoted 29 lines
Quoted 29 lines
package/minidlna/minidlna.mk +21 -0
index bcbe5fa..fcc9d06 100644
@@ -24,4 +24,41 @@ MINIDLNA_CONF_OPTS = \
        --disable-static
 endif
 
+MINIDLNA_CONF_OPTS += \
+       --with-db-path=/var/cache/minidlna \
+       --with-log-path=/var/log/minidlna
+
+define MINIDLNA_INSTALL_CONF_HOOK
+       $(INSTALL) -D -m 644 package/minidlna/minidlna.conf \
+               $(TARGET_DIR)/etc/minidlna.conf
+endef
+
+define MINIDLNA_INSTALL_SYSUSERS_HOOK
+       $(INSTALL) -D -m 644 package/minidlna/minidlna_sysusers.conf \
+               $(TARGET_DIR)/usr/lib/sysusers.d/minidlna.conf
+endef
+
+define MINIDLNA_INSTALL_TMPFILES_HOOK
+       $(INSTALL) -D -m 644 package/minidlna/minidlna_tmpfiles.conf \
+               $(TARGET_DIR)/usr/lib/tmpfiles.d/minidlna.conf
+endef
+
+define MINIDLNA_INSTALL_SYSCTL_HOOK
+       $(INSTALL) -D -m 644 package/minidlna/minidlna_sysctl.conf \
Quoted 8 lines

package/minidlna/minidlna.mk MINIDLNA_CONF_OPTS = \ · line 53

Quoted 6 lines
package/minidlna/minidlna.mk +6 -0
+               $(TARGET_DIR)/usr/lib/sysctl.d/20-minidlna.conf
+endef
+
+ifeq ($(BR2_INIT_SYSTEMD),y)
+MINIDLNA_POST_INSTALL_TARGET_HOOKS += \
+       MINIDLNA_INSTALL_CONF_HOOK \

This hook could be run even if init is not systemd, no?

Quoted 3 lines

It could be run, but it will be useless because there is no initscript for non-systemd systems anyway. Maybe I should resend this patch with initscript added.

I think so; so when sysV initscript will be added, the conf will be in place already.

Quoted 7 lines
Quoted 7 lines

package/minidlna/minidlna.mk MINIDLNA_CONF_OPTS = \ · line 56

Quoted 4 lines
package/minidlna/minidlna.mk +3 -0
+       MINIDLNA_INSTALL_SYSUSERS_HOOK \
+       MINIDLNA_INSTALL_TMPFILES_HOOK \
+       MINIDLNA_INSTALL_SYSCTL_HOOK

Maybe you could put all systemd stuff in 1 and single hook.

Quoted 8 lines
Quoted 8 lines

package/minidlna/minidlna.mk MINIDLNA_CONF_OPTS = \ · line 64

Quoted 8 lines
package/minidlna/minidlna.mk +7 -0
+endif
+
+define MINIDLNA_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 644 package/minidlna/minidlna.service \
+               $(TARGET_DIR)/lib/systemd/system/minidlna.service
+endef
+
 $(eval $(autotools-package))

[...]

Regards,

Signature · 1 line
Samuel
#31 lore raw

PATCH 9/16 package/minidlna: improve systemd support

In reply to Maxim Mikityanskiy
Quoted 3 lines · Maxim Mikityanskiy
Quoted 2 lines

To make minidlna compliant with non-systemd ssytem, you should add the

Quoted 1 line

user using _USERS infra [1].

There were two reasons I preferred sysusers over _USERS.

I think that where possible, we should use sysusers on a systemd system and
_USERS on a non-systemd system. Perhaps the _USERS infrastructure should be extended to do this automatically - AFAIK there is no advantage of using a static user when you use systemd, right? Except of course when the package requires one specific UID, but IIRC even that can be encoded in the sysusers configuration, no?

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#32 lore raw

PATCH 9/16 package/minidlna: improve systemd support

In reply to Maxim Mikityanskiy

Dear Maxim Mikityanskiy,

Quoted 15 lines · Maxim Mikityanskiy

Support running minidlna in system-wide mode using systemd:

1. Set --with-db-path and --with-log-path configure options to make default minidlna directories comply with FHS.

2. Install suitable minidlna.conf for system-wide mode.

3. Install sysctl.d config file to increase inotify watches count.

4. Install tmpfiles.d config file to mkdir and chmod necessary directories for minidlna running in system-wide mode.

5. Install sysusers.d config file to create minidlna user when using systemd.

Quoted 8 lines

6. Install minidlna.service for systemd.

Note: User=minidlna should be set in minidlna.service, not in minidlna.conf, because minidlna is unable to drop privileges correctly by itself: it does not get any privileges provided by groups of minidlna user. Systemd drops privileges correctly in that case.

I applied another patch adding a systemd service file for minidlna. Could you rebase this patch on top of the latest Buildroot Git tree?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#33 lore raw

PATCH 10/16 package/transmission: improve systemd support

In reply to Maxim Mikityanskiy

Support running transmission-daemon in system-wide mode using systemd:

1. Pass --with-systemd-daemon to configure script if systemd is enabled.

2. Install sysctl.d config file to increase send and receive buffer sizes.

3. Install tmpfiles.d config file to create transmission config directory.

4. Install sysusers.d config file to create transmission user when using systemd. Create transmission user when not using systemd.

5. Install transmission-daemon.service for systemd.

---
 package/transmission/transmission-daemon.service | 12 +++++++
 package/transmission/transmission.mk             | 45 ++++++++++++++++++++++++
 package/transmission/transmission_sysctl.conf    |  2 ++
 package/transmission/transmission_sysusers.conf  |  1 +
 package/transmission/transmission_tmpfiles.conf  |  1 +
 5 files changed, 61 insertions(+)
 create mode 100644 package/transmission/transmission-daemon.service
 create mode 100644 package/transmission/transmission_sysctl.conf
 create mode 100644 package/transmission/transmission_sysusers.conf
 create mode 100644 package/transmission/transmission_tmpfiles.conf
package/transmission/transmission-daemon.service new file +12 -0
new file mode 100644
index 0000000..4e7c98b
@@ -0,0 +1,12 @@
+[Unit]
+Description=Transmission BitTorrent Daemon
+After=network.target
+
+[Service]
+User=transmission
+Type=notify
+ExecStart=/usr/bin/transmission-daemon -f --log-error -g /var/lib/transmission/config
+ExecReload=/bin/kill -s HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
package/transmission/transmission.mk +45 -0

56 lines not on this page · raw message

package/transmission/transmission_sysctl.conf new file +2 -0
new file mode 100644
index 0000000..7862332
@@ -0,0 +1,2 @@
+net.core.wmem_max = 1048576
+net.core.rmem_max = 4194304
package/transmission/transmission_sysusers.conf new file +1 -0
new file mode 100644
index 0000000..09396d4
@@ -0,0 +1 @@
+u transmission - "Transmission daemon" /var/lib/transmission
package/transmission/transmission_tmpfiles.conf new file +1 -0
new file mode 100644
index 0000000..e40b94a
@@ -0,0 +1 @@
+d /var/lib/transmission/config 0700 transmission users -
Signature · 1 line
2.2.1
#34 lore raw

PATCH 10/16 package/transmission: improve systemd support

Hi Maxim,

Quoted 51 lines · Maxim Mikityanskiy

Support running transmission-daemon in system-wide mode using systemd:

1. Pass --with-systemd-daemon to configure script if systemd is enabled.

2. Install sysctl.d config file to increase send and receive buffer sizes.

3. Install tmpfiles.d config file to create transmission config directory.

4. Install sysusers.d config file to create transmission user when using systemd. Create transmission user when not using systemd.

5. Install transmission-daemon.service for systemd.

---
 package/transmission/transmission-daemon.service | 12 +++++++
 package/transmission/transmission.mk             | 45 ++++++++++++++++++++++++
 package/transmission/transmission_sysctl.conf    |  2 ++
 package/transmission/transmission_sysusers.conf  |  1 +
 package/transmission/transmission_tmpfiles.conf  |  1 +
 5 files changed, 61 insertions(+)
 create mode 100644 package/transmission/transmission-daemon.service
 create mode 100644 package/transmission/transmission_sysctl.conf
 create mode 100644 package/transmission/transmission_sysusers.conf
 create mode 100644 package/transmission/transmission_tmpfiles.conf
package/transmission/transmission-daemon.service new file +12 -0
new file mode 100644
index 0000000..4e7c98b
@@ -0,0 +1,12 @@
+[Unit]
+Description=Transmission BitTorrent Daemon
+After=network.target
+
+[Service]
+User=transmission
+Type=notify
+ExecStart=/usr/bin/transmission-daemon -f --log-error -g /var/lib/transmission/config
+ExecReload=/bin/kill -s HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
package/transmission/transmission.mk +0 -0
index b8a5c42..b5b9c8b 100644

package/transmission/transmission.mk endif · line 41

Quoted 6 lines
package/transmission/transmission.mk +3 -0
@@ -36,11 +36,56 @@ endif
 ifeq ($(BR2_PACKAGE_TRANSMISSION_DAEMON),y)
        TRANSMISSION_CONF_OPTS += --enable-daemon
 
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+       TRANSMISSION_DEPENDENCIES += systemd
+       TRANSMISSION_CONF_OPTS += --with-systemd-daemon

We usually like when option are symetrical, so here, just add:
<snip>
else
TRANSMISSION_CONF_OPTS += --without-systemd-daemon </snip>

Note that, we usually don't indent variable assignation ;)

Quoted 36 lines
package/transmission/transmission.mk +31 -0
+endif
+
+ifeq ($(BR2_INIT_SYSTEMD),)
+define TRANSMISSION_USERS
+       transmission -1 transmission -1 * /var/lib/transmission - transmission Transmission Daemon
+endef
+endif
+
 define TRANSMISSION_INSTALL_INIT_SYSV
        $(INSTALL) -m 0755 -D package/transmission/S92transmission \
                $(TARGET_DIR)/etc/init.d/S92transmission
 endef
 
+define TRANSMISSION_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 644 package/transmission/transmission-daemon.service \
+               $(TARGET_DIR)/lib/systemd/system/transmission-daemon.service
+       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+       ln -fs /lib/systemd/system/transmission-daemon.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/transmission-daemon.service
+
+       mkdir -p $(TARGET_DIR)/var/lib/transmission/config
+endef
+
+define TRANSMISSION_INSTALL_SYSCTL_HOOK
+       $(INSTALL) -D -m 644 package/transmission/transmission_sysctl.conf \
+               $(TARGET_DIR)/usr/lib/sysctl.d/20-transmission.conf
+endef
+
+TRANSMISSION_POST_INSTALL_TARGET_HOOKS += \
+       TRANSMISSION_INSTALL_SYSCTL_HOOK
+
+define TRANSMISSION_INSTALL_TMPFILES_HOOK
+       $(INSTALL) -D -m 644 package/transmission/transmission_tmpfiles.conf \
+               $(TARGET_DIR)/usr/lib/tmpfiles.d/transmission.conf
+endef
+

package/transmission/transmission.mk endif · line 87

Quoted 10 lines
package/transmission/transmission.mk +10 -0
+TRANSMISSION_POST_INSTALL_TARGET_HOOKS += \
+       TRANSMISSION_INSTALL_TMPFILES_HOOK
+
+define TRANSMISSION_INSTALL_SYSUSERS_HOOK
+       $(INSTALL) -D -m 644 package/transmission/transmission_sysusers.conf \
+               $(TARGET_DIR)/usr/lib/sysusers.d/transmission.conf
+endef
+
+TRANSMISSION_POST_INSTALL_TARGET_HOOKS += \
+       TRANSMISSION_INSTALL_SYSUSERS_HOOK

The 3 above hooks are for systemd only, no?
If yes, put them all together in a single hook only added to the TRANSMISSION_POST_INSTALL_TARGET_HOOKS when init is systemd.

Quoted 27 lines
package/transmission/transmission.mk +1 -0
+
 else
        TRANSMISSION_CONF_OPTS += --disable-daemon
 endif
package/transmission/transmission_sysctl.conf new file +2 -0
new file mode 100644
index 0000000..7862332
@@ -0,0 +1,2 @@
+net.core.wmem_max = 1048576
+net.core.rmem_max = 4194304
package/transmission/transmission_sysusers.conf new file +1 -0
new file mode 100644
index 0000000..09396d4
@@ -0,0 +1 @@
+u transmission - "Transmission daemon" /var/lib/transmission
package/transmission/transmission_tmpfiles.conf new file +1 -1
new file mode 100644
index 0000000..e40b94a
@@ -0,0 +1 @@
+d /var/lib/transmission/config 0700 transmission users -
--
Quoted 2 lines

2.2.1

Regards,

Signature · 1 line
Samuel
#35 lore raw

PATCH 10/16 package/transmission: improve systemd support

Quoted 7 lines · Samuel Martin

We usually like when option are symetrical, so here, just add:
<snip>
else
TRANSMISSION_CONF_OPTS += --without-systemd-daemon </snip>

Note that, we usually don't indent variable assignation ;)

To be more accurate: we normally don't indent the bodies of make conditions.
But the transmission.mk file already violates that principle.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#36 lore raw

PATCH v2 1/1 transmission: improve systemd support

In reply to Maxim Mikityanskiy

From: Maxim Mikityanskiy <[email protected]>

Support running transmission-daemon in system-wide mode using systemd:

1. Pass --with-systemd-daemon to configure script if systemd is enabled.

2. Install sysctl.d config file to increase send and receive buffer sizes.

3. Install sysusers.d config file to create transmission user when using systemd. Create transmission user when not using systemd.

4. Install transmission-daemon.service for systemd.

[Aur?lien : Fix symlink relative path, use upstream service file, no need for config path, and use transmission user in sysv script]

---
 package/transmission/S92transmission            |  4 +--
 package/transmission/transmission.mk            | 37 +++++++++++++++++++++++++
 package/transmission/transmission_sysctl.conf   |  2 ++
 package/transmission/transmission_sysusers.conf |  1 +
 4 files changed, 41 insertions(+), 3 deletions(-)
 create mode 100644 package/transmission/transmission_sysctl.conf
 create mode 100644 package/transmission/transmission_sysusers.conf
package/transmission/S92transmission +1 -3
index 1870522..e5976b0 100644
@@ -24,9 +24,7 @@
 # by default, this is set to 'transmission'.
 # For the sake of security you shouldn't set a password
 # on this user
-#USERNAME=transmission
-USERNAME=default
-
+USERNAME=transmission
 
 
 # ----- *ADVANCED* CONFIGURATION -----
package/transmission/transmission.mk +37 -0
index bbc32bf..81dd110 100644
@@ -36,11 +36,48 @@ endif
 ifeq ($(BR2_PACKAGE_TRANSMISSION_DAEMON),y)
 TRANSMISSION_CONF_OPTS += --enable-daemon
 
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+TRANSMISSION_DEPENDENCIES += systemd
+TRANSMISSION_CONF_OPTS += --with-systemd-daemon
+else
+TRANSMISSION_CONF_OPTS += --without-systemd-daemon
+endif
+
+ifeq ($(BR2_INIT_SYSTEMD),)
+define TRANSMISSION_USERS
+	transmission -1 transmission -1 * /var/lib/transmission - transmission Transmission Daemon
+endef
+endif
+
 define TRANSMISSION_INSTALL_INIT_SYSV
 	$(INSTALL) -m 0755 -D package/transmission/S92transmission \
 		$(TARGET_DIR)/etc/init.d/S92transmission
 endef
 
+define TRANSMISSION_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 0755 $(@D)/daemon/transmission-daemon.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/transmission-daemon.service
+	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+	ln -fs ../../../../usr/lib/systemd/system/transmission-daemon.service \
+		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/transmission-daemon.service
+endef
+
+define TRANSMISSION_INSTALL_SYSCTL_HOOK
+	$(INSTALL) -D -m 644 package/transmission/transmission_sysctl.conf \
+		$(TARGET_DIR)/usr/lib/sysctl.d/20-transmission.conf
+endef
+
+TRANSMISSION_POST_INSTALL_TARGET_HOOKS += \
+	TRANSMISSION_INSTALL_SYSCTL_HOOK
+
+define TRANSMISSION_INSTALL_SYSUSERS_HOOK
+	$(INSTALL) -D -m 644 package/transmission/transmission_sysusers.conf \
+		$(TARGET_DIR)/usr/lib/sysusers.d/transmission.conf
+endef
+
+TRANSMISSION_POST_INSTALL_TARGET_HOOKS += \
+	TRANSMISSION_INSTALL_SYSUSERS_HOOK
+
 else
 TRANSMISSION_CONF_OPTS += --disable-daemon
 endif
package/transmission/transmission_sysctl.conf new file +2 -0
new file mode 100644
index 0000000..7862332
@@ -0,0 +1,2 @@
+net.core.wmem_max = 1048576
+net.core.rmem_max = 4194304
package/transmission/transmission_sysusers.conf new file +1 -0
new file mode 100644
index 0000000..09396d4
@@ -0,0 +1 @@
+u transmission - "Transmission daemon" /var/lib/transmission
Signature · 1 line
2.4.5
#37 lore raw

PATCH v2 1/1 transmission: improve systemd support

Hi Aur?lien, all

Quoted 62 lines · Aur?lien Chabot

From: Maxim Mikityanskiy <[email protected]>

Support running transmission-daemon in system-wide mode using systemd:

1. Pass --with-systemd-daemon to configure script if systemd is enabled.

2. Install sysctl.d config file to increase send and receive buffer sizes.

3. Install sysusers.d config file to create transmission user when using systemd. Create transmission user when not using systemd.

4. Install transmission-daemon.service for systemd.

[Aur?lien : Fix symlink relative path, use upstream service file, no need for config path, and use transmission user in sysv script]

---
 package/transmission/S92transmission            |  4 +--
 package/transmission/transmission.mk            | 37 +++++++++++++++++++++++++
 package/transmission/transmission_sysctl.conf   |  2 ++
 package/transmission/transmission_sysusers.conf |  1 +
 4 files changed, 41 insertions(+), 3 deletions(-)
 create mode 100644 package/transmission/transmission_sysctl.conf
 create mode 100644 package/transmission/transmission_sysusers.conf
package/transmission/S92transmission +1 -3
index 1870522..e5976b0 100644
@@ -24,9 +24,7 @@
 # by default, this is set to 'transmission'.
 # For the sake of security you shouldn't set a password
 # on this user
-#USERNAME=transmission
-USERNAME=default
-
+USERNAME=transmission
 
 
 # ----- *ADVANCED* CONFIGURATION -----
package/transmission/transmission.mk +11 -0
index bbc32bf..81dd110 100644
@@ -36,11 +36,48 @@ endif
 ifeq ($(BR2_PACKAGE_TRANSMISSION_DAEMON),y)
 TRANSMISSION_CONF_OPTS += --enable-daemon
 
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+TRANSMISSION_DEPENDENCIES += systemd
+TRANSMISSION_CONF_OPTS += --with-systemd-daemon
+else
+TRANSMISSION_CONF_OPTS += --without-systemd-daemon
+endif
+
+ifeq ($(BR2_INIT_SYSTEMD),)
+define TRANSMISSION_USERS
+       transmission -1 transmission -1 * /var/lib/transmission - transmission Transmission Daemon
+endef

package/transmission/transmission.mk endif · line 59

Quoted 10 lines
package/transmission/transmission.mk +5 -0
+endif
+
 define TRANSMISSION_INSTALL_INIT_SYSV
        $(INSTALL) -m 0755 -D package/transmission/S92transmission \
                $(TARGET_DIR)/etc/init.d/S92transmission
 endef
 
+define TRANSMISSION_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 0755 $(@D)/daemon/transmission-daemon.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/transmission-daemon.service

Do we still need to install the service ? Doesn't the transmission Makefile do it for us ?

package/transmission/transmission.mk endif · line 72

Quoted 13 lines
package/transmission/transmission.mk +13 -0
+       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+       ln -fs ../../../../usr/lib/systemd/system/transmission-daemon.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/transmission-daemon.service
+endef
+
+define TRANSMISSION_INSTALL_SYSCTL_HOOK
+       $(INSTALL) -D -m 644 package/transmission/transmission_sysctl.conf \
+               $(TARGET_DIR)/usr/lib/sysctl.d/20-transmission.conf
+endef
+
+TRANSMISSION_POST_INSTALL_TARGET_HOOKS += \
+       TRANSMISSION_INSTALL_SYSCTL_HOOK
+

I don't know what the other think about it but I really don't like the fact that there's some sysctl conf installed by a package.

Quoted 17 lines
package/transmission/transmission.mk +8 -0
+define TRANSMISSION_INSTALL_SYSUSERS_HOOK
+       $(INSTALL) -D -m 644 package/transmission/transmission_sysusers.conf \
+               $(TARGET_DIR)/usr/lib/sysusers.d/transmission.conf
+endef
+
+TRANSMISSION_POST_INSTALL_TARGET_HOOKS += \
+       TRANSMISSION_INSTALL_SYSUSERS_HOOK
+
 else
 TRANSMISSION_CONF_OPTS += --disable-daemon
 endif
package/transmission/transmission_sysctl.conf new file +0 -0
new file mode 100644
index 0000000..7862332

package/transmission/transmission_sysctl.conf line 2

Quoted 2 lines
package/transmission/transmission_sysctl.conf new file +2 -0
@@ -0,0 +1,2 @@
+net.core.wmem_max = 1048576
+net.core.rmem_max = 4194304

So I would scratch that too.

package/transmission/transmission_sysusers.conf

Quoted 8 lines
package/transmission/transmission_sysusers.conf new file +1 -1
new file mode 100644
index 0000000..09396d4
@@ -0,0 +1 @@
+u transmission - "Transmission daemon" /var/lib/transmission
--

Have you tested with a read-only file system ? Since /var/lib/transmission is not a tmpfs, I don't know if transmission will be very happy about that.

Quoted 6 lines

2.4.5

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#38 lore raw

PATCH v2 1/1 transmission: improve systemd support

Quoted 4 lines · Maxime Hadjinlian

Have you tested with a read-only file system ? Since /var/lib/transmission is not a tmpfs, I don't know if transmission will be very happy about that.

From what I try, transmission doesn't crash or stop if it cannot write it's configuration. That's why I remove the tmpfs. Moreover the tmpfs stuff was only added for systemd, and if we choose to do that we should do the same for sysvinit.

I just saw a well that with systemd the folder /var/lib/transmission is not created, so I should have kept the line creating the folder. BTW, is it really the prefer solution to user sysuser.d instead of the buildroot user target ? Isn't this cause also problem on read only fs, because ets/passwd will not be writable ?

Aur?lien
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20150716/c2794fc3/attachment-0001.html>

#39 lore raw

PATCH v2 1/1 transmission: improve systemd support

Hi Aur?lien, all

Quoted 14 lines · Aur?lien Chabot
Quoted 4 lines · Maxime Hadjinlian

Have you tested with a read-only file system ? Since /var/lib/transmission is not a tmpfs, I don't know if transmission will be very happy about that.

From what I try, transmission doesn't crash or stop if it cannot write it's configuration. That's why I remove the tmpfs. Moreover the tmpfs stuff was only added for systemd, and if we choose to do that we should do the same for sysvinit.

Quoted 5 lines

I just saw a well that with systemd the folder /var/lib/transmission is not created, so I should have kept the line creating the folder. BTW, is it really the prefer solution to user sysuser.d instead of the buildroot user target ? Isn't this cause also problem on read only fs, because ets/passwd will not be writable ?

You are absolutely right, that's not the way to go, you should use the Buildroot infra to do that.
As I said before, please remove also the sysctl settings, it should not be install by us.

I'll try to give it a better look and test that tonight or tomorrow.

Quoted 3 lines

Aur?lien

#40 lore raw

PATCH v3 1/1 transmission: improve systemd support

In reply to Maxim Mikityanskiy

From: Maxim Mikityanskiy <[email protected]>

Support running transmission-daemon in system-wide mode using systemd:

1. Pass --with-systemd-daemon to configure script if systemd is enabled.

2. Create the transmission user if having daemon

3. Install transmission-daemon.service for systemd.

[Aur?lien : Fix symlink relative path, use upstream service file, no need for config path, and use transmission user in sysv script, remove sysctl stuff]

---
 package/transmission/S92transmission |  4 +---
 package/transmission/transmission.mk | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 3 deletions(-)
package/transmission/S92transmission +1 -3
index 1870522..e5976b0 100644
@@ -24,9 +24,7 @@
 # by default, this is set to 'transmission'.
 # For the sake of security you shouldn't set a password
 # on this user
-#USERNAME=transmission
-USERNAME=default
-
+USERNAME=transmission
 
 
 # ----- *ADVANCED* CONFIGURATION -----
package/transmission/transmission.mk +19 -0
index bbc32bf..efc00a1 100644
@@ -36,11 +36,30 @@ endif
 ifeq ($(BR2_PACKAGE_TRANSMISSION_DAEMON),y)
 TRANSMISSION_CONF_OPTS += --enable-daemon
 
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+TRANSMISSION_DEPENDENCIES += systemd
+TRANSMISSION_CONF_OPTS += --with-systemd-daemon
+else
+TRANSMISSION_CONF_OPTS += --without-systemd-daemon
+endif
+
+define TRANSMISSION_USERS
+	transmission -1 transmission -1 * /var/lib/transmission - transmission Transmission Daemon
+endef
+
 define TRANSMISSION_INSTALL_INIT_SYSV
 	$(INSTALL) -m 0755 -D package/transmission/S92transmission \
 		$(TARGET_DIR)/etc/init.d/S92transmission
 endef
 
+define TRANSMISSION_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 0755 $(@D)/daemon/transmission-daemon.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/transmission-daemon.service
+	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+	ln -fs ../../../../usr/lib/systemd/system/transmission-daemon.service \
+		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/transmission-daemon.service
+endef
+
 else
 TRANSMISSION_CONF_OPTS += --disable-daemon
 endif
Signature · 1 line
2.4.6
#41 lore raw

PATCH v3 1/1 transmission: improve systemd support

Hi Aur?lien, all

Quoted 72 lines · Aur?lien Chabot

From: Maxim Mikityanskiy <[email protected]>

Support running transmission-daemon in system-wide mode using systemd:

1. Pass --with-systemd-daemon to configure script if systemd is enabled.

2. Create the transmission user if having daemon

3. Install transmission-daemon.service for systemd.

[Aur?lien : Fix symlink relative path, use upstream service file, no need for config path, and use transmission user in sysv script, remove sysctl stuff]

---
 package/transmission/S92transmission |  4 +---
 package/transmission/transmission.mk | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 3 deletions(-)
package/transmission/S92transmission +1 -3
index 1870522..e5976b0 100644
@@ -24,9 +24,7 @@
 # by default, this is set to 'transmission'.
 # For the sake of security you shouldn't set a password
 # on this user
-#USERNAME=transmission
-USERNAME=default
-
+USERNAME=transmission
 
 
 # ----- *ADVANCED* CONFIGURATION -----
package/transmission/transmission.mk +19 -1
index bbc32bf..efc00a1 100644
@@ -36,11 +36,30 @@ endif
 ifeq ($(BR2_PACKAGE_TRANSMISSION_DAEMON),y)
 TRANSMISSION_CONF_OPTS += --enable-daemon
 
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+TRANSMISSION_DEPENDENCIES += systemd
+TRANSMISSION_CONF_OPTS += --with-systemd-daemon
+else
+TRANSMISSION_CONF_OPTS += --without-systemd-daemon
+endif
+
+define TRANSMISSION_USERS
+       transmission -1 transmission -1 * /var/lib/transmission - transmission Transmission Daemon
+endef
+
 define TRANSMISSION_INSTALL_INIT_SYSV
        $(INSTALL) -m 0755 -D package/transmission/S92transmission \
                $(TARGET_DIR)/etc/init.d/S92transmission
 endef
 
+define TRANSMISSION_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 0755 $(@D)/daemon/transmission-daemon.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/transmission-daemon.service
+       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+       ln -fs ../../../../usr/lib/systemd/system/transmission-daemon.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/transmission-daemon.service
+endef
+
 else
 TRANSMISSION_CONF_OPTS += --disable-daemon
 endif
--
Quoted 2 lines

2.4.6

Acked-by Maxime Hadjinlian <[email protected]>

Quoted 4 lines

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#42 lore raw

PATCH v3 1/1 transmission: improve systemd support

In reply to Aurélien Chabot

Dear Aur?lien Chabot,

Quoted 14 lines · Aur?lien Chabot

From: Maxim Mikityanskiy <[email protected]>

Support running transmission-daemon in system-wide mode using systemd:

1. Pass --with-systemd-daemon to configure script if systemd is enabled.

2. Create the transmission user if having daemon

3. Install transmission-daemon.service for systemd.

[Aur?lien : Fix symlink relative path, use upstream service file, no need for config path, and use transmission user in sysv script, remove sysctl stuff]

Quoted 6 lines
---
 package/transmission/S92transmission |  4 +---
 package/transmission/transmission.mk | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 3 deletions(-)

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#43 lore raw

PATCH 11/16 package/samba: use FHS dirs

In reply to Maxim Mikityanskiy

Clean up system directories by making samba conform to FHS and by using subdirectories e.g. /var/log/samba and /var/run/samba instead of /var/log and /var/run.

---
 package/samba/S91smb   |  5 +++--
 package/samba/samba.mk | 10 +++++-----
 2 files changed, 8 insertions(+), 7 deletions(-)
package/samba/S91smb +3 -2
index c190771..2e03e82 100755
@@ -10,6 +10,7 @@
 mkdir -p /var/cache/samba
 mkdir -p /var/log/samba
 mkdir -p /var/lock/subsys
+mkdir -p /var/run/samba
 
 RETVAL=0
 
@@ -33,13 +34,13 @@ stop() {
 	echo -n "Shutting down SMB services: "
 	kill -9 `pidof smbd`
 	RETVAL=$?
-	rm -f /var/run/smbd.pid
+	rm -f /var/run/samba/smbd.pid
 	echo "done"
 
 	echo -n "Shutting down NMB services: "
 	kill -9 `pidof nmbd`
 	RETVAL2=$?
-	rm -f /var/run/nmbd.pid
+	rm -f /var/run/samba/nmbd.pid
 
 	[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && rm -f /var/lock/subsys/smb
 	echo "done"
package/samba/samba.mk +5 -5
index d25e94e..31ad644 100644
@@ -33,11 +33,11 @@ SAMBA_CONF_ENV = \
 	$(if $(BR2_PACKAGE_SAMBA_AVAHI),AVAHI_LIBS=-pthread)
 
 SAMBA_CONF_OPTS = \
-	--with-piddir=/var/run \
-	--with-lockdir=/var/lock \
-	--with-logfilebase=/var/log \
-	--with-configdir=/etc/samba \
-	--with-privatedir=/etc/samba \
+	--with-fhs \
+	--with-piddir=/var/run/samba \
+	--with-lockdir=/var/cache/samba \
+	--with-ncalrpcdir=/var/run/ncalrpc \
+	--with-nmbdsocketdir=/var/run/nmbd \
 	\
 	--disable-cups \
 	--enable-shared-libs \
Signature · 1 line
2.2.1
#44 lore raw

PATCH 11/16 package/samba: use FHS dirs

Quoted 5 lines · Maxim Mikityanskiy

Clean up system directories by making samba conform to FHS and by using subdirectories e.g. /var/log/samba and /var/run/samba instead of /var/log and /var/run.

Quoted 57 lines
---
 package/samba/S91smb   |  5 +++--
 package/samba/samba.mk | 10 +++++-----
 2 files changed, 8 insertions(+), 7 deletions(-)
package/samba/S91smb +3 -2
index c190771..2e03e82 100755
@@ -10,6 +10,7 @@
 mkdir -p /var/cache/samba
 mkdir -p /var/log/samba
 mkdir -p /var/lock/subsys
+mkdir -p /var/run/samba
 
 RETVAL=0
 
@@ -33,13 +34,13 @@ stop() {
        echo -n "Shutting down SMB services: "
        kill -9 `pidof smbd`
        RETVAL=$?
-       rm -f /var/run/smbd.pid
+       rm -f /var/run/samba/smbd.pid
        echo "done"
 
        echo -n "Shutting down NMB services: "
        kill -9 `pidof nmbd`
        RETVAL2=$?
-       rm -f /var/run/nmbd.pid
+       rm -f /var/run/samba/nmbd.pid
 
        [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && rm -f /var/lock/subsys/smb
        echo "done"
package/samba/samba.mk +5 -6
index d25e94e..31ad644 100644
@@ -33,11 +33,11 @@ SAMBA_CONF_ENV = \
        $(if $(BR2_PACKAGE_SAMBA_AVAHI),AVAHI_LIBS=-pthread)
 
 SAMBA_CONF_OPTS = \
-       --with-piddir=/var/run \
-       --with-lockdir=/var/lock \
-       --with-logfilebase=/var/log \
-       --with-configdir=/etc/samba \
-       --with-privatedir=/etc/samba \
+       --with-fhs \
+       --with-piddir=/var/run/samba \
+       --with-lockdir=/var/cache/samba \
+       --with-ncalrpcdir=/var/run/ncalrpc \
+       --with-nmbdsocketdir=/var/run/nmbd \
        \
        --disable-cups \
        --enable-shared-libs \
--

2.2.1

Quoted 4 lines

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Regards,

Signature · 1 line
Samuel
#45 lore raw

PATCH 11/16 package/samba: use FHS dirs

In reply to Maxim Mikityanskiy

Dear Maxim Mikityanskiy,

Quoted 9 lines · Maxim Mikityanskiy

Clean up system directories by making samba conform to FHS and by using subdirectories e.g. /var/log/samba and /var/run/samba instead of /var/log and /var/run.

---
 package/samba/S91smb   |  5 +++--
 package/samba/samba.mk | 10 +++++-----
 2 files changed, 8 insertions(+), 7 deletions(-)

Even though we recently marked the samba package as deprecated, I've applied this patch.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#46 lore raw

PATCH 12/16 package/samba: add systemd support

In reply to Maxim Mikityanskiy

Add {smbd,nmbd,winbindd}.service files for systemd. Add tmpfiles.d config file to create samba directories.

---
 package/samba/nmbd.service        | 12 ++++++++++++
 package/samba/samba.mk            | 23 +++++++++++++++++++++++
 package/samba/samba_tmpfiles.conf |  4 ++++
 package/samba/smbd.service        | 12 ++++++++++++
 package/samba/winbindd.service    | 12 ++++++++++++
 5 files changed, 63 insertions(+)
 create mode 100644 package/samba/nmbd.service
 create mode 100644 package/samba/samba_tmpfiles.conf
 create mode 100644 package/samba/smbd.service
 create mode 100644 package/samba/winbindd.service
package/samba/nmbd.service new file +12 -0
new file mode 100644
index 0000000..6e241ea
@@ -0,0 +1,12 @@
+[Unit]
+Description=Samba NetBIOS name server
+After=network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/samba/nmbd.pid
+ExecStart=/usr/sbin/nmbd -D
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
package/samba/samba.mk +23 -0
index 31ad644..5a11ebe 100644
@@ -182,6 +182,29 @@ endef
 
 SAMBA_POST_INSTALL_TARGET_HOOKS += SAMBA_INSTALL_CONFIG
 
+ifeq ($(BR2_INIT_SYSTEMD),y)
+define SAMBA_INSTALL_TMPFILES_HOOK
+	$(INSTALL) -D -m 644 package/samba/samba_tmpfiles.conf \
+		$(TARGET_DIR)/usr/lib/tmpfiles.d/samba.conf
+endef
+
+SAMBA_POST_INSTALL_TARGET_HOOKS += SAMBA_INSTALL_TMPFILES_HOOK
+endif
+
+define SAMBA_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 644 package/samba/smbd.service \
+		$(TARGET_DIR)/lib/systemd/system/smbd.service
+	$(INSTALL) -D -m 644 package/samba/nmbd.service \
+		$(TARGET_DIR)/lib/systemd/system/nmbd.service
+	$(if $(BR2_PACKAGE_SAMBA_WINBINDD),$(INSTALL) -D -m 644 package/samba/winbindd.service $(TARGET_DIR)/lib/systemd/system/winbindd.service)
+	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+	ln -fs /lib/systemd/system/smbd.service \
+		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/smbd.service
+	ln -fs /lib/systemd/system/nmbd.service \
+		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/nmbd.service
+	$(if $(BR2_PACKAGE_SAMBA_WINBINDD),ln -fs /lib/systemd/system/winbindd.service $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/winbindd.service)
+endef
+
 define SAMBA_INSTALL_INIT_SYSV
 	$(INSTALL) -m 0755 -D package/samba/S91smb $(TARGET_DIR)/etc/init.d/S91smb
 endef
package/samba/samba_tmpfiles.conf new file +4 -0
new file mode 100644
index 0000000..e265f75
@@ -0,0 +1,4 @@
+d /var/cache/samba 0755 root root -
+d /var/log/samba 0755 root root -
+d /var/lock/samba 0755 root root -
+d /var/run/samba 0755 root root -
package/samba/smbd.service new file +12 -0
new file mode 100644
index 0000000..64abf56
@@ -0,0 +1,12 @@
+[Unit]
+Description=Samba SMB/CIFS server
+After=network.target nmbd.service winbindd.service
+
+[Service]
+Type=forking
+PIDFile=/var/run/samba/smbd.pid
+ExecStart=/usr/sbin/smbd -D
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
package/samba/winbindd.service new file +12 -0
new file mode 100644
index 0000000..214c17e
@@ -0,0 +1,12 @@
+[Unit]
+Description=Samba Winbind daemon
+After=network.target nmbd.service
+
+[Service]
+Type=forking
+PIDFile=/var/run/samba/winbindd.pid
+ExecStart=/usr/sbin/winbindd -D
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
Signature · 1 line
2.2.1
#47 lore raw

PATCH 12/16 package/samba: add systemd support

Hi Maxim,

Quoted 44 lines · Maxim Mikityanskiy

Add {smbd,nmbd,winbindd}.service files for systemd. Add tmpfiles.d config file to create samba directories.

---
 package/samba/nmbd.service        | 12 ++++++++++++
 package/samba/samba.mk            | 23 +++++++++++++++++++++++
 package/samba/samba_tmpfiles.conf |  4 ++++
 package/samba/smbd.service        | 12 ++++++++++++
 package/samba/winbindd.service    | 12 ++++++++++++
 5 files changed, 63 insertions(+)
 create mode 100644 package/samba/nmbd.service
 create mode 100644 package/samba/samba_tmpfiles.conf
 create mode 100644 package/samba/smbd.service
 create mode 100644 package/samba/winbindd.service
package/samba/nmbd.service new file +12 -0
new file mode 100644
index 0000000..6e241ea
@@ -0,0 +1,12 @@
+[Unit]
+Description=Samba NetBIOS name server
+After=network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/samba/nmbd.pid
+ExecStart=/usr/sbin/nmbd -D
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
package/samba/samba.mk +2 -0
index 31ad644..5a11ebe 100644
@@ -182,6 +182,29 @@ endef
 
 SAMBA_POST_INSTALL_TARGET_HOOKS += SAMBA_INSTALL_CONFIG
 
+ifeq ($(BR2_INIT_SYSTEMD),y)
+define SAMBA_INSTALL_TMPFILES_HOOK

package/samba/samba.mk endef · line 196

Quoted 10 lines
package/samba/samba.mk +10 -0
+       $(INSTALL) -D -m 644 package/samba/samba_tmpfiles.conf \
+               $(TARGET_DIR)/usr/lib/tmpfiles.d/samba.conf
+endef
+
+SAMBA_POST_INSTALL_TARGET_HOOKS += SAMBA_INSTALL_TMPFILES_HOOK
+endif
+
+define SAMBA_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 644 package/samba/smbd.service \
+               $(TARGET_DIR)/lib/systemd/system/smbd.service

smbd can be disabled, so its *.service installation should be optional WRT its option.

package/samba/samba.mk endef · line 198

Quoted 2 lines
package/samba/samba.mk +2 -0
+       $(INSTALL) -D -m 644 package/samba/nmbd.service \
+               $(TARGET_DIR)/lib/systemd/system/nmbd.service

ditto for nmbd.

package/samba/samba.mk endef · line 202

Quoted 4 lines
package/samba/samba.mk +4 -0
+       $(if $(BR2_PACKAGE_SAMBA_WINBINDD),$(INSTALL) -D -m 644 package/samba/winbindd.service $(TARGET_DIR)/lib/systemd/system/winbindd.service)
+       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+       ln -fs /lib/systemd/system/smbd.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/smbd.service

ditto

package/samba/samba.mk endef · line 204

Quoted 2 lines
package/samba/samba.mk +2 -0
+       ln -fs /lib/systemd/system/nmbd.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/nmbd.service

ditto

Quoted 53 lines
package/samba/samba.mk +3 -0
+       $(if $(BR2_PACKAGE_SAMBA_WINBINDD),ln -fs /lib/systemd/system/winbindd.service $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/winbindd.service)
+endef
+
 define SAMBA_INSTALL_INIT_SYSV
        $(INSTALL) -m 0755 -D package/samba/S91smb $(TARGET_DIR)/etc/init.d/S91smb
 endef
package/samba/samba_tmpfiles.conf new file +4 -0
new file mode 100644
index 0000000..e265f75
@@ -0,0 +1,4 @@
+d /var/cache/samba 0755 root root -
+d /var/log/samba 0755 root root -
+d /var/lock/samba 0755 root root -
+d /var/run/samba 0755 root root -
package/samba/smbd.service new file +12 -0
new file mode 100644
index 0000000..64abf56
@@ -0,0 +1,12 @@
+[Unit]
+Description=Samba SMB/CIFS server
+After=network.target nmbd.service winbindd.service
+
+[Service]
+Type=forking
+PIDFile=/var/run/samba/smbd.pid
+ExecStart=/usr/sbin/smbd -D
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
package/samba/winbindd.service new file +12 -1
new file mode 100644
index 0000000..214c17e
@@ -0,0 +1,12 @@
+[Unit]
+Description=Samba Winbind daemon
+After=network.target nmbd.service
+
+[Service]
+Type=forking
+PIDFile=/var/run/samba/winbindd.pid
+ExecStart=/usr/sbin/winbindd -D
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
--
Quoted 1 line

2.2.1

Regards,

Signature · 1 line
Samuel
#48 lore raw

PATCH 12/16 package/samba: add systemd support

Hi Samuel, Maxim, all

Quoted 2 lines · Samuel Martin

Hi Maxim,

On a more general note, we want to install your systemd services into /usr/lib/systemd/system/ instead of the /lib/systemd/system that you used.

Quoted 139 lines · Maxim Mikityanskiy
Quoted 44 lines

Add {smbd,nmbd,winbindd}.service files for systemd. Add tmpfiles.d config file to create samba directories.

---
 package/samba/nmbd.service        | 12 ++++++++++++
 package/samba/samba.mk            | 23 +++++++++++++++++++++++
 package/samba/samba_tmpfiles.conf |  4 ++++
 package/samba/smbd.service        | 12 ++++++++++++
 package/samba/winbindd.service    | 12 ++++++++++++
 5 files changed, 63 insertions(+)
 create mode 100644 package/samba/nmbd.service
 create mode 100644 package/samba/samba_tmpfiles.conf
 create mode 100644 package/samba/smbd.service
 create mode 100644 package/samba/winbindd.service
package/samba/nmbd.service new file +12 -0
new file mode 100644
index 0000000..6e241ea
@@ -0,0 +1,12 @@
+[Unit]
+Description=Samba NetBIOS name server
+After=network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/samba/nmbd.pid
+ExecStart=/usr/sbin/nmbd -D
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
package/samba/samba.mk +2 -0
index 31ad644..5a11ebe 100644
@@ -182,6 +182,29 @@ endef
 
 SAMBA_POST_INSTALL_TARGET_HOOKS += SAMBA_INSTALL_CONFIG
 
+ifeq ($(BR2_INIT_SYSTEMD),y)
+define SAMBA_INSTALL_TMPFILES_HOOK

package/samba/samba.mk endef · line 196

Quoted 10 lines
package/samba/samba.mk +10 -0
+       $(INSTALL) -D -m 644 package/samba/samba_tmpfiles.conf \
+               $(TARGET_DIR)/usr/lib/tmpfiles.d/samba.conf
+endef
+
+SAMBA_POST_INSTALL_TARGET_HOOKS += SAMBA_INSTALL_TMPFILES_HOOK
+endif
+
+define SAMBA_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 644 package/samba/smbd.service \
+               $(TARGET_DIR)/lib/systemd/system/smbd.service

smbd can be disabled, so its *.service installation should be optional WRT its option.

package/samba/samba.mk endef · line 198

Quoted 2 lines
package/samba/samba.mk +2 -0
+       $(INSTALL) -D -m 644 package/samba/nmbd.service \
+               $(TARGET_DIR)/lib/systemd/system/nmbd.service

ditto for nmbd.

package/samba/samba.mk endef · line 202

Quoted 4 lines
package/samba/samba.mk +4 -0
+       $(if $(BR2_PACKAGE_SAMBA_WINBINDD),$(INSTALL) -D -m 644 package/samba/winbindd.service $(TARGET_DIR)/lib/systemd/system/winbindd.service)
+       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+       ln -fs /lib/systemd/system/smbd.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/smbd.service

ditto

package/samba/samba.mk endef · line 204

Quoted 2 lines
package/samba/samba.mk +2 -0
+       ln -fs /lib/systemd/system/nmbd.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/nmbd.service

ditto

Quoted 53 lines
package/samba/samba.mk +3 -0
+       $(if $(BR2_PACKAGE_SAMBA_WINBINDD),ln -fs /lib/systemd/system/winbindd.service $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/winbindd.service)
+endef
+
 define SAMBA_INSTALL_INIT_SYSV
        $(INSTALL) -m 0755 -D package/samba/S91smb $(TARGET_DIR)/etc/init.d/S91smb
 endef
package/samba/samba_tmpfiles.conf new file +4 -0
new file mode 100644
index 0000000..e265f75
@@ -0,0 +1,4 @@
+d /var/cache/samba 0755 root root -
+d /var/log/samba 0755 root root -
+d /var/lock/samba 0755 root root -
+d /var/run/samba 0755 root root -
package/samba/smbd.service new file +12 -0
new file mode 100644
index 0000000..64abf56
@@ -0,0 +1,12 @@
+[Unit]
+Description=Samba SMB/CIFS server
+After=network.target nmbd.service winbindd.service
+
+[Service]
+Type=forking
+PIDFile=/var/run/samba/smbd.pid
+ExecStart=/usr/sbin/smbd -D
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
package/samba/winbindd.service new file +12 -1
new file mode 100644
index 0000000..214c17e
@@ -0,0 +1,12 @@
+[Unit]
+Description=Samba Winbind daemon
+After=network.target nmbd.service
+
+[Service]
+Type=forking
+PIDFile=/var/run/samba/winbindd.pid
+ExecStart=/usr/sbin/winbindd -D
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
--
Quoted 1 line

2.2.1

Regards,

--
Samuel
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#49 lore raw

PATCH 13/16 package/tar: add support for acl and xattr

In reply to Maxim Mikityanskiy

If acl or attr is going to be installed, add support for them to tar.

---
 package/tar/tar.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)
package/tar/tar.mk +10 -0
index caaa5ad..e3f538d 100644
@@ -19,6 +19,16 @@ TAR_DEPENDENCIES += busybox
 HOST_TAR_DEPENDENCIES =
 endif
 
+ifeq ($(BR2_PACKAGE_ACL),y)
+TAR_DEPENDENCIES += acl
+TAR_CONF_OPTS += --with-posix-acls
+endif
+
+ifeq ($(BR2_PACKAGE_ATTR),y)
+TAR_DEPENDENCIES += attr
+TAR_CONF_OPTS += --with-xattrs
+endif
+
 $(eval $(autotools-package))
 
 # host-tar: use cpio.gz instead of tar.gz to prevent chicken-egg problem
Signature · 1 line
2.2.1
#50 lore raw

PATCH 13/16 package/tar: add support for acl and xattr

Dear Maxim Mikityanskiy,

Quoted 6 lines · Maxim Mikityanskiy

If acl or attr is going to be installed, add support for them to tar.

---
 package/tar/tar.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)

Applied, thanks! I added a 'else' condition, which makes sure to explicitly disable the acl and attr support when the corresponding packages are not available.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#51 lore raw

PATCH 14/16 package/util-linux: add more tool select options

In reply to Maxim Mikityanskiy

Add more options to Config.in to allow optionally select or deselect util-linux tools.

Also fix s/BR2_PACKAGE_WDCTL/BR2_PACKAGE_UTIL_LINUX_WDCTL/

---
 package/util-linux/Config.in     | 64 +++++++++++++++++++++++++++++++++++++++-
 package/util-linux/util-linux.mk | 17 +++++++++--
 2 files changed, 78 insertions(+), 3 deletions(-)
package/util-linux/Config.in +63 -1
index a8dfa1c..78648c1 100644
@@ -26,6 +26,11 @@ config BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
 	help
 	  Install libmount.
 
+config BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS
+	bool "libsmartcols"
+	help
+	  Install libsmartcols.
+
 config BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	bool "libuuid"
 	help
@@ -36,6 +41,7 @@ config BR2_PACKAGE_UTIL_LINUX_BINARIES
 	depends on BR2_USE_MMU # fork()
 	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
 	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS
 	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  Install the basic set of util-linux binaries.
@@ -52,6 +58,11 @@ config BR2_PACKAGE_UTIL_LINUX_ARCH
 	help
 	  Print machine architecture
 
+config BR2_PACKAGE_UTIL_LINUX_BFS
+	bool "bfs"
+	help
+	  SCO bfs filesystem support
+
 config BR2_PACKAGE_UTIL_LINUX_CHFN_CHSH
 	bool "chfn/chsh"
 	depends on (BR2_ENABLE_LOCALE && BR2_USE_WCHAR) # linux-pam
@@ -86,16 +97,31 @@ config BR2_PACKAGE_UTIL_LINUX_FALLOCATE
 	help
 	  Preallocate space to a file
 
+config BR2_PACKAGE_UTIL_LINUX_FDFORMAT
+	bool "fdformat"
+	help
+	  Low-level format a floppy disk
+
 config BR2_PACKAGE_UTIL_LINUX_FSCK
 	bool "fsck"
 	help
 	  Check and repair a linux filesystem
 
+config BR2_PACKAGE_UTIL_LINUX_HWCLOCK
+	bool "hwclock"
+	help
+	  Query or set the hardware clock (RTC)
+
 config BR2_PACKAGE_UTIL_LINUX_KILL
 	bool "kill"
 	help
 	  Send a signal to a process
 
+config BR2_PACKAGE_UTIL_LINUX_LAST
+	bool "last"
+	help
+	  Show a listing of last logged in users
+
 config BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS
 	bool "login utilities"
 	depends on (BR2_ENABLE_LOCALE && BR2_USE_WCHAR) # linux-pam
@@ -118,6 +144,11 @@ config BR2_PACKAGE_UTIL_LINUX_MESG
 	help
 	  Control write access to your terminal
 
+config BR2_PACKAGE_UTIL_LINUX_MINIX
+	bool "minix"
+	help
+	  Minix filesystem support
+
 config BR2_PACKAGE_UTIL_LINUX_NSENTER
 	bool "nsenter"
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
@@ -127,16 +158,31 @@ config BR2_PACKAGE_UTIL_LINUX_NSENTER
 comment "nsenter needs a toolchain w/ headers >= 3.0"
 	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
 
+config BR2_PACKAGE_UTIL_LINUX_MORE
+	bool "more"
+	help
+	  File perusal filter for crt viewing
+
 config BR2_PACKAGE_UTIL_LINUX_MOUNT
 	bool "mount/umount"
 	help
 	  Mount/unmount filesystems
 
+config BR2_PACKAGE_UTIL_LINUX_MOUNTPOINT
+	bool "mountpoint"
+	help
+	  See if a directory is a mountpoint
+
 config BR2_PACKAGE_UTIL_LINUX_NEWGRP
 	bool "newgrp"
 	help
 	  Log in to a new group
 
+config BR2_PACKAGE_UTIL_LINUX_NOLOGIN
+	bool "nologin"
+	help
+	  Politely refuse a login
+
 config BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT
 	bool "pivot_root"
 	help
@@ -167,11 +213,27 @@ config BR2_PACKAGE_UTIL_LINUX_SCHEDUTILS
 	help
 	  Scheduling utilities (chrt, ionice, taskset)
 
+config BR2_PACKAGE_UTIL_LINUX_SETPRIV
+	bool "setpriv"
+	select BR2_PACKAGE_LIBCAP_NG
+	help
+	  Run a program with different Linux privilege settings
+
+config BR2_PACKAGE_UTIL_LINUX_SETTERM
+	bool "setterm"
+	help
+	  Set terminal attributes
+
 config BR2_PACKAGE_UTIL_LINUX_SWITCH_ROOT
 	bool "switch_root"
 	help
 	  Switch to another filesystem as the root of the mount tree
 
+config BR2_PACKAGE_UTIL_LINUX_UL
+	bool "ul"
+	help
+	  Do underlining
+
 config BR2_PACKAGE_UTIL_LINUX_UNSHARE
 	bool "unshare"
 	help
@@ -197,7 +259,7 @@ config BR2_PACKAGE_UTIL_LINUX_WALL
 	help
 	  Send a message to everybody's terminal
 
-config BR2_PACKAGE_WDCTL
+config BR2_PACKAGE_UTIL_LINUX_WDCTL
 	bool "wdctl"
 	help
 	  Shows hardware watchdog status
package/util-linux/util-linux.mk +15 -2
index c8fb77c..a70363f 100644
@@ -66,34 +66,47 @@ UTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_LINUX_PAM),linux-pam)
 UTIL_LINUX_CONF_OPTS += \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_AGETTY),--enable-agetty,--disable-agetty) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_ARCH),--enable-arch,--disable-arch) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_BFS),--enable-bfs,--disable-bfs) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_CHFN_CHSH),--enable-chfn-chsh,--disable-chfn-chsh) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_CRAMFS),--enable-cramfs,--disable-cramfs) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_DDATE),--enable-ddate,--disable-ddate) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_EJECT),--enable-eject,--disable-eject) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_FALLOCATE),--enable-fallocate,--disable-fallocate) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_FDFORMAT),--enable-fdformat,--disable-fdformat) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_FSCK),--enable-fsck,--disable-fsck) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_HWCLOCK),--enable-hwclock,--disable-hwclock) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_KILL),--enable-kill,--disable-kill) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_LAST),--enable-last,--disable-last) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBBLKID),--enable-libblkid,--disable-libblkid) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBMOUNT),--enable-libmount,--disable-libmount) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS),--enable-libsmartcols,--disable-libsmartcols) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBUUID),--enable-libuuid,--disable-libuuid) \
-	$(if $(BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS),--enable-last --enable-login --enable-su --enable-sulogin,--disable-last --disable-login --disable-su --disable-sulogin) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS),--enable-last --enable-login --enable-runuser --enable-su --enable-sulogin,--disable-last --disable-login --disable-runuser --disable-su --disable-sulogin) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LOSETUP),--enable-losetup,--disable-losetup) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_MESG),--enable-mesg,--disable-mesg) \
-	$(if $(BR2_PACKAGE_UTIL_LINUX_NSENTER),--enable-nsenter,--disable-nsenter) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_MINIX),--enable-minix,--disable-minix) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_MORE),--enable-more,--disable-more) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_MOUNT),--enable-mount,--disable-mount) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_MOUNTPOINT),--enable-mountpoint,--disable-mountpoint) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_NEWGRP),--enable-newgrp,--disable-newgrp) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_NOLOGIN),--enable-nologin,--disable-nologin) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_NSENTER),--enable-nsenter,--disable-nsenter) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_PARTX),--enable-partx,--disable-partx) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT),--enable-pivot_root,--disable-pivot_root) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_RAW),--enable-raw,--disable-raw) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_RENAME),--enable-rename,--disable-rename) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_RESET),--enable-reset,--disable-reset) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_SCHEDUTILS),--enable-schedutils,--disable-schedutils) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_SETPRIV),--enable-setpriv,--disable-setpriv) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_SETTERM),--enable-setterm,--disable-setterm) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_SWITCH_ROOT),--enable-switch_root,--disable-switch_root) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_UL),--enable-ul,--disable-ul) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_UNSHARE),--enable-unshare,--disable-unshare) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_UTMPDUMP),--enable-utmpdump,--disable-utmpdump) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_UUIDD),--enable-uuidd,--disable-uuidd) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_VIPW),--enable-vipw,--disable-vipw) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_WALL),--enable-wall,--disable-wall) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_WDCTL),--enable-wdctl,--disable-wdctl) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_WRITE),--enable-write,--disable-write)
 
 # In the host version of util-linux, we so far only require libuuid,
Signature · 1 line
2.2.1
#52 lore raw

PATCH 14/16 package/util-linux: add more tool select options

Dear Maxim Mikityanskiy,

Quoted 4 lines · Maxim Mikityanskiy

Add more options to Config.in to allow optionally select or deselect util-linux tools.

Also fix s/BR2_PACKAGE_WDCTL/BR2_PACKAGE_UTIL_LINUX_WDCTL/

Ideally, this fix should have been in a separate patch. Note that there is no need for Config.in.legacy handling, because the option has never done anything, so renaming it doesn't hurt.

package/util-linux/Config.in config BR2_PACKAGE_UTIL_LINUX_BINARIES · line 44

Quoted 5 lines
package/util-linux/Config.in +1 -0
@@ -36,6 +41,7 @@ config BR2_PACKAGE_UTIL_LINUX_BINARIES
 	depends on BR2_USE_MMU # fork()
 	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
 	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS

I was originally not very happy of this additional select, which means that libsmartcols now gets installed regardless of which binaries you install. But it seems to be used by quite a few util-linux binaries anyway, so ok.

So: applied, thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#53 lore raw

PATCH 14/16 package/util-linux: add more tool select options

In reply to Maxim Mikityanskiy

Maxim, All,

On 2015-01-19 18:14 +0200, Maxim Mikityanskiy spake thusly:

Quoted 4 lines

Add more options to Config.in to allow optionally select or deselect util-linux tools.

Also fix s/BR2_PACKAGE_WDCTL/BR2_PACKAGE_UTIL_LINUX_WDCTL/

[--SNIP--]

package/util-linux/Config.in config BR2_PACKAGE_UTIL_LINUX_WALL · line 262

Quoted 2 lines
package/util-linux/Config.in +1 -1
-config BR2_PACKAGE_WDCTL
+config BR2_PACKAGE_UTIL_LINUX_WDCTL

BR2_PACKAGE_WDCTL should have been added to config.in.legacy to provide backward compatibility with previos .config/defconfig files.
I'll submit a patch for that in a momemnt.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#54 lore raw

PATCH 15/16 package/vim: add default vimrc

In reply to Maxim Mikityanskiy

Support /etc/vim/vimrc as system-wide vimrc file. Add some default sample vimrc.

---
 package/vim/vim.mk | 11 +++++++++++
 package/vim/vimrc  | 14 ++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 100644 package/vim/vimrc
package/vim/vim.mk +11 -0
index da84d14..992e41b 100644
@@ -28,6 +28,12 @@ VIM_CONF_OPTS = --with-tlib=ncurses --enable-gui=no --without-x
 VIM_LICENSE = Charityware
 VIM_LICENSE_FILES = README.txt
 
+define VIM_VIMRC_HOOK
+	echo '#define SYS_VIMRC_FILE "/etc/vim/vimrc"' >> $(@D)/src/feature.h
+endef
+
+VIM_PRE_CONFIGURE_HOOKS += VIM_VIMRC_HOOK
+
 define VIM_INSTALL_TARGET_CMDS
 	cd $(@D)/src; \
 		$(MAKE) DESTDIR=$(TARGET_DIR) installvimbin; \
@@ -51,6 +57,11 @@ define VIM_INSTALL_VI_SYMLINK
 endef
 VIM_POST_INSTALL_TARGET_HOOKS += VIM_INSTALL_VI_SYMLINK
 
+define VIM_INSTALL_VIMRC
+	$(INSTALL) -D -m 644 package/vim/vimrc $(TARGET_DIR)/etc/vim/vimrc
+endef
+VIM_POST_INSTALL_TARGET_HOOKS += VIM_INSTALL_VIMRC
+
 ifeq ($(BR2_PACKAGE_VIM_RUNTIME),y)
 VIM_POST_INSTALL_TARGET_HOOKS += VIM_INSTALL_RUNTIME_CMDS
 VIM_POST_INSTALL_TARGET_HOOKS += VIM_REMOVE_DOCS
package/vim/vimrc new file +14 -0
new file mode 100644
index 0000000..bfc2087
@@ -0,0 +1,14 @@
+set nocompatible
+
+set ai
+set background=dark
+set backspace=indent,eol,start
+set nomodeline
+set ruler
+
+set ignorecase smartcase incsearch hlsearch
+
+syntax on
+
+filetype plugin on
+filetype indent on
Signature · 1 line
2.2.1
#55 lore raw

PATCH 15/16 package/vim: add default vimrc

Hi Maxim,

Quoted 60 lines · Maxim Mikityanskiy

Support /etc/vim/vimrc as system-wide vimrc file. Add some default sample vimrc.

---
 package/vim/vim.mk | 11 +++++++++++
 package/vim/vimrc  | 14 ++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 100644 package/vim/vimrc
package/vim/vim.mk +11 -0
index da84d14..992e41b 100644
@@ -28,6 +28,12 @@ VIM_CONF_OPTS = --with-tlib=ncurses --enable-gui=no --without-x
 VIM_LICENSE = Charityware
 VIM_LICENSE_FILES = README.txt
 
+define VIM_VIMRC_HOOK
+       echo '#define SYS_VIMRC_FILE "/etc/vim/vimrc"' >> $(@D)/src/feature.h
+endef
+
+VIM_PRE_CONFIGURE_HOOKS += VIM_VIMRC_HOOK
+
 define VIM_INSTALL_TARGET_CMDS
        cd $(@D)/src; \
                $(MAKE) DESTDIR=$(TARGET_DIR) installvimbin; \
@@ -51,6 +57,11 @@ define VIM_INSTALL_VI_SYMLINK
 endef
 VIM_POST_INSTALL_TARGET_HOOKS += VIM_INSTALL_VI_SYMLINK
 
+define VIM_INSTALL_VIMRC
+       $(INSTALL) -D -m 644 package/vim/vimrc $(TARGET_DIR)/etc/vim/vimrc
+endef
+VIM_POST_INSTALL_TARGET_HOOKS += VIM_INSTALL_VIMRC
+
 ifeq ($(BR2_PACKAGE_VIM_RUNTIME),y)
 VIM_POST_INSTALL_TARGET_HOOKS += VIM_INSTALL_RUNTIME_CMDS
 VIM_POST_INSTALL_TARGET_HOOKS += VIM_REMOVE_DOCS
package/vim/vimrc new file +14 -1
new file mode 100644
index 0000000..bfc2087
@@ -0,0 +1,14 @@
+set nocompatible
+
+set ai
+set background=dark
+set backspace=indent,eol,start
+set nomodeline
+set ruler
+
+set ignorecase smartcase incsearch hlsearch
+
+syntax on
+
+filetype plugin on
+filetype indent on
--
Quoted 2 lines

2.2.1

I'm usually not so fond of this kind fo config... just for comfort IMHO ;-) but since this one is fairly short:

Signature · 1 line
Samuel
#56 lore raw

PATCH 15/16 package/vim: add default vimrc

In reply to Maxim Mikityanskiy

Dear Maxim Mikityanskiy,

Quoted 9 lines · Maxim Mikityanskiy

Support /etc/vim/vimrc as system-wide vimrc file. Add some default sample vimrc.

---
 package/vim/vim.mk | 11 +++++++++++
 package/vim/vimrc  | 14 ++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 100644 package/vim/vimrc

I don't think it's really that useful to have a custom vimrc installed by default. We do install a default config file for daemons when they need it to have some sane default behavior, but for things like text editors, I'm not sure it's really worth it.

So I've marked your patch as Rejected in our patch tracking system.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#57 lore raw

PATCH 16/16 package/rng-tools: add systemd support for rngd

In reply to Maxim Mikityanskiy

Add rngd.service for systemd. Also patch rngd with patch from Fedora to ignore failure if no hwrng present:
https://bugzilla.redhat.com/show_bug.cgi?id=892178

---
 package/rng-tools/rng-tools.mk         |  8 ++++++++
 package/rng-tools/rngd-exit-code.patch | 11 +++++++++++
 package/rng-tools/rngd.service         |  9 +++++++++
 3 files changed, 28 insertions(+)
 create mode 100644 package/rng-tools/rngd-exit-code.patch
 create mode 100644 package/rng-tools/rngd.service
package/rng-tools/rng-tools.mk +8 -0
index 5b89656..13352cc 100644
@@ -21,4 +21,12 @@ else
 RNG_TOOLS_CONF_OPTS += --without-libgcrypt
 endif
 
+define RNG_TOOLS_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 644 package/rng-tools/rngd.service \
+		$(TARGET_DIR)/lib/systemd/system/rngd.service
+	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+	ln -fs /lib/systemd/system/rngd.service \
+		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/rngd.service
+endef
+
 $(eval $(autotools-package))
package/rng-tools/rngd-exit-code.patch new file +11 -0
new file mode 100644
index 0000000..5f87161
@@ -0,0 +1,11 @@
+--- a/rngd.c
++++ b/rngd.c
+@@ -319,7 +319,7 @@ int main(int argc, char **argv)
+ 			message(LOG_DAEMON|LOG_ERR,
+ 				"Maybe RNG device modules are not loaded\n");
+ 		}
+-		return 1;
++		return 66;
+ 	}
+ 
+ 	if (arguments->verbose) {
package/rng-tools/rngd.service new file +9 -0
new file mode 100644
index 0000000..3bdc4c1
@@ -0,0 +1,9 @@
+[Unit]
+Description=Hardware RNG Entropy Gatherer Daemon
+
+[Service]
+ExecStart=/usr/sbin/rngd -f
+SuccessExitStatus=66
+
+[Install]
+WantedBy=multi-user.target
Signature · 1 line
2.2.1
#58 lore raw

PATCH 16/16 package/rng-tools: add systemd support for rngd

Hi Maxim,

package/rng-tools/rngd-exit-code.patch

Quoted 35 lines · Maxim Mikityanskiy

Add rngd.service for systemd. Also patch rngd with patch from Fedora to ignore failure if no hwrng present:
https://bugzilla.redhat.com/show_bug.cgi?id=892178

---
 package/rng-tools/rng-tools.mk         |  8 ++++++++
 package/rng-tools/rngd-exit-code.patch | 11 +++++++++++
 package/rng-tools/rngd.service         |  9 +++++++++
 3 files changed, 28 insertions(+)
 create mode 100644 package/rng-tools/rngd-exit-code.patch
 create mode 100644 package/rng-tools/rngd.service
package/rng-tools/rng-tools.mk +8 -0
index 5b89656..13352cc 100644
@@ -21,4 +21,12 @@ else
 RNG_TOOLS_CONF_OPTS += --without-libgcrypt
 endif
 
+define RNG_TOOLS_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 644 package/rng-tools/rngd.service \
+               $(TARGET_DIR)/lib/systemd/system/rngd.service
+       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+       ln -fs /lib/systemd/system/rngd.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/rngd.service
+endef
+
 $(eval $(autotools-package))
package/rng-tools/rngd-exit-code.patch new file +0 -0
new file mode 100644
index 0000000..5f87161

Few comments about the patch:
- patch filename should follow what git format-patch generates, so something 0001-<some description>.patch;
- patch should have a non-empty description and sob-line.

Check [1] for detailed package's patch requirements.

Quoted 28 lines
package/rng-tools/rngd-exit-code.patch new file +11 -0
@@ -0,0 +1,11 @@
+--- a/rngd.c
++++ b/rngd.c
+@@ -319,7 +319,7 @@ int main(int argc, char **argv)
+                       message(LOG_DAEMON|LOG_ERR,
+                               "Maybe RNG device modules are not loaded\n");
+               }
+-              return 1;
++              return 66;
+       }
+
+       if (arguments->verbose) {
package/rng-tools/rngd.service new file +9 -1
new file mode 100644
index 0000000..3bdc4c1
@@ -0,0 +1,9 @@
+[Unit]
+Description=Hardware RNG Entropy Gatherer Daemon
+
+[Service]
+ExecStart=/usr/sbin/rngd -f
+SuccessExitStatus=66
+
+[Install]
+WantedBy=multi-user.target
--
Quoted 2 lines

2.2.1

[1] http://nightly.buildroot.org/manual.html#patch-policy

Regards,

Signature · 1 line
Samuel
#59 lore raw

PATCH 16/16 package/rng-tools: add systemd support for rngd

In reply to Maxim Mikityanskiy

Dear Maxim Mikityanskiy,

Quoted 4 lines · Maxim Mikityanskiy

Add rngd.service for systemd. Also patch rngd with patch from Fedora to ignore failure if no hwrng present:
https://bugzilla.redhat.com/show_bug.cgi?id=892178

Quoted 8 lines
---
 package/rng-tools/rng-tools.mk         |  8 ++++++++
 package/rng-tools/rngd-exit-code.patch | 11 +++++++++++
 package/rng-tools/rngd.service         |  9 +++++++++
 3 files changed, 28 insertions(+)
 create mode 100644 package/rng-tools/rngd-exit-code.patch
 create mode 100644 package/rng-tools/rngd.service

Applied, after doing a number of changes:

[Thomas:
- rename patch to the proper naming convention
- add description and SoB to patch
- install service file to /usr/lib/systemd and not /lib/systemd
- use a relative symbolic link instead of an absolute one]

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com