The ramdisk. IMG and uimage in Android cannot contain the driver module (*. Ko ).

Source: Internet
Author: User
Tags builtin

The android source code of Freescale imx53 has been compiled together over the past few days. Today, when compiling Android kernel, we found that the driver modules configured in the make menuconfig mode are not compiled.

Previously, the kernel was compiled by running the following command according to the original documents:

 
Make uimage

By checking the makefile of the kernel, you can find some clues. Now you can record your work notes as follows:

Run the terminal in imx_kernel and enter the following command to view the information related to kernel compilation.

 
Make help

The following commands and information related to compilation are displayed:

Cleaning targets: clean-remove most generated files but keep the config and enough build support to build external modules mrproper-Remove all generated files + config + varous backup files distclean-mrproper + remove editor backup and patch filesconfiguration targets: config-update Current Config utilising a line-oriented program nconfig-update Current Config utilising a ncurses menu Ba Sed program menuconfig-update Current Config utilising a menu based program xconfig-update Current Config utilising a QT based front-end gconfig-update Current Config utilising a GTK based front-end oldconfig-update current config utilising a provided. config as base localmodconfig-update Current Config disabling modules not loaded localyesconfig-update Current Config converting local MoD to core silentoldconfig-same as oldconfig, but quietly, additionally update deps randconfig-New config with random answer to all options defconfig-New config with default answer to all options allmodconfig-New config selecting modules when possible allyesconfig-New config where all options are accepted with Yes allnoconfig-New config where all options are answered with noother gen Eric targets: All-build all targets marked with [*] * vmlinux-build the bare kernel * modules-build all modules modules_install-install all modules to install_mod_path (default :/) firmware_install-install all firmware to install_fw_path (default: $ (install_mod_path)/lib/firmware) DIR/-build all files in Dir and below DIR/file. [OISS]-build specified target only DIR/file. LST-build spec Ified mixed source/Assembly target only (requires a recent binutils and recent build (system. map) DIR/file. ko-build module including final link modules_prepare-set up for Building external modules tags/tags-generate tags file for editors cs1_- generate cs1_index kernelrelease-output the release version string kernelversion-output version stored in makefile headers_install-in Stall sanitised kernel headers to install_hdr_path (default:/data/en3/Freescale/I. mx536/I. MX53-QSB-Android-Release3.3/src/kernel_imx/usr) Static analysers checkstack-generate a list of stack hogs namespacecheck-Name Space Analysis on compiled kernel versioncheck-sanity check on version. h usage includecheck-check for duplicate included header files export_report-list the usages of all exp Orted symbols headers_check-sanity check on exported headers headerdep-detect conflict sion cycles in headerskernel packaging: rpm-PKG-build both source and binary RPM kernel packages binrpm-PKG-build only the binary kernel package Deb-PKG-build the kernel as an Deb package tar-PKG-build the kernel as an uncompressed tarball targz-PKG-build the kernel as a gzip compressed tarball tarbz2- PKG-build the kernel as a Bzip2 compressed tarballdocumentation targets: Linux kernel internal documentation in different formats: htmldocs-HTML pdfdocs-PDF psdocs-postscript xmldocs-XML docbook mandocs-man pages installmandocs-install man pages generated by mandocs cleandocs-clean all generated docbook filesarchitecture specific targets (ARM ): * zimage-compressed kernel image (Ar CH/ARM/boot/zimage) image-uncompressed kernel image (ARCH/ARM/boot/image) * xipimage-xip kernel image, IF configured (ARCH/ARM/boot/xipimage) uimage-u-boot wrapped zimage bootpimage-combined zimage and initial RAM disk (supply initrd image via make variable initrd = <path>) install-install uncompressed kernel zinstall-install compressed kernel install using (your )~ /Bin/installkernel or (distribution)/sbin/installkernel or install to $ (install_path) and run lilo ......................................................

You can see many compilation-related commands, such as make, make all, make clean, and make uimage.

After testing, it is found that after running the make command, the driver modules configured with <m> in make menuconfig can be compiled. However, when the uimage file generated by make uimage is burned to the board, why can't I find those in the file system on the Target Board *. ko file, read the android filesystem related information one morning, and finally found a solution, that is, by modifying the ramdisk generated by Android. IMG, use scripts to put these *. import the Ko file to the filesystem of Android.CodeIs the script that implements the entire process:

#! /Bin/shmake_kernel = $1 # Root dirkernel_dir = $ (PWD) # out dirout_dir =$ {kernel_dir }/.. /.. /out # modules install pathramdisk_dir = ramdiskinstall_mod_path =$ {out_dir}/tmp/$ {ramdisk_dir} # echo "make kernel? (Y, n )"; read make_kernelecho "*****************************" Echo "* Make kernel * "Echo" ****************************** "If [" $ make_kernel" X = "N" X]; thenecho "*** skip ***" elsemake-j4make uimage-j4cp ARCH/ARM/boot/uimage $ {out_dir} fiecho "*********** * ***************** "Echo" * install modules * "Echo "*********** * ****************** "CD $ {out_dir} [-e" tmp "] | {echo" mkdir tmp"; mkdir TMP;} CP. /Ramdisk. IMG./tmp # Last Exit status: determines whether ramdisk. IMG has case "$? "In" 0 ") CD tmpmv ramdisk. IMG ramdisk.img.gz CD. /$ {ramdisk_dir} gunzip ramdisk.img.gz [-e "$ {ramdisk_dir}"] | {echo "mkdir $ {ramdisk_dir}"; mkdir $ {ramdisk_dir };} CD $ {ramdisk_dir} cpio-I-f .. /ramdisk. imgcd $ {kernel_dir} Make modules_install # focus on this. When you run this command in the kernel directory, the related *. install the Ko file to the directory specified by install_mod_path !! CD $ {install_mod_path} Find. | cpio-o-h NEWC | gzip> .. /ramdisk. imgcd .. echo "*****************************" Echo "** make uramdisk. IMG * "Echo" ***************************** "mkimage-A arm -O Linux-T ramdisk-C none-A 0x70308000-n "android root filesystem"-D. /ramdisk. IMG. /uramdisk. imgmv uramdisk. IMG. /.. CD .. rm-RF. /tmpcd $ {kernel_dir} echo "*** okay ***"; "1") echo "ramdisk. the imgfile does not exist !!!!!! "RM-RF./tmpcd $ {kernel_dir}; esac

after such processing, you can generate ramdisk from the android source code. install any of our own items in IMG, and set uimage and uramdisk. I burned IMG together on the board and checked through the serial port to get what I wanted, as shown below:

Lrwxrwxrwx radio Radio build->/data/en3/Freescale/I. mx536/I. MX53-QSB-Android-Release3.3/src/kernel_imx-rw-r -- r -- radio Radio 81 modules. isapnpmap-RW-r -- radio Radio 74 modules. ofmap-RW-r -- radio Radio 43 modules. seriomap-RW-r -- radio Radio 2908 modules. dep. bin-RW-r -- radio Radio 1671 modules. symbols. binlrwxrwxrwx Radio radio source->/data/en3/Freescale/I. mx536/I. MX53-QSB-Android-Release3.3/src/kernel_imx-rw-r -- r -- radio RADIO 141 modules. inputmap-RW-r -- radio Radio 11595 modules. builtin-RW-r -- radio Radio 99 modules. pcimap-RW-r -- radio Radio 1072 modules. symbolsdrwxr-XR-x radio Radio kernel-RW-r -- radio Radio 13189 modules. builtin. bin-RW-r -- radio Radio 3795 modules. alias. bin-RW-r -- radio Radio 189 modules. usbmap-RW-r -- radio Radio 1189 modules. dep-RW-r -- radio Radio 4404 modules. alias-RW-r -- radio Radio 1042 modules. order-RW-r -- radio Radio 69 modules. ccwmap-RW-r -- radio Radio 73 modules. ieee1394map

the related *. Ko driver module is in the kernel directory!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.