So I am creating my own copy of Linux initramfs (For learning purposes). Everything seems to be working great. I, correctly, installed shared libraries and I can run some binaries from within the initramfs. I also installed and run busybox tools without any problem. However, when trying to mount /dev/sr0, mount reports that no such device or address is found. The serial logs (Reported by Virtualbox into a text file) show that the kernel could detect the SATA hard drive but it can't detect the IDE cdrom controller. When I use my host's system original initramfs, It does detect and successfully mounts the cdrom drive but lsmod shows really lots of loaded modules and I can't try them all. So I want to detect IDE cdrom drive with my initramfs by loading the correct kernel modules but I am not sure which ones will do the job for a virtualized IDE interface.
By the way, my initramfs loads the following modules:
load_modules()
{
modules="ahci sd_mod sr_mod virtio_blk virtio_pci"
modules="$modules ohci_pci ehci_pci loop ext4 isofs squashfs"
for mod in $modules;
do
echo "Loading $mod ..."
modprobe $mod
done
}
The following is part of the serial log that shows that SATA disk is detected:
[ 5.988202] SCSI subsystem initialized
[ 6.074669] libata version 3.00 loaded.
[ 6.212811] tsc: Refined TSC clocksource calibration: 2594.307 MHz
[ 6.213805] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x25653a78b6d, max_idle_ns: 440795319419 ns
[ 6.216298] ahci 0000:00:0d.0: version 3.0
[ 6.217563] ahci 0000:00:0d.0: SSS flag set, parallel bus scan disabled
[ 6.393125] ahci 0000:00:0d.0: AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
[ 6.394486] ahci 0000:00:0d.0: flags: 64bit ncq stag only ccc
[ 6.396023] scsi host0: ahci
[ 6.396708] ata1: SATA max UDMA/133 abar m8192@0xf0806000 port 0xf0806100 irq 21
[ 6.713317] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[ 6.729072] ata1.00: ATA-6: VBOX HARDDISK, 1.0, max UDMA/133
[ 6.753066] ata1.00: 4194304 sectors, multi 128: LBA48 NCQ (depth 31/32)
[ 6.812916] ata1.00: configured for UDMA/133
[ 6.863148] scsi 0:0:0:0: Direct-Access ATA VBOX HARDDISK 1.0 PQ: 0 ANSI: 5
[ 6.871504] sd 0:0:0:0: [sda] 4194304 512-byte logical blocks: (2.15 GB/2.00 GiB)