28
Apr
Posted by Derek@TheDailyLinux in Kernel » Add Comment »
Command to Reduce File Size of Installed Kernel Modules
I mentioned the objcopy command earlier, but I had recently put it into effect myself by shaving off quite a bit of bulk from Linux kernel modules targeted towards an embedded system and I wanted to share my steps and commands with you.
- Step 1: Compile your kernel and install the modules
- Step 2: Change to the directory in which you installed your kernel modules
- Step 3: Run the following command which will find all files ending in .ko and pipe it to run the
objcopycommand (note, the following shows an example of using cross compile tools targeted towards ARM)
make; make modules_install
cd /lib/modules/2.6.24.4/kernel/drivers
find . -type f -name '*.ko' | xargs -n 1 /myfiles/tscrosstool/crosstool-linux-arm-uclibc-3.4.6/arm-uclibc-3.4.6/bin/arm-linux-objcopy --strip-unneeded
That’s it. You’ll notice that your kernel module sizes are now very small compared to what they used to be, and this allows you to squeeze in more features in your embedded system and possibly leave even more free space for your programs or files.
Feel free to donate if this post prevented any headaches! Another way to show your appreciation is to take a gander at these relative ads that you may be interested in:
Here are some similar posts that you may be interested in:
There's 0 Comment So Far
Share your thoughts, leave a comment!