Since I am trying to make an initramfs for my ARM board, I have to make modules for my hardware before doing anythings. For making modules, you have to compile the kernel. Here is a short explanation about how to compile the kernel for an ARM-based architecture and how to make modules.
- First, download a source code. Here is a list of source code: Source code for kernels. I downloaded linux-2.6.28.1 because I want to add a newer version in my project. You can grab the last version.
- Extract compress file, for example, tar xjvf linux-2.6.28.1.tar.bz2 in my case
- Change to new directory like: cd linux-2.6.28
- Edit the Makefile and change to the following: ARCH ?= arm and CROSS_COMPILE ?= arm5tel-redhat-linux-gnueabi-
- To allow a set of defaults to be selected for the particular machine that you are compiling the source for, you should find the proper confing file in arch/arm/configs/ directory. In my case, the proper file is arch/arm/configs/omap3_beagle_defconfig. Then you should run the following make command: make omap3_beagle_defconfig
- After that, use make gconfig to open up the GUI configuration. This is a very useful command that you can customize everything, for example, you can choose to install a specific driver or ipv6 or so many other things.
- Compile the kernel source by following commands: 1) make clean 2)make ARCH=arm CROSS_COMPILE=/usr/armv5tel-redhat-linux-gnueabi/bin/ zImage The zImage in a compress file. you can use uImage instead if you do not want to compress the kernel. In my case, the path to compiler was /usr/armv5tel-redhat-linux-gnueabi/bin/ . You should find the proper address in your case.
- Finally, to make the modules, you should use the following command: make modules_install INSTALL_MOD_PATH=/tmp/arm-modules This can be any path in your choice.I will use these modules later for making iniramfs.
Regards,
Khosro Taraghi
I wonder how to make initramfs?
ReplyDeleteSincere thanks,
Jack