1 |
On Tue, Aug 6, 2019 at 7:39 PM Ian Zimmerman <itz@××××××××××××.org> wrote: |
2 |
> |
3 |
> On 2019-08-06 12:28, Rich Freeman wrote: |
4 |
> |
5 |
> > > Arguing against this trivial (and IMHO, elegant) solution is tilting |
6 |
> > > at windmills. Specially if it is for ideological reasons instead of |
7 |
> > > technical ones. |
8 |
> |
9 |
> > Some of the solutions I've seen tossed out in this thread are more |
10 |
> > complex than just building your own initramfs from scratch. |
11 |
> > |
12 |
> > An initramfs is just a userspace bootloader that runs on top of linux. |
13 |
> > Nobody has any problem with conventional bootloaders, and if you want |
14 |
> > to do anything with one of those you have to muck around in low-level |
15 |
> > C or assembly. |
16 |
> |
17 |
> There is a difference, and that difference is the reason I dislike |
18 |
> initramfs, not one of the other possible reasons you hypothesize. The |
19 |
> difference is that real Unix processes (not just kernel threads and not |
20 |
> just PID 1) survive from the initramfs stage into the "real Unix" |
21 |
> stage. It's like being able to trace matter back before the Big Bang. |
22 |
|
23 |
They only persist if you allow them to. Most implementations I've |
24 |
seen don't leave anything behind. |
25 |
|
26 |
Typically an initramfs will unlink everything inside, kill any stray |
27 |
processes (if it even forks anything in the first place), and then |
28 |
will exec the new init from the previous init. That starts up init as |
29 |
PID 1 with nothing else running, and no trace of the initramfs |
30 |
remaining. |
31 |
|
32 |
But, sure, you can stick a fork bomb in an initramfs and have it |
33 |
create 10GB of junk in the ramfs as well so that you boot up a |
34 |
crippled system if you really want to. |
35 |
|
36 |
Unless something has changed the kernel is actually built with an |
37 |
empty initramfs built-in by default which loads no matter what. So, |
38 |
the framework of an initramfs is always there, and the only thing that |
39 |
changes is whether it does anything. |
40 |
|
41 |
-- |
42 |
Rich |