[arch-projects] [mkinitcpio][PATCH] check if module is builtin kernel in add_module

Eli Schwartz eschwartz at archlinux.org
Sun Sep 10 17:26:09 UTC 2017


On 09/10/2017 06:21 AM, BlackEagle via arch-projects wrote:
> When we want to make sure a module is added to initcpio, but the module
> is built in the kernel, we now get an error the module is not found.
> Therefore we should check if the module is builtin and don't fail when
> its found there.
> 
> example: when sd_mod is built in your kernel you got an error before
> 
> ==> ERROR: module not found: `sd_mod'
> 
> but the module can be found in /lib/modules/$KERNELNAME/modules.builtin
> 'kernel/drivers/scsi/sd_mod.ko'

I'm a bit confused, since I don't get such errors even though I have
btrfs as a builtin.


>      if (( !found )); then
> +        if grep "$target" "$_optmoduleroot/lib/modules/$KERNELVERSION/modules.builtin" > /dev/null 2>&1; then
> +            return 0
> +        fi
>          (( ign_errors || _addedmodules["$target"] )) && return 0

Specifically, this `|| _addedmodules["$target"]` was added in commit
c90eb88f04c6acf621e9682172636fae3d0328ad which fixed temporary errors I
was getting.

>          error "module not found: \`%s'" "$target"
>          return 1
> --
> 2.14.1
> 


-- 
Eli Schwartz

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.archlinux.org/pipermail/arch-projects/attachments/20170910/aa005629/attachment.asc>


More information about the arch-projects mailing list