1 |
On Tue, 28 May 2013 05:55:39 +0200 |
2 |
Luca Barbato <lu_zero@g.o> wrote: |
3 |
|
4 |
> On 5/26/13 4:58 PM, Ian Stakenvicius wrote: |
5 |
> > The way it's being proposed (and please correct me if i'm wrong), the |
6 |
> > wrapper is a direct replacement binary (small C program) for all init |
7 |
> > systems, and would based on some configuration file or whatnot |
8 |
> > determine and exec the init system it's supposed to -- and make any |
9 |
> > other necessary changes too, such as switching /etc/inittab) |
10 |
> |
11 |
> The really minimal wrapper would be something like |
12 |
> |
13 |
> #!/bin/sh |
14 |
> |
15 |
> INIT=/bin/init |
16 |
> |
17 |
> if [[ -e /etc/switch-init ]]; then |
18 |
> . /etc/switch-init |
19 |
> fi |
20 |
> |
21 |
> exec ${INIT} |
22 |
> |
23 |
> With switch-init doing stuff needed, including remounting the rootfs rw |
24 |
> if there are stuff to be changed and if we want stick to symlinks it |
25 |
> could replace itself by a symlink. |
26 |
> |
27 |
> Yes, it would be that simple. |
28 |
|
29 |
And you actually make the boot depend on: |
30 |
|
31 |
1) valid /bin/sh, |
32 |
|
33 |
2) valid /etc/switch-init which would not interfere with boot process. |
34 |
|
35 |
With switch-init being executed as a shell script, it can do anything. |
36 |
And I wouldn't be surprised if you made it do various things you'd like |
37 |
to be done. Not to mention what would happen if it gets corrupted into |
38 |
binary mess and shell tries to execute that. |
39 |
|
40 |
There's no fallback that could handle shell failures, you know. |
41 |
|
42 |
-- |
43 |
Best regards, |
44 |
Michał Górny |