You are not logged in.

#1 2015-01-02 14:02:19

iaw4
Member
Registered: 2014-11-28
Posts: 46

boot stage 1 to stage 2

I have learned how to manipulate the two boot stages (mkinitcpio and systemd).  stage 1 ends when it passes control to the stage 2 kernel.  at this point, what actually survives?

I am particularly wondering about file system mounts.  I know I can dump a squashfs into RAM in stage 1, and then mount it as a root (loop device) in stage 2.  there is also a remounting action later, but that is based on /etc/fstab.  interestingly, the RAM area survives to the new kernel.

experimenting to see what is and what is not immediately present at stage 2 is not so easy due to the asynchronous nature of systemd.  so, is there a whitepaper somewhere that explains this?

sincerely, /iaw

Offline

#2 2015-01-02 14:13:43

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,564
Website

Re: boot stage 1 to stage 2

I'm not sure where you are getting your terminology for the stages.  The only uses I've seen for boot stages refer to the bios loading the boot loader as stage one (often with several subsections, like loading the MBR, detecting the bootable partition, loading VBR).  Stage 2 I've only known to refer to bootloaders like syslinux and grub loading the final kernel (e.g. linux).  None of this involves mkinitcpio or systemd.

It sounds like you are not actually talking about the boot process, but rather the init process.  At the end of the boot process, the stage 2 bootloader loads the kernel along with an initramfs.  The init system then does much of what you are talking about.  It is easy to see what is present at this stage simply by replacing the init system with a kernel command line option (e.g., "init=/usr/bin/bash").


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2015-01-02 19:11:47

iaw4
Member
Registered: 2014-11-28
Posts: 46

Re: boot stage 1 to stage 2

yes, indeed.  my terminology was wrong.  and this is a great way to learn what survives and what does not.

regards,

/iaw

Offline

#4 2015-01-02 19:34:55

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: boot stage 1 to stage 2

Please read the sticky in this forum: Sysadmin is not for general queries about everything related to administering a system; "solutions and posts here are expected to provide value to the more competent GNU/Linux users and established members of the community."


Moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2015-01-02 23:18:12

iaw4
Member
Registered: 2014-11-28
Posts: 46

Re: boot stage 1 to stage 2

I guess I mistakenly thought I was relatively competent... ;-)

Offline

#6 2015-01-02 23:29:43

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: boot stage 1 to stage 2

iaw4 wrote:

I guess I mistakenly thought I was relatively competent... ;-)

Even the more competent occasionally ask a basic question. smile


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB