#872410 AHCI module not loaded when using preseed

Package:
debian-installer
Source:
debian-installer
Description:
Debian Installer documentation
Submitter:
Gilles MOREL
Date:
2019-12-19 10:39:02 UTC
Severity:
normal
#872410#5
Date:
2017-08-17 07:31:42 UTC
From:
To:
On some computer, when I start debian-installer with kernel option "vga=788 auto priority=critical url=<tftp url to preseed> hw-detect/load_firmware=false debian-installer/locale=fr_FR.UTF-8 debian-installer/language=fr debian-installer/country=FR keyboard-configuration/xkb-keymap=fr-latin9".

After some search, I noticed that the ahci kernel module was not loaded when I use preseed.

To help to solve the problem, I joined all available log from debian-installer and the preseed I use. About package source, http://repos.ati33.lan:3142 is a apt-cache-ng server, version 0.8.0-3. I use it in all package downloading for these computers.

About options, I added "hw-detect/load_firmware=false" since, on some hardware, the default option is to try to load firmware and debian-installer looped to try to load firmware, and I don't need firmware at this point.
I also eard that "priority=critical" were useless since I have "auto".
--
Gilles Émilien MOREL <contact@gilles-morel.fr>
Ce message et toutes les pièces jointes sont établis à l'intention exclusive de ses destinataires et sont confidentiels. L'intégrité de ce message n'étant pas assurée sur Internet, je ne peux être tenu responsable des altérations qui pourraient se produire sur son contenu. Il est donc possible que, dans ce message, apparaisse inopinément des émoticônes, des têtes de troll, un rickroll ou des phrases qui se terminent par le mot balançoire.

#872410#10
Date:
2017-08-17 15:48:10 UTC
From:
To:
Hi Gilles,

Gilles MOREL <contact@gilles-morel.fr> (2017-08-17):

This is strange, it seems the sata-modules udeb is fetched just fine,
I'm not sure why ahci wouldn't be loaded.

linux.git has this as its configuration:

    debian/installer/modules/sata-modules:drivers/ata/ahci* ?

so ahci* modules should end up in that udeb, and that's indeed the
case for what I can see.

Are you using brand new hardware for which support might be missing?
Is the non-preseed installation loading appropriate modules… on the
same HW as the failing preseed installation?


KiBi.

#872410#15
Date:
2017-08-17 20:55:13 UTC
From:
To:
Hi Cyril,

The ahci kernel module does exist in debian-installer, I can load manually and, then, the hard drive appears, but too late.
When I manually install, the kernel modules are correctly (that is to say xhci_pci AND ahci).
The hardware was bought in 2016.

I don't know about linux.git configuration, I don't use it in debian-installer.
--
Gilles Émilien MOREL <contact@gilles-morel.fr>
Ce message et toutes les pièces jointes sont établies à l'intention exclusive de ses destinataires et sont confidentiels. Si vous n'êtes pas le destinataire de ce message, merci de détruire votre ordinateur par le feu et d'avertir immédiatement les pompiers.
----- Message original ---------------- Cyril Brulebois <kibi@debian.org> à Gilles MOREL <contact@gilles-morel.fr>, 872410@bugs.debian.org le jeudi 17 août 2017 à 17:48:10 +0200 avec Mutt/1.5.23 (2014-03-12) Re: Bug#872410: AHCI module not loaded when using preseed --------------------------------------------------- Hi Gilles, Gilles MOREL <contact@gilles-morel.fr> (2017-08-17): This is strange, it seems the sata-modules udeb is fetched just fine, I'm not sure why ahci wouldn't be loaded. linux.git has this as its configuration: debian/installer/modules/sata-modules:drivers/ata/ahci* ? so ahci* modules should end up in that udeb, and that's indeed the case for what I can see. Are you using brand new hardware for which support might be missing? Is the non-preseed installation loading appropriate modules… on the same HW as the failing preseed installation? KiBi.
#872410#20
Date:
2017-08-17 21:50:28 UTC
From:
To:
Could this be due to a missing 'depmod' in the installer?

