Mail archive
alpine-devel

Re: [alpine-devel] Some questions about initramfs-init.

From: Magicloud Magiclouds <magicloud.magiclouds_at_gmail.com>
Date: Sat, 30 Mar 2019 02:45:27 +0800

Thanks. I still do not get the arch part. Detail is after the question.

On Sat, Mar 30, 2019 at 2:35 AM Natanael Copa <ncopa_at_alpinelinux.org> wrote:
>
> On Sat, 30 Mar 2019 02:17:09 +0800
> Magicloud Magiclouds <magicloud.magiclouds_at_gmail.com> wrote:
>
> > Hi,
> >
> > I'd like to propose a rewrite of the initrd `init` script. Because I
> > think it is quite mixed up of booting logic, and missing some
> > customization possibilities.
> >
> > But before that, I need to get some questions clear. In following
> > discussion, "stage 1" means the initrd system (before switch_root),
> > "stage 2" means the actual system end user uses (after switch_root).
> >
> > 1. Why there is a keymap setup? I cannot see the necessity of it
> > except for fallback/single shell.
>
> We have support for encrypted apkovls, for "disk less" installs. You
> may need to type the password to decrypt the configuration.
Ah, I forgot that requirement.
>
> > 2. Why networking is after nlplug-findfs? Can I bring up network (if
> > needed) before nlplug-findfs?
>
> nlplug-findfs also serves as coldplug, and enumerates all the current
> devices so all kernel modules gets loaded. Without this there is no
> guarantee that the network driver is automatically detected and loaded.
I see.
>
> > 3. Since nlplug-findfs already output a repofile, why there is a
> > find_boot_repositories soon after to overwrite repofile?
>
> I will have to consult the source code and git log. I don't remember.
Just FYI, from line 520, if there is no network requirement,
nlplug-findfs (in line 528) gets the option "-b $repofile". Then in
line 667, $repofile is overwrite by find_boot_repositories.
>
> > 4. Since apk works without /etc/apk/arch, why overwrite it with `apk
> > --print-arch`, instead of just removing it?
>
> Because it was an upgrade path from 32bit x86 to 64 bit diskless
> installs. You can simply copy an apkovl from 32 bit install to a 64 bit
> boot USB and the entire install is 64 bit after that. Without the
> --print-arch logic it would error because it wouldnt find the packages.
I do not think I followed.

I can see the following case. Say my apkovl is 32bit, so
$sysroot/etc/apk/arch is x86 (I guess, I do not have a 32bit env to
check). So current logic overwrites it with x86_64, so following apk
bootstrap uses 64bit packages.

But if just removing the 32bit arch file, would not apk in new boot
USB (which contains 64 bit system) using 64bit packages by default?
>
> > 5. The script contains two ways of using repofile. One is using it
> > directly as "--repositories-file", the other is joining its content
> > with "--repository". What is the difference?
>
> IIRC, --repositories-file will replace the
> default /etc/apk/repositories, while --repository will append the
> specified repo to whatever is listed in /etc/apk/repositories
I see.
>
>
>
> >
> > Thanks.
> >
>


-- 
竹密岂妨流水过
山高哪阻野云飞
And for G+, please use magiclouds#gmail.com.
---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Sat Mar 30 2019 - 02:45:27 UTC