From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: James Knight via buildroot <buildroot@buildroot.org>
Cc: James Knight <james.knight@collins.com>
Subject: Re: [Buildroot] [PATCH 1/2] package/skeleton-init-openrc: prepare runlevels from make over skeleton
Date: Tue, 7 Feb 2023 22:20:54 +0100 [thread overview]
Message-ID: <20230207222054.39573a80@windsurf> (raw)
In-Reply-To: <20220622212045.573-1-james.knight@collins.com>
Hello James,
On Wed, 22 Jun 2022 17:20:44 -0400
James Knight via buildroot <buildroot@buildroot.org> wrote:
> The following commit changes the creation of an OpenRC environment's
> `/etc/runlevels/default/sysv-rcs` symbolic link from the skeleton to
> inside the package's Makefile (triggered from the
> `SKELETON_INIT_OPENRC_INSTALL_TARGET_CMDS` call). The original symlink
> to a `/etc/init.d/sysv-rcs` path may not gracefully work for all
> developer environments. For example, on a fresh checkout in a Windows
> environment, the symbolic link may be automatically updated to
> include a drive specification. For example:
>
> $ git diff
> diff --git a/package/skeleton-init-openrc/skeleton/etc/runlevels/default/sysv-rcs b/package/skeleton-init-openrc/skeleton/etc/runlevels/default/sysv-rcs
> index ef5e00823c..e417b4bb44 120000
> --- a/package/skeleton-init-openrc/skeleton/etc/runlevels/default/sysv-rcs
> +++ b/package/skeleton-init-openrc/skeleton/etc/runlevels/default/sysv-rcs
> @@ -1 +1 @@
> -/etc/init.d/sysv-rcs
> \ No newline at end of file
> +G:/etc/init.d/sysv-rcs
> \ No newline at end of file
>
> If a developer built with fresh checkout using an example
> `qemu_x86_defconfig` tailored to target an OpenRC init system, an
> improper symlink can be observed in the target system:
>
> ...
> Welcome to Buildroot
> buildroot login: root
> Jun 22 20:42:34 login[971]: root login on 'console'
> # /etc/runlevels/default/sysv-rcs --version
> -sh: /etc/runlevels/default/sysv-rcs: not found
> # readlink /etc/runlevels/default/sysv-rcs
> /??/G:/etc/init.d/sysv-rcs
> # /etc/init.d/sysv-rcs --version
> sysv-rcs (OpenRC) 0.43.3 (Buildroot 2022.05-225-g64390b6c42-dirty)
>
> By switching from having the symbolic link in the skeleton file to
> building it during the package's install stage, this (1) prevents
> oddities with a Git working environment on environments like Windows,
> as well as (2) ensures a proper symlink is created in a Windows
> environment. For example:
>
> # readlink /etc/runlevels/default/sysv-rcs
> /etc/init.d/sysv-rcs
> # /etc/runlevels/default/sysv-rcs --version
> sysv-rcs (OpenRC) 0.43.3 (Buildroot 2022.05-225-g64390b6c42-dirty)
>
> Signed-off-by: James Knight <james.knight@collins.com>
Thanks for the patch, but the proposed solution is not really
desirable, and in fact is probably not the full explanation. Indeed,
the OpenRC skeleton in package/skeleton-init-openrc/skeleton/ has
plenty of other symlinks, and you didn't complain about them.
However, one key difference between the symlinks in
package/skeleton-init-openrc/skeleton/ and the sysv-rcs symlink your
patch is fixing is that the former symlinks have a relative path to the
target, while the latter have a relative path to the target.
Could you try instead to change this symlink to use a relative path to
its target?
Thanks!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
prev parent reply other threads:[~2023-02-07 21:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-22 21:20 [Buildroot] [PATCH 1/2] package/skeleton-init-openrc: prepare runlevels from make over skeleton James Knight via buildroot
2022-06-22 21:20 ` [Buildroot] [PATCH 2/2] .gitattributes: default lf line endings for text files James Knight via buildroot
2022-06-23 5:51 ` James Hilliard
2022-06-23 15:35 ` [Buildroot] [External] " Knight, James D - Collins via buildroot
2022-09-18 9:32 ` [Buildroot] " Arnout Vandecappelle
2023-02-07 21:20 ` Thomas Petazzoni via buildroot [this message]
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=20230207222054.39573a80@windsurf \
--to=buildroot@buildroot.org \
--cc=james.knight@collins.com \
--cc=thomas.petazzoni@bootlin.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox