一、说明
主机系统:Ubuntu 20.04.3 LTS
开发板:TOPEET-IMX6ULL
Linux版本:linux-imx_5.4.70_2.3.0
交叉编译器:gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf
有了前面IMX6ULL-移植uboot-imx_v2020.04_5.4.70_2.3.0的基础再进行Linux移植就会方便很多。因为Linux的移植更多的是对设备树的修改,而在Uboot移植时已经修改过设备树,所以接下来会省不少事。
二、环境搭建
2.1、Linux源码
获取NXP维护的Linux内核源码:
git clone https://source.codeaurora.org/external/imx/linux-imx
使用命令git tag -a查看版本然后git checkout -b git checkout -b rel_imx_5.4.70_2.3.0 接下来就基于版本源码进行linux内核移植 2.2、交叉编译器 参考IMX6ULL-移植uboot-imx_v2020.04_5.4.70_2.3.0的2.2小节 三、编译源码 linux源码根目录下创建编译脚本make.sh内容如下: #!/bin/bash # 若之前已经导入到环境变量则不需要 export PATH=$PATH:/usr/local/arm/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf/bin # 若已经在顶层Makefile文件中指定则不需要 export ARCH=arm # 若已经在顶层Makefile文件中指定则不需要 export CROSS_COMPILE=arm-none-linux-gnueabihf- make distclean # make mrproper # For I.MX6 --> imx_v7_defconfig # For I.MX7 --> imx_v7_defconfig # For I.MX8 --> imx_v8_defconfig make imx_v7_defconfig # make menuconfig make -j $(nproc) all 执行编译./make.sh并等待编译完成,如果没有错误出现说明搭建环境OK。 补充说明: make命令 /imx6ull/kernel/linux-imx_5.4.70_2.3.0$ make help 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 + various backup files distclean - mrproper + remove editor backup and patch files Configuration targets: config - Update current config utilising a line-oriented program nconfig - Update current config utilising a ncurses menu based 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 mods to core defconfig - New config with default from ARCH supplied defconfig savedefconfig - Save current config as ./defconfig (minimal config) allnoconfig - New config where all options are answered with no allyesconfig - New config where all options are accepted with yes allmodconfig - New config selecting modules when possible alldefconfig - New config with all symbols set to default randconfig - New config with random answer to all options listnewconfig - List new options olddefconfig - Same as oldconfig but sets new symbols to their default value without prompting kvmconfig - Enable additional options for kvm guest kernel support xenconfig - Enable additional options for xen dom0 and guest kernel support tinyconfig - Configure the tiniest possible kernel testconfig - Run Kconfig unit tests (requires python3 and pytest) Other generic 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: /) dir/ - Build all files in dir and below dir/file.[ois] - Build specified target only dir/file.ll - Build the LLVM assembly file (requires compiler support for LLVM assembly generation) dir/file.lst - Build specified 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 cscope - Generate cscope index gtags - Generate GNU GLOBAL index kernelrelease - Output the release version string (use with make -s) kernelversion - Output the version stored in Makefile (use with make -s) image_name - Output the image name (use with make -s) headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH (default: ./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 exported symbols headerdep - Detect inclusion cycles in headers coccicheck - Check with Coccinelle Tools: nsdeps - Generate missing symbol namespace dependencies Kernel selftest: kselftest - Build and run kernel selftest (run as root) Build, install, and boot kernel before running kselftest on it kselftest-clean - Remove all generated kselftest files kselftest-merge - Merge all the config dependencies of kselftest to existing .config. Userspace tools targets: use 'make tools/help' or 'cd tools; make help' Kernel packaging: rpm-pkg - Build both source and binary RPM kernel packages binrpm-pkg - Build only the binary kernel RPM package deb-pkg - Build both source and binary deb kernel packages bindeb-pkg - Build only the binary kernel deb package snap-pkg - Build only the binary kernel snap package (will connect to external hosts) 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 tarball tarxz-pkg - Build the kernel as a xz compressed tarball perf-tar-src-pkg - Build perf-5.4.70.tar source tarball perf-targz-src-pkg - Build perf-5.4.70.tar.gz source tarball perf-tarbz2-src-pkg - Build perf-5.4.70.tar.bz2 source tarball perf-tarxz-src-pkg - Build perf-5.4.70.tar.xz source tarball Documentation targets: Linux kernel internal documentation in different formats from ReST: htmldocs - HTML latexdocs - LaTeX pdfdocs - PDF epubdocs - EPUB xmldocs - XML linkcheckdocs - check for broken external links (will connect to external hosts) refcheckdocs - check for references to non-existing files under Documentation cleandocs - clean all generated files make SPHINXDIRS='s1 s2' [target] Generate only docs of folder s1, s2 valid values for SPHINXDIRS are: make SPHINX_CONF={conf-file} [target] use *additional* sphinx-build configuration. This is e.g. useful to build with nit-picking config. Default location for the generated documents is Documentation/output Architecture specific targets (x86): * bzImage - Compressed kernel image (arch/x86/boot/bzImage) install - Install kernel using (your) ~/bin/installkernel or (distribution) /sbin/installkernel or install to $(INSTALL_PATH) and run lilo fdimage - Create 1.4MB boot floppy image (arch/x86/boot/fdimage) fdimage144 - Create 1.4MB boot floppy image (arch/x86/boot/fdimage) fdimage288 - Create 2.8MB boot floppy image (arch/x86/boot/fdimage) isoimage - Create a boot CD-ROM image (arch/x86/boot/image.iso) bzdisk/fdimage*/isoimage also accept: FDARGS='...' arguments for the booted kernel FDINITRD=file initrd for the booted kernel i386_defconfig - Build for i386 x86_64_defconfig - Build for x86_64 make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build make V=2 [targets] 2 => give reason for rebuild of target make O=dir [targets] Locate all output files in 'dir', including .config make C=1 [targets] Check re-compiled c source with $CHECK (sparse by default) make C=2 [targets] Force check of all c source with $CHECK make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections make W=n [targets] Enable extra build checks, n=1,2,3 where
上一篇:IMX6ULL-移植uboot-imx_v2020.04_5.4.70_2.3.0
下一篇:IMX6ULL - Linux根文件系统(rootfs)构建
推荐阅读最新更新时间:2026-02-11 09:50
- LT6658AHMSE-2.5 偏置多应变计的典型应用电路
- DC2290A-F,使用 LTC2385-16、16 位、5Msps 高速 SAR ADC 的演示板
- 使用 NXP Semiconductors 的 PC9S08PT60VLH 的参考设计
- OP113ESZ 假接地发生器的典型应用
- LT8631HFE 200kHz、1.8V、1A 降压转换器的典型应用电路
- 低失真、低噪声差分放大器驱动要求苛刻的通信收发器中的高速 ADC
- LTC1147-3.3 高效降压转换器的典型应用电路
- AM2G-4807SH30Z 7.2V 2 瓦 DC-DC 转换器的典型应用
- DC1067A-A,LTC2450IDC 演示板,16 位高性能,Delta Sigma 模数转换器
- 使用 Diodes Incorporated 的 PT8A3514 的参考设计



CANopen移植工程(源代码)
智能车平衡轮腿
uCOS-II移植到STM32的详细步骤
非常经典的关于LLC的杨波博士论文
VI-27WIU






京公网安备 11010802033920号