Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a kernel image. The sources are somewhat lost and I dont want to migrate to a recent version (embeded software, custom (patched) linux kernel 2.4.24).

I want to make a simple operation: replace the hid-quirk-handling of one vendor with another. This is to bypass this bug also present in my kernel. I'm pretty shure, the binary patch is okay. Its an array of structures defined as

struct hid_blacklist {
    __u16 idVendor;
    __u16 idProduct;
    unsigned quirks;
} hid_blacklist[] = { 
    ....
};

and the hex dump reads exactly the same.

the procedure used is:

  • extraxt vmlinux.gz from vmlinuz ( as described here )
  • decompress ( gzip -d -c > vmlinux )
  • apply binary patch (vmlinux.patched)
  • copy header from original image ( dd if=vmlinuz of=vmlinuz.patched bs=1 count=$$$$$)
  • compress patched kernel and append to new image ( gzip -n -9 -c vmlinux.patched >> vmlinuz.patched)

vmlinuz.patched is 3 byte larger after altering 4 bytes. This sounds reasonable for me. The image gets decompressed along with linux_os.gz but the kernel does not start, no Cursor is blinking, just a black screen. So here my question: Do I have overseen a checksum or similar? Why doesn't happen anything?

share|improve this question
    
The image contains lots of compile time calculations. If you shift everything with 3 bytes after some point, that'll break quite a lot of things. –  Sami Laine Mar 29 at 7:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.