Ben.

#872410#25
Date:
2017-08-20 08:02:11 UTC
From:
To:
Hello,

I don't know this message is for me, but I don't know what is a 'depmod' and I don't know how to add one in the installer, considering I use the netinstaller from debian-installer-9-netboot-amd64 package.
--
Gilles Émilien MOREL <contact@gilles-morel.fr>
Pensez à l'environnement, imprimez ce message electronique et jetez le bien au tri sélectif.
----- Message original ---------------- Ben Hutchings <ben@decadent.org.uk> à Cyril Brulebois <kibi@debian.org>, 872410@bugs.debian.org, Gilles MOREL <contact@gilles-morel.fr> le jeudi 17 août 2017 à 22:50:28 +0100 avec Evolution 3.22.6-1 Re: Bug#872410: AHCI module not loaded when using preseed --------------------------------------------------- Could this be due to a missing 'depmod' in the installer? Ben.
#872410#30
Date:
2017-08-25 07:21:11 UTC
From:
To:
	Hello,

Is there any news about this bug?
Must I try something to help debug?
--
Gilles Émilien MOREL <contact@gilles-morel.fr>
Afin d'espérer une réponse de ma part, pensez à mettre votre numéro de carte bancaire dans votre couriel.
----- Message original ---------------- Cyril Brulebois <kibi@debian.org> à Gilles MOREL <contact@gilles-morel.fr>, 872410@bugs.debian.org le jeudi 17 août 2017 à 17:48:10 +0200 avec Mutt/1.5.23 (2014-03-12) Re: Bug#872410: AHCI module not loaded when using preseed --------------------------------------------------- Hi Gilles, Gilles MOREL <contact@gilles-morel.fr> (2017-08-17): This is strange, it seems the sata-modules udeb is fetched just fine, I'm not sure why ahci wouldn't be loaded. linux.git has this as its configuration: debian/installer/modules/sata-modules:drivers/ata/ahci* ? so ahci* modules should end up in that udeb, and that's indeed the case for what I can see. Are you using brand new hardware for which support might be missing? Is the non-preseed installation loading appropriate modules… on the same HW as the failing preseed installation? KiBi.
#872410#35
Date:
2017-09-04 15:20:21 UTC
From:
To:
	Hello,

Is that possible to have any nows about this bug, I still don't have any answer since mid-August.
Pearhaps you're working on it, but I don't know because I have no answer to my last two messages.

This is my first bug report, so I don't know how it is supposed to work.

Regards,
--
Gilles Émilien MOREL <contact@gilles-morel.fr>
Le premier tirage aléatoire est [39, 98, 56, 26, 89] et le second est [9, 9, 9, 9, 9]. Quel tirage est le plus aléatoire ?

#872410#40
Date:
2017-09-04 15:24:20 UTC
From:
To:
Hi,

Gilles MOREL <contact@gilles-morel.fr> (2017-09-04):

Well, I've been busy trying to put pieces together to release D-I Buster
Alpha 1. Now, your mails are amongst 800+ unread ones in my debian-boot@
folder. Maybe others have more free time than I have. In any cases, when
someone has time to look into your issue, you'll get a reply.


KiBi.

#872410#45
Date:
2018-04-30 15:24:22 UTC
From:
To:
Hello,

I have the same problem as reported here. Hardware is an Intel NUC7i5.

Digging a little deeper into the problem it looks like a timing issue to me.

The sata-modules udeb is loaded. It contains the ahci-module and after
"depmod -a" (line 33 @ bin/hw-detect) the ahci-module appears in
"modules.dep". So far everything seems to be fine.

The problem is around "update-dev" (line 233 @ bin/hw-detect). This
issues "udevadm trigger --action=add" but after that the ahci-module
is NOT loaded.

