All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baruch Siach <baruch@tkos.co.il>
To: "José Pekkarinen" <jose.pekkarinen@unikie.com>
Cc: buildroot@busybox.net
Subject: Re: [Buildroot] [PATCH] Fix restorecond startup for sysvinit builds
Date: Fri, 23 Jul 2021 17:42:44 +0300	[thread overview]
Message-ID: <874kclytuj.fsf@tarshish> (raw)
In-Reply-To: <20210723124754.46568-1-jose.pekkarinen@unikie.com>

Hi José,

On Fri, Jul 23 2021, José Pekkarinen wrote:
> Currently restorecond init script sources the
> file /etc/rc.d/init.d/functions, that in some
> init systems, like sysvinit, may not be available,
> however, it doesn't actually uses any function
> from it.
>
> Also, the init script uses daemon, that is not
> marked as a dependency. So this patches adds its
> dependency to guarantee it's present in the build.
>
> Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
> ---
>  package/restorecond/Config.in      |  2 +
>  package/restorecond/S20restorecond | 86 ++++++++++++++++++++++++++++++
>  package/restorecond/restorecond.mk |  4 +-
>  3 files changed, 90 insertions(+), 2 deletions(-)
>  create mode 100644 package/restorecond/S20restorecond
>
> diff --git a/package/restorecond/Config.in b/package/restorecond/Config.in
> index 31f85f2882..c2e773eace 100644
> --- a/package/restorecond/Config.in
> +++ b/package/restorecond/Config.in
> @@ -4,11 +4,13 @@ config BR2_PACKAGE_RESTORECOND
>  	depends on BR2_USE_WCHAR # libglib2
>  	depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2
>  	depends on !BR2_STATIC_LIBS # libselinux
> +	depends on BR2_PACKAGE_DAEMON # daemon

No need to depend on package you select.

>  	select BR2_PACKAGE_DBUS
>  	select BR2_PACKAGE_DBUS_GLIB
>  	select BR2_PACKAGE_LIBGLIB2
>  	select BR2_PACKAGE_LIBSELINUX
>  	select BR2_PACKAGE_LIBSEPOL
> +	select BR2_PACKAGE_DAEMON

Since BR2_PACKAGE_RESTORECOND depends on MMU and THREADS already, there
is no need to add dependencies. But it would be nice to add "daemon"
in the comment next to these dependencies above.

>  	help
>  	  restorecond is a daemon that watches for file creation and
>  	  then sets the default SELinux file context for that file.

[...]

> diff --git a/package/restorecond/restorecond.mk b/package/restorecond/restorecond.mk
> index 7ab7e978dd..1546661baf 100644
> --- a/package/restorecond/restorecond.mk
> +++ b/package/restorecond/restorecond.mk
> @@ -9,7 +9,7 @@ RESTORECOND_SITE = https://github.com/SELinuxProject/selinux/releases/download/2
>  RESTORECOND_LICENSE = GPL-2.0
>  RESTORECOND_LICENSE_FILES = COPYING
>  
> -RESTORECOND_DEPENDENCIES = libglib2 libsepol libselinux dbus-glib
> +RESTORECOND_DEPENDENCIES = libglib2 libsepol libselinux dbus-glib daemon

This is a run-time dependency, right? If so there is no need for daemon
to build before restorecond. But add a "runtime" comment next to
select BR2_PACKAGE_DAEMON.

baruch

>  
>  # Undefining _FILE_OFFSET_BITS here because of a "bug" with glibc fts.h
>  # large file support.
> @@ -27,7 +27,7 @@ define RESTORECOND_BUILD_CMDS
>  endef
>  
>  define RESTORECOND_INSTALL_INIT_SYSV
> -	$(INSTALL) -m 0755 -D $(@D)/restorecond.init \
> +	$(INSTALL) -m 0755 -D package/restorecond/S20restorecond \
>  		$(TARGET_DIR)/etc/init.d/S20restorecond
>  endef


-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

  reply	other threads:[~2021-07-23 14:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23 12:47 [Buildroot] [PATCH] Fix restorecond startup for sysvinit builds José Pekkarinen
2021-07-23 14:42 ` Baruch Siach [this message]
2021-07-26  5:06   ` José Pekkarinen
2021-07-24 21:36 ` Thomas Petazzoni
2021-07-26  5:29   ` José Pekkarinen

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=874kclytuj.fsf@tarshish \
    --to=baruch@tkos.co.il \
    --cc=buildroot@busybox.net \
    --cc=jose.pekkarinen@unikie.com \
    /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.