:: Re: [DNG] busybox init
Forside
Slet denne besked
Besvar denne besked
Skribent: Didier Kryn
Dato:  
Til: dng
Emne: Re: [DNG] busybox init
Le 03/01/2022 à 21:27, tito via Dng a écrit :
> On Mon,  3 Jan 2022 18:45:28 +0100 (CET)
> karl@??? wrote:
>
>>   I have used busybox init for a while. It differs from sysvinit
>> by not having runlevels, except perhaps on and off.
>>
>> Busybox repo is at: git://busybox.net/busybox.git
>> Website at: https://busybox.net/
>> Comment re. systemd: https://busybox.net/kill_it_with_fire.txt
>>
>> Example inittab at:
>>   https://git.busybox.net/busybox/tree/examples/inittab
>> excerpt:
>>
>> # Note: BusyBox init works just fine without an inittab. If no inittab is
>> # found, it has the following default behavior:
>> #       ::sysinit:/etc/init.d/rcS
>> #       ::askfirst:/bin/sh
>> #       ::ctrlaltdel:/sbin/reboot
>> #       ::shutdown:/sbin/swapoff -a
>> #       ::shutdown:/bin/umount -a -r
>> #       ::restart:/sbin/init
>> #       tty2::askfirst:/bin/sh
>> #       tty3::askfirst:/bin/sh
>> #       tty4::askfirst:/bin/sh
>>
>> The sysinit thing is a how you start the system, it's just
>> one script /etc/init.d/rcS (or where you prefer to place it).
>>
>> One could possible (not tested) mimic sysvinit bootup by having
>>   for i in /etc/rc2.d/S*; do $i start; done
>> in the rcS file or if you prefer you can have your own handwritten
>> and tuned script there.
>>
>> Would there be any interests having a busybox_init package which
>> I could possible maintain (with a little help) ?
>>
>> Regards,
>> /Karl Hammar
>>
> Hi,
> just to add my 2 cents.
>
> I would build a static compiled busybox binary with:
>
> init
> a shell
> reboot, shutdown
> swapon/swapoff
> mount, umount
> (start-stop-daemon)
> (getty, login)

    AFAIR you would also need cttyhack, setsid and a few others I've
forgotten if you want to be able to debug it.
>
> able to fully bring up a system.
> We could call it systemB like the other one but _B_etter.
> Then we implant it as blob into the kernel image
> so that we get rid also of initrds creating a
> PAC man like GNU/Linux/systemB/Frankenstein monster
> that eats all little sysDs.
>

    This wasn't the proposal of Karl. He just suggested a KISS
replacement for sysvinit. But it does not solve the issue of the
complexity of the RC scripts: they remain exactly the same and this is
the main (only ?) issue with them.

    The boot time is no longer an issue with faster cpus and disks. My
laptop takes 20s to boot Chimaera and the longest is the kernel, not the
RC scripts. I've stopped several years ago to use any mode of suspend.
On Dell servers, the BIOS startup takes at least 10 times as long as
Linux boot.

--     Didier