NXP官方yocto学习(二)

        使用yocto平台搭建IMX8QXP开发环境,学习yocto编译工具链,u-boot,kernel,rootfs。

工具链编译

        使用全新的imx-yocto-bsp项目编译工具链SDK。

DISTRO=fsl-imx-wayland MACHINE=imx8qxpmek source fsl-setup-release.sh -b build_imx8qxp
bitbake core-image-minimal -c populate_sdk
Initialising tasks: 100% |####################################################################################################################################################| Time: 0:00:02
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 3060 tasks of which 0 didn't need to be rerun and all succeeded.

        编译完成后进入目录:build_imx8qxp/tmp/deploy/sdk,此时还没有deploy/images。

[wangyb@wangyb-VirtualBox:sdk]$ ls
fsl-imx-wayland-glibc-x86_64-core-image-minimal-aarch64-toolchain-4.14-sumo.host.manifest  fsl-imx-wayland-glibc-x86_64-core-image-minimal-aarch64-toolchain-4.14-sumo.target.manifest
fsl-imx-wayland-glibc-x86_64-core-image-minimal-aarch64-toolchain-4.14-sumo.sh             fsl-imx-wayland-glibc-x86_64-core-image-minimal-aarch64-toolchain-4.14-sumo.testdata.json

        部署工具链,拷贝脚本到需要部署的目录并执行

[wangyb@wangyb-VirtualBox:toolchain-sdk]$ ./fsl-imx-wayland-glibc-x86_64-core-image-minimal-aarch64-toolchain-4.14-sumo.sh 
NXP i.MX Release Distro SDK installer version 4.14-sumo
=======================================================
Enter target directory for SDK (default: /opt/fsl-imx-wayland/4.14-sumo): /home/wangyb/sda3/toolchain-sdk
You are about to install the SDK to "/home/wangyb/sda3/toolchain-sdk". Proceed[Y/n]? 
Extracting SDK..................................done
Setting it up...done
SDK has been successfully set up and is ready to be used.
Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
 $ . /home/wangyb/sda3/toolchain-sdk/environment-setup-aarch64-poky-linux
[wangyb@wangyb-VirtualBox:toolchain-sdk]$ ls
environment-setup-aarch64-poky-linux  fsl-imx-wayland-glibc-x86_64-core-image-minimal-aarch64-toolchain-4.14-sumo.sh  site-config-aarch64-poky-linux  sysroots  version-aarch64-poky-linux

        部署完成后可使用编译链:aarch64-poky-linux-gcc

