Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Grant Edwards <grant.b.edwards@gmail.com>
To: buildroot@busybox.net
Cc: buildroot@uclibc.org
Subject: Re: [Buildroot] How to set target system PATH?
Date: Thu, 23 Jan 2025 17:32:50 -0000 (UTC)	[thread overview]
Message-ID: <vmtug2$bn$1@ciao.gmane.io> (raw)
In-Reply-To: 4b9b3ef0-afbe-4cf2-94c6-966496c4a92f@mind.be

On 2025-01-23, Arnout Vandecappelle via buildroot <buildroot@buildroot.org> wrote:
>
>
> On 23/01/2025 18:00, Grant Edwards wrote:
>> I've set the desired PATH in the config file:
>> 
>>    BR2_SYSTEM_DEFAULT_PATH="/bin:/sbin:/usr/bin:/usr/sbin:/apps/bin"
>> 
>> But that only seems to affect login shells, and not daemons started
>> from /etc/init.d.
>> 
>> How do I set the _system_ PATH rather than just the login shell PATH.
>
>   Good question! That depends on the init system (because that one is 
> responsible to set the path). I looked in the source, and it looks like both 
> systemd and busybox init hardcode it without any configuration option...
>
>   So unless you convince the maintainers of your favourite init system to 
> change, you won't be able to customize the system path.

Yea, I've been looking at the busybox init docs, and it doesn't look
like there's any way to add/change the environment variables.  It sure
would have been nice if that could be done in /etc/inittab.

I dug through the local archives, and it turns out I addressed this
problem once 13 years ago. I used a postbbuild script and sed commands
to insert a couple lines into etc/init.d/rcS to set/export PATH and
LD_LIBRARY_PATH.

IIRC, I wasn't very happy with that at the time, but I guess I'll have
to do it again.

--
Grant


_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      parent reply	other threads:[~2025-01-23 17:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-23 17:00 [Buildroot] How to set target system PATH? Grant Edwards
2025-01-23 17:18 ` Arnout Vandecappelle via buildroot
2025-01-23 17:30   ` Baruch Siach via buildroot
2025-01-23 17:48     ` Grant Edwards
2025-01-23 17:32   ` Grant Edwards [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='vmtug2$bn$1@ciao.gmane.io' \
    --to=grant.b.edwards@gmail.com \
    --cc=buildroot@busybox.net \
    --cc=buildroot@uclibc.org \
    /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