zhouyu@zhouyu-virtual-machine:~/linux_kernel.org/linux-3.16$ ls
arch Documentation init lib README sound
block drivers ipc MAINTAINERS REPORTING-BUGS tools
COPYING firmware Kbuild Makefile samples usr
CREDITS fs Kconfig mm scripts virt
crypto include kernel net security
zhouyu@zhouyu-virtual-machine:~/linux_kernel.org/linux-3.16$ make distclean
zhouyu@zhouyu-virtual-machine:~/linux_kernel.org/linux-3.16$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- tisdk_am335x-evm_defconfig
#
# configuration written to .config
#
zhouyu@zhouyu-virtual-machine:~/linux_kernel.org/linux-3.16$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/lxdialog/checklist.o
HOSTCC scripts/kconfig/lxdialog/inputbox.o
HOSTCC scripts/kconfig/lxdialog/menubox.o
HOSTCC scripts/kconfig/lxdialog/textbox.o
HOSTCC scripts/kconfig/lxdialog/util.o
HOSTCC scripts/kconfig/lxdialog/yesno.o
HOSTCC scripts/kconfig/mconf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/mconf
scripts/kconfig/mconf Kconfig
configuration written to .config
*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage
......
LINK vmlinux
LD vmlinux.o
MODPOST vmlinux.o
GEN .version
CHK include/generated/compile.h
UPD include/generated/compile.h
CC init/version.o
LD init/built-in.o
KSYM .tmp_kallsyms1.o
KSYM .tmp_kallsyms2.o
LD vmlinux
SORTEX vmlinux
SYSMAP System.map
OBJCOPY arch/arm/boot/Image
Kernel: arch/arm/boot/Image is ready
AS arch/arm/boot/compressed/head.o
GZIP arch/arm/boot/compressed/piggy.gzip
AS arch/arm/boot/compressed/piggy.gzip.o
CC arch/arm/boot/compressed/misc.o
CC arch/arm/boot/compressed/decompress.o
CC arch/arm/boot/compressed/string.o
SHIPPED arch/arm/boot/compressed/hyp-stub.S
AS arch/arm/boot/compressed/hyp-stub.o
SHIPPED arch/arm/boot/compressed/fdt_rw.c
SHIPPED arch/arm/boot/compressed/fdt.h
SHIPPED arch/arm/boot/compressed/libfdt.h
SHIPPED arch/arm/boot/compressed/libfdt_internal.h
CC arch/arm/boot/compressed/fdt_rw.o
SHIPPED arch/arm/boot/compressed/fdt_ro.c
CC arch/arm/boot/compressed/fdt_ro.o
SHIPPED arch/arm/boot/compressed/fdt_wip.c
CC arch/arm/boot/compressed/fdt_wip.o
SHIPPED arch/arm/boot/compressed/fdt.c
CC arch/arm/boot/compressed/fdt.o
CC arch/arm/boot/compressed/atags_to_fdt.o
SHIPPED arch/arm/boot/compressed/lib1funcs.S
AS arch/arm/boot/compressed/lib1funcs.o
SHIPPED arch/arm/boot/compressed/ashldi3.S
AS arch/arm/boot/compressed/ashldi3.o
SHIPPED arch/arm/boot/compressed/bswapsdi2.S
AS arch/arm/boot/compressed/bswapsdi2.o
LD arch/arm/boot/compressed/vmlinux
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
zhouyu@zhouyu-virtual-machine:~/linux_kernel.org/linux-3.16$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- LOADADDR=0x80008000 uImage
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
make[1]: “include/generated/mach-types.h”是最新的。
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CHK kernel/config_data.h
Kernel: arch/arm/boot/Image is ready
Kernel: arch/arm/boot/zImage is ready
UIMAGE arch/arm/boot/uImage
Image Name: Linux-3.16.0
Created: Sun Sep 14 00:42:29 2014
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 4177544 Bytes = 4079.63 kB = 3.98 MB
Load Address: 80008000
Entry Point: 80008000
Image arch/arm/boot/uImage is ready
Usage: mkimage -l image
-l ==> list image header information
mkimage [-x] -A arch -O os -T type -C comp -a addr -e ep -n name -d data_file[:data_file...] image
-A ==> set architecture to 'arch' //用于指定CPU类型,比如arm
-O ==> set operating system to 'os' //用于指定操作系统,比如linux
-T ==> set image type to 'type' //用于指定映象类型,比如kernel
-C ==> set compression type 'comp' //用于选择压缩方式可以none、gzip、bzip2
-a ==> set load address to 'addr' (hex) //用于指定载入内存的地址
-e ==> set entry point to 'ep' (hex) //用于指定入口地址
-n ==> set image name to 'name' //用于设定映像名称,这个名称保存在头部
-d ==> use image data from 'datafile' //用于指定制作uImage的源文件zImage的路径
-x ==> set XIP (execute in place) //指定执行地址
mkimage [-D dtc_options] [-f fit-image.its|-F] fit-image -D => set options for device tree compiler -f => input filename for FIT sourceSigning / verified boot not supported (CONFIG_FIT_SIGNATURE undefined) mkimage -V ==> print version information and exit
zhouyu@zhouyu-virtual-machine:~/linux_kernel.org/linux-3.16/arch/arm/boot$ mkimage -A arm -O linux -T kernel -C none -a 80008000 -e 80008040 -n uImage -d zImage uImage_mkimage_backup
Image Name: uImage
Created: Sun Sep 14 11:51:56 2014
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 4177544 Bytes = 4079.63 kB = 3.98 MB
Load Address: 80008000
Entry Point: 80008040
得到最终需要的uImage,不过我将它命名为uImage_mkimage_backup。
step5:得到了内核之后,还需要编译设备树,也就是将.dts源文件编译成.dtb文件,dts文件存放在arch/arm/boot/dts/目录之下,如图,
对于BBB板子选择红线框中的第二个文件,执行命令如下进行编译,
zhouyu@zhouyu-virtual-machine:~/linux_kernel.org/linux-3.16$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x-boneblack.dtb
DTC arch/arm/boot/dts/am335x-boneblack.dtb
zhouyu@zhouyu-virtual-machine:~/linux_kernel.org/linux-3.16$ make ARCH=arm CROSS_COMPILE=arm-
linux-gnueabihf- modules
......
LD [M] sound/soc/omap/snd-soc-omap.ko
CC sound/soc/omap/snd-soc-omap3pandora.mod.o
LD [M] sound/soc/omap/snd-soc-omap3pandora.ko
CC sound/soc/snd-soc-core.mod.o
LD [M] sound/soc/snd-soc-core.ko
CC sound/soundcore.mod.o
LD [M] sound/soundcore.ko
CC sound/usb/snd-usb-audio.mod.o
LD [M] sound/usb/snd-usb-audio.ko
CC sound/usb/snd-usbmidi-lib.mod.o
LD [M] sound/usb/snd-usbmidi-lib.ko
zhouyu@zhouyu-virtual-machine:~/linux_kernel.org/linux-3.16$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=/home/zhouyu/zynfs/ modules_install
INSTALL crypto/ccm.ko
INSTALL crypto/ctr.ko
INSTALL crypto/seqiv.ko
INSTALL crypto/tcrypt.ko
INSTALL drivers/base/regmap/regmap-spi.ko
INSTALL drivers/bluetooth/bcm203x.ko
INSTALL drivers/bluetooth/bpa10x.ko
INSTALL drivers/bluetooth/btwilink.ko
INSTALL drivers/bluetooth/hci_uart.ko
INSTALL drivers/hwmon/lm75.ko
INSTALL drivers/iio/adc/ti_am335x_adc.ko
INSTALL drivers/iio/industrialio.ko
INSTALL drivers/iio/kfifo_buf.ko
INSTALL drivers/input/input-polldev.ko
INSTALL drivers/input/touchscreen/pixcir_i2c_ts.ko
INSTALL drivers/media/usb/gspca/gspca_main.ko
INSTALL drivers/media/usb/uvc/uvcvideo.ko
INSTALL drivers/media/v4l2-core/videobuf2-core.ko
INSTALL drivers/media/v4l2-core/videobuf2-memops.ko
INSTALL drivers/media/v4l2-core/videobuf2-vmalloc.ko
INSTALL drivers/misc/bmp085-i2c.ko
INSTALL drivers/misc/lis3lv02d/lis3lv02d.ko
INSTALL drivers/misc/lis3lv02d/lis3lv02d_i2c.ko
INSTALL drivers/misc/tsl2550.ko
INSTALL drivers/net/can/c_can/c_can.ko
INSTALL drivers/net/can/c_can/c_can_platform.ko
INSTALL drivers/net/can/can-dev.ko
INSTALL drivers/net/wireless/libertas/libertas.ko
INSTALL drivers/net/wireless/libertas/libertas_sdio.ko
INSTALL drivers/net/wireless/libertas/usb8xxx.ko
INSTALL drivers/net/wireless/ti/wl12xx/wl12xx.ko
INSTALL drivers/net/wireless/ti/wl18xx/wl18xx.ko
INSTALL drivers/net/wireless/ti/wlcore/wlcore.ko
INSTALL drivers/net/wireless/ti/wlcore/wlcore_sdio.ko
INSTALL drivers/phy/phy-twl4030-usb.ko
INSTALL drivers/usb/dwc3/dwc3-omap.ko
INSTALL drivers/usb/dwc3/dwc3.ko
INSTALL drivers/usb/gadget/g_acm_ms.ko
INSTALL drivers/usb/gadget/g_audio.ko
INSTALL drivers/usb/gadget/g_cdc.ko
INSTALL drivers/usb/gadget/g_dbgp.ko
INSTALL drivers/usb/gadget/g_ether.ko
INSTALL drivers/usb/gadget/g_ffs.ko
INSTALL drivers/usb/gadget/g_hid.ko
INSTALL drivers/usb/gadget/g_mass_storage.ko
INSTALL drivers/usb/gadget/g_midi.ko
INSTALL drivers/usb/gadget/g_multi.ko
INSTALL drivers/usb/gadget/g_ncm.ko
INSTALL drivers/usb/gadget/g_printer.ko
INSTALL drivers/usb/gadget/g_serial.ko
INSTALL drivers/usb/gadget/g_webcam.ko
INSTALL drivers/usb/gadget/g_zero.ko
INSTALL drivers/usb/gadget/gadgetfs.ko
INSTALL drivers/usb/gadget/libcomposite.ko
INSTALL drivers/usb/gadget/u_ether.ko
INSTALL drivers/usb/gadget/u_serial.ko
INSTALL drivers/usb/gadget/usb_f_acm.ko
INSTALL drivers/usb/gadget/usb_f_ecm.ko
INSTALL drivers/usb/gadget/usb_f_ecm_subset.ko
INSTALL drivers/usb/gadget/usb_f_fs.ko
INSTALL drivers/usb/gadget/usb_f_mass_storage.ko
INSTALL drivers/usb/gadget/usb_f_ncm.ko
INSTALL drivers/usb/gadget/usb_f_obex.ko
INSTALL drivers/usb/gadget/usb_f_rndis.ko
INSTALL drivers/usb/gadget/usb_f_serial.ko
INSTALL drivers/usb/gadget/usb_f_ss_lb.ko
INSTALL drivers/usb/misc/usbtest.ko
INSTALL drivers/usb/musb/musb_am335x.ko
INSTALL drivers/usb/musb/musb_dsps.ko
INSTALL drivers/usb/musb/musb_hdrc.ko
INSTALL drivers/usb/musb/omap2430.ko
INSTALL drivers/usb/phy/phy-twl6030-usb.ko
INSTALL fs/configfs/configfs.ko
INSTALL net/802/p8022.ko
INSTALL net/802/psnap.ko
INSTALL net/802/stp.ko
INSTALL net/bluetooth/bluetooth.ko
INSTALL net/bridge/bridge.ko
INSTALL net/can/can-bcm.ko
INSTALL net/can/can-gw.ko
INSTALL net/can/can-raw.ko
INSTALL net/can/can.ko
INSTALL net/ipv4/inet_diag.ko
INSTALL net/ipv4/netfilter/ip_tables.ko
INSTALL net/ipv4/netfilter/ipt_MASQUERADE.ko
INSTALL net/ipv4/netfilter/iptable_filter.ko
INSTALL net/ipv4/netfilter/iptable_nat.ko
INSTALL net/ipv4/netfilter/nf_conntrack_ipv4.ko
INSTALL net/ipv4/netfilter/nf_defrag_ipv4.ko
INSTALL net/ipv4/netfilter/nf_nat_ipv4.ko
INSTALL net/ipv4/tcp_diag.ko
INSTALL net/ipv4/xfrm4_mode_beet.ko
INSTALL net/ipv4/xfrm4_mode_transport.ko
INSTALL net/ipv4/xfrm4_mode_tunnel.ko
INSTALL net/llc/llc.ko
INSTALL net/mac80211/mac80211.ko
INSTALL net/netfilter/nf_conntrack.ko
INSTALL net/netfilter/nf_nat.ko
INSTALL net/netfilter/x_tables.ko
INSTALL net/netfilter/xt_nat.ko
INSTALL net/netfilter/xt_tcpudp.ko
INSTALL net/wireless/cfg80211.ko
INSTALL net/wireless/lib80211.ko
INSTALL sound/core/oss/snd-mixer-oss.ko
INSTALL sound/core/oss/snd-pcm-oss.ko
INSTALL sound/core/snd-compress.ko
INSTALL sound/core/snd-hwdep.ko
INSTALL sound/core/snd-pcm-dmaengine.ko
INSTALL sound/core/snd-pcm.ko
INSTALL sound/core/snd-rawmidi.ko
INSTALL sound/core/snd-timer.ko
INSTALL sound/core/snd.ko
INSTALL sound/soc/codecs/snd-soc-dmic.ko
INSTALL sound/soc/codecs/snd-soc-tlv320aic3x.ko
INSTALL sound/soc/codecs/snd-soc-twl4030.ko
INSTALL sound/soc/codecs/snd-soc-twl6040.ko
INSTALL sound/soc/davinci/snd-soc-davinci-mcasp.ko
INSTALL sound/soc/davinci/snd-soc-davinci.ko
INSTALL sound/soc/davinci/snd-soc-evm.ko
INSTALL sound/soc/omap/snd-soc-omap-abe-twl6040.ko
INSTALL sound/soc/omap/snd-soc-omap-dmic.ko
INSTALL sound/soc/omap/snd-soc-omap-mcbsp.ko
INSTALL sound/soc/omap/snd-soc-omap-mcpdm.ko
INSTALL sound/soc/omap/snd-soc-omap-twl4030.ko
INSTALL sound/soc/omap/snd-soc-omap.ko
INSTALL sound/soc/omap/snd-soc-omap3pandora.ko
INSTALL sound/soc/snd-soc-core.ko
INSTALL sound/soundcore.ko
INSTALL sound/usb/snd-usb-audio.ko
INSTALL sound/usb/snd-usbmidi-lib.ko
DEPMOD 3.16.0