declare -x AR="aarch64-poky-linux-ar"
declare -x ARCH="arm64"
declare -x AS="aarch64-poky-linux-as "
declare -x CC="aarch64-poky-linux-gcc  --sysroot=/home/wangyb/sda3/toolchain-sdk/sysroots/aarch64-poky-linux"
declare -x CFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types "
declare -x CONFIGURE_FLAGS="--target=aarch64-poky-linux --host=aarch64-poky-linux --build=x86_64-linux --with-libtool-sysroot=/home/wangyb/sda3/toolchain-sdk/sysroots/aarch64-poky-linux"
declare -x CONFIG_SITE="/home/wangyb/sda3/toolchain-sdk/site-config-aarch64-poky-linux"
declare -x CPP="aarch64-poky-linux-gcc -E  --sysroot=/home/wangyb/sda3/toolchain-sdk/sysroots/aarch64-poky-linux"
declare -x CPPFLAGS=""
declare -x CROSS_COMPILE="aarch64-poky-linux-"
declare -x CXX="aarch64-poky-linux-g++  --sysroot=/home/wangyb/sda3/toolchain-sdk/sysroots/aarch64-poky-linux"
declare -x CXXFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types "
declare -x GDB="aarch64-poky-linux-gdb"
declare -x KCFLAGS="--sysroot=/home/wangyb/sda3/toolchain-sdk/sysroots/aarch64-poky-linux"
declare -x LD="aarch64-poky-linux-ld  --sysroot=/home/wangyb/sda3/toolchain-sdk/sysroots/aarch64-poky-linux"
declare -x LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed"
declare -x M4="m4"
declare -x NM="aarch64-poky-linux-nm"
declare -x OBJCOPY="aarch64-poky-linux-objcopy"
declare -x OBJDUMP="aarch64-poky-linux-objdump"
declare -x OECORE_ACLOCAL_OPTS="-I /home/wangyb/sda3/toolchain-sdk/sysroots/x86_64-pokysdk-linux/usr/share/aclocal"
declare -x OECORE_DISTRO_VERSION="4.14-sumo"
declare -x OECORE_NATIVE_SYSROOT="/home/wangyb/sda3/toolchain-sdk/sysroots/x86_64-pokysdk-linux"
declare -x OECORE_SDK_VERSION="4.14-sumo"
declare -x OECORE_TARGET_SYSROOT="/home/wangyb/sda3/toolchain-sdk/sysroots/aarch64-poky-linux"
declare -x OPENSSL_CONF="/home/wangyb/sda3/toolchain-sdk/sysroots/x86_64-pokysdk-linux/usr/lib/ssl/openssl.cnf"
declare -x PATH="/home/wangyb/sda3/toolchain-sdk/sysroots/x86_64-pokysdk-linux/usr/bin:/home/wangyb/sda3/toolchain-sdk/sysroots/x86_64-pokysdk-linux/usr/sbin:/home/wangyb/sda3/toolchain-sdk/sysroots/x86_64-pokysdk-linux/bin:/home/wangyb/sda3/toolchain-sdk/sysroots/x86_64-pokysdk-linux/sbin:/home/wangyb/sda3/toolchain-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/../x86_64-pokysdk-linux/bin:/home/wangyb/sda3/toolchain-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux:/home/wangyb/sda3/toolchain-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux-musl:/home/wangyb/sda3/imx-yocto-bsp/sources/poky/scripts:/home/wangyb/sda3/imx-yocto-bsp/sources/poky/bitbake/bin:/home/wangyb/bin:/home/wangyb/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
declare -x PKG_CONFIG_PATH="/home/wangyb/sda3/toolchain-sdk/sysroots/aarch64-poky-linux/usr/lib/pkgconfig:/home/wangyb/sda3/toolchain-sdk/sysroots/aarch64-poky-linux/usr/share/pkgconfig"
declare -x PKG_CONFIG_SYSROOT_DIR="/home/wangyb/sda3/toolchain-sdk/sysroots/aarch64-poky-linux"
declare -x RANLIB="aarch64-poky-linux-ranlib"
declare -x SDKTARGETSYSROOT="/home/wangyb/sda3/toolchain-sdk/sysroots/aarch64-poky-linux"
declare -x STRIP="aarch64-poky-linux-strip"
declare -x TARGET_PREFIX="aarch64-poky-linux-"
[wangyb@wangyb-VirtualBox:toolchain-sdk]$ aarch64-poky-linux-gcc -v
Using built-in specs.
COLLECT_GCC=aarch64-poky-linux-gcc
COLLECT_LTO_WRAPPER=/home/wangyb/sda3/toolchain-sdk/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/7.3.0/lto-wrapper
Target: aarch64-poky-linux
Configured with: ../../../../../../work-shared/gcc-7.3.0-r0/gcc-7.3.0/configure --build=x86_64-linux --host=x86_64-pokysdk-linux --target=aarch64-poky-linux --prefix=/opt/fsl-imx-wayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr --exec_prefix=/opt/fsl-imx-wayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr --bindir=/opt/fsl-imx-wayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux --sbindir=/opt/fsl-imx-wayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux --libexecdir=/opt/fsl-imx-wayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux --datadir=/opt/fsl-imx-wayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/share --sysconfdir=/opt/fsl-imx-wayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/etc --sharedstatedir=/opt/fsl-imx-wayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/com --localstatedir=/opt/fsl-imx-wayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/var --libdir=/opt/fsl-imx-wayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux --includedir=/opt/fsl-imx-wayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/include --oldincludedir=/opt/fsl-imx-wayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/include --infodir=/opt/fsl-imx-wayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/share/info --mandir=/opt/fsl-imx-wayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/share/man --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot=/home/wangyb/sda3/imx-yocto-bsp/build_imx8qxp/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/7.3.0-r0/recipe-sysroot --with-gnu-ld --enable-shared --enable-languages=c,c++ --enable-threads=posix --enable-multilib --enable-c99 --enable-long-long --enable-symvers=gnu --enable-libstdcxx-pch --program-prefix=aarch64-poky-linux- --without-local-prefix --enable-lto --enable-libssp --enable-libitm --disable-bootstrap --disable-libmudflap --with-system-zlib --with-linker-hash-style=gnu --enable-linker-build-id --with-ppl=no --with-cloog=no --enable-checking=release --enable-cheaders=c_global --without-isl --with-gxx-include-dir=/not/exist/usr/include/c++/7.3.0 --with-build-time-tools=/home/wangyb/sda3/imx-yocto-bsp/build_imx8qxp/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/7.3.0-r0/recipe-sysroot-native/usr/aarch64-poky-linux/bin --with-sysroot=/not/exist --with-build-sysroot=/home/wangyb/sda3/imx-yocto-bsp/build_imx8qxp/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/7.3.0-r0/recipe-sysroot --without-long-double-128 --enable-poison-system-directories --with-mpfr=/home/wangyb/sda3/imx-yocto-bsp/build_imx8qxp/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/7.3.0-r0/recipe-sysroot --with-mpc=/home/wangyb/sda3/imx-yocto-bsp/build_imx8qxp/tmp/work/x86_64-nativesdk-pokysdk-linux/gcc-cross-canadian-aarch64/7.3.0-r0/recipe-sysroot --enable-nls --enable-initfini-array --enable-__cxa_atexit
Thread model: posix
gcc version 7.3.0 (GCC) 

        工具链位置路径

[wangyb@wangyb-VirtualBox:toolchain-sdk]$ which aarch64-poky-linux-gcc
/home/wangyb/sda3/toolchain-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-gcc

[wangyb@wangyb-VirtualBox:toolchain-sdk]$ ls sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux
aarch64-poky-linux-addr2line  aarch64-poky-linux-dwp      aarch64-poky-linux-gcc-nm      aarch64-poky-linux-gdb      aarch64-poky-linux-nm       aarch64-poky-linux-size
aarch64-poky-linux-ar         aarch64-poky-linux-elfedit  aarch64-poky-linux-gcc-ranlib  aarch64-poky-linux-gprof    aarch64-poky-linux-objcopy  aarch64-poky-linux-strings
aarch64-poky-linux-as         aarch64-poky-linux-g++      aarch64-poky-linux-gcov        aarch64-poky-linux-ld       aarch64-poky-linux-objdump  aarch64-poky-linux-strip
aarch64-poky-linux-c++filt    aarch64-poky-linux-gcc      aarch64-poky-linux-gcov-dump   aarch64-poky-linux-ld.bfd   aarch64-poky-linux-ranlib
aarch64-poky-linux-cpp        aarch64-poky-linux-gcc-ar   aarch64-poky-linux-gcov-tool   aarch64-poky-linux-ld.gold  aarch64-poky-linux-readelf

        工具链指定了逻辑目录:--sysroot=toolchain-sdk/sysroots/aarch64-poky-linux,使用编译链自带的头文件和库文件。而不是使用系统的/usr/include, /usr/lib

