lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOx-CDWzJWqYGhoJ4HPhio5-5zE025jYrmVpocryyxMfwfwsxw@mail.gmail.com>
Date:   Mon, 23 Oct 2023 17:06:38 +0600
From:   gmssixty gmssixty <gmssixty@...il.com>
To:     Randy Dunlap <rdunlap@...radead.org>
Cc:     linux-kernel@...r.kernel.org
Subject: Re: How can I add "busybox sh" as init during boot of the custom kernel?

On Mon, Oct 23, 2023 at 7:59 AM Randy Dunlap <rdunlap@...radead.org> wrote:
>
>
>
>
> > On Mon, Oct 23, 2023 at 6:15 AM Randy Dunlap <rdunlap@...radead.org> 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.
> >>
>
> On 10/22/23 17:34, gmssixty gmssixty wrote:
> > 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?
> >
>
> Please don't top-post.
>
> You need a file name after init=.
> "/bin/busybox sh" is not a file name AFAIK.
>
> To use /sbin/init, enter
>         init=/sbin/init
>
> To use bash (e.g.), enter
>         init=/usr/bin/bash
>
> The kernel init code already tries to use /sbin/init if that file is
> present, along with /etc/init, /bin/init, and /bin/sh .
>
>
> --
> ~Randy

What would I write in /sbin/init? I mean, what will be the content of
/sbin/init? Should I write: "exec /bin/busybox sh" in /sbin/init? Or
should I write "/bin/busybox sh" in /sbin/init?

BTW, what is top-post?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