I'm trying to boot from an automatically generated kernel and initramfs. They were created with genkernel-3.4.10-r1 ("genkernel all") and were built for and on a Core 2 Duo system (Dell Optiplex 755) with the tools from a stage3-i686-2008.0. At reboot, the machine hangs. The last screen output reads "Freeing unused kernel memory". Debugging the initramfs's /init script, the problem seems to lie with the detect_sbp2_devices() function (an echo before it gets executed always, an echo after it never). I am currently circumventing the issue by commenting out the call to detect_sbp2_devices(), which allows the machine to boot perfectly. Reproducible: Always Steps to Reproduce: Take "my" system (don't know which parameter is relevant, it's a Core 2 Duo and I have no problems with two other systems (Pentium 4 and Xeon)), build a x86 kernel and initramfs with "genkernel all", install a bootloader and reboot. Actual Results: The machine hangs at "Freeing unused kernel memory". Expected Results: Boot completion. # lspci 00:00.0 Host bridge: Intel Corporation 82Q35 Express DRAM Controller (rev 02) 00:01.0 PCI bridge: Intel Corporation 82Q35 Express PCI Express Root Port (rev 02) 00:02.0 VGA compatible controller: Intel Corporation 82Q35 Express Integrated Graphics Controller (rev 02) 00:02.1 Display controller: Intel Corporation 82Q35 Express Integrated Graphics Controller (rev 02) 00:03.0 Communication controller: Intel Corporation 82Q35 Express MEI Controller (rev 02) 00:03.2 IDE interface: Intel Corporation 82Q35 Express PT IDER Controller (rev 02) 00:03.3 Serial controller: Intel Corporation 82Q35 Express Serial KT Controller (rev 02) 00:19.0 Ethernet controller: Intel Corporation 82566DM-2 Gigabit Network Connection (rev 02) 00:1a.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 02) 00:1a.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 02) 00:1a.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 02) 00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 02) 00:1c.0 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 (rev 02) 00:1d.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 02) 00:1d.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 02) 00:1d.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 02) 00:1d.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 02) 00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 92) 00:1f.0 ISA bridge: Intel Corporation 82801IO (ICH9DO) LPC Interface Controller (rev 02) 00:1f.2 SATA controller: Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA AHCI Controller (rev 02) 00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller (rev 02)
All that function does is: [ -e /proc/scsi/scsi ] && echo 'scsi add-single-device 0 0 0 0' > /proc/scsi/scsi If that's hanging your boot, it sounds like a kernel problem. What kernel version is this?
I noticed that's all it does, I was at a dead end. Kernel version is the latest stable portage gentoo-sources, being gentoo-sources-2.6.25-r7. Like I said, created with genkernel-3.4.10-r1, so you can find the kernel config. To be sure, I will try to get the config from the running kernel tomorrow and do a comparison.
Replicated issue on Optiplex 755 with gentoo-sources-2.6.25-r8
And has anyone tried a non-genkernel kernel to see if this still happens? What about a newer kernel with gk?
Sounds as if libata hangs in the add-single-device method. Is sysfs already mounted when detect_sbp2_devices is executed? If yes, check with "cat /sys/class/scsi_host/host0/proc_name" which SCSI host is the host 0 at that point. Then this host driver needs to be fixed, if it wasn't already fixed by now. Furthermore, please just delete this detect_sbp2_devices function. It does *nothing* --- except of course exposing kernel bugs (which is a good, provided that somebody picks these bugs up and fixes them, that is). This "echo 'scsi add-single-device...' >/proc/scsi/scsi" thing is a relic from ancient times when the Linux SCSI core did not have a hotplug kernel-API. This was in Linux 2.4. If you want SCSI hotplugging, use Linux 2.6. *If* you really want Linux 2.4 and SCSI hotplugging, then please don't run this add-single-device in scripts; invoke it only manually. You should *not* automatically invoke it because at least the respective Linux 2.4 interface is prone to race conditions and can crash the kernel.
I've removed the function in git. Neither of the current genkernel maintainers had any idea why it was there, so we were reluctant to remove it.
As agaffney removed this in git and the latest stable genkernel does not have this code any longer, is it time to close this?