[wangyb@wangyb-VirtualBox:sysroots]$ ls aarch64-poky-linux/usr/include/
acl          byteswap.h      cursesw.h  et                fstab.h         iconv.h       limits.h    nc_tparm.h     nl_types.h          pthread.h    sgtty.h        sysexits.h    unctrl.h
aio.h        bzlib.h         cursslk.h  eti.h             fts.h           ieee754-64.h  link.h      ncurses_dll.h  nss.h               pty.h        shadow.h       syslog.h      unistd.h
aliases.h    c++             db51       etip.h            ftw.h           ieee754.h     linux       ncurses.h      obstack.h           pwd.h        signal.h       systemd       ustat.h
alloca.h     check.h         db_cxx.h   execinfo.h        gawkapi.h       ifaddrs.h     locale.h    ndbm.h         packer.h            rdma         sound          tar.h         utime.h
a.out.h      check_stdint.h  db.h       expat_config.h    _G_config.h     inttypes.h    lzma        net            panel.h             readline     spawn.h        termcap.h     utmp.h
argp.h       com_err.h       dbm.h      expat_external.h  gconv.h         langinfo.h    lzma.h      netash         paths.h             re_comp.h    ss             term_entry.h  utmpx.h
argz.h       complex.h       dbus-1.0   expat.h           gdbm            lastlog.h     lzo         netatalk       pcrecpparg.h        regex.h      stab.h         term.h        uuid
ar.h         cpio.h          dirent.h   ext2fs            gdbm.h          libcgroup     malloc.h    netax25        pcrecpp.h           regexp.h     stdc-predef.h  termio.h      values.h
arpa         crack.h         dlfcn.h    fcntl.h           getopt.h        libcgroup.h   math.h      netdb.h        pcre.h              resolv.h     stdint.h       termios.h     video
asm          crypt.h         drm        features.h        glob.h          libfdisk      mcheck.h    neteconet      pcreposix.h         rpc          stdio_ext.h    tgmath.h      wait.h
asm-generic  ctype.h         e2p        fenv.h            gmp.h           libgen.h      memory.h    netinet        pcre_scanner.h      rpcsvc       stdio.h        thread_db.h   wchar.h
assert.h     curses-64.h     elf.h      FlexLexer.h       gmpxx.h         libintl.h     menu.h      netipx         pcre_stringpiece.h  sched.h      stdlib.h       tic.h         wctype.h
attr         cursesapp.h     endian.h   fmtmsg.h          gnu             libio.h       misc        netiucv        poll.h              scsi         string.h       time.h        wordexp.h
bash         cursesf.h       envz.h     fnmatch.h         gnumake.h       libkmod.h     mntent.h    netpacket      printf.h            search.h     strings.h      ttyent.h      xen
bits         curses.h        err.h      form.h            gnu-versions.h  libmount      monetary.h  netrom         proc                security     stropts.h      uchar.h       zconf.h
blkid        cursesm.h       errno.h    fpu_control-64.h  grp.h           libsmartcols  mqueue.h    netrose        proc_service.h      semaphore.h  sys            ucontext.h    zlib.h
btrfs        cursesp.h       error.h    fpu_control.h     gshadow.h       libudev.h     mtd         nfs            protocols           setjmp.h     syscall.h      ulimit.h
[wangyb@wangyb-VirtualBox:sysroots]$ ls aarch64-poky-linux/usr/lib
aarch64-poky-linux  libattr.so          libdbus-1.so         libgdbm_compat.so.4      liblzo2.so.2       libpanel.so.5           libreadline.so              libticw.so.5.9
audit               libblkid.so         libdbus-1.so.3       libgdbm_compat.so.4.0.0  liblzo2.so.2.0.0   libpanel.so.5.9         libreadline.so.7            libtinfo.so
cmake               libBrokenLocale.so  libdbus-1.so.3.19.4  libgdbm.so               libmenu.so         libpanelw.so            libreadline.so.7.0          libutil.so
coreutils           libbtrfs.so         libdl.so             libgdbm.so.5             libmenu.so.5       libpanelw.so.5          libresolv.so                libuuid.so
crt1.o              libbtrfs.so.0       libexpat.so          libgdbm.so.5.0.0         libmenu.so.5.9     libpanelw.so.5.9        librt.so                    libz.so
crti.o              libbtrfs.so.0.1     libexpat.so.1        libgmp.so                libmenuw.so        libpcrecpp.so           libsmartcols.so             Mcrt1.o
crtn.o              libbz2.so           libexpat.so.1.6.7    libgmp.so.10             libmenuw.so.5      libpcrecpp.so.0         libssp_nonshared.a          modules-load.d
dbus-1.0            libbz2.so.1         libfdisk.so          libgmp.so.10.3.2         libmenuw.so.5.9    libpcrecpp.so.0.0.1     libssp.so                   opkg
e2fsprogs           libbz2.so.1.0.6     libfl_pic.so         libgmpxx.so              libmount.so        libpcreposix.so         libssp.so.0                 os-release
e2initrd_helper     libcgroup.so        libfl_pic.so.2       libgmpxx.so.4            libm.so            libpcreposix.so.0       libssp.so.0.0.0             perl
environment.d       libcheck.so         libfl_pic.so.2.0.0   libgmpxx.so.4.5.2        libncurses.so      libpcreposix.so.0.0.5   libstdc++.so                perl5
gawk                libcheck.so.0       libfl.so             libhistory.so            libncursesw.so     libpcre.so              libstdc++.so.6              pkgconfig
gcc                 libcheck.so.0.0.0   libfl.so.2           libhistory.so.7          libnsl.so          libpcre.so.1            libstdc++.so.6.0.24         Scrt1.o
gconv               libcidn.so          libfl.so.2.0.0       libhistory.so.7.0        libnss_compat.so   libpcre.so.1.2.9        libstdc++.so.6.0.24-gdb.py  sysctl.d
gcrt1.o             libc_nonshared.a    libform.so           libkmod.so               libnss_db.so       libperl.so.5            libtermcap.so               systemd
kbd                 libcrypt.so         libform.so.5         libkmod.so.2             libnss_dns.so      libperl.so.5.24.1       libthread_db.so             sysusers.d
libacl.so           libc.so             libform.so.5.9       libkmod.so.2.3.3         libnss_files.so    libprocps.so            libtic.so                   tmpfiles.d
libanl.so           libcurses.so        libformw.so          liblzma.so               libnss_hesiod.so   libprocps.so.6          libtic.so.5                 util-linux
libatomic.so        libdb-5.3.so        libformw.so.5        liblzma.so.5             libnss_nisplus.so  libprocps.so.6.0.0      libtic.so.5.9               zlib
libatomic.so.1      libdb-5.so          libformw.so.5.9      liblzma.so.5.2.3         libnss_nis.so      libpthread_nonshared.a  libticw.so
libatomic.so.1.2.0  libdb.so            libgdbm_compat.so    liblzo2.so               libpanel.so        libpthread.so           libticw.so.5

        编写Makefile,Makefile中的工具链全部使用$CC $LD $CXX $STRIP $RANLIB $AS $AR等变量格式;如不需要 Makefile 则直接使用$CC $CFLAGS test.c -o test -ltestshlib 的类似简单编译方式实现。

        如需要编译构建外部驱动程序模块,则在编译驱动程序模块的 Makefile 中指定内核源代码路 径为:/sysroots/aarch64-poky-linux/usr/src/kernel。[这时候还没有kernel目录]