Delaying the "update-dev" command by adding a "sleep 3" in front of it
results in a normally loaded ahci-module. "sleep 2" isn't enough on my
hardware.

I've no idea why.

Interestingly: placing an "udevadm control --reload" in front of
"update-dev" instead of "sleep 3" does the job but it only delays the
"update-dev" command by less than 1 second.

Jörg

#872410#50
Date:
2018-05-02 16:25:35 UTC
From:
To:
Hello Gilles,

with this HACK you don't have to modify your kernel, initrd or
udeb-repository. Simply add this line to your preseed file:

d-i preseed/early_command string sed -i '/depmod -a > .dev.null 2>&1 ||
true/a modprobe ahci || true' /bin/hw-detect

It tries to modify /bin/hw-detect to unconditionally try to load the
ahci module after the "depmod -a"-command at the beginning of the
script. hw-detect is called (at least) 2 times before partitioning.
First for network-detect (at this time the sata-modules-udeb is
obviously not available and modprobe will fail) and a second time form
disk-detect. Now the sata-modules-udeb should have been installed
already and the ahci-module is ready to install - after "depmop -a" of
course.

This is no solution for the root cause of the problem.

To further investigate this it would be nice if you could confirm my
guess of a timing problem. For this you could add this line to your
preseed file (instead of the above of course):

d-i preseed/early_command string sed -i '/^update-dev >.dev.null$/i
sleep 10' /bin/hw-detect

or this:

d-i preseed/early_command string sed -i '/^update-dev >.dev.null$/i
udevadm control --reload' /bin/hw-detect

Hope this helps.

Jörg

#872410#55
Date:
2018-05-03 09:36:34 UTC
From:
To:
Hello Jörg,

All the lines you suggested me work for my problem. I put the third in my configuration.
--
Gilles Émilien MOREL <contact@gilles-morel.fr>
« Beaucoup de choses passent par le pipi de nos jours. » -- Thomas Cyrix
----- Message original ---------------- Jörg Schulz <jschulz@sgbs.de> à Gilles MOREL <contact@gilles-morel.fr> copie à 872410@bugs.debian.org le mercredi 02 mai 2018 à 18:25:35 +0200 avec Thunderbird 52.5.2 pour Linux x86_64 Re: Bug#872410: AHCI module not loaded when using preseed -------------------------------------------------- Hello Gilles, with this HACK you don't have to modify your kernel, initrd or udeb-repository. Simply add this line to your preseed file: d-i preseed/early_command string sed -i '/depmod -a > .dev.null 2>&1 || true/a modprobe ahci || true' /bin/hw-detect It tries to modify /bin/hw-detect to unconditionally try to load the ahci module after the "depmod -a"-command at the beginning of the script. hw-detect is called (at least) 2 times before partitioning. First for network-detect (at this time the sata-modules-udeb is obviously not available and modprobe will fail) and a second time form disk-detect. Now the sata-modules-udeb should have been installed already and the ahci-module is ready to install - after "depmop -a" of course. This is no solution for the root cause of the problem. To further investigate this it would be nice if you could confirm my guess of a timing problem. For this you could add this line to your preseed file (instead of the above of course): d-i preseed/early_command string sed -i '/^update-dev >.dev.null$/i sleep 10' /bin/hw-detect or this: d-i preseed/early_command string sed -i '/^update-dev >.dev.null$/i udevadm control --reload' /bin/hw-detect Hope this helps. Jörg
#872410#60
Date:
2019-12-19 10:30:44 UTC
From:
To:
Still having this problem with buster and newer hardware "Intel NUC8".

Sometimes the ahci module gets loaded without any modification
of the installer (/bin/hw-detect).

When using the old hack
 > d-i preseed/early_command string
 >   sed -i '/^update-dev >.dev.null$/i udevadm control --reload'
 >   /bin/hw-detect
the ahci module seems to be loaded reliably.


Jörg