Mail archive
alpine-devel

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

From: Natanael Copa <ncopa_at_alpinelinux.org>
Date: Fri, 29 Mar 2019 19:34:53 +0100

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.

> 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.

> 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.

> 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.

> 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



>
> Thanks.
>



---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Fri Mar 29 2019 - 19:34:53 UTC