u-boot编译

        u-boot不包含DCD表用于DDR初始化,用户需要使用imx-mkimage更新DCD表来生成最终的imx-boot文件。

        u-boot-imx编译,适用于i.MX 6 or i.MX 7

DISTRO=fsl-imx-wayland MACHINE=imx8qxpmek source fsl-setup-release.sh -b build_imx8qxp
bitbake u-boot-imx
[wangyb@wangyb-VirtualBox:build_imx8qxp]$ ls tmp/deploy/images/imx8qxpmek/ -lh
总用量 620K
lrwxrwxrwx 2 wangyb wangyb   24 12月  1 16:31 u-boot.bin -> u-boot-sd-2018.03-r0.bin
lrwxrwxrwx 2 wangyb wangyb   24 12月  1 16:31 u-boot.bin-sd -> u-boot-sd-2018.03-r0.bin
lrwxrwxrwx 2 wangyb wangyb   24 12月  1 16:31 u-boot-imx8qxpmek.bin -> u-boot-sd-2018.03-r0.bin
lrwxrwxrwx 2 wangyb wangyb   24 12月  1 16:31 u-boot-imx8qxpmek.bin-sd -> u-boot-sd-2018.03-r0.bin
-rw-r--r-- 2 wangyb wangyb 617K 12月  1 16:31 u-boot-sd-2018.03-r0.bin

         imx-boot编译,适用于i.MX8

NXP官方yocto学习(二)

DISTRO=fsl-imx-wayland MACHINE=imx8qxpmek source fsl-setup-release.sh -b build_imx8qxp
bitbake imx-boot
[wangyb@wangyb-VirtualBox:build_imx8qxp]$ ls tmp/deploy/images/imx8qxpmek/ -lh
总用量 2.7M
-rwxr-xr-x 2 wangyb wangyb 8.7K 12月  1 16:42 imx8qx_m4_TCM_hello_world.bin
-rwxr-xr-x 2 wangyb wangyb  30K 12月  1 16:42 imx8qx_m4_TCM_power_mode_switch.bin
-rwxr-xr-x 2 wangyb wangyb 111K 12月  1 16:42 imx8qx_m4_TCM_rear_view_camera.bin
-rwxr-xr-x 2 wangyb wangyb  19K 12月  1 16:42 imx8qx_m4_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin
-rwxr-xr-x 2 wangyb wangyb  20K 12月  1 16:42 imx8qx_m4_TCM_rpmsg_lite_str_echo_rtos.bin
-rwxr-xr-x 2 wangyb wangyb  29K 12月  1 16:42 imx8qx_m4_TCM_srtm_demo.bin
lrwxrwxrwx 2 wangyb wangyb   36 12月  1 16:42 imx-boot-imx8qxpmek-sd.bin -> imx-boot-imx8qxpmek-sd.bin-flash_all
-rw-r--r-- 2 wangyb wangyb 912K 12月  1 16:42 imx-boot-imx8qxpmek-sd.bin-flash
-rw-r--r-- 2 wangyb wangyb 941K 12月  1 16:42 imx-boot-imx8qxpmek-sd.bin-flash_all
drwxr-xr-x 2 wangyb wangyb 4.0K 12月  1 16:42 imx-boot-tools
-rw-r--r-- 2 wangyb wangyb  36K 12月  1 16:42 mx8qx-ahab-container.img

        两个.bin-flash都可启动,使用方法:

