Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Custom module for LiveCD
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
PatG
n00b
n00b


Joined: 27 Oct 2003
Posts: 63
Location: texas

PostPosted: Mon Aug 29, 2005 10:27 pm    Post subject: Custom module for LiveCD Reply with quote

I think this is possible but I am not sure about how to do it.

I have encountered (as many have) issues with the aacraid driver from Adaptec.

See this post for dertails.

Now I have the latest source code for this driver from adaptec. Since the module/kernel/card combination is not stable on the LiveCD I would like to recompile the new code as one last ditch effort to get this to work. I have another system running on 2.6.11-gentoo-r6. Is there a way I can compile this module on that system, replace the files on the gentoo distribution iso and then burn a custom LiveCD to test this new driver code?

I am thinking that I would have to

1. install the 2005.1 Kernel Source on my running system
2. have my symlink for /usr/src/linux point to the 2005.1 Kernel Source
3. Replace the aacraid files in the 2005.1 source with the source from adaptec
4. Compile the aacraid driver (or do I have to do the whole kernel with aacraid as a module) ?
5. Rip the whole 2005.1 iso to a file system (or can I edit the iso directly)
6. Replace the compiled aacraid driver and source with the new stuff
7. Remake the iso (I'm not sure how to do this)
8. Burn the new LiveCD
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54793
Location: 56N 3W

PostPosted: Tue Aug 30, 2005 5:15 pm    Post subject: Reply with quote

PatG,

You need identical kernel source and compiler to that used to make the liveCD kernel on another system. Some kernel configuration options must be the same too, like SMP. You can get the liveCD .config file from its /proc.
Then you compile the new module with that compiler against your copy of the livCD kernel.
You may need to point /usr/src/linux at your copy of the liveCD, maybe not. It depends how the module detects the kernel.
It can also want to build against the running kernel.

Having compiled your module, you can move the .ko file to your install on a USB stick or floppy and load it with insmod, not modprobe.
You will have to load any dependantcies by hand too.

There is no need to make a new liveCD.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
PatG
n00b
n00b


Joined: 27 Oct 2003
Posts: 63
Location: texas

PostPosted: Tue Aug 30, 2005 11:37 pm    Post subject: Reply with quote

NeddySeagoon,

After writing the first post I was thinking about alot of the things you mentioned. I found the 2.6.12 source on the cd and extracted it to my running system. I did not know how to compile just the module so I just did a make of the whole kernel. just a few wasted CPU cycles :oops: I did not do modules_install because I did not want to actually run this kernel on this box. Now I have an aacraid.ko compiled against the 2005.1 CD kernel source. Will test as soon as my SATA RAID rebuilds. Now, I did not use the .config from the LiveCD, is this absolutely necessary? I would not expect that the aacraid module would be affected by how they built the LiveCD kernel except for module loading which has to be enabled. Am I missing something obvious (or not so) here? Either way I will know pretty soon. I'm sure this will either work or go down in flames.

I will just copy the module to a floppy and load it with

# insmod /mnt/floppy/aacraid (correct?)

Perhaps you could give a hint on how to do just the module compile. I looked at several sites on building your own modules but this RAID source is not quite as straight forward as the "Hello World" examples.

Pat
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54793
Location: 56N 3W

PostPosted: Wed Aug 31, 2005 4:14 pm    Post subject: Reply with quote

PatG,

To just build the modules you do
Code:
make modules
The make tool is smart. It looks at the dates on the binaries it already has and compares them to the dates on the source files, proviving the binaries are later, they are not remade, so adding a module to a kernel is fast - only the new stuff is compiled.

Your own kernel need not be exactly the same config as the live CD one but there are a few essentials that must be identical,
Like the SMP set up, 8k or 4k stacks, module versioning and regparams or not. Thats probably not an exhaustive list.

Your insmod is almost right. You need to mount the floppy on /mnt/floppy
Then the command is insmod /mnt/floppy/aacraid.ko Im fairly sure inmod needs the .ko
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum