From: Adrian Freihofer <adrian.freihofer@gmail.com>
To: gavrosc@yahoo.com, richard.purdie@linuxfoundation.org
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH] initramfs-framework: remove hard dependency with busybox
Date: Thu, 10 Apr 2025 23:27:38 +0200 [thread overview]
Message-ID: <ce4a1e37f12e7951bf19c3abc2a2b8e6a1f212d5.camel@gmail.com> (raw)
In-Reply-To: <CAMKF1spsxXoWi_GMqcBqip7yvJGSvsPMXe3RXGBi8FfLaDMdNg@mail.gmail.com>
On Sat, 2025-03-29 at 09:29 -0700, Khem Raj via lists.openembedded.org
wrote:
> On Sat, Mar 29, 2025 at 9:01 AM Christos Gavros via
> lists.openembedded.org <gavrosc=yahoo.com@lists.openembedded.org>
> wrote:
> >
> > hi Adrian
> >
> > thank you for the comment. I had a look in commits log and it looks
> > that '-c' was there since the beginning in 2008/09/10 in script
> > 'init-live.sh' and then moved in 'finish.sh' in 2011/12/08.
> > I reproduced the issue by using qemu and I described how I did it
> > in detail in bug #15716.
> > After I applied the change I tested both busybox and packagegroup-
> > core-base-utils. The boot was successful in both cases.
> > Also '-c' is an option in busybox:
> > https://www.busybox.net/downloads/BusyBox.html
> >
>
> -c option is to redirect the console after switching root. Some
> devices it did not work properly because util-linux version moved the
> pseudo filesystems like /dev automatically
> but busybox version did not, maybe things have changed but I would
> suggest that this operation is now happening with both switch_root
> versions with you script manually doing so.
I tested this on a device with kernel 6.1+. It seams to work as
expected also with a busybox based initramfs. Maybe you are right and
this is more like a legacy thing which can (or even should?) be
removed.
Additionally I looked into the code from busybox. The related lines
are:
if (console) {
close(0);
xopen(console, O_RDWR);
xdup2(0, 1);
xdup2(0, 2);
}
https://github.com/brgl/busybox/blob/master/util-linux/switch_root.c#L143
At least on my device this would just close /dev/console and open it
again. Not really useful.
I think the patch is beneficial for probably all kind of systems.
Adrian
>
> > I will wait for more comments and then I will extend the commit
> > message and send a v2.
> >
> > Br
> > Christos
> >
> >
> >
> >
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#213886):
> https://lists.openembedded.org/g/openembedded-core/message/213886
> Mute This Topic: https://lists.openembedded.org/mt/111959232/4454582
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe:
> https://lists.openembedded.org/g/openembedded-core/unsub [
> adrian.freihofer@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
next prev parent reply other threads:[~2025-04-10 21:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250328180456.90413-1-gavrosc.ref@yahoo.com>
2025-03-28 18:04 ` [PATCH] initramfs-framework: remove hard dependency with busybox Christos Gavros
2025-03-29 13:45 ` [OE-core] " Adrian Freihofer
2025-03-29 16:01 ` Christos Gavros
2025-03-29 16:29 ` [OE-core] " Khem Raj
2025-04-10 21:27 ` Adrian Freihofer [this message]
2025-04-11 9:40 ` Richard Purdie
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=ce4a1e37f12e7951bf19c3abc2a2b8e6a1f212d5.camel@gmail.com \
--to=adrian.freihofer@gmail.com \
--cc=gavrosc@yahoo.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=richard.purdie@linuxfoundation.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