Multiplay Labs

tech hits and tips from Multiplay

Finding the cause of kldload “Exec format error”

without comments

I’ve just been trying to get ipmitool working on our custom kernel, which requires the ipmi kernel module loaded however after adding this module to our kernel config it refused to load giving the following error:-
kldload ipmi.ko
kldload: can't load ipmi.ko: Exec format error

Not exactly helpful 🙁

After much digging I finally figured out it the ipmi module depends on the smbus module, so I added this and in doing so noticed some messages on the console of the machine, I’d been working over ssh. These messages told me exactly the issue:-

Jun 6 23:27:47 test kernel: KLD ipmi.ko: depends on smbus - not available or version mismatch
Jun 6 23:27:47 test kernel: linker_load_file: Unsupported file type

If only it output those to controlling console as well as the main console and /var/log/messages I would have not spent ages searching for the solution.

The moral of this little tale is if you have kldload spit out “Exec format error” at you, check /var/log/messages to find out why 🙂

Written by Dilbert

June 6th, 2011 at 11:58 pm

Posted in FreeBSD

Leave a Reply

You must be logged in to post a comment.