All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: James Knight <james.d.knight@live.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/2] package/skeleton-init-systemd: copy over etc-factory content
Date: Sun, 1 Oct 2023 12:38:44 +0200	[thread overview]
Message-ID: <20231001103844.GK2579@scaer> (raw)
In-Reply-To: <SN4P221MB0682E582104B524681EBE0C9A0729@SN4P221MB0682.NAMP221.PROD.OUTLOOK.COM>

James, All,

On 2023-05-05 00:30 -0400, James Knight spake thusly:
> The systemd package will prepare the folder `/usr/share/factory/etc/`,
> which holds a series of default configuration files for a runtime
> state [1]. For example, the etc-factory repository holds the default
> template for `/etc/pam.d/system-auth` which is required in a default
> environment configured to use systemd with SELinux. Without this file
> prepared, login attempts will fail with the message:
> 
>     ... buildroot login[242]: PAM _pam_load_conf_file: unable to open config for system-auth
>     ...
> 
> To avoid this, when preparing the initial skeleton structure for systemd
> environments, copy over fallback configurations defined in etc-factory
> into the target's `etc` folder. If a file is already prepared at this
> state, these template files will be ignored.

Why is that not listed in the systemd tmpfiles, so that it is installed
when running systemd-tmpfiles, either at runtime by systemd on a r/w
filesystem, or at buildtime with BR2_INIT_SYSTEMD_POPULATE_TMPFILES ?

Also, none of our runtime tests for systemd exhibits this login issue:

    support/testing/tests/init/test_systemd.py
    support/testing/tests/init/test_systemd_selinux.py

Could you try to add a bit more explanations and context, please?

Regards,
Yann E. MORIN.

> [1]: https://www.freedesktop.org/software/systemd/man/file-hierarchy.html
> 
> Signed-off-by: James Knight <james.d.knight@live.com>
> ---
>  package/skeleton-init-systemd/skeleton-init-systemd.mk | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/package/skeleton-init-systemd/skeleton-init-systemd.mk b/package/skeleton-init-systemd/skeleton-init-systemd.mk
> index fb15552f99eafcc90bc5fa9dfcee3ad465492b81..4076821c0c0429cf90681f4b16be114c44bde282 100644
> --- a/package/skeleton-init-systemd/skeleton-init-systemd.mk
> +++ b/package/skeleton-init-systemd/skeleton-init-systemd.mk
> @@ -68,6 +68,13 @@ SKELETON_INIT_SYSTEMD_ROOTFS_PRE_CMD_HOOKS += SKELETON_INIT_SYSTEMD_CREATE_TMPFI
>  endif  # BR2_INIT_SYSTEMD_POPULATE_TMPFILES
>  
>  define SKELETON_INIT_SYSTEMD_INSTALL_TARGET_CMDS
> +	if [ -d $(TARGET_DIR)/usr/share/factory/etc ]; then \
> +		rsync -av --ignore-existing --remove-source-files \
> +			$(TARGET_DIR)/usr/share/factory/etc/ $(TARGET_DIR)/etc/; \
> +		rm -rf $(TARGET_DIR)/usr/share/factory/etc/; \
> +		rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share/factory; \
> +	fi
> +
>  	mkdir -p $(TARGET_DIR)/home
>  	mkdir -p $(TARGET_DIR)/srv
>  	mkdir -p $(TARGET_DIR)/var
> -- 
> 2.40.1.windows.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2023-10-01 10:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-05  4:30 [Buildroot] [PATCH 1/2] package/skeleton-init-systemd: copy over etc-factory content James Knight
2023-10-01 10:38 ` Yann E. MORIN [this message]
2024-06-19 15:12   ` James Knight

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=20231001103844.GK2579@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=james.d.knight@live.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.