From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/6] Add the systemd package
Date: Tue, 20 Mar 2012 09:35:55 +0100 [thread overview]
Message-ID: <4F68416B.50604@free-electrons.com> (raw)
In-Reply-To: <201203200032.19236.arnout@mind.be>
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
next prev parent reply other threads:[~2012-03-20 8:35 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F68416B.50604@free-electrons.com \
--to=maxime.ripard@free-electrons.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.