0%

Linux 内核编译

Linux Kernel 编译常用命令

Linux Kernel Version: 4.9.22

  1. make mrproper 主要清除环境变量及配置文件
  2. O=/path/to/output/ 来指定输出文件的位置,默认放在源码位置
  3. make -C Kernel ARCH=$ARCH CROSS_COMPILE=$COMPILER
  4. make distclean Remove editor backup files, patch leftover files and the like
  5. make prepare make scripts This will prepare some files necessary to build a kernel module
  6. make $J -C $TARGET_DIR ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage vmlinux dtbs
  7. make zImage build the kernel image
  8. make vmLinux build the kernel image
  9. make uImage build the kernel image
  10. make -j4 uImage dtbs modules Compile the dtb from Linux kernel source code
  11. make $J LOADADDR=0x00008000 uImage LOADADDR specifies the address where the kernel image will be located by U-Boot and is stored in the U-Boot header by the mkimage utility.