Skip to main content
added 252 characters in body
Source Link

init= can take any executable

init= can take any executable, including shell scripts. The underlying reason is likely that the exec syscall can directly handle both ELF executables and shebangs.

Here for example I demonstrate how to create an arbitrary minimal C compiled init: How to create a custom Linux distro that runs just one program and nothing else?

So why would it not accept /bin/bash, of all things, which is just a regular executable, and can actually be useful? :-)

Next, you should also to try to understand what the trade-offs will be with your regular init such as systemd or Busybox'

Basically, with a raw /bin/bash, you:

Job control can be restored on Busybox' init and other similar inits with a leading - in the inittab:

tty3::respawn:-/bin/sh

The more normal inittab entries, which use login and keep spawning shells if you do Ctrl+D are:

::respawn:/sbin/getty -L ttyS0 0 vt100

which use the getty executable, but TODO: I haven't been able to spawn those myself without the Busybox init: getty start from command line?

You can use this setup to play around with it and reach the above conclusions.

init= can take any executable

init= can take any executable, including shell scripts.

Here for example I demonstrate how to create an arbitrary minimal C compiled init: How to create a custom Linux distro that runs just one program and nothing else?

So why would it not accept /bin/bash, of all things, which is just a regular executable, and can actually be useful? :-)

Next, you should also to try to understand what the trade-offs will be with your regular init such as systemd or Busybox'

Basically, with a raw /bin/bash, you:

Job control can be restored on Busybox' init and other similar inits with a leading - in the inittab:

tty3::respawn:-/bin/sh

The more normal inittab entries, which use login and keep spawning shells if you do Ctrl+D are:

::respawn:/sbin/getty -L ttyS0 0 vt100

which use the getty executable, but TODO: I haven't been able to spawn those myself without the Busybox init: getty start from command line?

You can use this setup to play around with it and reach the above conclusions.

init= can take any executable

init= can take any executable, including shell scripts. The underlying reason is likely that the exec syscall can directly handle both ELF executables and shebangs.

Here for example I demonstrate how to create an arbitrary minimal C compiled init: How to create a custom Linux distro that runs just one program and nothing else?

So why would it not accept /bin/bash, of all things, which is just a regular executable, and can actually be useful? :-)

Next, you should also to try to understand what the trade-offs will be with your regular init such as systemd or Busybox'

Basically, with a raw /bin/bash, you:

Job control can be restored on Busybox' init and other similar inits with a leading - in the inittab:

tty3::respawn:-/bin/sh

The more normal inittab entries, which use login and keep spawning shells if you do Ctrl+D are:

::respawn:/sbin/getty -L ttyS0 0 vt100

which use the getty executable, but TODO: I haven't been able to spawn those myself without the Busybox init: getty start from command line?

You can use this setup to play around with it and reach the above conclusions.

added 21 characters in body
Source Link

init= can take any executable

init= can take any executable, including shell scripts.

Here for example I demonstrate how to create an arbitrary minimal C compiled init: How to create a custom Linux distro that runs just one program and nothing else?

So why would it not accept /bin/bash, of all things, which is just a regular executable, and can actually be useful? :-)

Next, you should also to try to understand what the trade-offs will be with your regular init such as systemd or Busybox'

Basically, with a raw /bin/bash, you:

Job control can be restored on Busybox' init and other similar inits with a leading - in the inittab:

tty3::respawn:-/bin/sh

The more normal inittab entries, which use login and keep spawning shells if you do CtrlCtrl+D are:

::respawn:/sbin/getty -L ttyS0 0 vt100

which use the getty executable, but TODO: I haven't been able to spawn those myself without the Busybox init: getty start from command line?

You can use this setup to play around with it and reach the above conclusions.

init= can take any executable

init= can take any executable, including shell scripts.

Here for example I demonstrate how to create an arbitrary minimal C compiled init: How to create a custom Linux distro that runs just one program and nothing else?

So why would it not accept /bin/bash, of all things, which is just a regular executable, and can actually be useful? :-)

Next, you should also to try to understand what the trade-offs will be with your regular init such as systemd or Busybox'

Basically, with a raw /bin/bash, you:

Job control can be restored on Busybox' init and other similar inits with a leading - in the inittab:

tty3::respawn:-/bin/sh

The more normal inittab entries, which keep spawning shells if you do Ctrl

::respawn:/sbin/getty -L ttyS0 0 vt100

which use the getty executable, but TODO: I haven't been able to spawn those myself without the Busybox init: getty start from command line?

You can use this setup to play around with it and reach the above conclusions.

init= can take any executable

init= can take any executable, including shell scripts.

Here for example I demonstrate how to create an arbitrary minimal C compiled init: How to create a custom Linux distro that runs just one program and nothing else?

So why would it not accept /bin/bash, of all things, which is just a regular executable, and can actually be useful? :-)

Next, you should also to try to understand what the trade-offs will be with your regular init such as systemd or Busybox'

Basically, with a raw /bin/bash, you:

Job control can be restored on Busybox' init and other similar inits with a leading - in the inittab:

tty3::respawn:-/bin/sh

The more normal inittab entries, which use login and keep spawning shells if you do Ctrl+D are:

::respawn:/sbin/getty -L ttyS0 0 vt100

which use the getty executable, but TODO: I haven't been able to spawn those myself without the Busybox init: getty start from command line?

You can use this setup to play around with it and reach the above conclusions.

Source Link

init= can take any executable

init= can take any executable, including shell scripts.

Here for example I demonstrate how to create an arbitrary minimal C compiled init: How to create a custom Linux distro that runs just one program and nothing else?

So why would it not accept /bin/bash, of all things, which is just a regular executable, and can actually be useful? :-)

Next, you should also to try to understand what the trade-offs will be with your regular init such as systemd or Busybox'

Basically, with a raw /bin/bash, you:

Job control can be restored on Busybox' init and other similar inits with a leading - in the inittab:

tty3::respawn:-/bin/sh

The more normal inittab entries, which keep spawning shells if you do Ctrl

::respawn:/sbin/getty -L ttyS0 0 vt100

which use the getty executable, but TODO: I haven't been able to spawn those myself without the Busybox init: getty start from command line?

You can use this setup to play around with it and reach the above conclusions.