View Single Post
Old 10-13-2021, 08:50 AM   #5
katadelos
rm -rf /
katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.katadelos ought to be getting tired of karma fortunes by now.
 
Posts: 219
Karma: 3333683
Join Date: Nov 2019
Location: United Kingdom
Device: K5, KT, KT2, KT3, KT4, KV, PW2, PW3, PW4, PW5
Quote:
Originally Posted by wishindo View Post
1) Should I use the toolchain at Snapshots of NiLuJe's hacks?
2) Where would I get the kernel headers?
3) Do I download the source for the same version number as the output of "uname -r" (2.6.26-rt in my case) from kernel.org to get the module source?
A couple of tips while I'm on my lunch break, I can take a close look at this later:

1) That would be the easiest way to get a vaguely compatible cross-compiler toolchain, I think that there's a specific one for older Kindles so I'd use that one
2) Headers are already present within the source tar ball
3) Use the linux-2.6.26-lab126.tar.bz2 tarball within the Kindle_src_3.4.3_3543620001.tar.gz sources.

Building the kernel modules will be something along the lines of this:

Code:
cd linux-2.6.26
# Note: you should change CROSS_COMPILE to the triplet of your toolchain
make ARCH=arm CROSS_COMPILE=arm-kindlepw2-linux-gnueabi- imx35_luigi_defconfig # I think this is the right defconfig?
make ARCH=arm CROSS_COMPILE=arm-kindlepw2-linux-gnueabi- menuconfig # Then select the kernel modules that you need
make ARCH=arm CROSS_COMPILE=arm-kindlepw2-linux-gnueabi- modules_prepare
make ARCH=arm CROSS_COMPILE=arm-kindlepw2-linux-gnueabi- M=drivers/usb/ -j7 # This will build all kernel modules within a specific directory, you'll need to do this for a few directories IIRC
make ARCH=arm CROSS_COMPILE=arm-kindlepw2-linux-gnueabi- modules -j7 # Or just build all of them at once, wastes time because it'll build kernel modules that are already on the device
find . -name *.ko # Get the paths of your shiny new kernel modules!
Then it's a case of transferring the kernel modules over to the device and using insmod to insert them into the kernel. You'll get errors if you insert them in the wrong order but you should be able to work out that order by checking the kernel log to see which missing symbol the kernel is complaining about, grepping through the kernel modules to see which module contains that symbol and inserting that module before the problematic one until the hardware works.

You'll probably run into some really obscure build errors that will require patching, compiling legacy kernel versions with any vaguely modern cross-compiler is something of a dark art
katadelos is offline   Reply With Quote