* [Buildroot] [pull request] Pull request for branch for-2012.05/systemd
@ 2012-03-19 15:59 Maxime Ripard
2012-03-19 15:59 ` [Buildroot] [PATCH 1/6] Change the /etc/mtab symlink to use an absolute path Maxime Ripard
` (5 more replies)
0 siblings, 6 replies; 22+ messages in thread
From: Maxime Ripard @ 2012-03-19 15:59 UTC (permalink / raw)
To: buildroot
Hi all,
This is an update of my previous RFC for integrating systemd into buildroot
I guess we have now reached a pretty good shape and we can begin to think
about merging these.
As always, any comments are welcome :)
Maxime
The following changes since commit 03ceab6d1611cf378ac9bec92134354bcdd963d1:
Update for 2012.02 (2012-02-29 23:19:47 +0100)
are available in the git repository at:
git://git.free-electrons.com/users/maxime-ripard/buildroot.git for-2012.05/systemd
Maxime Ripard (6):
Change the /etc/mtab symlink to use an absolute path
Add the systemd package
Enable cgroups in Linux if we use systemd
Rework of the init system
Fix installation for the lighttpd package
Add systemd unit for lighttpd
fs/skeleton/etc/mtab | 2 +-
linux/linux.mk | 2 +
package/Config.in | 1 +
package/Makefile.package.in | 8 +
package/dbus/dbus.mk | 4 +
package/lighttpd/lighttpd.conf | 445 +++++++++++++++++++++++++++++++++
package/lighttpd/lighttpd.mk | 44 ++++
package/lighttpd/lighttpd.service | 10 +
package/systemd/Config.in | 20 ++
package/systemd/getty at .service | 39 +++
package/systemd/serial-getty at .service | 31 +++
package/systemd/systemd.mk | 69 +++++
package/sysvinit/Config.in | 1 +
package/udev/udev.mk | 4 +
target/generic/Config.in | 22 ++
15 files changed, 701 insertions(+), 1 deletions(-)
create mode 100644 package/lighttpd/lighttpd.conf
create mode 100644 package/lighttpd/lighttpd.service
create mode 100644 package/systemd/Config.in
create mode 100644 package/systemd/getty at .service
create mode 100644 package/systemd/serial-getty at .service
create mode 100644 package/systemd/systemd.mk
Thanks,
--
Maxime Ripard
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Buildroot] [PATCH 1/6] Change the /etc/mtab symlink to use an absolute path
2012-03-19 15:59 [Buildroot] [pull request] Pull request for branch for-2012.05/systemd Maxime Ripard
@ 2012-03-19 15:59 ` Maxime Ripard
2012-03-19 16:08 ` Peter Korsgaard
2012-03-19 15:59 ` [Buildroot] [PATCH 2/6] Add the systemd package Maxime Ripard
` (4 subsequent siblings)
5 siblings, 1 reply; 22+ messages in thread
From: Maxime Ripard @ 2012-03-19 15:59 UTC (permalink / raw)
To: buildroot
As systemd checks if /etc/mtab is a symlink to /proc/mount or
/proc/self/mounts, we need to change it so that we can run systemd.
http://cgit.freedesktop.org/systemd/tree/src/main.c#n1082
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
fs/skeleton/etc/mtab | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/skeleton/etc/mtab b/fs/skeleton/etc/mtab
index e1c2045..4c0a094 120000
--- a/fs/skeleton/etc/mtab
+++ b/fs/skeleton/etc/mtab
@@ -1 +1 @@
-../proc/mounts
\ No newline at end of file
+/proc/mounts
\ No newline at end of file
--
1.7.5.4
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Buildroot] [PATCH 2/6] Add the systemd package
2012-03-19 15:59 [Buildroot] [pull request] Pull request for branch for-2012.05/systemd Maxime Ripard
2012-03-19 15:59 ` [Buildroot] [PATCH 1/6] Change the /etc/mtab symlink to use an absolute path Maxime Ripard
@ 2012-03-19 15:59 ` Maxime Ripard
2012-03-19 23:32 ` Arnout Vandecappelle
2012-03-19 15:59 ` [Buildroot] [PATCH 3/6] Enable cgroups in Linux if we use systemd Maxime Ripard
` (3 subsequent siblings)
5 siblings, 1 reply; 22+ messages in thread
From: Maxime Ripard @ 2012-03-19 15:59 UTC (permalink / raw)
To: buildroot
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
package/Config.in | 1 +
package/dbus/dbus.mk | 4 ++
package/systemd/Config.in | 19 +++++++++
package/systemd/getty at .service | 39 ++++++++++++++++++
package/systemd/serial-getty at .service | 31 +++++++++++++++
package/systemd/systemd.mk | 69 +++++++++++++++++++++++++++++++++
package/udev/udev.mk | 4 ++
7 files changed, 167 insertions(+), 0 deletions(-)
create mode 100644 package/systemd/Config.in
create mode 100644 package/systemd/getty at .service
create mode 100644 package/systemd/serial-getty at .service
create mode 100644 package/systemd/systemd.mk
diff --git a/package/Config.in b/package/Config.in
index 8a7c9c4..c392e50 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -571,6 +571,7 @@ source "package/psmisc/Config.in"
source "package/rsyslog/Config.in"
source "package/sysklogd/Config.in"
source "package/sysvinit/Config.in"
+source "package/systemd/Config.in"
endif
source "package/util-linux/Config.in"
source "package/dsp-tools/Config.in"
diff --git a/package/dbus/dbus.mk b/package/dbus/dbus.mk
index e18e291..0942b33 100644
--- a/package/dbus/dbus.mk
+++ b/package/dbus/dbus.mk
@@ -39,6 +39,10 @@ else
DBUS_CONF_OPT += --without-x
endif
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+DBUS_CONF_OPT += --with-systemdsystemunitdir=/lib/systemd/system
+endif
+
# fix rebuild (dbus makefile errors out if /var/lib/dbus is a symlink)
define DBUS_REMOVE_VAR_LIB_DBUS
rm -rf $(TARGET_DIR)/var/lib/dbus
diff --git a/package/systemd/Config.in b/package/systemd/Config.in
new file mode 100644
index 0000000..d87054d
--- /dev/null
+++ b/package/systemd/Config.in
@@ -0,0 +1,19 @@
+config BR2_PACKAGE_SYSTEMD
+ bool "systemd"
+ depends on BR2_PACKAGE_UDEV
+ select BR2_PACKAGE_DBUS
+ select BR2_PACKAGE_LIBCAP
+ help
+ systemd is a system and service manager for Linux, compatible with
+ SysV and LSB init scripts. systemd provides aggressive parallelization
+ capabilities, uses socket and D-Bus activation for starting services,
+ offers on-demand starting of daemons, keeps track of processes using
+ Linux cgroups, supports snapshotting and restoring of the system
+ state, maintains mount and automount points and implements an
+ elaborate transactional dependency-based service control logic.
+ It can work as a drop-in replacement for sysvinit.
+
+ http://freedesktop.org/wiki/Software/systemd
+
+comment "systemd not available (depends on udev and dbus)"
+ depends on !BR2_PACKAGE_UDEV || !BR2_PACKAGE_DBUS
diff --git a/package/systemd/getty at .service b/package/systemd/getty at .service
new file mode 100644
index 0000000..15b3453
--- /dev/null
+++ b/package/systemd/getty at .service
@@ -0,0 +1,39 @@
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+[Unit]
+Description=Getty on %I
+BindTo=dev-%i.device
+After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service
+
+# If additional gettys are spawned during boot then we should make
+# sure that this is synchronized before getty.target, even though
+# getty.target didn't actually pull it in.
+Before=getty.target
+
+[Service]
+Environment=TERM=linux
+ExecStart=-/sbin/getty -L %I 115200 vt100
+Restart=always
+RestartSec=0
+UtmpIdentifier=%I
+TTYPath=/dev/%I
+TTYReset=yes
+TTYVHangup=yes
+TTYVTDisallocate=yes
+KillMode=process
+
+# Unset locale for the console getty since the console has problems
+# displaying some internationalized messages.
+Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION=
+
+# Some login implementations ignore SIGTERM, so we send SIGHUP
+# instead, to ensure that login terminates cleanly.
+KillSignal=SIGHUP
+
+[Install]
+Alias=getty.target.wants/getty at tty1.service
diff --git a/package/systemd/serial-getty at .service b/package/systemd/serial-getty at .service
new file mode 100644
index 0000000..e28ecdf
--- /dev/null
+++ b/package/systemd/serial-getty at .service
@@ -0,0 +1,31 @@
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+[Unit]
+Description=Serial Getty on %I
+BindTo=dev-%i.device
+After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service
+
+# If additional gettys are spawned during boot then we should make
+# sure that this is synchronized before getty.target, even though
+# getty.target didn't actually pull it in.
+Before=getty.target
+
+[Service]
+Environment=TERM=vt100
+ExecStart=-/sbin/getty -L %I 115200 vt100
+Restart=always
+RestartSec=0
+UtmpIdentifier=%I
+TTYPath=/dev/%I
+TTYReset=yes
+TTYVHangup=yes
+KillMode=process
+
+# Some login implementations ignore SIGTERM, so we send SIGHUP
+# instead, to ensure that login terminates cleanly.
+KillSignal=SIGHUP
diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
new file mode 100644
index 0000000..a20ddf4
--- /dev/null
+++ b/package/systemd/systemd.mk
@@ -0,0 +1,69 @@
+#############################################################
+#
+# systemd
+#
+#############################################################
+SYSTEMD_VERSION = 37
+SYSTEMD_SITE = http://www.freedesktop.org/software/systemd/
+SYSTEMD_SOURCE = systemd-$(SYSTEMD_VERSION).tar.bz2
+SYSTEMD_DEPENDENCIES = \
+ host-intltool \
+ libcap \
+ udev \
+ dbus
+
+# Build after Busybox
+ifeq ($(BR2_PACKAGE_BUSYBOX),y)
+ SYSTEMD_DEPENDENCIES += busybox
+endif
+
+SYSTEMD_CONF_OPT += \
+ --with-distro=other \
+ --disable-selinux \
+ --disable-pam \
+ --disable-libcryptsetup \
+ --disable-gtk \
+ --disable-plymouth \
+ --with-rootdir=/ \
+ --with-dbuspolicydir=/etc/dbus-1/system.d \
+ --with-dbussessionservicedir=/usr/share/dbus-1/services \
+ --with-dbussystemservicedir=/usr/share/dbus-1/system-services \
+ --with-dbusinterfacedir=/usr/share/dbus-1/interfaces \
+ --with-udevrulesdir=/etc/udev/rules.d \
+ --with-sysvinit-path=/etc/init.d/ \
+ --without-sysvrcd-path
+
+ifeq ($(BR2_PACKAGE_ACL),y)
+ SYSTEMD_CONF_OPT += --enable-acl
+ SYSTEMD_DEPENDENCIES += acl
+else
+ SYSTEMD_CONF_OPT += --disable-acl
+endif
+
+define SYSTEMD_INSTALL_INIT_HOOK
+ ln -fs ../bin/systemd $(TARGET_DIR)/sbin/init
+ ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/halt
+ ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/poweroff
+ ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/reboot
+
+ mkdir -p $(TARGET_DIR)/run
+
+ ln -fs ../../../lib/systemd/system/multi-user.target $(TARGET_DIR)/etc/systemd/system/default.target
+endef
+
+define SYSTEMD_INSTALL_TTY_HOOK
+ rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty at tty1.service
+ [ -f $(TARGET_DIR)/etc/systemd/system/getty at .service ] || \
+ $(INSTALL) -D package/systemd/getty at .service \
+ $(TARGET_DIR)/etc/systemd/system/
+ [ -f $(TARGET_DIR)/etc/systemd/system/serial-getty at .service ] || \
+ $(INSTALL) -D package/systemd/serial-getty at .service \
+ $(TARGET_DIR)/etc/systemd/system/
+ ln -fs ../serial-getty at .service $(TARGET_DIR)/etc/systemd/system/getty.target.wants/serial-getty@$(BR2_TARGET_GENERIC_GETTY_PORT).service
+endef
+
+SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
+ SYSTEMD_INSTALL_INIT_HOOK \
+ SYSTEMD_INSTALL_TTY_HOOK \
+
+$(eval $(call AUTOTARGETS))
diff --git a/package/udev/udev.mk b/package/udev/udev.mk
index d445a2f..ed41511 100644
--- a/package/udev/udev.mk
+++ b/package/udev/udev.mk
@@ -35,6 +35,10 @@ UDEV_CONF_OPT += \
--disable-gudev
endif
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+ UDEV_CONF_OPT += --with-systemdsystemunitdir=/lib/systemd/system/
+endif
+
define UDEV_INSTALL_INITSCRIPT
$(INSTALL) -m 0755 package/udev/S10udev $(TARGET_DIR)/etc/init.d/S10udev
endef
--
1.7.5.4
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Buildroot] [PATCH 3/6] Enable cgroups in Linux if we use systemd
2012-03-19 15:59 [Buildroot] [pull request] Pull request for branch for-2012.05/systemd Maxime Ripard
2012-03-19 15:59 ` [Buildroot] [PATCH 1/6] Change the /etc/mtab symlink to use an absolute path Maxime Ripard
2012-03-19 15:59 ` [Buildroot] [PATCH 2/6] Add the systemd package Maxime Ripard
@ 2012-03-19 15:59 ` Maxime Ripard
2012-03-19 15:59 ` [Buildroot] [PATCH 4/6] Rework of the init system Maxime Ripard
` (2 subsequent siblings)
5 siblings, 0 replies; 22+ messages in thread
From: Maxime Ripard @ 2012-03-19 15:59 UTC (permalink / raw)
To: buildroot
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
linux/linux.mk | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/linux/linux.mk b/linux/linux.mk
index ae236d4..52635fd 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -149,6 +149,8 @@ define LINUX_CONFIGURE_CMDS
$(if $(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV),
$(call KCONFIG_SET_OPT,CONFIG_UEVENT_HELPER_PATH,\"/sbin/mdev\",$(@D)/.config))
yes '' | $(TARGET_MAKE_ENV) $(MAKE1) $(LINUX_MAKE_FLAGS) -C $(@D) oldconfig
+ $(if $(BR2_PACKAGE_SYSTEMD),
+ $(call KCONFIG_ENABLE_OPT,CONFIG_CGROUPS,$(@D)/.config))
endef
# Compilation. We make sure the kernel gets rebuilt when the
--
1.7.5.4
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Buildroot] [PATCH 4/6] Rework of the init system
2012-03-19 15:59 [Buildroot] [pull request] Pull request for branch for-2012.05/systemd Maxime Ripard
` (2 preceding siblings ...)
2012-03-19 15:59 ` [Buildroot] [PATCH 3/6] Enable cgroups in Linux if we use systemd Maxime Ripard
@ 2012-03-19 15:59 ` Maxime Ripard
2012-03-19 23:45 ` Arnout Vandecappelle
2012-03-19 15:59 ` [Buildroot] [PATCH 5/6] Fix installation for the lighttpd package Maxime Ripard
2012-03-19 15:59 ` [Buildroot] [PATCH 6/6] Add systemd unit for lighttpd Maxime Ripard
5 siblings, 1 reply; 22+ messages in thread
From: Maxime Ripard @ 2012-03-19 15:59 UTC (permalink / raw)
To: buildroot
Since we have now two uncompatible init systems, and we want only one of
them at the same time in use in the rootfs, we need to select a
particular init system. This patch also adds $(PKG)_INSTALL_INIT_SYSTEMD
and $(PKG)_INSTALL_INIT_SYSV hooks that are called when the matching
init systems are selected to install properly the init scripts of the
package.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
package/Makefile.package.in | 8 ++++++++
package/systemd/Config.in | 1 +
package/sysvinit/Config.in | 1 +
target/generic/Config.in | 22 ++++++++++++++++++++++
4 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/package/Makefile.package.in b/package/Makefile.package.in
index 33461b4..94ed7c6 100644
--- a/package/Makefile.package.in
+++ b/package/Makefile.package.in
@@ -419,6 +419,10 @@ $(BUILD_DIR)/%/.stamp_images_installed:
# Install to target dir
$(BUILD_DIR)/%/.stamp_target_installed:
@$(call MESSAGE,"Installing to target")
+ $(if $(BR2_INIT_SYSTEMD),\
+ $($(PKG)_INSTALL_INIT_SYSTEMD))
+ $(if $(BR2_INIT_SYSV)$(BR2_INIT_BUSYBOX),\
+ $($(PKG)_INSTALL_INIT_SYSV))
$($(PKG)_INSTALL_TARGET_CMDS)
$(foreach hook,$($(PKG)_POST_INSTALL_TARGET_HOOKS),$(call $(hook))$(sep))
$(Q)touch $@
@@ -437,6 +441,10 @@ $(BUILD_DIR)/%/.stamp_uninstalled:
rm -f $($(PKG)_TARGET_INSTALL_TARGET)
$($(PKG)_UNINSTALL_STAGING_CMDS)
$($(PKG)_UNINSTALL_TARGET_CMDS)
+ $(if $(BR2_INIT_SYSTEMD),\
+ $($(PKG)_UNINSTALL_INIT_SYSTEMD))
+ $(if $(BR2_INIT_SYSV)$(BR2_INIT_BUSYBOX),\
+ $($(PKG)_UNINSTALL_INIT_SYSV))
# Remove package sources
$(BUILD_DIR)/%/.stamp_dircleaned:
diff --git a/package/systemd/Config.in b/package/systemd/Config.in
index d87054d..dd08d0f 100644
--- a/package/systemd/Config.in
+++ b/package/systemd/Config.in
@@ -1,5 +1,6 @@
config BR2_PACKAGE_SYSTEMD
bool "systemd"
+ depends on BR2_INIT_SYSTEMD
depends on BR2_PACKAGE_UDEV
select BR2_PACKAGE_DBUS
select BR2_PACKAGE_LIBCAP
diff --git a/package/sysvinit/Config.in b/package/sysvinit/Config.in
index 34ec391..d91c643 100644
--- a/package/sysvinit/Config.in
+++ b/package/sysvinit/Config.in
@@ -1,5 +1,6 @@
config BR2_PACKAGE_SYSVINIT
bool "sysvinit"
+ depends on BR2_INIT_SYSV
help
/sbin/init - parent of all processes
diff --git a/target/generic/Config.in b/target/generic/Config.in
index 88f0718..ed33e1a 100644
--- a/target/generic/Config.in
+++ b/target/generic/Config.in
@@ -37,6 +37,28 @@ comment "udev requires a toolchain with LARGEFILE + WCHAR support"
endchoice
+choice
+ prompt "Init system"
+ default BR2_INIT_BUSYBOX
+ help
+ To select systemd, you first need to have dbus and udev enabled
+
+config BR2_INIT_BUSYBOX
+ bool "Busybox init"
+ select BR2_PACKAGE_BUSYBOX
+
+config BR2_INIT_SYSV
+ bool "Use systemV init"
+ select BR2_PACKAGE_SYSVINIT
+
+config BR2_INIT_SYSTEMD
+ bool "Use systemd"
+ select BR2_PACKAGE_DBUS
+ depends on BR2_PACKAGE_UDEV
+ select BR2_PACKAGE_SYSTEMD
+
+endchoice
+
config BR2_ROOTFS_DEVICE_TABLE
string "Path to the permission tables"
default "target/generic/device_table.txt"
--
1.7.5.4
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Buildroot] [PATCH 5/6] Fix installation for the lighttpd package
2012-03-19 15:59 [Buildroot] [pull request] Pull request for branch for-2012.05/systemd Maxime Ripard
` (3 preceding siblings ...)
2012-03-19 15:59 ` [Buildroot] [PATCH 4/6] Rework of the init system Maxime Ripard
@ 2012-03-19 15:59 ` Maxime Ripard
2012-03-19 23:51 ` Arnout Vandecappelle
2012-03-19 15:59 ` [Buildroot] [PATCH 6/6] Add systemd unit for lighttpd Maxime Ripard
5 siblings, 1 reply; 22+ messages in thread
From: Maxime Ripard @ 2012-03-19 15:59 UTC (permalink / raw)
To: buildroot
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
package/lighttpd/lighttpd.conf | 445 ++++++++++++++++++++++++++++++++++++++++
package/lighttpd/lighttpd.mk | 33 +++
2 files changed, 478 insertions(+), 0 deletions(-)
create mode 100644 package/lighttpd/lighttpd.conf
diff --git a/package/lighttpd/lighttpd.conf b/package/lighttpd/lighttpd.conf
new file mode 100644
index 0000000..89be6f6
--- /dev/null
+++ b/package/lighttpd/lighttpd.conf
@@ -0,0 +1,445 @@
+#######################################################################
+##
+## /etc/lighttpd/lighttpd.conf
+##
+## check /etc/lighttpd/conf.d/*.conf for the configuration of modules.
+##
+#######################################################################
+
+#######################################################################
+##
+## Some Variable definition which will make chrooting easier.
+##
+## if you add a variable here. Add the corresponding variable in the
+## chroot example aswell.
+##
+var.log_root = "/var/log/lighttpd"
+var.server_root = "/srv/www"
+var.state_dir = "/var/run"
+var.home_dir = "/var/lib/lighttpd"
+var.conf_dir = "/etc/lighttpd"
+
+##
+## run the server chrooted.
+##
+## This requires root permissions during startup.
+##
+## If you run Chrooted set the the variables to directories relative to
+## the chroot dir.
+##
+## example chroot configuration:
+##
+#var.log_root = "/logs"
+#var.server_root = "/"
+#var.state_dir = "/run"
+#var.home_dir = "/lib/lighttpd"
+#var.vhosts_dir = "/vhosts"
+#var.conf_dir = "/etc"
+#
+#server.chroot = "/srv/www"
+
+##
+## Some additional variables to make the configuration easier
+##
+
+##
+## Base directory for all virtual hosts
+##
+## used in:
+## conf.d/evhost.conf
+## conf.d/simple_vhost.conf
+## vhosts.d/vhosts.template
+##
+var.vhosts_dir = server_root + "/vhosts"
+
+##
+## Cache for mod_compress
+##
+## used in:
+## conf.d/compress.conf
+##
+var.cache_dir = "/var/cache/lighttpd"
+
+##
+## Base directory for sockets.
+##
+## used in:
+## conf.d/fastcgi.conf
+## conf.d/scgi.conf
+##
+var.socket_dir = home_dir + "/sockets"
+
+##
+#######################################################################
+
+#######################################################################
+##
+## Load the modules.
+include "modules.conf"
+
+##
+#######################################################################
+
+#######################################################################
+##
+## Basic Configuration
+## ---------------------
+##
+server.port = 80
+
+##
+## Use IPv6?
+##
+server.use-ipv6 = "disable"
+
+##
+## bind to a specific IP
+##
+#server.bind = "localhost"
+
+##
+## Run as a different username/groupname.
+## This requires root permissions during startup.
+##
+server.username = "root"
+server.groupname = "root"
+
+##
+## enable core files.
+##
+#server.core-files = "disable"
+
+##
+## Document root
+##
+server.document-root = server_root + "/htdocs"
+
+##
+## The value for the "Server:" response field.
+##
+## It would be nice to keep it at "lighttpd".
+##
+#server.tag = "lighttpd"
+
+##
+## store a pid file
+##
+server.pid-file = state_dir + "/lighttpd.pid"
+
+##
+#######################################################################
+
+#######################################################################
+##
+## Logging Options
+## ------------------
+##
+## all logging options can be overwritten per vhost.
+##
+## Path to the error log file
+##
+server.errorlog = log_root + "/error.log"
+
+##
+## If you want to log to syslog you have to unset the
+## server.errorlog setting and uncomment the next line.
+##
+#server.errorlog-use-syslog = "enable"
+
+##
+## Access log config
+##
+include "conf.d/access_log.conf"
+
+##
+## The debug options are moved into their own file.
+## see conf.d/debug.conf for various options for request debugging.
+##
+include "conf.d/debug.conf"
+
+##
+#######################################################################
+
+#######################################################################
+##
+## Tuning/Performance
+## --------------------
+##
+## corresponding documentation:
+## http://www.lighttpd.net/documentation/performance.html
+##
+## set the event-handler (read the performance section in the manual)
+##
+## possible options on linux are:
+##
+## select
+## poll
+## linux-sysepoll
+##
+## linux-sysepoll is recommended on kernel 2.6.
+##
+server.event-handler = "linux-sysepoll"
+
+##
+## The basic network interface for all platforms at the syscalls read()
+## and write(). Every modern OS provides its own syscall to help network
+## servers transfer files as fast as possible
+##
+## linux-sendfile - is recommended for small files.
+## writev - is recommended for sending many large files
+##
+server.network-backend = "linux-sendfile"
+
+##
+## As lighttpd is a single-threaded server, its main resource limit is
+## the number of file descriptors, which is set to 1024 by default (on
+## most systems).
+##
+## If you are running a high-traffic site you might want to increase this
+## limit by setting server.max-fds.
+##
+## Changing this setting requires root permissions on startup. see
+## server.username/server.groupname.
+##
+## By default lighttpd would not change the operation system default.
+## But setting it to 2048 is a better default for busy servers.
+##
+server.max-fds = 2048
+
+##
+## Stat() call caching.
+##
+## lighttpd can utilize FAM/Gamin to cache stat call.
+##
+## possible values are:
+## disable, simple or fam.
+##
+server.stat-cache-engine = "simple"
+
+##
+## Fine tuning for the request handling
+##
+## max-connections == max-fds/2 (maybe /3)
+## means the other file handles are used for fastcgi/files
+##
+server.max-connections = 1024
+
+##
+## How many seconds to keep a keep-alive connection open,
+## until we consider it idle.
+##
+## Default: 5
+##
+#server.max-keep-alive-idle = 5
+
+##
+## How many keep-alive requests until closing the connection.
+##
+## Default: 16
+##
+#server.max-keep-alive-requests = 16
+
+##
+## Maximum size of a request in kilobytes.
+## By default it is unlimited (0).
+##
+## Uploads to your server cant be larger than this value.
+##
+#server.max-request-size = 0
+
+##
+## Time to read from a socket before we consider it idle.
+##
+## Default: 60
+##
+#server.max-read-idle = 60
+
+##
+## Time to write to a socket before we consider it idle.
+##
+## Default: 360
+##
+#server.max-write-idle = 360
+
+##
+## Traffic Shaping
+## -----------------
+##
+## see /usr/share/doc/lighttpd/traffic-shaping.txt
+##
+## Values are in kilobyte per second.
+##
+## Keep in mind that a limit below 32kB/s might actually limit the
+## traffic to 32kB/s. This is caused by the size of the TCP send
+## buffer.
+##
+## per server:
+##
+#server.kbytes-per-second = 128
+
+##
+## per connection:
+##
+#connection.kbytes-per-second = 32
+
+##
+#######################################################################
+
+#######################################################################
+##
+## Filename/File handling
+## ------------------------
+
+##
+## files to check for if .../ is requested
+## index-file.names = ( "index.php", "index.rb", "index.html",
+## "index.htm", "default.htm" )
+##
+index-file.names += (
+ "index.xhtml", "index.html", "index.htm", "default.htm", "index.php"
+)
+
+##
+## deny access the file-extensions
+##
+## ~ is for backupfiles from vi, emacs, joe, ...
+## .inc is often used for code includes which should in general not be part
+## of the document-root
+url.access-deny = ( "~", ".inc" )
+
+##
+## disable range requests for pdf files
+## workaround for a bug in the Acrobat Reader plugin.
+##
+#$HTTP["url"] =~ "\.pdf$" {
+# server.range-requests = "disable"
+#}
+
+##
+## url handling modules (rewrite, redirect)
+##
+#url.rewrite = ( "^/$" => "/server-status" )
+#url.redirect = ( "^/wishlist/(.+)" => "http://www.example.com/$1" )
+
+##
+## both rewrite/redirect support back reference to regex conditional using %n
+##
+#$HTTP["host"] =~ "^www\.(.*)" {
+# url.redirect = ( "^/(.*)" => "http://%1/$1" )
+#}
+
+##
+## which extensions should not be handle via static-file transfer
+##
+## .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
+##
+static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", ".scgi" )
+
+##
+## error-handler for status 404
+##
+#server.error-handler-404 = "/error-handler.html"
+#server.error-handler-404 = "/error-handler.php"
+
+##
+## Format: <errorfile-prefix><status-code>.html
+## -> ..../status-404.html for 'File not found'
+##
+#server.errorfile-prefix = "/srv/www/htdocs/errors/status-"
+
+##
+## mimetype mapping
+##
+include "conf.d/mime.conf"
+
+##
+## directory listing configuration
+##
+include "conf.d/dirlisting.conf"
+
+##
+## Should lighttpd follow symlinks?
+##
+server.follow-symlink = "enable"
+
+##
+## force all filenames to be lowercase?
+##
+#server.force-lowercase-filenames = "disable"
+
+##
+## defaults to /var/tmp as we assume it is a local harddisk
+##
+server.upload-dirs = ( "/var/tmp" )
+
+##
+#######################################################################
+
+
+#######################################################################
+##
+## SSL Support
+## -------------
+##
+## To enable SSL for the whole server you have to provide a valid
+## certificate and have to enable the SSL engine.::
+##
+## ssl.engine = "enable"
+## ssl.pemfile = "/path/to/server.pem"
+##
+## The HTTPS protocol does not allow you to use name-based virtual
+## hosting with SSL. If you want to run multiple SSL servers with
+## one lighttpd instance you must use IP-based virtual hosting: ::
+##
+## $SERVER["socket"] == "10.0.0.1:443" {
+## ssl.engine = "enable"
+## ssl.pemfile = "/etc/ssl/private/www.example.com.pem"
+## #
+## # Mitigate BEAST attack:
+## #
+## # A stricter base cipher suite. For details see:
+## # http://blog.ivanristic.com/2011/10/mitigating-the-beast-attack-on-tls.html
+## #
+## ssl.cipher-list = "ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4-SHA:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM"
+## #
+## # Make the server prefer the order of the server side cipher suite instead of the client suite.
+## # This is necessary to mitigate the BEAST attack (unless you disable all non RC4 algorithms).
+## # This option is enabled by default, but only used if ssl.cipher-list is set.
+## #
+## # ssl.honor-cipher-order = "enable"
+## #
+## # Mitigate CVE-2009-3555 by disabling client triggered renegotation
+## # This is enabled by default.
+## #
+## # ssl.disable-client-renegotiation = "enable"
+## #
+## server.name = "www.example.com"
+##
+## server.document-root = "/srv/www/vhosts/example.com/www/"
+## }
+##
+
+## If you have a .crt and a .key file, cat them together into a
+## single PEM file:
+## $ cat /etc/ssl/private/lighttpd.key /etc/ssl/certs/lighttpd.crt \
+## > /etc/ssl/private/lighttpd.pem
+##
+#ssl.pemfile = "/etc/ssl/private/lighttpd.pem"
+
+##
+## optionally pass the CA certificate here.
+##
+##
+#ssl.ca-file = ""
+
+##
+#######################################################################
+
+#######################################################################
+##
+## custom includes like vhosts.
+##
+#include "conf.d/config.conf"
+#include_shell "cat /etc/lighttpd/vhosts.d/*.conf"
+##
+#######################################################################
diff --git a/package/lighttpd/lighttpd.mk b/package/lighttpd/lighttpd.mk
index b8aa310..58617a6 100644
--- a/package/lighttpd/lighttpd.mk
+++ b/package/lighttpd/lighttpd.mk
@@ -56,6 +56,39 @@ else
LIGHTTPD_CONF_OPT += --without-lua
endif
+define LIGHTTPD_INSTALL_CONFIG
+mkdir -p $(TARGET_DIR)/etc/lighttpd
+mkdir -p $(TARGET_DIR)/etc/lighttpd/conf.d
+mkdir -p $(TARGET_DIR)/var/log/lighttpd
+mkdir -p $(TARGET_DIR)/srv/www/htdocs
+
+[ -f $(TARGET_DIR)/etc/lighttpd/lighttpd.conf ] || \
+ $(INSTALL) -D -m 755 package/lighttpd/lighttpd.conf \
+ $(TARGET_DIR)/etc/lighttpd/lighttpd.conf
+
+[ -f $(TARGET_DIR)/etc/lighttpd/modules.conf ] || \
+ $(INSTALL) -D -m 755 $(@D)/doc/config/modules.conf \
+ $(TARGET_DIR)/etc/lighttpd/modules.conf
+
+[ -f $(TARGET_DIR)/etc/lighttpd/conf.d/access_log.conf ] || \
+ $(INSTALL) -D -m 755 $(@D)/doc/config/conf.d/access_log.conf \
+ $(TARGET_DIR)/etc/lighttpd/conf.d/access_log.conf
+
+[ -f $(TARGET_DIR)/etc/lighttpd/conf.d/debug.conf ] || \
+ $(INSTALL) -D -m 755 $(@D)/doc/config/conf.d/debug.conf \
+ $(TARGET_DIR)/etc/lighttpd/conf.d/debug.conf
+
+[ -f $(TARGET_DIR)/etc/lighttpd/conf.d/dirlisting.conf ] || \
+ $(INSTALL) -D -m 755 $(@D)/doc/config/conf.d/dirlisting.conf \
+ $(TARGET_DIR)/etc/lighttpd/conf.d/dirlisting.conf
+
+[ -f $(TARGET_DIR)/etc/lighttpd/conf.d/mime.conf ] || \
+ $(INSTALL) -D -m 755 $(@D)/doc/config/conf.d/mime.conf \
+ $(TARGET_DIR)/etc/lighttpd/conf.d/mime.conf
+endef
+
+LIGHTTPD_POST_INSTALL_TARGET_HOOKS += LIGHTTPD_INSTALL_CONFIG
+
define LIGHTTPD_UNINSTALL_TARGET_CMDS
rm -f $(TARGET_DIR)/usr/sbin/lighttpd
rm -f $(TARGET_DIR)/usr/sbin/lighttpd-angel
--
1.7.5.4
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Buildroot] [PATCH 6/6] Add systemd unit for lighttpd
2012-03-19 15:59 [Buildroot] [pull request] Pull request for branch for-2012.05/systemd Maxime Ripard
` (4 preceding siblings ...)
2012-03-19 15:59 ` [Buildroot] [PATCH 5/6] Fix installation for the lighttpd package Maxime Ripard
@ 2012-03-19 15:59 ` Maxime Ripard
2012-03-19 23:55 ` Arnout Vandecappelle
5 siblings, 1 reply; 22+ messages in thread
From: Maxime Ripard @ 2012-03-19 15:59 UTC (permalink / raw)
To: buildroot
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
package/lighttpd/lighttpd.mk | 11 +++++++++++
package/lighttpd/lighttpd.service | 10 ++++++++++
2 files changed, 21 insertions(+), 0 deletions(-)
create mode 100644 package/lighttpd/lighttpd.service
diff --git a/package/lighttpd/lighttpd.mk b/package/lighttpd/lighttpd.mk
index 58617a6..966b787 100644
--- a/package/lighttpd/lighttpd.mk
+++ b/package/lighttpd/lighttpd.mk
@@ -89,6 +89,17 @@ endef
LIGHTTPD_POST_INSTALL_TARGET_HOOKS += LIGHTTPD_INSTALL_CONFIG
+define LIGHTTPD_INSTALL_INIT_SYSTEMD
+[ -f $(TARGET_DIR)/etc/systemd/system/lighttpd.service ] || \
+ $(INSTALL) -D -m 755 package/lighttpd/lighttpd.service \
+ $(TARGET_DIR)/etc/systemd/system/lighttpd.service
+
+mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+
+ln -fs ../lighttpd.service \
+ $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/lighttpd.service
+endef
+
define LIGHTTPD_UNINSTALL_TARGET_CMDS
rm -f $(TARGET_DIR)/usr/sbin/lighttpd
rm -f $(TARGET_DIR)/usr/sbin/lighttpd-angel
diff --git a/package/lighttpd/lighttpd.service b/package/lighttpd/lighttpd.service
new file mode 100644
index 0000000..0ca5357
--- /dev/null
+++ b/package/lighttpd/lighttpd.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Lighttpd Web Server
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/lighttpd-angel -f /etc/lighttpd/lighttpd.conf -D
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
--
1.7.5.4
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Buildroot] [PATCH 1/6] Change the /etc/mtab symlink to use an absolute path
2012-03-19 15:59 ` [Buildroot] [PATCH 1/6] Change the /etc/mtab symlink to use an absolute path Maxime Ripard
@ 2012-03-19 16:08 ` Peter Korsgaard
0 siblings, 0 replies; 22+ messages in thread
From: Peter Korsgaard @ 2012-03-19 16:08 UTC (permalink / raw)
To: buildroot
>>>>> "Maxime" == Maxime Ripard <maxime.ripard@free-electrons.com> writes:
Maxime> As systemd checks if /etc/mtab is a symlink to /proc/mount or
Maxime> /proc/self/mounts, we need to change it so that we can run systemd.
Maxime> http://cgit.freedesktop.org/systemd/tree/src/main.c#n1082
Committed, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Buildroot] [PATCH 2/6] Add the systemd package
2012-03-19 15:59 ` [Buildroot] [PATCH 2/6] Add the systemd package Maxime Ripard
@ 2012-03-19 23:32 ` Arnout Vandecappelle
2012-03-20 8:35 ` Maxime Ripard
0 siblings, 1 reply; 22+ messages in thread
From: Arnout Vandecappelle @ 2012-03-19 23:32 UTC (permalink / raw)
To: buildroot
On Monday 19 March 2012 16:59:36 Maxime Ripard wrote:
[snip]
> diff --git a/package/systemd/Config.in b/package/systemd/Config.in
> new file mode 100644
> index 0000000..d87054d
> --- /dev/null
> +++ b/package/systemd/Config.in
> @@ -0,0 +1,19 @@
> +config BR2_PACKAGE_SYSTEMD
> + bool "systemd"
> + depends on BR2_PACKAGE_UDEV
> + select BR2_PACKAGE_DBUS
> + select BR2_PACKAGE_LIBCAP
> + help
> + systemd is a system and service manager for Linux, compatible with
> + SysV and LSB init scripts. systemd provides aggressive parallelization
> + capabilities, uses socket and D-Bus activation for starting services,
> + offers on-demand starting of daemons, keeps track of processes using
> + Linux cgroups, supports snapshotting and restoring of the system
> + state, maintains mount and automount points and implements an
> + elaborate transactional dependency-based service control logic.
> + It can work as a drop-in replacement for sysvinit.
Trailing whitespace.
> +
> + http://freedesktop.org/wiki/Software/systemd
> +
> +comment "systemd not available (depends on udev and dbus)"
> + depends on !BR2_PACKAGE_UDEV || !BR2_PACKAGE_DBUS
DBUS is a 'select' depedency, not a 'depends on', so it shouldn't be in
the depends on of the comment.
> diff --git a/package/systemd/getty at .service b/package/systemd/getty at .service
[snip]
> diff --git a/package/systemd/serial-getty at .service b/package/systemd/serial-getty at .service
AFAICS the only difference between these two files and the upstream
version is that it's getty instead of agetty. Wouldn't it be simpler
and more future-safe to patch the upstream files?
> diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
> new file mode 100644
> index 0000000..a20ddf4
> --- /dev/null
> +++ b/package/systemd/systemd.mk
[snip]
> +# Build after Busybox
Why? (I know why, but it should be in the comment)
> +ifeq ($(BR2_PACKAGE_BUSYBOX),y)
> + SYSTEMD_DEPENDENCIES += busybox
> +endif
[snip]
> +define SYSTEMD_INSTALL_INIT_HOOK
> + ln -fs ../bin/systemd $(TARGET_DIR)/sbin/init
> + ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/halt
> + ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/poweroff
> + ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/reboot
> +
> + mkdir -p $(TARGET_DIR)/run
In the current skeleton, /run is a symlink to /tmp. For a
user-defined skeleton, I would say that it's up to the user to
make sure a valid /run exists.
> +
> + ln -fs ../../../lib/systemd/system/multi-user.target $(TARGET_DIR)/etc/systemd/system/default.target
> +endef
> +
> +define SYSTEMD_INSTALL_TTY_HOOK
> + rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty at tty1.service
> + [ -f $(TARGET_DIR)/etc/systemd/system/getty at .service ] || \
> + $(INSTALL) -D package/systemd/getty at .service \
> + $(TARGET_DIR)/etc/systemd/system/
> + [ -f $(TARGET_DIR)/etc/systemd/system/serial-getty at .service ] || \
> + $(INSTALL) -D package/systemd/serial-getty at .service \
> + $(TARGET_DIR)/etc/systemd/system/
> + ln -fs ../serial-getty at .service $(TARGET_DIR)/etc/systemd/system/getty.target.wants/serial-getty@$(BR2_TARGET_GENERIC_GETTY_PORT).service
This looks strange to me. Admittedly, I've never used systemd and
don't really know how it works. But to me, this looks like the
getty at .service is actually not used.
> +endef
> +
> +SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
> + SYSTEMD_INSTALL_INIT_HOOK \
> + SYSTEMD_INSTALL_TTY_HOOK \
> +
> +$(eval $(call AUTOTARGETS))
[snip]
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286540
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
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Buildroot] [PATCH 4/6] Rework of the init system
2012-03-19 15:59 ` [Buildroot] [PATCH 4/6] Rework of the init system Maxime Ripard
@ 2012-03-19 23:45 ` Arnout Vandecappelle
2012-03-20 8:53 ` Maxime Ripard
2012-03-20 9:14 ` Peter Korsgaard
0 siblings, 2 replies; 22+ messages in thread
From: Arnout Vandecappelle @ 2012-03-19 23:45 UTC (permalink / raw)
To: buildroot
On Monday 19 March 2012 16:59:38 Maxime Ripard wrote:
> +choice
> + prompt "Init system"
> + default BR2_INIT_BUSYBOX
> + help
> + To select systemd, you first need to have dbus and udev enabled
Only udev. Anyway, the help text of a choice is never shown, so
this won't work. I don't know if it's possible to add comments in a
choice, but that would be the way to go.
> +
> +config BR2_INIT_BUSYBOX
> + bool "Busybox init"
> + select BR2_PACKAGE_BUSYBOX
> +
> +config BR2_INIT_SYSV
> + bool "Use systemV init"
> + select BR2_PACKAGE_SYSVINIT
> +
> +config BR2_INIT_SYSTEMD
> + bool "Use systemd"
> + select BR2_PACKAGE_DBUS
> + depends on BR2_PACKAGE_UDEV
Would it be an option to make this a select
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV instead? (With a depends
on LARGEFILE and WCHAR, of course.) Or is that a bad idea?
> + select BR2_PACKAGE_SYSTEMD
The latter two selects are only possible if
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS is selected. The select/depends
combination breaks the dependency of BR2_PACKAGE_SYSVINIT and
BR2_PACKAGE_SYSTEMD on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS. So the
systemd package will be selected, but it's not visible to the user.
Of course, there's nothing strictly wrong with that. It's just
a bit strange.
Clearly, adding a select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS here is
a bad idea. I also don't like much to add a dependency on it
either. So instead, I propose to move sysvinit and systemd out
of the BR2_PACKAGE_BUSYBOX_SHOW_OTHERS condition (in package/Config.in).
They anyway can't be selected or deselected by the user, since their
selection is fully determined by the BR2_INIT_* option.
> +
> +endchoice
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286540
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
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Buildroot] [PATCH 5/6] Fix installation for the lighttpd package
2012-03-19 15:59 ` [Buildroot] [PATCH 5/6] Fix installation for the lighttpd package Maxime Ripard
@ 2012-03-19 23:51 ` Arnout Vandecappelle
2012-03-20 9:42 ` Maxime Ripard
0 siblings, 1 reply; 22+ messages in thread
From: Arnout Vandecappelle @ 2012-03-19 23:51 UTC (permalink / raw)
To: buildroot
On Monday 19 March 2012 16:59:39 Maxime Ripard wrote:
> package/lighttpd/lighttpd.conf | 445 ++++++++++++++++++++++++++++++++++++++++
Same remark as for systemd: wouldn't it be better to patch the upstream
file instead of copying it? Also, why did you revert the disabling of
range requests for pdf documents?
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286540
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
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Buildroot] [PATCH 6/6] Add systemd unit for lighttpd
2012-03-19 15:59 ` [Buildroot] [PATCH 6/6] Add systemd unit for lighttpd Maxime Ripard
@ 2012-03-19 23:55 ` Arnout Vandecappelle
2012-03-21 9:24 ` Maxime Ripard
0 siblings, 1 reply; 22+ messages in thread
From: Arnout Vandecappelle @ 2012-03-19 23:55 UTC (permalink / raw)
To: buildroot
On Monday 19 March 2012 16:59:40 Maxime Ripard wrote:
> +define LIGHTTPD_INSTALL_INIT_SYSTEMD
> +[ -f $(TARGET_DIR)/etc/systemd/system/lighttpd.service ] || \
> + $(INSTALL) -D -m 755 package/lighttpd/lighttpd.service \
> + $(TARGET_DIR)/etc/systemd/system/lighttpd.service
> +
> +mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
> +
> +ln -fs ../lighttpd.service \
> + $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/lighttpd.service
> +endef
This should be indented, no?
Would it be useful to add this to generic package infrastructure?
I mean, if systemd is selected and pkgdir/pkgname.service exists,
install it and enable it in multi-user.
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286540
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
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Buildroot] [PATCH 2/6] Add the systemd package
2012-03-19 23:32 ` Arnout Vandecappelle
@ 2012-03-20 8:35 ` Maxime Ripard
2012-03-20 8:46 ` Peter Korsgaard
2012-03-20 18:19 ` Arnout Vandecappelle
0 siblings, 2 replies; 22+ messages in thread
From: Maxime Ripard @ 2012-03-20 8:35 UTC (permalink / raw)
To: buildroot
Hello Arnout,
Le 20/03/2012 00:32, Arnout Vandecappelle a ?crit :
> On Monday 19 March 2012 16:59:36 Maxime Ripard wrote:
> [snip]
>> diff --git a/package/systemd/Config.in b/package/systemd/Config.in
>> new file mode 100644
>> index 0000000..d87054d
>> --- /dev/null
>> +++ b/package/systemd/Config.in
>> @@ -0,0 +1,19 @@
>> +config BR2_PACKAGE_SYSTEMD
>> + bool "systemd"
>> + depends on BR2_PACKAGE_UDEV
>> + select BR2_PACKAGE_DBUS
>> + select BR2_PACKAGE_LIBCAP
>> + help
>> + systemd is a system and service manager for Linux, compatible with
>> + SysV and LSB init scripts. systemd provides aggressive parallelization
>> + capabilities, uses socket and D-Bus activation for starting services,
>> + offers on-demand starting of daemons, keeps track of processes using
>> + Linux cgroups, supports snapshotting and restoring of the system
>> + state, maintains mount and automount points and implements an
>> + elaborate transactional dependency-based service control logic.
>> + It can work as a drop-in replacement for sysvinit.
> Trailing whitespace.
Oops...
>> +
>> + http://freedesktop.org/wiki/Software/systemd
>> +
>> +comment "systemd not available (depends on udev and dbus)"
>> + depends on !BR2_PACKAGE_UDEV || !BR2_PACKAGE_DBUS
>
> DBUS is a 'select' depedency, not a 'depends on', so it shouldn't be in
> the depends on of the comment.
Right
>> diff --git a/package/systemd/getty at .service b/package/systemd/getty at .service
> [snip]
>> diff --git a/package/systemd/serial-getty at .service b/package/systemd/serial-getty at .service
>
> AFAICS the only difference between these two files and the upstream
> version is that it's getty instead of agetty. Wouldn't it be simpler
> and more future-safe to patch the upstream files?
Probably. I'll send a patch and see how it turns out.
In the meantime, maybe I can just put a patch here instead of the whole
file.
>> diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
>> new file mode 100644
>> index 0000000..a20ddf4
>> --- /dev/null
>> +++ b/package/systemd/systemd.mk
> [snip]
>> +# Build after Busybox
> Why? (I know why, but it should be in the comment)
ACK
>> +ifeq ($(BR2_PACKAGE_BUSYBOX),y)
>> + SYSTEMD_DEPENDENCIES += busybox
>> +endif
> [snip]
>> +define SYSTEMD_INSTALL_INIT_HOOK
>> + ln -fs ../bin/systemd $(TARGET_DIR)/sbin/init
>> + ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/halt
>> + ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/poweroff
>> + ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/reboot
>> +
>> + mkdir -p $(TARGET_DIR)/run
> In the current skeleton, /run is a symlink to /tmp. For a
> user-defined skeleton, I would say that it's up to the user to
> make sure a valid /run exists.
Yes, of course.
>> +
>> + ln -fs ../../../lib/systemd/system/multi-user.target $(TARGET_DIR)/etc/systemd/system/default.target
>> +endef
>> +
>> +define SYSTEMD_INSTALL_TTY_HOOK
>> + rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty at tty1.service
>> + [ -f $(TARGET_DIR)/etc/systemd/system/getty at .service ] || \
>> + $(INSTALL) -D package/systemd/getty at .service \
>> + $(TARGET_DIR)/etc/systemd/system/
>> + [ -f $(TARGET_DIR)/etc/systemd/system/serial-getty at .service ] || \
>> + $(INSTALL) -D package/systemd/serial-getty at .service \
>> + $(TARGET_DIR)/etc/systemd/system/
>> + ln -fs ../serial-getty at .service $(TARGET_DIR)/etc/systemd/system/getty.target.wants/serial-getty@$(BR2_TARGET_GENERIC_GETTY_PORT).service
>
> This looks strange to me. Admittedly, I've never used systemd and
> don't really know how it works. But to me, this looks like the
> getty at .service is actually not used.
Well, actually, this symlink with weird names is used as the way to pass
units some arguments.
If you look into the serial-getty at .service file, you will see at some
point some %i or %I. These expands to what is between the @ and the
.service in the filename. If we were to have serial-getty at ttyS2.service,
it would expand to "ttyS2", and the unit would have the start command
"/sbin/getty -L ttyS2 115200 vt100".
The symlinks are here only to avoid copying the same file over and over
again.
>> +endef
>> +
>> +SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
>> + SYSTEMD_INSTALL_INIT_HOOK \
>> + SYSTEMD_INSTALL_TTY_HOOK \
>> +
>> +$(eval $(call AUTOTARGETS))
> [snip]
>
> Regards,
> Arnout
>
Thanks,
Maxime
--
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Buildroot] [PATCH 2/6] Add the systemd package
2012-03-20 8:35 ` Maxime Ripard
@ 2012-03-20 8:46 ` Peter Korsgaard
2012-03-20 18:19 ` Arnout Vandecappelle
1 sibling, 0 replies; 22+ messages in thread
From: Peter Korsgaard @ 2012-03-20 8:46 UTC (permalink / raw)
To: buildroot
>>>>> "Maxime" == Maxime Ripard <maxime.ripard@free-electrons.com> writes:
Hi,
Maxime> Probably. I'll send a patch and see how it turns out.
Maxime> In the meantime, maybe I can just put a patch here instead of
Maxime> the whole file.
Or just run sed s/agetty/getty/g when you copy it to TARGET_DIR.
I'm trying to get systemd to build under uClibc, which so far meant I
had to bump the default to 0.9.33 (for new CLONE_* flags) and enable
utmpx support. Systemd also needs IPv6 support so needs to have a
depends on BR2_INET_IPV6
Line.
I'm still rebuilding my toolchain at the moment, but if you could resend
the patch with those fixes in the near future, that would be great.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Buildroot] [PATCH 4/6] Rework of the init system
2012-03-19 23:45 ` Arnout Vandecappelle
@ 2012-03-20 8:53 ` Maxime Ripard
2012-03-20 9:15 ` Peter Korsgaard
2012-03-20 9:14 ` Peter Korsgaard
1 sibling, 1 reply; 22+ messages in thread
From: Maxime Ripard @ 2012-03-20 8:53 UTC (permalink / raw)
To: buildroot
Le 20/03/2012 00:45, Arnout Vandecappelle a ?crit :
> On Monday 19 March 2012 16:59:38 Maxime Ripard wrote:
>> +choice
>> + prompt "Init system"
>> + default BR2_INIT_BUSYBOX
>> + help
>> + To select systemd, you first need to have dbus and udev enabled
> Only udev. Anyway, the help text of a choice is never shown, so
> this won't work. I don't know if it's possible to add comments in a
> choice, but that would be the way to go.
Ah. I didn't know that.
>> +
>> +config BR2_INIT_BUSYBOX
>> + bool "Busybox init"
>> + select BR2_PACKAGE_BUSYBOX
>> +
>> +config BR2_INIT_SYSV
>> + bool "Use systemV init"
>> + select BR2_PACKAGE_SYSVINIT
>> +
>> +config BR2_INIT_SYSTEMD
>> + bool "Use systemd"
>> + select BR2_PACKAGE_DBUS
>> + depends on BR2_PACKAGE_UDEV
> Would it be an option to make this a select
> BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV instead? (With a depends
> on LARGEFILE and WCHAR, of course.) Or is that a bad idea?
Well, while the select on BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV is
indeed a good idea, like you said, we are still to depends on WCHAR and
LARGEFILE support. So from the user point of view, we are still left
without an option, and no way of getting how to select it (and we
definitely don't want to select LARGEFILE and WCHAR)
Peter, do you have an idea about that ?
>
>> + select BR2_PACKAGE_SYSTEMD
>
> The latter two selects are only possible if
> BR2_PACKAGE_BUSYBOX_SHOW_OTHERS is selected. The select/depends
> combination breaks the dependency of BR2_PACKAGE_SYSVINIT and
> BR2_PACKAGE_SYSTEMD on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS. So the
> systemd package will be selected, but it's not visible to the user.
>
> Of course, there's nothing strictly wrong with that. It's just
> a bit strange.
>
> Clearly, adding a select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS here is
> a bad idea. I also don't like much to add a dependency on it
> either. So instead, I propose to move sysvinit and systemd out
> of the BR2_PACKAGE_BUSYBOX_SHOW_OTHERS condition (in package/Config.in).
> They anyway can't be selected or deselected by the user, since their
> selection is fully determined by the BR2_INIT_* option.
I agree here.
Peter, are you ok with this change ?
Thanks,
Maxime
--
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Buildroot] [PATCH 4/6] Rework of the init system
2012-03-19 23:45 ` Arnout Vandecappelle
2012-03-20 8:53 ` Maxime Ripard
@ 2012-03-20 9:14 ` Peter Korsgaard
1 sibling, 0 replies; 22+ messages in thread
From: Peter Korsgaard @ 2012-03-20 9:14 UTC (permalink / raw)
To: buildroot
>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:
Hi,
Arnout> On Monday 19 March 2012 16:59:38 Maxime Ripard wrote:
>> +choice
>> + prompt "Init system"
>> + default BR2_INIT_BUSYBOX
>> + help
>> + To select systemd, you first need to have dbus and udev enabled
Arnout> Only udev. Anyway, the help text of a choice is never shown, so
Arnout> this won't work. I don't know if it's possible to add comments in a
Arnout> choice, but that would be the way to go.
It is (it didn't used to be, but I fixed it a while ago). We have an
example in the ARM subarch selection for Cortex A8/A9.
>> +
>> +config BR2_INIT_BUSYBOX
>> + bool "Busybox init"
>> + select BR2_PACKAGE_BUSYBOX
>> +
>> +config BR2_INIT_SYSV
>> + bool "Use systemV init"
>> + select BR2_PACKAGE_SYSVINIT
>> +
>> +config BR2_INIT_SYSTEMD
>> + bool "Use systemd"
>> + select BR2_PACKAGE_DBUS
>> + depends on BR2_PACKAGE_UDEV
Arnout> Would it be an option to make this a select
Arnout> BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV instead? (With a depends
Arnout> on LARGEFILE and WCHAR, of course.) Or is that a bad idea?
The option should depend on LARGEFILE/WCHAR/IPV6 and then indeed select
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV. If those deps are not available
a comment should be shown, similar to how we do it for
BR2_PACKAGE_XSERVER_xorg.
Arnout> The latter two selects are only possible if
Arnout> BR2_PACKAGE_BUSYBOX_SHOW_OTHERS is selected. The select/depends
Arnout> combination breaks the dependency of BR2_PACKAGE_SYSVINIT and
Arnout> BR2_PACKAGE_SYSTEMD on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS. So the
Arnout> systemd package will be selected, but it's not visible to the user.
Arnout> Of course, there's nothing strictly wrong with that. It's just
Arnout> a bit strange.
I think stating that busybox has an alternative for systemd is
stretching the BUSYBOX_SHOW_OTHERS notion a bit. Perhaps we should just
move systemd outside the conditional?
Arnout> Clearly, adding a select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS here
Arnout> is a bad idea. I also don't like much to add a dependency on
Arnout> it either. So instead, I propose to move sysvinit and systemd
Arnout> out of the BR2_PACKAGE_BUSYBOX_SHOW_OTHERS condition (in
Arnout> package/Config.in).
.. Like you suggest here ;)
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Buildroot] [PATCH 4/6] Rework of the init system
2012-03-20 8:53 ` Maxime Ripard
@ 2012-03-20 9:15 ` Peter Korsgaard
0 siblings, 0 replies; 22+ messages in thread
From: Peter Korsgaard @ 2012-03-20 9:15 UTC (permalink / raw)
To: buildroot
>>>>> "Maxime" == Maxime Ripard <maxime.ripard@free-electrons.com> writes:
Hi,
Maxime> Well, while the select on BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV is
Maxime> indeed a good idea, like you said, we are still to depends on WCHAR and
Maxime> LARGEFILE support. So from the user point of view, we are still left
Maxime> without an option, and no way of getting how to select it (and we
Maxime> definitely don't want to select LARGEFILE and WCHAR)
Maxime> Peter, do you have an idea about that ?
Just add a comment like we do for BR2_PACKAGE_XSERVER_xorg
>> Clearly, adding a select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS here is
>> a bad idea. I also don't like much to add a dependency on it
>> either. So instead, I propose to move sysvinit and systemd out
>> of the BR2_PACKAGE_BUSYBOX_SHOW_OTHERS condition (in package/Config.in).
>> They anyway can't be selected or deselected by the user, since their
>> selection is fully determined by the BR2_INIT_* option.
Maxime> I agree here.
Maxime> Peter, are you ok with this change ?
Yes.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Buildroot] [PATCH 5/6] Fix installation for the lighttpd package
2012-03-19 23:51 ` Arnout Vandecappelle
@ 2012-03-20 9:42 ` Maxime Ripard
2012-03-20 12:29 ` Arnout Vandecappelle
0 siblings, 1 reply; 22+ messages in thread
From: Maxime Ripard @ 2012-03-20 9:42 UTC (permalink / raw)
To: buildroot
Le 20/03/2012 00:51, Arnout Vandecappelle a ?crit :
> On Monday 19 March 2012 16:59:39 Maxime Ripard wrote:
>> package/lighttpd/lighttpd.conf | 445 ++++++++++++++++++++++++++++++++++++++++
>
> Same remark as for systemd: wouldn't it be better to patch the upstream
> file instead of copying it? Also, why did you revert the disabling of
> range requests for pdf documents?
Well, here, the default values are sensible.
I mean, for a default configuration file, it is a normal behaviour for a
modern webserver to start it with its own UID/GID and to enable ipv6.
I don't see why they would accept a patch that disable these.
For PDF ranges option, it relies on a regex, and we don't always compile
with pcre, so I turned it down. Moreover, it's to fix a broken behaviour
of Adobe Acrobat's plugin that don't display the correct file size from
what I can understand, so nothing really critical here.
Here, same thing, maybe a patch against the source would be more
convenient and lightweight for us, I don't know.
--
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Buildroot] [PATCH 5/6] Fix installation for the lighttpd package
2012-03-20 9:42 ` Maxime Ripard
@ 2012-03-20 12:29 ` Arnout Vandecappelle
0 siblings, 0 replies; 22+ messages in thread
From: Arnout Vandecappelle @ 2012-03-20 12:29 UTC (permalink / raw)
To: buildroot
On Tuesday 20 March 2012 10:42:36 Maxime Ripard wrote:
> Le 20/03/2012 00:51, Arnout Vandecappelle a ?crit :
> > On Monday 19 March 2012 16:59:39 Maxime Ripard wrote:
> >> package/lighttpd/lighttpd.conf | 445 ++++++++++++++++++++++++++++++++++++++++
> >
> > Same remark as for systemd: wouldn't it be better to patch the upstream
> > file instead of copying it? Also, why did you revert the disabling of
> > range requests for pdf documents?
>
> Well, here, the default values are sensible.
> I mean, for a default configuration file, it is a normal behaviour for a
> modern webserver to start it with its own UID/GID and to enable ipv6.
> I don't see why they would accept a patch that disable these.
With 'patching the upstream file' I mean adding a patch to buildroot
that modifies the upstream source file. Although I like Peter's
suggestion to fixup the files with SED as well. But for this one, that
would be difficult.
> For PDF ranges option, it relies on a regex, and we don't always compile
> with pcre, so I turned it down.
That's a good reason.
[snip]
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286540
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
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Buildroot] [PATCH 2/6] Add the systemd package
2012-03-20 8:35 ` Maxime Ripard
2012-03-20 8:46 ` Peter Korsgaard
@ 2012-03-20 18:19 ` Arnout Vandecappelle
2012-03-21 9:33 ` Maxime Ripard
1 sibling, 1 reply; 22+ messages in thread
From: Arnout Vandecappelle @ 2012-03-20 18:19 UTC (permalink / raw)
To: buildroot
On Tuesday 20 March 2012 09:35:55 Maxime Ripard wrote:
[snip]
> >> diff --git a/package/systemd/getty at .service b/package/systemd/getty at .service
> > [snip]
> >> diff --git a/package/systemd/serial-getty at .service b/package/systemd/serial-getty at .service
> >
> > AFAICS the only difference between these two files and the upstream
> > version is that it's getty instead of agetty. Wouldn't it be simpler
> > and more future-safe to patch the upstream files?
>
> Probably. I'll send a patch and see how it turns out.
> In the meantime, maybe I can just put a patch here instead of the whole
> file.
That's what I meant. I doubt that upstream would accept a patch that
removes agetty. Maybe a patch that makes it configurable in the m4
file, but that's a lot more work to cook.
BTW, I just noticed now that the 'normal' service definition files
are installed in /lib/systemd/system rather than /etc/systemd/system.
[snip]
> >> +define SYSTEMD_INSTALL_TTY_HOOK
> >> + rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty at tty1.service
> >> + [ -f $(TARGET_DIR)/etc/systemd/system/getty at .service ] || \
> >> + $(INSTALL) -D package/systemd/getty at .service \
> >> + $(TARGET_DIR)/etc/systemd/system/
> >> + [ -f $(TARGET_DIR)/etc/systemd/system/serial-getty at .service ] || \
> >> + $(INSTALL) -D package/systemd/serial-getty at .service \
> >> + $(TARGET_DIR)/etc/systemd/system/
> >> + ln -fs ../serial-getty at .service $(TARGET_DIR)/etc/systemd/system/getty.target.wants/serial-getty@$(BR2_TARGET_GENERIC_GETTY_PORT).service
> >
> > This looks strange to me. Admittedly, I've never used systemd and
> > don't really know how it works. But to me, this looks like the
> > getty at .service is actually not used.
>
> Well, actually, this symlink with weird names is used as the way to pass
> units some arguments.
That much I know :-)
My point is: the getty at tty1.service file is removed. Therefore, there
is nobody using the getty at .service generic definition. At least that's
my understanding of how systemd works. So why install the
getty at .service file?
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286540
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
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Buildroot] [PATCH 6/6] Add systemd unit for lighttpd
2012-03-19 23:55 ` Arnout Vandecappelle
@ 2012-03-21 9:24 ` Maxime Ripard
0 siblings, 0 replies; 22+ messages in thread
From: Maxime Ripard @ 2012-03-21 9:24 UTC (permalink / raw)
To: buildroot
Le 20/03/2012 00:55, Arnout Vandecappelle a ?crit :
> On Monday 19 March 2012 16:59:40 Maxime Ripard wrote:
>> +define LIGHTTPD_INSTALL_INIT_SYSTEMD
>> +[ -f $(TARGET_DIR)/etc/systemd/system/lighttpd.service ] || \
>> + $(INSTALL) -D -m 755 package/lighttpd/lighttpd.service \
>> + $(TARGET_DIR)/etc/systemd/system/lighttpd.service
>> +
>> +mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
>> +
>> +ln -fs ../lighttpd.service \
>> + $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/lighttpd.service
>> +endef
>
> This should be indented, no?
>
> Would it be useful to add this to generic package infrastructure?
> I mean, if systemd is selected and pkgdir/pkgname.service exists,
> install it and enable it in multi-user.
I thought so at first, and in my first proposal, that was indeed the
case, but fact is that not every package doesn't want to be in
multi-user targets, but some will want to be in the sockets one, other
in network, etc.
So that's the reason I only added callbacks and let it up to the package
to install its units where they should be.
--
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Buildroot] [PATCH 2/6] Add the systemd package
2012-03-20 18:19 ` Arnout Vandecappelle
@ 2012-03-21 9:33 ` Maxime Ripard
0 siblings, 0 replies; 22+ messages in thread
From: Maxime Ripard @ 2012-03-21 9:33 UTC (permalink / raw)
To: buildroot
Le 20/03/2012 19:19, Arnout Vandecappelle a ?crit :
> On Tuesday 20 March 2012 09:35:55 Maxime Ripard wrote:
> [snip]
>>>> diff --git a/package/systemd/getty at .service b/package/systemd/getty at .service
>>> [snip]
>>>> diff --git a/package/systemd/serial-getty at .service b/package/systemd/serial-getty at .service
>>>
>>> AFAICS the only difference between these two files and the upstream
>>> version is that it's getty instead of agetty. Wouldn't it be simpler
>>> and more future-safe to patch the upstream files?
>>
>> Probably. I'll send a patch and see how it turns out.
>> In the meantime, maybe I can just put a patch here instead of the whole
>> file.
>
> That's what I meant. I doubt that upstream would accept a patch that
> removes agetty. Maybe a patch that makes it configurable in the m4
> file, but that's a lot more work to cook.
>
> BTW, I just noticed now that the 'normal' service definition files
> are installed in /lib/systemd/system rather than /etc/systemd/system.
>
> [snip]
>>>> +define SYSTEMD_INSTALL_TTY_HOOK
>>>> + rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty at tty1.service
>>>> + [ -f $(TARGET_DIR)/etc/systemd/system/getty at .service ] || \
>>>> + $(INSTALL) -D package/systemd/getty at .service \
>>>> + $(TARGET_DIR)/etc/systemd/system/
>>>> + [ -f $(TARGET_DIR)/etc/systemd/system/serial-getty at .service ] || \
>>>> + $(INSTALL) -D package/systemd/serial-getty at .service \
>>>> + $(TARGET_DIR)/etc/systemd/system/
>>>> + ln -fs ../serial-getty at .service $(TARGET_DIR)/etc/systemd/system/getty.target.wants/serial-getty@$(BR2_TARGET_GENERIC_GETTY_PORT).service
>>>
>>> This looks strange to me. Admittedly, I've never used systemd and
>>> don't really know how it works. But to me, this looks like the
>>> getty at .service is actually not used.
>>
>> Well, actually, this symlink with weird names is used as the way to pass
>> units some arguments.
>
> That much I know :-)
>
> My point is: the getty at tty1.service file is removed. Therefore, there
> is nobody using the getty at .service generic definition. At least that's
> my understanding of how systemd works. So why install the
> getty at .service file?
Aaah. I see your point now. Sorry I went a bit off-topic :)
You're right, of course, I'll remove it.
--
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2012-03-21 9:33 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-19 15:59 [Buildroot] [pull request] Pull request for branch for-2012.05/systemd Maxime Ripard
2012-03-19 15:59 ` [Buildroot] [PATCH 1/6] Change the /etc/mtab symlink to use an absolute path Maxime Ripard
2012-03-19 16:08 ` Peter Korsgaard
2012-03-19 15:59 ` [Buildroot] [PATCH 2/6] Add the systemd package Maxime Ripard
2012-03-19 23:32 ` Arnout Vandecappelle
2012-03-20 8:35 ` Maxime Ripard
2012-03-20 8:46 ` Peter Korsgaard
2012-03-20 18:19 ` Arnout Vandecappelle
2012-03-21 9:33 ` Maxime Ripard
2012-03-19 15:59 ` [Buildroot] [PATCH 3/6] Enable cgroups in Linux if we use systemd Maxime Ripard
2012-03-19 15:59 ` [Buildroot] [PATCH 4/6] Rework of the init system Maxime Ripard
2012-03-19 23:45 ` Arnout Vandecappelle
2012-03-20 8:53 ` Maxime Ripard
2012-03-20 9:15 ` Peter Korsgaard
2012-03-20 9:14 ` Peter Korsgaard
2012-03-19 15:59 ` [Buildroot] [PATCH 5/6] Fix installation for the lighttpd package Maxime Ripard
2012-03-19 23:51 ` Arnout Vandecappelle
2012-03-20 9:42 ` Maxime Ripard
2012-03-20 12:29 ` Arnout Vandecappelle
2012-03-19 15:59 ` [Buildroot] [PATCH 6/6] Add systemd unit for lighttpd Maxime Ripard
2012-03-19 23:55 ` Arnout Vandecappelle
2012-03-21 9:24 ` Maxime Ripard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox