From 2b179f80693db10cb5a93ee649917ae6988feaf2 Mon Sep 17 00:00:00 2001 From: guowenxue <guowenxue@gmail.com> Date: Thu, 26 Sep 2024 17:44:21 +0800 Subject: [PATCH] BSP:IGKBoard-All: Move BSP scripts to bsp folder --- readme.md | 166 +++++++++++++++++++++++++++--------------------------- 1 files changed, 83 insertions(+), 83 deletions(-) diff --git a/readme.md b/readme.md index 2f9d3b9..1b5e09c 100644 --- a/readme.md +++ b/readme.md @@ -24,13 +24,13 @@ guowenxue@9d57f9229b66:~$ cd ~/igkboard-imx6ull/ -guowenxue@9d57f9229b66:~/igkboard-imx6ull$ ls +guowenxue@9d57f9229b66:~/igkboard-imx6ull$ ls bsp bootloader config.json debian drivers images kernel tools yocto ``` -下面是编译系统各文件的简单介绍。 +下面是BSP编译系统各文件的简单介绍。 | 文件/文件夹 | 描述 | | --------------- | ------------------------------------------ | @@ -52,7 +52,7 @@ 下面是顶层编译系统的配置文件,默认为 ***IGKBoard-IMX6ULL*** 开发板的配置。 ```json -guowenxue@9d57f9229b66:~/igkboard-imx6ull$ cat config.json +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp$ cat config.json { "bsp": { @@ -81,7 +81,7 @@ * ***bsp.board*** 该选项指定要编译的目标开发板,具体支持哪些可以查看 `kernel/patches/` 文件夹下有哪些开发板文件夹. ```bash -guowenxue@9d57f9229b66:~/igkboard-imx6ull$ ls kernel/patches/ +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp$ ls kernel/patches/ alientek-imx6ull-v20 alientek-imx6ull-v24 gauguin-imx8mp gen_patch.sh igkboard-imx6ull igkboard-imx8mp ``` @@ -94,7 +94,7 @@ * ***bsp.version*** 该选项指定要编译的Linux BSP版本,具体支持哪些可以查看 `kernel/patches/` 相应开发板下支持哪些补丁. ```bash -guowenxue@9d57f9229b66:~/igkboard-imx6ull$ ls kernel/patches/igkboard-imx6ull/ +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp$ ls kernel/patches/igkboard-imx6ull/ linux-imx-lf-6.1.36-2.1.0.patch ``` @@ -140,7 +140,7 @@ 在开始编译之前,我们首先确定当前编译系统支持哪些BSP版本,这点可以通过查看相应开发板的补丁文件来获取。如下所示,当前 IGKBoard-IMX6ULL 只支持 lf-6.1.36-2.1.0 这个版本。 ```bash -guowenxue@9d57f9229b66:~/igkboard-imx6ull$ ls kernel/patches/igkboard-imx6ull/ +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp$ ls kernel/patches/igkboard-imx6ull/ linux-imx-lf-6.1.36-2.1.0.patch ``` @@ -196,9 +196,9 @@ 下面是我配置的代理命令 **proxy** 用来代理访问 github,设置好后可以使用 **curl** 命令访问 google.com 来测试代理是否生效。 ```bash -guowenxue@9d57f9229b66:~/igkboard-imx6ull$ proxy +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp$ proxy -guowenxue@9d57f9229b66:~/igkboard-imx6ull$ curl google.com +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp$ curl google.com <HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8"> <TITLE>301 Moved</TITLE></HEAD><BODY> <H1>301 Moved</H1> @@ -212,7 +212,7 @@ 另外,也可以使用 **unproxy** 命令来取消命令行代理。 ```bash -guowenxue@9d57f9229b66:~/igkboard-imx6ull$ unproxy +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp$ unproxy ``` @@ -250,7 +250,7 @@ 在嵌入式BSP系统开发过程中,依赖很多的Linux系统命令及交叉编译器。在该编译系统的 ***tools*** 文件夹下,有一个 ***setup_tools.sh*** 脚本可以用来一键安装它们。 ```bash -guowenxue@9d57f9229b66:~/igkboard-imx6ull$ ls tools/ +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp$ ls tools/ imgmnt setup_tools.sh ``` @@ -259,16 +259,16 @@ 接下来以 root 权限执行 ***tools/setup_tools.sh*** 脚本,来安装BSP源码编译所依赖的系统工具和交叉编译器,如果之前已经安装过则会自动跳过。 ```bash -guowenxue@9d57f9229b66:~/igkboard-imx6ull$ cd tools/ +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp$ cd tools/ -guowenxue@9d57f9229b66:~/igkboard-imx6ull/tools$ sudo ./setup_tools.sh - All system tools already installed, skip it - All development tools already installed, skip it - start download cross compiler from ARM Developer for Cortex-A core +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp/tools$ sudo ./setup_tools.sh + All system tools already installed, skip it + All development tools already installed, skip it + start download cross compiler from ARM Developer for Cortex-A core ... ... start decompress cross compiler for Cortex-A core ... ... - cross compiler for Cortex-A installed to "/opt/gcc-aarch32-10.3-2021.07" successfully + cross compiler for Cortex-A installed to "/opt/gcc-aarch32-10.3-2021.07" successfully ``` @@ -284,26 +284,26 @@ 在做好前面的配置后,编译 bootloader 的工作就非常简单了,我们只需要切换到 ***bootloader*** 文件夹下,执行 `build.sh` 脚本即可。它将会自动从配置的源码服务器上下载源码,并打上相应的补丁文件,开始漫长的编译工作。 ``` bash -guowenxue@9d57f9229b66:~/igkboard-imx6ull$ cd bootloader/ +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp$ cd bootloader/ -guowenxue@9d57f9229b66:~/igkboard-imx6ull/bootloader$ ls +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp/bootloader$ ls build.sh patches -guowenxue@9d57f9229b66:~/igkboard-imx6ull/bootloader$ ./build.sh - start build bootloader for igkboard-imx6ull - start fetch uboot-imx source code +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp/bootloader$ ./build.sh + start build bootloader for igkboard-imx6ull + start fetch uboot-imx source code ... ... - do patch for uboot-imx now... + do patch for uboot-imx now... ... ... - start build uboot-imx + start build uboot-imx ... ... MKIMAGE u-boot-dtb.imx OFCHK .config -+ cp u-boot-igkboard-imx6ull.imx /home/guowenxue/igkboard-imx6ull/bootloader/install ++ cp u-boot-igkboard-imx6ull.imx /home/guowenxue/igkboard-imx6ull/bsp/bootloader/install + set +x - bootloader installed to '/home/guowenxue/igkboard-imx6ull/bootloader/install' -u-boot-igkboard-imx6ull.imx + bootloader installed to '/home/guowenxue/igkboard-imx6ull/bsp/bootloader/install' +u-boot-igkboard-imx6ull.imx ``` @@ -311,7 +311,7 @@ 编译完成后,生成的 bootloader 文件将会存放到自动创建的 ***install*** 文件夹下。 ```bash -guowenxue@9d57f9229b66:~/igkboard-imx6ull/bootloader$ ls install/ +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp/bootloader$ ls install/ u-boot-igkboard-imx6ull.imx ``` @@ -320,13 +320,13 @@ 如果对 bootloader 源码有新的修改,我们可以使用 `./patches/gen_patch.sh` 脚本生成新的 patch 补丁文件。如果想保存该补丁文件,则可以替换 ***patches*** 文件夹下的相应文件。 ```bash -guowenxue@9d57f9229b66:~/igkboard-imx6ull/bootloader$ ./patches/gen_patch.sh uboot-imx/ - generate patch file - -guowenxue@9d57f9229b66:~/igkboard-imx6ull/bootloader$ ls +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp/bootloader$ ./patches/gen_patch.sh uboot-imx/ + generate patch file + +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp/bootloader$ ls build.sh install patches tarballs uboot-imx uboot-imx-lf-6.1.36-2.1.0.patch -guowenxue@9d57f9229b66:~/igkboard-imx6ull/bootloader$ mv uboot-imx-lf-6.1.36-2.1.0.patch patches/igkboard-imx6ull/ +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp/bootloader$ mv uboot-imx-lf-6.1.36-2.1.0.patch patches/igkboard-imx6ull/ ``` @@ -334,10 +334,10 @@ 另外使用 `build.sh -c` 命令可以一键清除所有编译产生的文件和源码。 ```bash -guowenxue@9d57f9229b66:~/igkboard-imx6ull/bootloader$ ./build.sh -c - start clean bootloader - -guowenxue@9d57f9229b66:~/igkboard-imx6ull/bootloader$ ls +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp/bootloader$ ./build.sh -c + start clean bootloader + +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp/bootloader$ ls build.sh patches ``` @@ -350,20 +350,20 @@ 同样地,编译 Linux内核源码的工作也非常简单,我们只需要切换到 ***kernel*** 文件夹下,执行 `build.sh` 脚本即可。它将会自动从配置的源码服务器上下载源码,并打上相应的补丁文件,开始漫长的编译工作。 ```bash -guowenxue@9d57f9229b66:~/igkboard-imx6ull$ cd kernel/ +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp$ cd kernel/ -guowenxue@9d57f9229b66:~/igkboard-imx6ull/kernel$ ls +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp/kernel$ ls build.sh patches -guowenxue@9d57f9229b66:~/igkboard-imx6ull/kernel$ ./build.sh - start build linux kernel for igkboard-imx6ull - start fetch linux kernel source code +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp/kernel$ ./build.sh + start build linux kernel for igkboard-imx6ull + start fetch linux kernel source code ... ... - do patch for linux-imx now... + do patch for linux-imx now... ... ... - start build linux-imx + start build linux-imx ... ... - linux kernel installed to '/home/guowenxue/igkboard-imx6ull/kernel/install' + linux kernel installed to '/home/guowenxue/igkboard-imx6ull/bsp/kernel/install' igkboard-imx6ull.dtb lib overlays zImage ``` @@ -372,7 +372,7 @@ 同样地,编译完成后生成的 linux内核文件将会存放到自动创建的 ***install*** 文件夹下。 ```bash -guowenxue@9d57f9229b66:~/igkboard-imx6ull/kernel$ ls install/ +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp/kernel$ ls install/ igkboard-imx6ull.dtb lib overlays zImage ``` @@ -381,13 +381,13 @@ 如果对 Linux内核源码有新的修改,我们可以使用 `./patches/gen_patch.sh` 脚本生成新的 patch 补丁文件。如果想保存该补丁文件,则可以替换 ***patches*** 文件夹下的相应文件。 ```bash -guowenxue@9d57f9229b66:~/igkboard-imx6ull/kernel$ ./patches/gen_patch.sh linux-imx/ - generate patch file - -guowenxue@9d57f9229b66:~/igkboard-imx6ull/kernel$ ls +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp/kernel$ ./patches/gen_patch.sh linux-imx/ + generate patch file + +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp/kernel$ ls build.sh install linux-imx linux-imx-lf-6.1.36-2.1.0.patch patches tarballs -guowenxue@9d57f9229b66:~/igkboard-imx6ull/kernel$ mv linux-imx-lf-6.1.36-2.1.0.patch patches/igkboard-imx6ull/ +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp/kernel$ mv linux-imx-lf-6.1.36-2.1.0.patch patches/igkboard-imx6ull/ ``` @@ -395,10 +395,10 @@ 另外使用 `build.sh -c` 命令可以一键清除所有编译产生的文件和源码。 ``` -guowenxue@9d57f9229b66:~/igkboard-imx6ull/kernel$ ./build.sh -c - start clean linux kernel - -guowenxue@9d57f9229b66:~/igkboard-imx6ull/kernel$ ls +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp/kernel$ ./build.sh -c + start clean linux kernel + +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp/kernel$ ls build.sh patches ``` @@ -415,36 +415,36 @@ 因为 Linux 系统镜像需要使用 **sudo** 和 **loop** 设备,所以这个需要在自己的虚拟机或实验室的编译服务器具有相应权限的账号下工作。 ```bash -guowenxue@9d57f9229b66:~/igkboard-imx6ull$ cd images/ +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp$ cd images/ -guowenxue@9d57f9229b66:~/igkboard-imx6ull/images$ ls +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp/images$ ls build.sh -guowenxue@9d57f9229b66:~/igkboard-imx6ull/images$ sudo ./build.sh - Build system image yocto-mickledore-lf-6.1.36-2.1.0.img - INFO: download rootfs-yocto-mickledore.tar.zst form http://studio.xxx.com:2211 +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp/images$ sudo ./build.sh + Build system image yocto-mickledore-lf-6.1.36-2.1.0.img + INFO: download rootfs-yocto-mickledore.tar.zst form http://studio.xxx.com:2211 ... ... - start generate empty system image + start generate empty system image ... ... - start partition system image - losetup system image on loop4 + start partition system image + losetup system image on loop4 ... ... - start format system image + start format system image ... ... - start install u-boot image + start install u-boot image ... ... - start install linux kernel images - update drivers in root filesystem - start install root filesystem - Build system image yocto-mickledore-lf-6.1.36-2.1.0.img done - Start bzip2 compress yocto-mickledore-lf-6.1.36-2.1.0.img + start install linux kernel images + update drivers in root filesystem + start install root filesystem + Build system image yocto-mickledore-lf-6.1.36-2.1.0.img done + Start bzip2 compress yocto-mickledore-lf-6.1.36-2.1.0.img ... ... Shell script exit now, do some clean work - - kpartx -dv /dev/loop4 + + kpartx -dv /dev/loop4 del devmap : loop4p1 del devmap : loop4p2 - losetup -d /dev/loop4 + losetup -d /dev/loop4 ``` @@ -452,7 +452,7 @@ 编译完成后,系统镜像和烧录所需要的文件将会存放到自动创建的 ***install*** 文件夹下。 ```bash -guowenxue@9d57f9229b66:~/igkboard-imx6ull/images$ ls install/ +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp/images$ ls install/ u-boot-igkboard-imx6ull.imx yocto-mickledore-lf-6.1.36-2.1.0.img.bz2 ``` @@ -485,17 +485,17 @@ 下面是 Yocto 源码编译的过程。 ```bash -guowenxue@9d57f9229b66:~/igkboard-imx6ull$ cd yocto/ +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp$ cd yocto/ -guowenxue@9d57f9229b66:~/igkboard-imx6ull/yocto$ ls +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp/yocto$ ls build.sh meta-igkboard -guowenxue@9d57f9229b66:~/igkboard-imx6ull/yocto$ ./build.sh - start build Yocto mickledore for igkboard-imx6ull - start download fetch Yocto mickledore source code +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp/yocto$ ./build.sh + start build Yocto mickledore for igkboard-imx6ull + start download fetch Yocto mickledore source code ... ... Build directory is igkboard-imx6ull -/home/guowenxue/igkboard-imx6ull/yocto/mickledore-lf-6.1.36-2.1.0 +/home/guowenxue/igkboard-imx6ull/bsp/yocto/mickledore-lf-6.1.36-2.1.0 Welcome LingYun IoT Gateway Kit Board Yocto BSP The Yocto Project has extensive documentation about OE including a @@ -509,9 +509,9 @@ core-image-minimal imx-image-full ... ... - - Yocto(mickledore) installed to '/home/guowenxue/igkboard-imx6ull/yocto/install' - Start bzip2 compress yocto-mickledore-lf-6.1.36-2.1.0.wic + + Yocto(mickledore) installed to '/home/guowenxue/igkboard-imx6ull/bsp/yocto/install' + Start bzip2 compress yocto-mickledore-lf-6.1.36-2.1.0.wic rootfs-yocto-mickledore.tar.zst u-boot-igkboard-imx6ull.imx yocto-mickledore-lf-6.1.36-2.1.0.wic.bz2 ``` @@ -520,7 +520,7 @@ 编译完成后,系统镜像和烧录所需要的文件将会存放到自动创建的 ***install*** 文件夹下。 ```bash -guowenxue@9d57f9229b66:~/igkboard-imx6ull/yocto$ ls install/ +guowenxue@9d57f9229b66:~/igkboard-imx6ull/bsp/yocto$ ls install/ rootfs-yocto-mickledore.tar.zst u-boot-igkboard-imx6ull.imx yocto-mickledore-lf-6.1.36-2.1.0.wic.bz2 ``` -- Gitblit v1.9.1