[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#961539: initramfs-tools-core: no error when modules listed in /etc/initramfs-tools/modules are missing



Package: initramfs-tools-core
Version: 0.133+deb10u1
Severity: wishlist

Dear Maintainer,

I have a system using Root on ZFS that failed to boot after a kernel
update, because the ZFS modules were not contained in the initramfs.
The source for the problem seems to be located in the DKMS handling of
the ZFS packages and will probably be fixed by a documentation update
in the Root on ZFS instructions -- see here:
https://github.com/openzfs/zfs/issues/10355

(root cause in short: update-initramfs ran before zfs-dkms had
 actually built the modules for the new kernel so the ZFS modules were
 missing and update-initramfs built an initramfs without the ZFS
 modules needed for boot)


= How does this relate to initramfs-tools-core?

The relation of that bug to initramfs-tools-core is as follows:

 - I had all ZFS modules added to /etc/initramfs-tools/modules

 - initramfs.conf(5) says:

   Modules listed in /etc/initramfs-tools/modules and
   /usr/share/initramfs-tools/modules.d/* are always
   included in the initramfs, and are loaded early
   in the boot process.


So while the manpage says the modules listed in the file
"are always included", they were missing from the initramfs.

This behaviour is not confined to ZFS modules, it will happen with any
modules that are listed in the modules files but missing in the file
sytem.



= What did I expect and what happened instead?

I did expect update-initramfs to fail when a module needed for the
boot is missing to prevent an unbootable system.

But instead update-initramfs completed successfully, the initramfs was
missing crucial modules and the system did not come up.


= What now?

I don't know what the course of action should be, thus only wishlist
priority for this bug:

If ignoring missing modules is the desired behaviour, I think an
additional note should be added to initramfs.conf(5) to relativize the
"are always included" statement.

Otherwise mkinitramfs should fail with an error message if a module
listed in one of the modules files is missing,


= Call chain

In my case, the call chain was:

 - /usr/sbin/update-initramfs:
      generate_initramfs()

 - /usr/sbin/mkinitramfs:
      code block <<# the "MODULES=list case.  Always honour.>>

 - /usr/share/initramfs-tools/hook-functions:
      add_modules_from_file()
      force_load()
      manual_add_modules()
      copy_file()

The last two functions interact like this:

 - copy_file() returns error code 2 when a source file is not found
   and thus can't be copied.

 - manual_add_modules() explicitely ignores the return code from
   copy_file() in this line:

   copy_file module "${kmod}" || continue


My guess is that ignoring a missing module is needed when mkinitramfs
is guessing which modules to include (MODULES=dep or MODULES=most),
but when a module should always be included, the error can't be
ignored.


-- System Information:
Debian Release: 10.4
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.19.0-9-amd64 (SMP w/2 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=de_DE.utf-8, LC_CTYPE=de_DE.utf-8 (charmap=UTF-8), LANGUAGE=de_DE.utf-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages initramfs-tools-core depends on:
ii  coreutils    8.30-3
ii  cpio         2.12+dfsg-9
ii  e2fsprogs    1.44.5-1+deb10u3
ii  klibc-utils  2.0.6-1
ii  kmod         26-1
ii  udev         241-7~deb10u4

Versions of packages initramfs-tools-core recommends:
ii  busybox  1:1.30.1-4
pn  pigz     <none>

Versions of packages initramfs-tools-core suggests:
ii  bash-completion  1:2.8-6

-- no debconf information

-- 
....Christian.Garbs....................................https://www.cgarbs.de

"Riko?" "Hmm?" "Did I ever tell you how beautiful you are?"
She smiled. "You tried once, but gave up."
                     (Hammer Time, Book One by Martin Rose)


Reply to: