Re: How can I add "busybox sh" as init during boot of the custom kernel?

From: gmssixty gmssixty
Date: Sun Oct 22 2023 - 20:34:22 EST


I tried this: init=/bin/busybox sh, but it got Kernel panic and
failed. On the other hand, what should I write in /sbin/init?

On Mon, Oct 23, 2023 at 6:15 AM Randy Dunlap <rdunlap@xxxxxxxxxxxxx> wrote:
>
>
>
> On 10/22/23 16:56, gmssixty gmssixty wrote:
> > How can I add "busybox sh" as init during boot of the custom kernel? I
> > have compiled the kernel and put the bzImage in /dev/sda3 (/mnt/sda3).
> > Booted that kernel. After booting, I got a message to set the init
> > process. I have put the busybox in /bin. Now I want to add this
> > "busybox sh" as an init process. How can I do this?
> >
> > Note that, I did not install any other software in that /dev/sda3
> > (/mnt/sda3). I have only bzImage and busybox.
>
> from Documentation/admin-guide/kernel-parameters.txt:
> (or https://docs.kernel.org/admin-guide/kernel-parameters.html)
>
> init= [KNL]
> Format: <full_path>
> Run specified binary instead of /sbin/init as init
> process.
>
> --
> ~Randy