# IBM xServer 306m with aic94xx needs initramfs help

## wilix

Hi,

I'm trying to make a LiveCD for the IBM 306m. After allot of google search I found this article on the net: http://www.mail-archive.com/linux-scsi@vger.kernel.org/msg04904.html

by following these steps I finally got the server to find the hard-drives:

```
$ cg-clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

$ cd linux-2.6

$ cg-branch-add scsi-misc git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git

$ cg-branch-add scsi-rc git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6.git

$ cg-branch-add aic94xx git://git.kernel.org/pub/scm/linux/kernel/git/jejb/aic94xx-sas-2.6.git

$ cg-update scsi-misc

$ cg-update scsi-rc

$ cg-update aic94xx
```

But when the livecd loads the aic94xx the first time, it cant find the aic94xx-seq.fw, but if I do a rmmod aic94xx and then modprobe aic94xx everything works fine.

 *Quote:*   

> aic94xx: Failed to load sequencer firmware file aic94xx-seq.fw, error -2

 

So now I have made a software raid on the server, and installed gentoo 2007.0.

But my next problem is to get the aic94xx loaded so the root can be found. Im trying to look in to initramfs but I really don't know what to change for the aic94xx to load right. I can make it to load but then it can not find aic94xx-seq.fw. I think it has something to do with hotplug, but I'm not sure, but I dont know how to change the order in the initramfs.

I should note that, right now I have aic94xx-seq.fw all over the initramfs   :Laughing: 

But on the LiveCD it is only in /lib/firmware and works fine!

Can someone help me with the initramfs, and tell me what I need to do.

It would be nice if I could get the LiveCD to run with out unloading the module and then load it again, but I guess that shouldn't be that difficult if I get the server to work, and that is more important for me   :Wink: 

I will  publish this LiveCD on one of my servers for others to use, when it is working right   :Cool: 

Thanks

----------

## warrawarra

Have you tried to load the module during startup with "/etc/modules.autoload.d/kernel-2.6" and adding the aic??? to kernel-2.6 file ?

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#book_part1_chap7

check 7E. might have something there to help you.

might have to update a few other things to make sure it is stable.

I have done this a few times and works like a charm.

Not sure about "udev" or "update-modules --force"

The autoload one is a easy way to get past haivng to recompile a new kernel just for 1 module / driver.

Hope this helps.

----------

## wilix

 *warrawarra wrote:*   

> Have you tried to load the module during startup with "/etc/modules.autoload.d/kernel-2.6" and adding the aic??? to kernel-2.6 file ?
> 
> http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#book_part1_chap7
> 
> check 7E. might have something there to help you.
> ...

 

Tank you for your reply!   :Smile: 

But my problem is not to get the modules loaded, my problem is, when aic94xx gets loaded, it wont load the hard-drives cause it doesn't load the aic94xx firmware (aic94xx-seq.fw). And all this should be done in the initramfs before I have /etc/modules.autoload.d/kernel-2.6 which is on the hard-drive  :Confused: 

Thanks again!

----------

## matt-swarmcast

I just got assigned the task of figuring out this problem for my company (first day on the job).  I've got the module to load correctly on 2006.1, but it still doesn't load the firmware correctly.  I'm not exactly ecstatic about this split driver idea, yet.  Anyway, apparently FC3 - FC5 does it correctly by default (though FC6+ messes it up) according to some other boards, so I plan on installing FC5 on a spare HDD and seeing if I can't get anymore insight from that.  I'm not running the IBM 306m, but my board does use the the 9410w controller (aic94xx).  If you figure anything out (or if you have any ideas on doing this on a normal install), please post them freely.  I'll keep this thread updated with my status as well.

--

Matt E.

----------

## matt-swarmcast

Interesting Link

Even more interesting link here!!!!

----------

## wilix

matt-swarmcast, are you interested in my LiveCD ? It doesn't work 100% cause you need to unload an reload the aic94xx again, to get aic94xx to work 

```
rmmod aic94xx ; modprobe aic94xx
```

I think, it is because there is something getting loading after aic94xx is loaded when it boots that makes it work the second time, I don't know what   :Confused: 

Maybe it is hotplug or some firmware_helper I'm not sure. If I only get that loaded before aic94xx gets loaded I think it will work. But I don't know how to do that    :Sad: 