sudo dd if=imx-boot-imx8qxpmek-sd.bin of=/dev/sdb bs=1k seek=32 conv=fsync

 kernel编译

        内核使用特殊的源码而不是通用源码,使用tag为imx_4.14.78_1.0.0_ga。

[wangyb@wangyb-VirtualBox:build_imx8qxp]$ cat ../sources/meta-fsl-bsp-release/imx/meta-bsp/recipes-kernel/linux/linux-imx-src-4.14.78.inc
# Copyright 2017-2018 NXP
# Released under the MIT license (see COPYING.MIT for the terms)

LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"

SRCBRANCH = "imx_4.14.78_1.0.0_ga"
LOCALVERSION = "-${SRCBRANCH}"
KERNEL_SRC ?= "git://source.codeaurora.org/external/imx/linux-imx.git;protocol=https"
SRC_URI = "${KERNEL_SRC};branch=${SRCBRANCH}"
SRCREV = "94da7bdc489ba686d868bcf80678a37cae22673e"

S = "${WORKDIR}/git"

        使用arch/arm64/configs/defconfig配置文件

[wangyb@wangyb-VirtualBox:build_imx8qxp]$ cat ../sources/meta-fsl-bsp-release/imx/meta-bsp/recipes-kernel/linux/linux-imx_4.14.78.bb 
DO_CONFIG_V7_COPY = "no"
DO_CONFIG_V7_COPY_mx6 = "yes"
DO_CONFIG_V7_COPY_mx7 = "yes"
DO_CONFIG_V7_COPY_mx8 = "no"

addtask copy_defconfig after do_unpack before do_preconfigure
do_copy_defconfig () {
    install -d ${B}
    if [ ${DO_CONFIG_V7_COPY} = "yes" ]; then
        # copy latest imx_v7_defconfig to use for mx6, mx6ul and mx7
        mkdir -p ${B}
        cp ${S}/arch/arm/configs/imx_v7_defconfig ${B}/.config
        cp ${S}/arch/arm/configs/imx_v7_defconfig ${B}/../defconfig
    else
        # copy latest defconfig to use for mx8
        mkdir -p ${B}
        cp ${S}/arch/arm64/configs/defconfig ${B}/.config
        cp ${S}/arch/arm64/configs/defconfig ${B}/../defconfig
    fi
}
DISTRO=fsl-imx-wayland MACHINE=imx8qxpmek source fsl-setup-release.sh -b build_imx8qxp
bitbake linux-imx

        使用Image和fsl-imx8qxp-mek.dtb文件 

