* [Buildroot] [PATCH 1/5] Add the systemd package
2012-02-03 14:27 [Buildroot] [RFC v2] Add systemd to buildroot Maxime Ripard
@ 2012-02-03 14:27 ` Maxime Ripard
2012-02-03 20:32 ` Peter Korsgaard
2012-02-03 14:27 ` [Buildroot] [PATCH 2/5] Rework of the init system Maxime Ripard
` (3 subsequent siblings)
4 siblings, 1 reply; 17+ messages in thread
From: Maxime Ripard @ 2012-02-03 14:27 UTC (permalink / raw)
To: buildroot
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
fs/skeleton/etc/mtab | 2 +-
linux/linux.mk | 2 +
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 | 68 +++++++++++++++++++++++++++++++++
package/udev/udev.mk | 6 ++-
9 files changed, 170 insertions(+), 2 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/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
diff --git a/linux/linux.mk b/linux/linux.mk
index dbe1ad7..d7c9c9c 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -150,6 +150,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
diff --git a/package/Config.in b/package/Config.in
index 66ee266..c416a03 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -569,6 +569,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..753b433
--- /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..26ae595
--- /dev/null
+++ b/package/systemd/systemd.mk
@@ -0,0 +1,68 @@
+#############################################################
+#
+# 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
+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 1825396..93571e1 100644
--- a/package/udev/udev.mk
+++ b/package/udev/udev.mk
@@ -12,7 +12,7 @@ UDEV_CONF_OPT = \
--sbindir=/sbin \
--with-rootlibdir=/lib \
--libexecdir=/lib/udev \
- --disable-introspection
+ --disable-introspection \
UDEV_DEPENDENCIES = host-gperf host-pkg-config
@@ -28,6 +28,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] 17+ messages in thread
* [Buildroot] [PATCH 1/5] Add the systemd package
2012-02-03 14:27 ` [Buildroot] [PATCH 1/5] Add the systemd package Maxime Ripard
@ 2012-02-03 20:32 ` Peter Korsgaard
2012-02-04 13:13 ` Maxime Ripard
0 siblings, 1 reply; 17+ messages in thread
From: Peter Korsgaard @ 2012-02-03 20:32 UTC (permalink / raw)
To: buildroot
>>>>> "Maxime" == Maxime Ripard <maxime.ripard@free-electrons.com> writes:
Maxime> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Maxime> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Looks good, a few minor comments:
Maxime> diff --git a/fs/skeleton/etc/mtab b/fs/skeleton/etc/mtab
Maxime> index e1c2045..4c0a094 120000
Maxime> --- a/fs/skeleton/etc/mtab
Maxime> +++ b/fs/skeleton/etc/mtab
Maxime> @@ -1 +1 @@
Maxime> -../proc/mounts
Maxime> \ No newline at end of file
Maxime> +/proc/mounts
Maxime> \ No newline at end of file
Is this needed by systemd? I would prefer to see this as a seperate
patch.
Maxime> diff --git a/linux/linux.mk b/linux/linux.mk
Maxime> index dbe1ad7..d7c9c9c 100644
Maxime> --- a/linux/linux.mk
Maxime> +++ b/linux/linux.mk
Maxime> @@ -150,6 +150,8 @@ define LINUX_CONFIGURE_CMDS
Maxime> $(if $(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV),
Maxime> $(call KCONFIG_SET_OPT,CONFIG_UEVENT_HELPER_PATH,\"/sbin/mdev\",$(@D)/.config))
Maxime> yes '' | $(TARGET_MAKE_ENV) $(MAKE1) $(LINUX_MAKE_FLAGS) -C $(@D) oldconfig
Maxime> + $(if $(BR2_PACKAGE_SYSTEMD),
Maxime> + $(call KCONFIG_ENABLE_OPT,CONFIG_CGROUPS,$(@D)/.config),)
The very last ',' can be removed. This could also go in a seperate
patch.
Maxime> +++ b/package/systemd/Config.in
Maxime> @@ -0,0 +1,19 @@
Maxime> +config BR2_PACKAGE_SYSTEMD
Maxime> + bool "systemd"
Maxime> + depends on BR2_PACKAGE_UDEV
Maxime> + select BR2_PACKAGE_DBUS
Maxime> + select BR2_PACKAGE_LIBCAP
Maxime> + help
Maxime> + systemd is a system and service manager for Linux, compatible with
Maxime> + SysV and LSB init scripts. systemd provides aggressive parallelization
Maxime> + capabilities, uses socket and D-Bus activation for starting services,
Maxime> + offers on-demand starting of daemons, keeps track of processes using
Maxime> + Linux cgroups, supports snapshotting and restoring of the system
Maxime> + state, maintains mount and automount points and implements an
Maxime> + elaborate transactional dependency-based service control logic. It can
This looks a bit too wide. "It can" should go on the next line.
Maxime> +++ b/package/systemd/systemd.mk
Maxime> @@ -0,0 +1,68 @@
Maxime> +#############################################################
Maxime> +#
Maxime> +# systemd
Maxime> +#
Maxime> +#############################################################
Maxime> +SYSTEMD_VERSION = 37
Maxime> +SYSTEMD_SITE = http://www.freedesktop.org/software/systemd/
Maxime> +SYSTEMD_SOURCE = systemd-$(SYSTEMD_VERSION).tar.bz2
Maxime> +SYSTEMD_DEPENDENCIES = \
Maxime> + host-intltool \
Maxime> + libcap \
Maxime> + udev \
Maxime> + dbus
Maxime> +
Maxime> +# Build after Busybox
Maxime> +ifeq ($(BR2_PACKAGE_BUSYBOX),y)
Maxime> + SYSTEMD_DEPENDENCIES += busybox
Maxime> +endif
Maxime> +
Maxime> +SYSTEMD_CONF_OPT += \
Maxime> + --with-distro=other \
Maxime> + --disable-selinux \
Maxime> + --disable-pam \
Maxime> + --disable-libcryptsetup \
Maxime> + --disable-gtk \
Maxime> + --disable-plymouth \
Maxime> + --with-rootdir=/ \
Maxime> + --with-dbuspolicydir=/etc/dbus-1/system.d \
Maxime> + --with-dbussessionservicedir=/usr/share/dbus-1/services \
Maxime> + --with-dbussystemservicedir=/usr/share/dbus-1/system-services \
Maxime> + --with-dbusinterfacedir=/usr/share/dbus-1/interfaces \
Maxime> + --with-udevrulesdir=/etc/udev/rules.d \
Maxime> + --with-sysvinit-path=/etc/init.d/ \
Maxime> + --without-sysvrcd-path
Maxime> +
Maxime> +ifeq ($(BR2_PACKAGE_ACL),y)
Maxime> + SYSTEMD_CONF_OPT += --enable-acl
You're missing
SYSTEMD_DEPENDENCIES += acl
Maxime> +++ b/package/udev/udev.mk
Maxime> @@ -12,7 +12,7 @@ UDEV_CONF_OPT = \
Maxime> --sbindir=/sbin \
Maxime> --with-rootlibdir=/lib \
Maxime> --libexecdir=/lib/udev \
Maxime> - --disable-introspection
Maxime> + --disable-introspection \
Why?
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH 1/5] Add the systemd package
2012-02-03 20:32 ` Peter Korsgaard
@ 2012-02-04 13:13 ` Maxime Ripard
2012-02-05 9:58 ` Peter Korsgaard
0 siblings, 1 reply; 17+ messages in thread
From: Maxime Ripard @ 2012-02-04 13:13 UTC (permalink / raw)
To: buildroot
hi Peter,
On 03/02/2012 21:32, Peter Korsgaard wrote:
>>>>>> "Maxime" == Maxime Ripard <maxime.ripard@free-electrons.com> writes:
> Maxime> diff --git a/fs/skeleton/etc/mtab b/fs/skeleton/etc/mtab
> Maxime> index e1c2045..4c0a094 120000
> Maxime> --- a/fs/skeleton/etc/mtab
> Maxime> +++ b/fs/skeleton/etc/mtab
> Maxime> @@ -1 +1 @@
> Maxime> -../proc/mounts
> Maxime> \ No newline at end of file
> Maxime> +/proc/mounts
> Maxime> \ No newline at end of file
>
> Is this needed by systemd? I would prefer to see this as a seperate
> patch.
Yes, this is needed as it checks for /etc/mtab being equal to
/proc/mounts or /proc/self/mounts.
http://cgit.freedesktop.org/systemd/tree/src/main.c#n1082
Or I guess I can patch it as well...
What do you prefer ? A patch for systemd, a separate patch to change
this or keep it this way ?
>
> Maxime> diff --git a/linux/linux.mk b/linux/linux.mk
> Maxime> index dbe1ad7..d7c9c9c 100644
> Maxime> --- a/linux/linux.mk
> Maxime> +++ b/linux/linux.mk
> Maxime> @@ -150,6 +150,8 @@ define LINUX_CONFIGURE_CMDS
> Maxime> $(if $(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV),
> Maxime> $(call KCONFIG_SET_OPT,CONFIG_UEVENT_HELPER_PATH,\"/sbin/mdev\",$(@D)/.config))
> Maxime> yes '' | $(TARGET_MAKE_ENV) $(MAKE1) $(LINUX_MAKE_FLAGS) -C $(@D) oldconfig
> Maxime> + $(if $(BR2_PACKAGE_SYSTEMD),
> Maxime> + $(call KCONFIG_ENABLE_OPT,CONFIG_CGROUPS,$(@D)/.config),)
>
> The very last ',' can be removed. This could also go in a seperate
> patch.
Ok.
> Maxime> +++ b/package/systemd/Config.in
> Maxime> @@ -0,0 +1,19 @@
> Maxime> +config BR2_PACKAGE_SYSTEMD
> Maxime> + bool "systemd"
> Maxime> + depends on BR2_PACKAGE_UDEV
> Maxime> + select BR2_PACKAGE_DBUS
> Maxime> + select BR2_PACKAGE_LIBCAP
> Maxime> + help
> Maxime> + systemd is a system and service manager for Linux, compatible with
> Maxime> + SysV and LSB init scripts. systemd provides aggressive parallelization
> Maxime> + capabilities, uses socket and D-Bus activation for starting services,
> Maxime> + offers on-demand starting of daemons, keeps track of processes using
> Maxime> + Linux cgroups, supports snapshotting and restoring of the system
> Maxime> + state, maintains mount and automount points and implements an
> Maxime> + elaborate transactional dependency-based service control logic. It can
>
> This looks a bit too wide. "It can" should go on the next line.
Ok.
> Maxime> +++ b/package/systemd/systemd.mk
> Maxime> @@ -0,0 +1,68 @@
> Maxime> +#############################################################
> Maxime> +#
> Maxime> +# systemd
> Maxime> +#
> Maxime> +#############################################################
> Maxime> +SYSTEMD_VERSION = 37
> Maxime> +SYSTEMD_SITE = http://www.freedesktop.org/software/systemd/
> Maxime> +SYSTEMD_SOURCE = systemd-$(SYSTEMD_VERSION).tar.bz2
> Maxime> +SYSTEMD_DEPENDENCIES = \
> Maxime> + host-intltool \
> Maxime> + libcap \
> Maxime> + udev \
> Maxime> + dbus
> Maxime> +
> Maxime> +# Build after Busybox
> Maxime> +ifeq ($(BR2_PACKAGE_BUSYBOX),y)
> Maxime> + SYSTEMD_DEPENDENCIES += busybox
> Maxime> +endif
> Maxime> +
> Maxime> +SYSTEMD_CONF_OPT += \
> Maxime> + --with-distro=other \
> Maxime> + --disable-selinux \
> Maxime> + --disable-pam \
> Maxime> + --disable-libcryptsetup \
> Maxime> + --disable-gtk \
> Maxime> + --disable-plymouth \
> Maxime> + --with-rootdir=/ \
> Maxime> + --with-dbuspolicydir=/etc/dbus-1/system.d \
> Maxime> + --with-dbussessionservicedir=/usr/share/dbus-1/services \
> Maxime> + --with-dbussystemservicedir=/usr/share/dbus-1/system-services \
> Maxime> + --with-dbusinterfacedir=/usr/share/dbus-1/interfaces \
> Maxime> + --with-udevrulesdir=/etc/udev/rules.d \
> Maxime> + --with-sysvinit-path=/etc/init.d/ \
> Maxime> + --without-sysvrcd-path
> Maxime> +
> Maxime> +ifeq ($(BR2_PACKAGE_ACL),y)
> Maxime> + SYSTEMD_CONF_OPT += --enable-acl
>
> You're missing
> SYSTEMD_DEPENDENCIES += acl
Right.
> Maxime> +++ b/package/udev/udev.mk
> Maxime> @@ -12,7 +12,7 @@ UDEV_CONF_OPT = \
> Maxime> --sbindir=/sbin \
> Maxime> --with-rootlibdir=/lib \
> Maxime> --libexecdir=/lib/udev \
> Maxime> - --disable-introspection
> Maxime> + --disable-introspection \
>
> Why?
Sorry, I used to have a line following this one, but it got removed,
will fix.
--
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] 17+ messages in thread
* [Buildroot] [PATCH 1/5] Add the systemd package
2012-02-04 13:13 ` Maxime Ripard
@ 2012-02-05 9:58 ` Peter Korsgaard
0 siblings, 0 replies; 17+ messages in thread
From: Peter Korsgaard @ 2012-02-05 9:58 UTC (permalink / raw)
To: buildroot
>>>>> "Maxime" == Maxime Ripard <maxime.ripard@free-electrons.com> writes:
Hi,
>> Is this needed by systemd? I would prefer to see this as a seperate
>> patch.
Maxime> Yes, this is needed as it checks for /etc/mtab being equal to
Maxime> /proc/mounts or /proc/self/mounts.
Maxime> http://cgit.freedesktop.org/systemd/tree/src/main.c#n1082
Maxime> Or I guess I can patch it as well...
Maxime> What do you prefer ? A patch for systemd, a separate patch to change
Maxime> this or keep it this way ?
No, I'm fine with the change to the skeleton, I just want it in a
seperate commit with an explanation (E.G. the systemd cgit link) so
people using another skeleton can easily figure out why/what to change.
Maxime> Sorry, I used to have a line following this one, but it got
Maxime> removed, will fix.
Great, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH 2/5] Rework of the init system
2012-02-03 14:27 [Buildroot] [RFC v2] Add systemd to buildroot Maxime Ripard
2012-02-03 14:27 ` [Buildroot] [PATCH 1/5] Add the systemd package Maxime Ripard
@ 2012-02-03 14:27 ` Maxime Ripard
2012-02-09 23:12 ` Arnout Vandecappelle
2012-02-03 14:27 ` [Buildroot] [PATCH 3/5] Fix installation for the lighttpd package Maxime Ripard
` (2 subsequent siblings)
4 siblings, 1 reply; 17+ messages in thread
From: Maxime Ripard @ 2012-02-03 14:27 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 1ace683..e267b65 100644
--- a/package/Makefile.package.in
+++ b/package/Makefile.package.in
@@ -431,6 +431,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 $@
@@ -449,6 +453,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 753b433..7a0b37d 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 a91de32..f54e7d8 100644
--- a/target/generic/Config.in
+++ b/target/generic/Config.in
@@ -32,6 +32,28 @@ config BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV
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] 17+ messages in thread
* [Buildroot] [PATCH 2/5] Rework of the init system
2012-02-03 14:27 ` [Buildroot] [PATCH 2/5] Rework of the init system Maxime Ripard
@ 2012-02-09 23:12 ` Arnout Vandecappelle
0 siblings, 0 replies; 17+ messages in thread
From: Arnout Vandecappelle @ 2012-02-09 23:12 UTC (permalink / raw)
To: buildroot
On Friday 03 February 2012 15:27:24 Maxime Ripard wrote:
> 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>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
[snip]
> + $(if $(BR2_INIT_SYSTEMD),\
> + $($(PKG)_INSTALL_INIT_SYSTEMD))
> + $(if $(BR2_INIT_SYSV)$(BR2_INIT_BUSYBOX),\
> + $($(PKG)_INSTALL_INIT_SYSV))
I'm not sure if it really is an improvement, but you replace this with
$($(PKG)_INSTALL_INIT_$(INIT_SYSTEM))
where
INIT_SYSTEM = $(call qstrip,$(BR2_INIT_SYSTEM))
and in target/generic/Config.in
config BR2_INIT_SYSTEM
string
default "SYSTEMD" if BR2_INIT_SYSTEMD
default "SYSV" if BR2_INIT_SYSV || BR2_INIT_BUSYBOX
It doesn't simplify this patch much, but it may help if other things
depend on the init system in the future.
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] 17+ messages in thread
* [Buildroot] [PATCH 3/5] Fix installation for the lighttpd package
2012-02-03 14:27 [Buildroot] [RFC v2] Add systemd to buildroot Maxime Ripard
2012-02-03 14:27 ` [Buildroot] [PATCH 1/5] Add the systemd package Maxime Ripard
2012-02-03 14:27 ` [Buildroot] [PATCH 2/5] Rework of the init system Maxime Ripard
@ 2012-02-03 14:27 ` Maxime Ripard
2012-02-03 14:27 ` [Buildroot] [PATCH 4/5] Add systemd unit for lighttpd Maxime Ripard
2012-02-03 14:27 ` [Buildroot] [PATCH 5/5] Add the systemd units files to openssh Maxime Ripard
4 siblings, 0 replies; 17+ messages in thread
From: Maxime Ripard @ 2012-02-03 14:27 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] 17+ messages in thread
* [Buildroot] [PATCH 4/5] Add systemd unit for lighttpd
2012-02-03 14:27 [Buildroot] [RFC v2] Add systemd to buildroot Maxime Ripard
` (2 preceding siblings ...)
2012-02-03 14:27 ` [Buildroot] [PATCH 3/5] Fix installation for the lighttpd package Maxime Ripard
@ 2012-02-03 14:27 ` Maxime Ripard
2012-02-03 14:27 ` [Buildroot] [PATCH 5/5] Add the systemd units files to openssh Maxime Ripard
4 siblings, 0 replies; 17+ messages in thread
From: Maxime Ripard @ 2012-02-03 14:27 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] 17+ messages in thread
* [Buildroot] [PATCH 5/5] Add the systemd units files to openssh
2012-02-03 14:27 [Buildroot] [RFC v2] Add systemd to buildroot Maxime Ripard
` (3 preceding siblings ...)
2012-02-03 14:27 ` [Buildroot] [PATCH 4/5] Add systemd unit for lighttpd Maxime Ripard
@ 2012-02-03 14:27 ` Maxime Ripard
4 siblings, 0 replies; 17+ messages in thread
From: Maxime Ripard @ 2012-02-03 14:27 UTC (permalink / raw)
To: buildroot
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
package/openssh/openssh.mk | 19 ++++++++++++++++---
package/openssh/sshd.socket | 9 +++++++++
package/openssh/sshd at .service | 7 +++++++
3 files changed, 32 insertions(+), 3 deletions(-)
create mode 100644 package/openssh/sshd.socket
create mode 100644 package/openssh/sshd at .service
diff --git a/package/openssh/openssh.mk b/package/openssh/openssh.mk
index 08bb499..652e1d1 100644
--- a/package/openssh/openssh.mk
+++ b/package/openssh/openssh.mk
@@ -12,10 +12,23 @@ OPENSSH_CONF_OPT = --libexecdir=/usr/lib --disable-lastlog --disable-utmp \
OPENSSH_DEPENDENCIES = zlib openssl
-define OPENSSH_INSTALL_INITSCRIPT
- $(INSTALL) -D -m 755 package/openssh/S50sshd $(TARGET_DIR)/etc/init.d/S50sshd
+define OPENSSH_INSTALL_INIT_SYSV
+if [! -f $(TARGET_DIR)/etc/init.d/S50sshd ]; then \
+ $(INSTALL) -D -m 755 package/openssh/S50sshd $(TARGET_DIR)/etc/init.d/S50sshd; \
+fi;
endef
-OPENSSH_POST_INSTALL_TARGET_HOOKS += OPENSSH_INSTALL_INITSCRIPT
+define OPENSSH_INSTALL_INIT_SYSTEMD
+[ -f $(TARGET_DIR)/etc/systemd/system/sshd.socket ] || \
+ $(INSTALL) -D -m 755 package/openssh/sshd.socket \
+ $(TARGET_DIR)/etc/systemd/system/sshd.socket
+
+[ -f $(TARGET_DIR)/etc/systemd/system/sshd at .service ] || \
+ $(INSTALL) -D -m 755 package/openssh/sshd at .service \
+ $(TARGET_DIR)/etc/systemd/system/sshd at .service
+
+mkdir -p $(TARGET_DIR)/etc/systemd/system/sockets.target.wants
+ln -fs ../sshd.socket $(TARGET_DIR)/etc/systemd/system/sockets.target.wants/sshd.socket
+endef
$(eval $(call AUTOTARGETS))
diff --git a/package/openssh/sshd.socket b/package/openssh/sshd.socket
new file mode 100644
index 0000000..fd68407
--- /dev/null
+++ b/package/openssh/sshd.socket
@@ -0,0 +1,9 @@
+[Unit]
+Conflicts=sshd.service
+
+[Socket]
+ListenStream=22
+Accept=yes
+
+[Install]
+WantedBy=sockets.target
diff --git a/package/openssh/sshd at .service b/package/openssh/sshd at .service
new file mode 100644
index 0000000..b81d471
--- /dev/null
+++ b/package/openssh/sshd at .service
@@ -0,0 +1,7 @@
+[Unit]
+Description=SSH Per-Connection Server
+After=syslog.target
+
+[Service]
+ExecStart=/usr/sbin/sshd -i
+StandardInput=socket
--
1.7.5.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH 1/5] Add the systemd package
2012-03-22 9:27 [Buildroot] [pull request v2] Pull request for branch for-2012.05/systemd Maxime Ripard
@ 2012-03-22 9:27 ` Maxime Ripard
2012-03-22 20:39 ` Peter Korsgaard
0 siblings, 1 reply; 17+ messages in thread
From: Maxime Ripard @ 2012-03-22 9:27 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/systemd-37-fix-getty-unit.patch | 26 ++++++++++
package/systemd/systemd.mk | 62 +++++++++++++++++++++++
package/udev/udev.mk | 4 ++
6 files changed, 116 insertions(+), 0 deletions(-)
create mode 100644 package/systemd/Config.in
create mode 100644 package/systemd/systemd-37-fix-getty-unit.patch
create mode 100644 package/systemd/systemd.mk
diff --git a/package/Config.in b/package/Config.in
index 85583c6..623c79a 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -577,6 +577,7 @@ source "package/rsyslog/Config.in"
source "package/sysklogd/Config.in"
source "package/sysvinit/Config.in"
endif
+source "package/systemd/Config.in"
source "package/util-linux/Config.in"
source "package/dsp-tools/Config.in"
endmenu
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..d114ddd
--- /dev/null
+++ b/package/systemd/Config.in
@@ -0,0 +1,19 @@
+config BR2_PACKAGE_SYSTEMD
+ bool "systemd"
+ depends on BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_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)"
+ depends on !BR2_PACKAGE_UDEV
diff --git a/package/systemd/systemd-37-fix-getty-unit.patch b/package/systemd/systemd-37-fix-getty-unit.patch
new file mode 100644
index 0000000..211fb4d
--- /dev/null
+++ b/package/systemd/systemd-37-fix-getty-unit.patch
@@ -0,0 +1,26 @@
+Index: systemd-37/units/getty at .service.m4
+===================================================================
+--- systemd-37.orig/units/getty at .service.m4 2012-03-21 10:05:23.868674099 +0100
++++ systemd-37/units/getty at .service.m4 2012-03-21 10:06:50.332671834 +0100
+@@ -32,7 +32,7 @@
+
+ [Service]
+ Environment=TERM=linux
+-ExecStart=-/sbin/agetty %I 38400
++ExecStart=-/sbin/getty -L %I 115200 vt100
+ Restart=always
+ RestartSec=0
+ UtmpIdentifier=%I
+Index: systemd-37/units/serial-getty at .service.m4
+===================================================================
+--- systemd-37.orig/units/serial-getty at .service.m4 2012-03-21 10:07:05.176671445 +0100
++++ systemd-37/units/serial-getty at .service.m4 2012-03-21 10:07:21.580671015 +0100
+@@ -32,7 +32,7 @@
+
+ [Service]
+ Environment=TERM=vt100
+-ExecStart=-/sbin/agetty -s %I 115200,38400,9600
++ExecStart=-/sbin/getty -L %I 115200 vt100
+ Restart=always
+ RestartSec=0
+ UtmpIdentifier=%I
diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
new file mode 100644
index 0000000..d615bbf
--- /dev/null
+++ b/package/systemd/systemd.mk
@@ -0,0 +1,62 @@
+#############################################################
+#
+# 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
+
+# Make sure that systemd will always be built after busybox so that we have
+# a consitent init setup between two builds
+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
+
+ 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
+ ln -fs ../../../../lib/systemd/system/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] 17+ messages in thread
* [Buildroot] [PATCH 1/5] Add the systemd package
2012-03-22 9:27 ` [Buildroot] [PATCH 1/5] Add the systemd package Maxime Ripard
@ 2012-03-22 20:39 ` Peter Korsgaard
2012-03-23 8:51 ` Maxime Ripard
0 siblings, 1 reply; 17+ messages in thread
From: Peter Korsgaard @ 2012-03-22 20:39 UTC (permalink / raw)
To: buildroot
>>>>> "Maxime" == Maxime Ripard <maxime.ripard@free-electrons.com> writes:
Hi,
Maxime> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Maxime> ---
Maxime> package/Config.in | 1 +
Maxime> package/dbus/dbus.mk | 4 ++
Maxime> package/systemd/Config.in | 19 +++++++
Maxime> package/systemd/systemd-37-fix-getty-unit.patch | 26 ++++++++++
Maxime> package/systemd/systemd.mk | 62 +++++++++++++++++++++++
Maxime> package/udev/udev.mk | 4 ++
Maxime> 6 files changed, 116 insertions(+), 0 deletions(-)
Maxime> create mode 100644 package/systemd/Config.in
Maxime> create mode 100644 package/systemd/systemd-37-fix-getty-unit.patch
Maxime> create mode 100644 package/systemd/systemd.mk
Maxime> +++ b/package/systemd/Config.in
Maxime> @@ -0,0 +1,19 @@
Maxime> +config BR2_PACKAGE_SYSTEMD
Maxime> + bool "systemd"
Maxime> + depends on BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV
Maxime> + select BR2_PACKAGE_DBUS
Maxime> + select BR2_PACKAGE_LIBCAP
Maxime> + help
Systemd also depends on BR2_INET_IPV6.
Maxime> + systemd is a system and service manager for Linux, compatible with
Maxime> + SysV and LSB init scripts. systemd provides aggressive parallelization
Maxime> + capabilities, uses socket and D-Bus activation for starting services,
Maxime> + offers on-demand starting of daemons, keeps track of processes using
Maxime> + Linux cgroups, supports snapshotting and restoring of the system
Maxime> + state, maintains mount and automount points and implements an
Maxime> + elaborate transactional dependency-based service control logic.
Maxime> + It can work as a drop-in replacement for sysvinit.
Maxime> +
Maxime> + http://freedesktop.org/wiki/Software/systemd
Maxime> +
Maxime> +comment "systemd not available (depends on udev)"
Maxime> + depends on !BR2_PACKAGE_UDEV
As you changed the depend on, this should also say something like:
(depends on /dev management with udev)
and depend on !BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV
Maxime> diff --git a/package/systemd/systemd-37-fix-getty-unit.patch b/package/systemd/systemd-37-fix-getty-unit.patch
Maxime> new file mode 100644
Maxime> index 0000000..211fb4d
Maxime> --- /dev/null
Maxime> +++ b/package/systemd/systemd-37-fix-getty-unit.patch
Maxime> @@ -0,0 +1,26 @@
Please add a git-style header with description and signed-off-by on all
patches.
Maxime> +Index: systemd-37/units/getty at .service.m4
Maxime> +===================================================================
Maxime> +--- systemd-37.orig/units/getty at .service.m4 2012-03-21 10:05:23.868674099 +0100
Maxime> ++++ systemd-37/units/getty at .service.m4 2012-03-21 10:06:50.3326
Otherwise it looks good. Care to fix?
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH 1/5] Add the systemd package
2012-03-22 20:39 ` Peter Korsgaard
@ 2012-03-23 8:51 ` Maxime Ripard
2012-03-23 9:04 ` Peter Korsgaard
0 siblings, 1 reply; 17+ messages in thread
From: Maxime Ripard @ 2012-03-23 8:51 UTC (permalink / raw)
To: buildroot
Hi Peter,
Le 22/03/2012 21:39, Peter Korsgaard a ?crit :
>>>>>> "Maxime" == Maxime Ripard <maxime.ripard@free-electrons.com> writes:
>
> Hi,
>
> Maxime> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> Maxime> ---
> Maxime> package/Config.in | 1 +
> Maxime> package/dbus/dbus.mk | 4 ++
> Maxime> package/systemd/Config.in | 19 +++++++
> Maxime> package/systemd/systemd-37-fix-getty-unit.patch | 26 ++++++++++
> Maxime> package/systemd/systemd.mk | 62 +++++++++++++++++++++++
> Maxime> package/udev/udev.mk | 4 ++
> Maxime> 6 files changed, 116 insertions(+), 0 deletions(-)
> Maxime> create mode 100644 package/systemd/Config.in
> Maxime> create mode 100644 package/systemd/systemd-37-fix-getty-unit.patch
> Maxime> create mode 100644 package/systemd/systemd.mk
>
> Maxime> +++ b/package/systemd/Config.in
> Maxime> @@ -0,0 +1,19 @@
> Maxime> +config BR2_PACKAGE_SYSTEMD
> Maxime> + bool "systemd"
> Maxime> + depends on BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV
> Maxime> + select BR2_PACKAGE_DBUS
> Maxime> + select BR2_PACKAGE_LIBCAP
> Maxime> + help
>
> Systemd also depends on BR2_INET_IPV6.
Ah, yes, I forgot to add it here.
> Maxime> + systemd is a system and service manager for Linux, compatible with
> Maxime> + SysV and LSB init scripts. systemd provides aggressive parallelization
> Maxime> + capabilities, uses socket and D-Bus activation for starting services,
> Maxime> + offers on-demand starting of daemons, keeps track of processes using
> Maxime> + Linux cgroups, supports snapshotting and restoring of the system
> Maxime> + state, maintains mount and automount points and implements an
> Maxime> + elaborate transactional dependency-based service control logic.
> Maxime> + It can work as a drop-in replacement for sysvinit.
> Maxime> +
> Maxime> + http://freedesktop.org/wiki/Software/systemd
> Maxime> +
> Maxime> +comment "systemd not available (depends on udev)"
> Maxime> + depends on !BR2_PACKAGE_UDEV
>
> As you changed the depend on, this should also say something like:
>
> (depends on /dev management with udev)
>
> and depend on !BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV
Of course.
I forgot LARGEFILE and WCHAR as well..
> Maxime> diff --git a/package/systemd/systemd-37-fix-getty-unit.patch b/package/systemd/systemd-37-fix-getty-unit.patch
> Maxime> new file mode 100644
> Maxime> index 0000000..211fb4d
> Maxime> --- /dev/null
> Maxime> +++ b/package/systemd/systemd-37-fix-getty-unit.patch
> Maxime> @@ -0,0 +1,26 @@
>
> Please add a git-style header with description and signed-off-by on all
> patches.
Ok
> Maxime> +Index: systemd-37/units/getty at .service.m4
> Maxime> +===================================================================
> Maxime> +--- systemd-37.orig/units/getty at .service.m4 2012-03-21 10:05:23.868674099 +0100
> Maxime> ++++ systemd-37/units/getty at .service.m4 2012-03-21 10:06:50.3326
>
> Otherwise it looks good. Care to fix?
Not at all, I'll resend it today.
--
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] 17+ messages in thread
* [Buildroot] [PATCH 1/5] Add the systemd package
2012-03-23 8:51 ` Maxime Ripard
@ 2012-03-23 9:04 ` Peter Korsgaard
0 siblings, 0 replies; 17+ messages in thread
From: Peter Korsgaard @ 2012-03-23 9:04 UTC (permalink / raw)
To: buildroot
>>>>> "Maxime" == Maxime Ripard <maxime.ripard@free-electrons.com> writes:
Hi,
>> As you changed the depend on, this should also say something like:
>>
>> (depends on /dev management with udev)
>>
>> and depend on !BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV
Maxime> Of course.
Maxime> I forgot LARGEFILE and WCHAR as well..
That's not needed as BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV already
depends on those.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH 1/5] Add the systemd package
2012-03-23 9:26 [Buildroot] [pull request v3] Pull request for branch for-2012.05/systemd Maxime Ripard
@ 2012-03-23 9:26 ` Maxime Ripard
0 siblings, 0 replies; 17+ messages in thread
From: Maxime Ripard @ 2012-03-23 9:26 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 | 20 +++++++
package/systemd/systemd-37-fix-getty-unit.patch | 34 ++++++++++++
package/systemd/systemd.mk | 62 +++++++++++++++++++++++
package/udev/udev.mk | 4 ++
6 files changed, 125 insertions(+), 0 deletions(-)
create mode 100644 package/systemd/Config.in
create mode 100644 package/systemd/systemd-37-fix-getty-unit.patch
create mode 100644 package/systemd/systemd.mk
diff --git a/package/Config.in b/package/Config.in
index 85583c6..623c79a 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -577,6 +577,7 @@ source "package/rsyslog/Config.in"
source "package/sysklogd/Config.in"
source "package/sysvinit/Config.in"
endif
+source "package/systemd/Config.in"
source "package/util-linux/Config.in"
source "package/dsp-tools/Config.in"
endmenu
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..8df3318
--- /dev/null
+++ b/package/systemd/Config.in
@@ -0,0 +1,20 @@
+config BR2_PACKAGE_SYSTEMD
+ bool "systemd"
+ depends on BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV
+ depends on BR2_INET_IPV6
+ 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 /dev management with udev and ipv6 support)"
+ depends on !(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV && BR2_INET_IPV6)
diff --git a/package/systemd/systemd-37-fix-getty-unit.patch b/package/systemd/systemd-37-fix-getty-unit.patch
new file mode 100644
index 0000000..6df54b1
--- /dev/null
+++ b/package/systemd/systemd-37-fix-getty-unit.patch
@@ -0,0 +1,34 @@
+Prefer getty to agetty in console setup systemd units
+
+Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
+---
+ units/getty at .service.m4 | 2 +-
+ units/serial-getty at .service.m4 | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+Index: systemd-37/units/getty at .service.m4
+===================================================================
+--- systemd-37.orig/units/getty at .service.m4
++++ systemd-37/units/getty at .service.m4
+@@ -32,7 +32,7 @@
+
+ [Service]
+ Environment=TERM=linux
+-ExecStart=-/sbin/agetty %I 38400
++ExecStart=-/sbin/getty -L %I 115200 vt100
+ Restart=always
+ RestartSec=0
+ UtmpIdentifier=%I
+Index: systemd-37/units/serial-getty at .service.m4
+===================================================================
+--- systemd-37.orig/units/serial-getty at .service.m4
++++ systemd-37/units/serial-getty at .service.m4
+@@ -32,7 +32,7 @@
+
+ [Service]
+ Environment=TERM=vt100
+-ExecStart=-/sbin/agetty -s %I 115200,38400,9600
++ExecStart=-/sbin/getty -L %I 115200 vt100
+ Restart=always
+ RestartSec=0
+ UtmpIdentifier=%I
diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
new file mode 100644
index 0000000..d615bbf
--- /dev/null
+++ b/package/systemd/systemd.mk
@@ -0,0 +1,62 @@
+#############################################################
+#
+# 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
+
+# Make sure that systemd will always be built after busybox so that we have
+# a consitent init setup between two builds
+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
+
+ 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
+ ln -fs ../../../../lib/systemd/system/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] 17+ messages in thread
* [Buildroot] [PATCH 1/5] Add the systemd package
2012-03-23 15:49 [Buildroot] [pull request v4] Pull request for branch for-2012.05/systemd Maxime Ripard
@ 2012-03-23 15:49 ` Maxime Ripard
2012-03-31 21:59 ` Peter Korsgaard
0 siblings, 1 reply; 17+ messages in thread
From: Maxime Ripard @ 2012-03-23 15:49 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 | 20 +++++++
package/systemd/systemd-37-fix-getty-unit.patch | 34 ++++++++++++
package/systemd/systemd.mk | 62 +++++++++++++++++++++++
package/udev/udev.mk | 4 ++
6 files changed, 125 insertions(+), 0 deletions(-)
create mode 100644 package/systemd/Config.in
create mode 100644 package/systemd/systemd-37-fix-getty-unit.patch
create mode 100644 package/systemd/systemd.mk
diff --git a/package/Config.in b/package/Config.in
index 85583c6..623c79a 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -577,6 +577,7 @@ source "package/rsyslog/Config.in"
source "package/sysklogd/Config.in"
source "package/sysvinit/Config.in"
endif
+source "package/systemd/Config.in"
source "package/util-linux/Config.in"
source "package/dsp-tools/Config.in"
endmenu
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..8df3318
--- /dev/null
+++ b/package/systemd/Config.in
@@ -0,0 +1,20 @@
+config BR2_PACKAGE_SYSTEMD
+ bool "systemd"
+ depends on BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV
+ depends on BR2_INET_IPV6
+ 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 /dev management with udev and ipv6 support)"
+ depends on !(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV && BR2_INET_IPV6)
diff --git a/package/systemd/systemd-37-fix-getty-unit.patch b/package/systemd/systemd-37-fix-getty-unit.patch
new file mode 100644
index 0000000..6df54b1
--- /dev/null
+++ b/package/systemd/systemd-37-fix-getty-unit.patch
@@ -0,0 +1,34 @@
+Prefer getty to agetty in console setup systemd units
+
+Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
+---
+ units/getty at .service.m4 | 2 +-
+ units/serial-getty at .service.m4 | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+Index: systemd-37/units/getty at .service.m4
+===================================================================
+--- systemd-37.orig/units/getty at .service.m4
++++ systemd-37/units/getty at .service.m4
+@@ -32,7 +32,7 @@
+
+ [Service]
+ Environment=TERM=linux
+-ExecStart=-/sbin/agetty %I 38400
++ExecStart=-/sbin/getty -L %I 115200 vt100
+ Restart=always
+ RestartSec=0
+ UtmpIdentifier=%I
+Index: systemd-37/units/serial-getty at .service.m4
+===================================================================
+--- systemd-37.orig/units/serial-getty at .service.m4
++++ systemd-37/units/serial-getty at .service.m4
+@@ -32,7 +32,7 @@
+
+ [Service]
+ Environment=TERM=vt100
+-ExecStart=-/sbin/agetty -s %I 115200,38400,9600
++ExecStart=-/sbin/getty -L %I 115200 vt100
+ Restart=always
+ RestartSec=0
+ UtmpIdentifier=%I
diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
new file mode 100644
index 0000000..fc49f3c
--- /dev/null
+++ b/package/systemd/systemd.mk
@@ -0,0 +1,62 @@
+#############################################################
+#
+# 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
+
+# Make sure that systemd will always be built after busybox so that we have
+# a consistent init setup between two builds
+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
+
+ 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
+ ln -fs ../../../../lib/systemd/system/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] 17+ messages in thread