Welcome! Log In Create A New Profile


patch Linux Kernel for accepting only on CF

Posted by klep 
Hi All,

I need make Linux kernel (2.6) patch and add this fragment:

struct hd_driveid hd; 
int ide; 

This code will check CF (PATA) serial number and prevent loading if it is incorrect.

Where in kernel source I can add it (./init/main.c?) ?
I need 100% this code execution after system boot up.

I would like to have unique kernel for every CF with specified serial.

Many thanks for help
Very insteresting.

You could know the detected S/N after the CF/PATA driver get loaded, so a simple shell script in "init" of the initrd (if you have the initrd) can do the S/N comparing.
While in "init" of the initrd, other people could modify it too by using CPIO utility.
Read the detected S/N from the dmesg after bootup and do comparing also works, though block your comparing function is simple too.
If you write the S/N comparing into the pata driver, and if it is a loadable module, other people could replace a clean one either on "modules" of your initrd or on /lib/{kernel}/modules/, the kernel module tree.

I'm not sure the way that inputting your expected S/N.

>>I would like to have unique kernel for every CF with specified serial.
So I think a built-in modified driver would be better. Just write the expected S/N in. Once you detected unexcepted S/N, do a kernel panic or call ACPI poweroff.
You'd compile a kernel for every CF because that kernel parameter-input is not so good too.

Not interesting at all.

-The Effo Staff
Effo Project, [effo.sourceforge.net]

Your Email:


Spam prevention:
Please, solve the mathematical question and enter the answer in the input field below. This is for blocking bots that try to post this form automatically.
Question: how much is 24 plus 20?