I've also made a git depository of the kernel I'm using, maybe you can test it on your system?

----------

## matt-swarmcast

I'm definitely interested in the live CD.  I'm even more interested in creating a new one with a newer kernel.  We'll see what gets done.  So you're saying that if you remove the module and reload it that gentoo will correctly load the sequencer firmware (aic94xx-seq.fw)?  Looks like I need to try recompiling this kernel with aic94xx as a module instead...

If it's easier, I'm fine with corresponding by email or phone (or IRC, perhaps?).  Let me know what works best for you.  Thanks!

-Matt E.

----------

## wilix

I just setup a wiki page so you can find the iso there http://wiki.gentoo.fo/

IRC sound ok for me, but I cant use IRC from work, so it must be after work  :Rolling Eyes: 

----------

## matt-swarmcast

When I took my existing situation and recompiled the kernel so aic94xx was a module instead of compiled into the kernel, it loaded the firmware correctly on boot.  The controller is recognized by both dmesg and lspci.  However, it doesn't see any of the drives attached.  Any ideas?

----------

## wilix

you dont get this message in mesg?

 *Quote:*   

> aic94xx: Failed to load sequencer firmware file aic94xx-seq.fw, error -2

 

I get this when I load the module the second time:

 *Quote:*   

> 
> 
> sas: phy5 added to port1, phy_mask:0x20
> 
> sas: DOING DISCOVERY on port 0, pid:18658
> ...

 

So I don't have any problems accessing the disks. btw have you tried my LiveCD, to see if that works better ?

----------

## matt-swarmcast

When I compiled the driver  into the kernel, i got that same error message.  Simply switching the driver to a module got the firmware to load successfully.  However, I only see a generic scsi device (sg0) instead of the RAID array.  I can't fdisk the sg0 (tried).  I will download and try the livecd of yours and see if that's any better.

-MRE

----------

## wilix

Well I dont use the RAID support in the controller, cause it is only a softeware raid and that kind of sucks, thats why I use mdadm instead. Then I can setup mdadm to send me mail if a disk fails

----------

## wilix

Is it possible for me to get your initramfs and kernel+modules, to test it on my server?   :Very Happy: 

```
mount /boot; tar cvjf ~/kernel.bz2 /boot /proc/config.gz /lib/modules/`uname -r`
```

who knows maybe it is the miracle I'm looking for   :Wink: 

----------

## matt-swarmcast

hmm...I'm not positive that I can attach a file on this board.  do you need a certain number of posts before you can attach a file?  Or do you have an email account (junk email account?) that I can send this to?

-MRE

----------

## matt-swarmcast

Can I get your kernel config file?

----------

## wilix

Here is my kernel config http://wiki.gentoo.fo/files/kernel.config

----------

## matt-swarmcast

Thanks, man.  I'm sorry about not updating anything for a while on the issue, but it hasn't been touched since last week sometime due to more important issues arising at work.  I'm back on this task (though probably not for long), so I'll let you know if I get anything working...

----------

## matt-swarmcast

Wilix, how do you have the modules load on your livecd?  It seems to me that aic94xx might be loading too soon (i.e. before everything it needs to load has loaded).  Perhaps you should switch to the /etc/modules.autoload.d/kernel-2.6 file and load the module names into that file, with aic94xx being the last to load.  Any thoughts?

----------

## wilix

yeah, I know the module is loaded to soon, but I can not put it in the modules.autoload. If I put it in the modules.autoload, the root (/) should already be mounted. But my problem is, all my drives are on the aic94xx controller so I dont have any modules.autoload when I boot.

Thats why I need to load aic94xx in the initramfs, but I dont know how to do that. 

I have got the aic94xx loaded in aic94xx, but there is something missing, I belive that I need to do something before I load the aic94xx module, but I dont know what that is, maybe it has something to du with udev, or hotplug but I'm not sure about that.

I've tried to find some help, to get a better understanding of the initramfs and how it works, so I can change the order, how everything gets loaded, but without luck   :Crying or Very sad: 

I will post it, when/if I figure out how I get the IBM 306m booted form the aic94xx controller, it cant be only me that is interested in this?

----------

## matt-swarmcast

Here are the links I'm finding helpful with initrd and initramfs:

http://gentoo-wiki.com/HOWTO_Initramfs

http://www.parisc-linux.org/~willy/initramfs-firmware-howto

http://linuxsh.sourceforge.net/cgi-bin/moin.cgi/Using_20Early_20User_20Space

http://www.mjmwired.net/kernel/Documentation/early-userspace/

https://linuxlink.timesys.com/docs/initramfs

http://www.timesys.com/timesource/initramfs.htm

You can create one with genkernel, even if you're not using the genkernel, and that's what I've been trying (now if I could create a decent livecd, lol).  I hope this helps.

----------

## micdobro

Me and my boss we were sitting on that problem for two days now and finally we managed to get it working (bootable RAID1 on the aic94xx with SATA disks). I created a WIKI page depicting all installation steps: http://gentoo-wiki.com/HARDWARE_Adaptec_aic94xx_with_bootable_software_RAID1. 

The kernel hint in the first post turned out to be the biggest milestone - thanks wilix!

----------

## matt-swarmcast

Thanks, micdoboro!  I'll be sure to get to this today.

----------

## matt-swarmcast

Well, I get a few warnings (errors?) when I begin.  Cogito and genkernel are both emerged and both the most up-to-date that's unmasked by portage.  I begin running through the cogito commands, and when I get to "cg-update aic94xx" I get the following output:

```
linux-2.6 # cg-update aic94xx

Fetching pack (head and objects)...

remote: Generating pack...

remote: Done counting 168 objects.

remote: Deltifying 168 objects...

remote:  100% (168/168) done

Indexing 168 objects.

remote: Total 168 (delta 100), reused 130 (delta 99)

 100% (168/168) done

Resolving 100 deltas.

 100% (100/100) done

Fetching tags...

New branch: 41484f1919e248a6ae4a53425d146c620392fff6

Applying changes...

Multiple merge base candidates, please select one manually (by running cg-merge -b BASE [BRANCH]):

9413d7b8aa777dd1fc7db9563ce5e80d769fe7b5

8d9107e8c50e1c4ff43c91c8841805833f3ecfb9

The most conservative base (but likely a lot of conflicts): 3f0a6766e0cc5a577805732e5adb50a585c58175

```

Well, I'm not really sure which base to merge.  The first one is actually the "scsi-misc" base (at least it's the new branch output for the "cg-update scsi-misc" command on my system).  I don't know what the second one is (I have no experience with cogito before this).  I'm also unable to identify what the "most conservative base" actually is.  Any ideas/help?

-MRE-

----------

## matt-swarmcast

well, I decided to just run "cg-merge -b 9413d7b8aa777dd1fc7db9563ce5e80d769fe7b5" and continue with the build.  Everything worked as normal, except I get an error on the boot when loading the sequencer firmware claiming "firmware file checksum mismatch."  I suspect redownloading the firmware and reinserting it into the initramfs should do the trick.  I'll keep you updated.

----------

## matt-swarmcast

Well, no bueno.  I replaced the firmware in the initramfs file, and it loads the firmware correctly, but I still suffer from the "Unidentified device type 5" errors.  I believe I followed your wiki to the letter. 

When you said enable SATA/PATA support, did you mean the option "Device Drivers->Serial ATA (prod) and Parallel ATA (experimental) drivers" as the option?  I enabled that (compiled into kernel) as well as compiled the available drivers as modules.  I assume that's what you were referring to, but if I'm wrong, let me know.  The other differentiation from the listed procedure was the previously mentioned cg-update difference.

Any ideas?

EDIT:  Ok, so the unidentified device type 5 error means I'm still not using the aic94xx driver.  Any ideas on the cogito problem I listed three posts back?

----------

## matt-swarmcast

The issue is solved by running the cg-merge command for the second base.  In my example:

```

cg-merge -b 8d9107e8c50e1c4ff43c91c8841805833f3ecfb9 aic94xx
```

Thanks, guys!

EDIT: To Wilix:  Do you still need an initramfs file, or is yours working now?

----------

## pr0ph3t

I have tried soooo hard to get this working. No joy. I even started going through the steps found here:

http://gentoo-wiki.com/HARDWARE_Adaptec_aic94xx_with_bootable_software_RAID1 and got stuck in the same spot. Although the suggestion you made did not work for me, it just caused more errors to show up. I'm a firm believer in gentoo and have used it on all my servers, but this may force me to RedHat or Suse.