[wangyb@wangyb-VirtualBox:build_imx8qxp]$ ls tmp/deploy/images/imx8qxpmek/ -lh
总用量 30M
lrwxrwxrwx 2 wangyb wangyb   56 12月  1 17:01 fsl-imx8qxp-mek-csi.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-csi-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   57 12月  1 17:01 fsl-imx8qxp-mek-dom0.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-dom0-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   64 12月  1 17:01 fsl-imx8qxp-mek-dsi-rm67191.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-dsi-rm67191-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   56 12月  1 17:01 fsl-imx8qxp-mek-dsp.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-dsp-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   52 12月  1 17:01 fsl-imx8qxp-mek.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   58 12月  1 17:01 fsl-imx8qxp-mek-enet2.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-enet2-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   66 12月  1 17:01 fsl-imx8qxp-mek-enet2-tja1100.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-enet2-tja1100-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   59 12月  1 17:01 fsl-imx8qxp-mek-inmate.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-inmate-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   78 12月  1 17:01 fsl-imx8qxp-mek-it6263-lvds0-dual-channel.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-it6263-lvds0-dual-channel-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   78 12月  1 17:01 fsl-imx8qxp-mek-it6263-lvds1-dual-channel.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-it6263-lvds1-dual-channel-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   74 12月  1 17:01 fsl-imx8qxp-mek-jdi-wuxga-lvds0-panel.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-jdi-wuxga-lvds0-panel-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   74 12月  1 17:01 fsl-imx8qxp-mek-jdi-wuxga-lvds1-panel.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-jdi-wuxga-lvds1-panel-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   58 12月  1 17:01 fsl-imx8qxp-mek-lcdif.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-lcdif-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   55 12月  1 17:01 fsl-imx8qxp-mek-m4.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-m4-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   64 12月  1 17:01 fsl-imx8qxp-mek-mipi-ov5640.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-mipi-ov5640-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   59 12月  1 17:01 fsl-imx8qxp-mek-ov5640.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-ov5640-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   57 12月  1 17:01 fsl-imx8qxp-mek-root.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-root-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   47 12月  1 17:01 Image -> Image--4.14.78-r0-imx8qxpmek-20211201090112.bin
-rw-r--r-- 2 wangyb wangyb  78K 12月  1 17:01 Image--4.14.78-r0-fsl-imx8qxp-mek-20211201090112.dtb
-rw-r--r-- 2 wangyb wangyb  79K 12月  1 17:01 Image--4.14.78-r0-fsl-imx8qxp-mek-csi-20211201090112.dtb
-rw-r--r-- 2 wangyb wangyb  79K 12月  1 17:01 Image--4.14.78-r0-fsl-imx8qxp-mek-dom0-20211201090112.dtb
-rw-r--r-- 2 wangyb wangyb  79K 12月  1 17:01 Image--4.14.78-r0-fsl-imx8qxp-mek-dsi-rm67191-20211201090112.dtb
-rw-r--r-- 2 wangyb wangyb  79K 12月  1 17:01 Image--4.14.78-r0-fsl-imx8qxp-mek-dsp-20211201090112.dtb
-rw-r--r-- 2 wangyb wangyb  78K 12月  1 17:01 Image--4.14.78-r0-fsl-imx8qxp-mek-enet2-20211201090112.dtb
-rw-r--r-- 2 wangyb wangyb  78K 12月  1 17:01 Image--4.14.78-r0-fsl-imx8qxp-mek-enet2-tja1100-20211201090112.dtb
-rw-r--r-- 2 wangyb wangyb 4.9K 12月  1 17:01 Image--4.14.78-r0-fsl-imx8qxp-mek-inmate-20211201090112.dtb
-rw-r--r-- 2 wangyb wangyb  78K 12月  1 17:01 Image--4.14.78-r0-fsl-imx8qxp-mek-it6263-lvds0-dual-channel-20211201090112.dtb
-rw-r--r-- 2 wangyb wangyb  78K 12月  1 17:01 Image--4.14.78-r0-fsl-imx8qxp-mek-it6263-lvds1-dual-channel-20211201090112.dtb
-rw-r--r-- 2 wangyb wangyb  78K 12月  1 17:01 Image--4.14.78-r0-fsl-imx8qxp-mek-jdi-wuxga-lvds0-panel-20211201090112.dtb
-rw-r--r-- 2 wangyb wangyb  78K 12月  1 17:01 Image--4.14.78-r0-fsl-imx8qxp-mek-jdi-wuxga-lvds1-panel-20211201090112.dtb
-rw-r--r-- 2 wangyb wangyb  79K 12月  1 17:01 Image--4.14.78-r0-fsl-imx8qxp-mek-lcdif-20211201090112.dtb
-rw-r--r-- 2 wangyb wangyb  79K 12月  1 17:01 Image--4.14.78-r0-fsl-imx8qxp-mek-m4-20211201090112.dtb
-rw-r--r-- 2 wangyb wangyb  79K 12月  1 17:01 Image--4.14.78-r0-fsl-imx8qxp-mek-mipi-ov5640-20211201090112.dtb
-rw-r--r-- 2 wangyb wangyb  79K 12月  1 17:01 Image--4.14.78-r0-fsl-imx8qxp-mek-ov5640-20211201090112.dtb
-rw-r--r-- 2 wangyb wangyb  79K 12月  1 17:01 Image--4.14.78-r0-fsl-imx8qxp-mek-root-20211201090112.dtb
-rw-r--r-- 2 wangyb wangyb  22M 12月  1 17:01 Image--4.14.78-r0-imx8qxpmek-20211201090112.bin
lrwxrwxrwx 2 wangyb wangyb   56 12月  1 17:01 Image-fsl-imx8qxp-mek-csi.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-csi-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   57 12月  1 17:01 Image-fsl-imx8qxp-mek-dom0.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-dom0-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   64 12月  1 17:01 Image-fsl-imx8qxp-mek-dsi-rm67191.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-dsi-rm67191-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   56 12月  1 17:01 Image-fsl-imx8qxp-mek-dsp.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-dsp-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   52 12月  1 17:01 Image-fsl-imx8qxp-mek.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   58 12月  1 17:01 Image-fsl-imx8qxp-mek-enet2.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-enet2-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   66 12月  1 17:01 Image-fsl-imx8qxp-mek-enet2-tja1100.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-enet2-tja1100-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   59 12月  1 17:01 Image-fsl-imx8qxp-mek-inmate.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-inmate-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   78 12月  1 17:01 Image-fsl-imx8qxp-mek-it6263-lvds0-dual-channel.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-it6263-lvds0-dual-channel-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   78 12月  1 17:01 Image-fsl-imx8qxp-mek-it6263-lvds1-dual-channel.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-it6263-lvds1-dual-channel-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   74 12月  1 17:01 Image-fsl-imx8qxp-mek-jdi-wuxga-lvds0-panel.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-jdi-wuxga-lvds0-panel-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   74 12月  1 17:01 Image-fsl-imx8qxp-mek-jdi-wuxga-lvds1-panel.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-jdi-wuxga-lvds1-panel-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   58 12月  1 17:01 Image-fsl-imx8qxp-mek-lcdif.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-lcdif-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   55 12月  1 17:01 Image-fsl-imx8qxp-mek-m4.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-m4-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   64 12月  1 17:01 Image-fsl-imx8qxp-mek-mipi-ov5640.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-mipi-ov5640-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   59 12月  1 17:01 Image-fsl-imx8qxp-mek-ov5640.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-ov5640-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   57 12月  1 17:01 Image-fsl-imx8qxp-mek-root.dtb -> Image--4.14.78-r0-fsl-imx8qxp-mek-root-20211201090112.dtb
lrwxrwxrwx 2 wangyb wangyb   47 12月  1 17:01 Image-imx8qxpmek.bin -> Image--4.14.78-r0-imx8qxpmek-20211201090112.bin
-rw-rw-r-- 2 wangyb wangyb 3.3M 12月  1 17:01 modules--4.14.78-r0-imx8qxpmek-20211201090112.tgz
lrwxrwxrwx 2 wangyb wangyb   49 12月  1 17:01 modules-imx8qxpmek.tgz -> modules--4.14.78-r0-imx8qxpmek-20211201090112.tgz

