From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/3] package/s6-linux-init: Allow to install as init system
Date: Wed, 27 Mar 2019 19:43:12 +0100 [thread overview]
Message-ID: <20190327194312.163ffdee@windsurf> (raw)
In-Reply-To: <20190216212835.25503-3-vadim4j@gmail.com>
Hello Vadim,
On Sat, 16 Feb 2019 23:28:34 +0200
Vadim Kochan <vadim4j@gmail.com> wrote:
> +ifeq ($(BR2_INIT_S6),y)
> +
> +# Don't let Busybox to install it's own tools like poweroff, reboot, halt, etc
> +S6_LINUX_INIT_DEPENDENCIES += $(if $(BR2_PACKAGE_BUSYBOX),busybox)
The comment is not good: i doesn't prevent Busybox from installing
these programs, but it ensures Busybox is built before, and therefore
we have the ability to "win" over Busybox as we can overwrite those
programs.
However, this is not how we handle this situation. In fact, we handle
it in exactly the opposite way. In package/busybox/busybox.mk, we add
to BUSYBOX_DEPENDENCIES all packages that install programs that
"conflict" with Busybox applets. This way, we are sure they are built
before Busybox. And the installation process of Busybox has been
carefully modified to not overwrite an existing program by a Busybox
applet if this program already exists.
So, you should use the same model for s6-linux-init.
> +
> +S6_LINUX_INIT_MAKER_OPTS = -b /usr/bin -c /etc/s6
> +
> +ifeq ($(BR2_ROOTFS_DEVICE_CREATION_STATIC),y)
> +S6_LINUX_INIT_MAKER_OPTS += -d 0
> +else
> +S6_LINUX_INIT_MAKER_OPTS += $(if $(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS),,-d 1)
So you need -d1 in which cases ? Where udev is used ?
What about:
ifeq ($(BR2_ROOTFS_DEVICE_CREATION_STATIC),y)
S6_LINUX_INIT_MAKER_OPTS += -d 0
else ifeq ($(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV)$(BR2_PACKAGE_HAS_UDEV),y)
S6_LINUX_INIT_MAKER_OPTS += -d 1
endif
or something like that ?
> +endif
> +
> +ifeq ($(BR2_TARGET_GENERIC_GETTY),y)
> +S6_LINUX_INIT_MAKER_OPTS += -G "/sbin/getty -L \
> + $(SYSTEM_GETTY_OPTIONS) \
> + $(SYSTEM_GETTY_PORT) \
> + $(SYSTEM_GETTY_BAUDRATE) \
> + $(SYSTEM_GETTY_TERM)"
I'd say keep this on one single line.
> +endif
> +
> +define S6_LINUX_INIT_INSTALL_INIT
> + ln -sf ../etc/s6/init $(TARGET_DIR)/sbin/init
> +
> + ln -sf /usr/bin/s6-reboot $(TARGET_DIR)/sbin/reboot
> + ln -sf /usr/bin/s6-poweroff $(TARGET_DIR)/sbin/poweroff
> + ln -sf /usr/bin/s6-halt $(TARGET_DIR)/sbin/halt
> +
> + echo "#! /usr/bin/execlineb -P" > $(@D)/rc.init
What is this empty script doing ? Perhaps we should have it as a file
in package/s6-linux-init/ instead of generating it.
> + $(INSTALL) -m 0755 $(@D)/rc.init $(TARGET_DIR)/etc/rc.init
> + echo "#! /usr/bin/execlineb -P" > $(@D)/rc.shutdown
> + $(INSTALL) -m 0755 $(@D)/rc.shutdown $(TARGET_DIR)/etc/rc.shutdown
Same question about what this empty script is doing.
> + rm -rf $(TARGET_DIR)/etc/s6
Any reason to have this rm -rf ?
> + $(HOST_DIR)/bin/s6-linux-init-maker $(S6_LINUX_INIT_MAKER_OPTS) $(TARGET_DIR)/etc/s6
> +endef
> +S6_LINUX_INIT_POST_INSTALL_TARGET_HOOKS += S6_LINUX_INIT_INSTALL_INIT
> +
> +endif # BR2_INIT_S6
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2019-03-27 18:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-16 21:28 [Buildroot] [PATCH 0/3] init: Add s6 as init system Vadim Kochan
2019-02-16 21:28 ` [Buildroot] [PATCH 1/3] package/s6-linux-init: Build also for the host Vadim Kochan
2019-03-27 16:55 ` Thomas Petazzoni
2019-04-02 15:48 ` Vadym Kochan
2019-02-16 21:28 ` [Buildroot] [PATCH 2/3] package/s6-linux-init: Allow to install as init system Vadim Kochan
2019-03-27 18:43 ` Thomas Petazzoni [this message]
2019-04-02 15:57 ` Vadym Kochan
2019-02-16 21:28 ` [Buildroot] [PATCH 3/3] package/s6-rc: Allow to integrate s6-rc services Vadim Kochan
2019-03-27 18:54 ` Thomas Petazzoni
2019-03-27 20:35 ` Arnout Vandecappelle
2019-03-27 20:37 ` Arnout Vandecappelle
2019-03-28 14:23 ` Thomas Petazzoni
2019-04-02 16:08 ` Vadym Kochan
2019-03-28 14:22 ` Thomas Petazzoni
2019-04-02 21:23 ` Vadim Kochan
2019-04-02 22:19 ` Vadim Kochan
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=20190327194312.163ffdee@windsurf \
--to=thomas.petazzoni@bootlin.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox