Now, I replaced the SSD with the original HDD and installed Gentoo on it. This HDD was completely wiped, so there should be nothing remaining from old installations.
The problem now is, if I execute $ shutdown -h now the laptop shutting down as expected, the light in the power button goes off. But after a second or so, the power comes up again and the laptop boots without interaction.
I have no clue what could trigger this unwanted restart; it’s just annoying. Sidenote: there is no symptom that the power button is faulty, and the issue is fully reproducible.
Furthermore, when I invoke $ halt, the laptop is shutting down, and then it remains powered on with a dark screen.
I sometimes have that trouble with a VM, and poweroff always shuts it down reliably.
No idea why it would happen with a hard install.
It is like, the runlevel that does a shutdown is not properly defined… but you did a fresh install? How can that be?
I have never had to look, but I think the init scripts used for shutdown must interact with the BIOS in some way. Maybe your machine has a strange bios requireing some modification of the init scripts.