Does anyone know of a better way to get this working? I'm baffled by the fact that gentoo/grub can read the /boot partition on boot (it too on a drive on this aic94xx controller), but it cannot read the root partition to load the firmware file.

Any help on this would really, really be appreciated. There has to be an easier way and one that doesn't break the upgrade path.

----------

## matt-swarmcast

That's probably because the kernel has been changed a few times since those commands worked.  I had to do this again about 10 days ago and those commands didn't work as is.  I can't remember what I tried to fix it, but it would be something like this:

cg-clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

cd linux-2.6

cg-switch v2.6.22

this downloads the kernel source, but switches back to v2.6.22, before the additional scripts were updated.  Next, you'd do one of the following (can't remember which):

1)  cg-branch-add scsi-misc git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git

     cg-branch-add scsi-rc git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6.git

     cg-branch-add aic94xx git://git.kernel.org/pub/scm/linux/kernel/git/jejb/aic94xx-sas-2.6.git

     cg-update scsi-misc

     cg-update scsi-rc

     cg-update aic94xx

which is just the commands as normal (possibly requiring a cg-merge -b as I had stated), or:

2)  cg-branch-add aic94xx git://git.kernel.org/pub/scm/linux/kernel/git/jejb/aic94xx-sas-2.6.git

     cg-update aic94xx

I know that updates just fine without errors, but I can't remember if it actualy works.  Anyway, if you PM me your email address, I can email you a gzipped tarball of my updated linux-2.6 source.  It'd be 2.6.22.  I'm running it with Gentoo on RAID10, and it works just fine.  I'm out of here at noon today, and not back until Monday, however, so if I don't get a response before I leave, it'd have to be until Monday before I get it to you.

-Matt-

----------

## georgia_tech_swagger

Use Ubuntu Hardy Heron 8.04 Alpha 2.

I have tried every major distro you can name.   It's the ONLY ONE that works with this chip.   It has the necessary kernel (2.6.24) and the necessary firmware and the necessary initramfs fixes.

----------

## hydrapolic

If anybody runs into the same problem, so:

1) a bootable CD (i386) can be found here:

```
  

http://wiki.gentoo.fo/doku.php

```

All you need to do is to download the live CD from there (http://wiki.gentoo.fo/iso/livecd-x306m_v2.iso) and

```

rmmod aic94xx ; modprobe aic94xx

```

This way you'll get the system booted and the disks will be accessible.

2) after booting the system, follow the steps mention here:

```

http://gentoo-wiki.com/HARDWARE_Adaptec_aic94xx_with_bootable_software_RAID1

```

You can safely skip the Cogito steps.

It's a little bit annoying, but don't forget to check the genkernel files each time you update it (because you need to modify them  :Smile: ) and to modify the initrd file (with the add_firmware script).

3) keep in mind:

- don't forget, that you need to download the i386 stage3 file, the amd64 will NOT work, you need to install i386 from stage3 and probably then you can switch to amd64 (not tested yet, running the server on i386 for now).

- don't forget to edit the necessary files during kernel updates.

Good luck, enjoy  :Smile: 

----------

## pgentoo

Hey guys,  I'm not on the same board, but I have the aic94xx (9410) as well.  I'm trying to get the adp94xx module compiled on my xen-sources-2.6.21 system, and haven't made much progress.  

Anyone able to successfully compile the module on this kernel?  

I don't require booting from this device, so I don't need a customized initramfs or anything along those lines... I just simply need a working module so i can load up these drives after boot, for storage.  Please note my drives are SATA and not SAS.

dmesg shows:

aic94xx: Adaptec aic94xx SAS/SATA driver version 1.0.3 loaded

ACPI: PCI Interrupt 0000:04:02.0[A] -> GSI 16 (level, low) -> IRQ 16

aic94xx: found Adaptec AIC-9410W SAS/SATA Host Adapter, device 0000:04:02.0

scsi4 : aic94xx

aic94xx: Found sequencer Firmware version 1.1 (V30)

aic94xx: device 0000:04:02.0: SAS addr 5003048000240520, PCBA SN ORG, 8 phys, 8 enabled phys, flash present, BIOS build 1822

ERROR: Unidentified device type 5

ERROR: Unidentified device type 5

ERROR: Unidentified device type 5

Any help would be greatly appreciated...

Thanks!

----------

