:: [Dng] Boot sequence: was vdev statu…
Página Inicial
Delete this message
Reply to this message
Autor: Steve Litt
Data:  
Para: dng
Tópicos Antigos: Re: [Dng] Fwd: [dng] vdev status update
Assunto: [Dng] Boot sequence: was vdev status update
On Sat, 18 Apr 2015 00:08:54 -0400
Jude Nelson <judecn@???> wrote:


> The init program in example/initramfs/init goes into
> /usr/share/initramfs-tools/init, not /sbin/init :) The initramfs's
> init script is fundamentally different from the init program
> in /sbin. That also explains your inability to reboot.
>
> Basically, when the bootloader loads the initramfs, the kernel mounts
> it as the root device and starts /sbin/init. /sbin/init, in turn,
> runs the script at /init (which you can see from the initramfs shell
> with "ls /"), which is copied into the initramfs image by the
> update-initramfs and mkinitramfs tools from the
> file /usr/share/initramfs-tools/init.


Hi Jude,

Your description above differs from what I thought happens at boot.
Until reading your description, I had thought:

1) Boot loader runs kernel via the kernel device/path/name, passing it
the root partition device, and device/path/name locations of the
init program and the initramfs (if any).

2) Using the passed info, the kernel mounts the initramfs (if any) as
/, and then runs the initramfs' /sbin/init. Any processes started by
the initramfs init program are kernel process surrounded by square
brackets in the ps command.

3) If the initramfs init program completes, the kernel runs the init
program whose location was passed to it by the bootloader. However,
in Manjaro's initramfs init, the last line of the initramfs' init
program runs the on-disk init program whose location was passed to
the kernel by the bootloader. When the init program whose location
was passed to the kernel runs, it runs as PID 1, and can spawn (or
manage if desired) other programs.


So I guess the main difference in what you wrote and what I thought was
that I thought the bootloader didn't load the initramfs, but merely
passed along enough information so the kernel could mount it as / and
run its /sbin/init.

This is very timely because I'm in the middle of writing a web page on
the Linux boot sequence, aimed for a lay audience (people like me, not
people like you and Anto).

Thanks,

SteveT

Steve Litt
April 2015 featured book: Twenty Eight Tales of Troubleshooting
http://www.troubleshooters.com/28