rootfs编译

        rootfs编译使用编译大包的方式,使用ext4文件系统格式。

DISTRO=fsl-imx-wayland MACHINE=imx8qxpmek source fsl-setup-release.sh -b build_imx8qxp
bitbake core-image-minimal
[wangyb@wangyb-VirtualBox:build_imx8qxp]$ ls tmp/deploy/images/imx8qxpmek/ -lh
总用量 89M
-rw-r--r-- 2 wangyb wangyb  56M 12月  1 17:21 core-image-minimal-imx8qxpmek-20211201092005.rootfs.ext4
-rw-r--r-- 2 wangyb wangyb 1.9K 12月  1 17:21 core-image-minimal-imx8qxpmek-20211201092005.rootfs.manifest
-rw-r--r-- 2 wangyb wangyb  19M 12月  1 17:21 core-image-minimal-imx8qxpmek-20211201092005.rootfs.sdcard.bz2
-rw-r--r-- 2 wangyb wangyb 9.0M 12月  1 17:21 core-image-minimal-imx8qxpmek-20211201092005.rootfs.tar.bz2
-rw-r--r-- 1 wangyb wangyb 143K 12月  1 17:21 core-image-minimal-imx8qxpmek-20211201092005.testdata.json
lrwxrwxrwx 2 wangyb wangyb   56 12月  1 17:21 core-image-minimal-imx8qxpmek.ext4 -> core-image-minimal-imx8qxpmek-20211201092005.rootfs.ext4
lrwxrwxrwx 2 wangyb wangyb   60 12月  1 17:21 core-image-minimal-imx8qxpmek.manifest -> core-image-minimal-imx8qxpmek-20211201092005.rootfs.manifest
lrwxrwxrwx 2 wangyb wangyb   62 12月  1 17:22 core-image-minimal-imx8qxpmek.sdcard.bz2 -> core-image-minimal-imx8qxpmek-20211201092005.rootfs.sdcard.bz2
lrwxrwxrwx 2 wangyb wangyb   59 12月  1 17:21 core-image-minimal-imx8qxpmek.tar.bz2 -> core-image-minimal-imx8qxpmek-20211201092005.rootfs.tar.bz2
lrwxrwxrwx 1 wangyb wangyb   58 12月  1 17:21 core-image-minimal-imx8qxpmek.testdata.json -> core-image-minimal-imx8qxpmek-20211201092005.testdata.json

        

上一篇:WYWZ控制台 V4.00(完全清除系统所有痕迹)中文免费版


下一篇:android11墓碑机制和addr2line使用