Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id AE1287810D6 for <~alpine/users@lists.alpinelinux.org>; Fri, 27 May 2022 17:16:54 +0000 (UTC) Received: by mail-pg1-f171.google.com with SMTP id 137so4433680pgb.5 for <~alpine/users@lists.alpinelinux.org>; Fri, 27 May 2022 10:16:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=pnEbcDX02QJ70dtqBaWMqwXsSA7pb4kQKEJR5NJMCzU=; b=dO03EwnwxzfYjjHsVlZhZaZoY6dSfehsSLc/SWo9x6z99Fz3JyPjlx3SS3nsEboRUH OkjhQ4eQUIPmpGIMicpoqVFYJhTZ5Qm+JStUxk+wd2Hv/l+bvTF31SUQ9yLI+/+6b1+u xuw2p4yA0WQZL3CRZMqWSV5gn/lquAhLO7lKJDTsMjqopcOoc0LvKrXitpSazgtySBMz CnFnens55ISt9E+ixqS8NNQhN8zXz7tyEhZ6J2k3KG4Tb0AZypbedlOA5Dv108WGyCb+ 4NMSHDxTyQMBes3k5y+8PM3CFibEnKA8qlxQqzb2Fvb9p2CL3HX7ZCwtTV8fDNLwUbPw xuMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=pnEbcDX02QJ70dtqBaWMqwXsSA7pb4kQKEJR5NJMCzU=; b=SUZGp5tfcpGwclHXJTOXHoh+Z2wuuZniATCRatLHi9jpvqhC4TxK423JJtbTSWQxl/ AYujFVGCOUFRDTElwftyDo6j66PEvlDLCGr2zio0/h5K5m5MZN8qVMDiVx/7Iw6100JX JZMl67Qb0HiKwnkfIpE9iaTGqAZmKQWjWOG1gtrJvxqdf1e2kAVuGd1mAHZgKx3b/zfb KKK5JqV1YD1nBe/Oarlm2A/rfF5ap7WF3dGaHZE8hw4z/B+6L4e1VukYzjcRQOrS0aJh YSXAwmrXckwxU7rtx9QV/zV5MltR0zkjw8UQPQqWei06WRL5aVTkBu2pwK1QqBHIHjc/ aOGg== X-Gm-Message-State: AOAM533YGpXtAHpA8smIwABYIvuaL7IaJzzTNJCe+rbMtDLq8afPtp/q KxIgcccPHImsr0lrJSFDn1y8SxuCon4wi38XeEih9ykHSGQ= X-Google-Smtp-Source: ABdhPJx2/qpHifRqYXuNA1xa9qL6P6KqFYx6MTCPXhYOh5OaftT4H81yLKU4FPg1Jfyp+RAjLGe87jEpWPAVgpaOoyY= X-Received: by 2002:a63:88:0:b0:3c1:7261:9110 with SMTP id 130-20020a630088000000b003c172619110mr37400885pga.9.1653671812671; Fri, 27 May 2022 10:16:52 -0700 (PDT) MIME-Version: 1.0 From: Hokus Pokus Date: Fri, 27 May 2022 19:16:41 +0200 Message-ID: Subject: Alpine linux kernel modules loading To: ~alpine/users@lists.alpinelinux.org Content-Type: multipart/alternative; boundary="000000000000f82ec505e001785b" --000000000000f82ec505e001785b Content-Type: text/plain; charset="UTF-8" Hi all, I have a question related to kernel modules loading on Alpine Linux. The system I am working with is Alpine Extended 3.15.4 with kernel 5.15.32-0-lts. So far I found that kernel modules are loaded via: 1) Modules passed as kernel arguments (cat /proc/cmdline) modules=sd-mod,usb-storage,ext4 Above is processed by the initramfs init (product of mkinitfs) and modprobe is called for every module on the argument list. 2) mdev hotplug modules load: /etc/mdev.conf: $MODALIAS=.* root:root 0660 @modprobe -q -b "$MODALIAS" This is for hotplug devices and modules for them. 3) OpenRC calling /etc/init.d/modules which process: - /lib/modules-load.d/*.conf - /etc/modules - /etc/modules-load.d/*.conf - /run/modules-load.d/*.conf Then modprobe is called for valid entries in above files. 4) OpenRC calling /etc/init.d/hwdrivers This one search /sys for modalias files and tries to load matching modules using modprobe ("cold" hardware modules). If I miss something and there is yet another level of modules loading? Explanation: I am creating Alpine initramfs.cpio using mkinitfs. The plan is to build a custom initramfs to play with. My initramfs will not switch_root to HDD at the end but will live in RAM only. To achieve this I want to replace original init script created by mkinitfs with my own. I have /sys, /dev and /proc setup ready and most of the script done. Only remaining part is kernel modules loading. The naive approach would be to just create list of modules that needs to be loaded and call modprobe for all of them. This would work as long as hardware will not change. I want to make it more intelligent and merge OpenRC logic (/etc/init.d/modules, /etc/init.d/hwdrivers). I am wondering if this will be enough to make it working or OpenRC is doing something more, not presented in those scripts. Best regards, Pawel --000000000000f82ec505e001785b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi all,

I have a question re= lated to kernel modules loading
on Alpine Linux. The system I am = working with is
Alpine Extended 3.15.4 with kernel 5.15.32-0-lts.=

So far I found that kernel modules are loaded= via:

1) Modules passed as kernel arguments (cat /= proc/cmdline)
modules=3Dsd-mod,usb-storage,ext4
Abo= ve is processed by the initramfs init (product of mkinitfs)
and m= odprobe is called for every module on the argument list.

2) mdev hotplug modules load:
/etc/mdev.conf:
$M= ODALIAS=3D.* root:root 0660 @modprobe -q -b "$MODALIAS"
This is for hotplug devices and modules for them.

=
3) OpenRC calling /etc/init.d/modules which process:
- /lib/= modules-load.d/*.conf
- /etc/modules
- /etc/modules-loa= d.d/*.conf
- /run/modules-load.d/*.conf
Then modprobe i= s called for valid entries in above files.

4) Open= RC calling /etc/init.d/hwdrivers
This one search /sys for modalia= s files and tries to load
matching modules using modprobe ("= cold" hardware modules).

If I miss something = and there is yet another level of
modules loading?

=
Explanation:
I am creating Alpine initramfs.cpio u= sing mkinitfs.
The plan is to build a custom initramfs to play wi= th.
My initramfs will not switch_root to HDD at the end
but will live in RAM only. To achieve this I want
to replace ori= ginal init script created by mkinitfs with my own.
I have /sys, /= dev and /proc setup ready and most of the script done.
Only r= emaining part is kernel modules loading.

The naive= approach would be to just create list of modules
that needs to b= e loaded and call modprobe for
all of them. This would work as lo= ng as hardware will not change.
I want to make it more intelligen= t and merge OpenRC
logic (/etc/init.d/modules, /etc/init.d/hwdriv= ers).
I am wondering if this will be enough to make it working
or OpenRC is doing something more, not presented in those scripts.<= br>

Best regards,
Pawel
--000000000000f82ec505e001785b--