在yocto中查找并修改软件源代码 / yocto how to find and modify the source for software packages
在开发过程中, 我们比较推荐使用这个文档 在yocto中进行kernel/u-boot开发 的方式来修改源码 。
首先,如果你还不在yocto的开发环境下的话,需要导入编译环境,如:
. sources/poky/oe-init-build-env
查找你想要看源代码的包的名称
bitbake -s | grep
然后进入这个软件包的源码目录,以下以barebox和kernel为例:
使用以下命令会进入barebox源码的路径下
bitbake barebox -c devshell
使用以下命令会进入kernel源码的路径下。
其中内核包名称是指BSP中的内核包的名称,如下表中的linux-mainline / linux-ti / linux-imx 等。
*Add filterReset all filtersDisable all filtersReset column sortingModify SettingsCopy the filter URLExport to PDFExport to CSVExport to WordPrintDocumentationWhat's newRate our appShowing the first rowsStart adding filters in the filter tools menu.The filter is disabled at the moment.Enable all filtersExport to PDFExport to CSVExport to WordPrintDocumentationWhat's newRate our appOops, it seems that you need to place a table or a macro generating a table within the Table Filter macro.
The table is being loaded. Please wait for a bit ...
平台BSP下载最新的meta-phytec tagyoctokernelBootloaderQTAM65xALPHA4 3.1 Dunfelllinux-phytec-ti BSP-Yocto-TISDK-AM65xx-ALPHA4uboot-phytec BSP-Yocto-TISDK-AM65xx-ALPHA4AM57xPD18.1.0 BSP-Yocto-TISDK-AM57xx-PD18.1.02.2 Mortylinux-phytec-ti v4.9.41-phy1uboot-phytec v2017.01-phy15.7AM57xPD18.2.0 BSP-Yocto-TISDK-AM57xx-PD18.2.02.2 Mortylinux-phytec-ti v4.9.41-phy4uboot-phytec v2017.01-phy45.7AM57xPD19.1.1 BSP-Yocto-TISDK-AM57xx-PD19.1.12.6 Thudlinux-phytec-ti BSP-Yocto-TISDK-AM57xx-PD19.1.1uboot-phytec BSP-Yocto-TISDK-AM57xx-PD19.1.1AM57xPD20.1.2 BSP-Yocto-TISDK-AM57xx-PD20.1.22.6 Thudlinux-phytec-ti BSP-Yocto-TISDK-AM57xx-PD20.1.2uboot-phytec BSP-Yocto-TISDK-AM57xx-PD20.1.25.11AM335xPD16.2.0 2.1.2-phy12.1 Krogothlinux-ti v4.4.19-phy2barebox v2016.07.0-phy35.6AM335xPD17.1.3 2.2.4-phy42.2 Mortylinux-ti v4.4.141-phy2barebox v2017.06.1-phy45.7AM335xPD17.2.0 2.3.2-phy22.3 Pyrolinux-mainline v4.9.47-phy25.8AM335xPD17.2.1 2.3.3-phy12.3 Pyrolinux-mainline v4.9.47-phy2barebox v2017.10.0-phy25.8AM335xPD17.2.2 2.3.3-phy22.3 Pyrolinux-mainline v4.9.98-phy1barebox v2017.10.0-phy35.8AM335xPD19.1.0 2.5.2-phy22.5 Sumolinux-mainline v4.14.78-phy4barebox v2018.11.0-phy25.10AM335xPD19.1.1 2.5.3-phy72.5 Sumolinux-mainline v4.14.78-phy6barebox v2018.11.0-phy35.10i.MX6Mira HTML5 v1.0
2.2.1-phy1linux-mainline v4.1.36-phy3barebox v2016.11.0-phy4i.MX6PD15.3.0 1.8.1-phy61.8 Fidolinux-mainline v4.1.18-phy4barebox v2015.11.0-phy4i.MX6PD15.3.1 1.8.1-phy6-fix11.8 Fidolinux-mainline v4.1.18-phy5barebox v2015.11.0-phy4i.MX6PD16.1.0 2.1.2-phy42.1 Krogothlinux-mainline v4.1.36-phy3barebox v2016.11.0-phy75.6i.MX6PD16.1.1 2.1.3-phy52.1 Krogothlinux-mainline v4.1.46-phy2barebox v2016.11.0-phy75.6i.MX6PD16.1.2 2.1.3-phy82.1 Krogothlinux-mainline v4.1.46-phy4barebox v2016.11.0-phy85.6i.MX6PD18.1.0 2.4.3-phy42.4 Rockolinux-mainline v4.14.39-phy4barebox v2017.12.0-phy35.9i.MX6PD18.1.1 2.4.4-phy22.4 Rockolinux-mainline v4.14.78-phy2barebox v2017.12.0-phy35.9i.MX6PD18.1.2 2.4.4-phy62.4 Rockolinux-mainline v4.14.134-phy2barebox v2017.12.0-phy65.9i.MX6PD20.1.0 2.7.4-phy22.7 Warriorlinux-mainline v4.19.100-phy3barebox v2019.11.0-phy25.12i.MX6PD21.1.0 3.3.3-phy23.3 Hardknottlinux-mainline v5.10.48-phy2barebox v2021.04.0-phy45.15i.MX6ulPD17.2.0 2.2.2-phy52.2 Mortylinux-mainline v4.12.4-phy4barebox v2017.04.0-phy35.7i.MX6ulPD17.1.2 2.2.2-phy32.2 Mortylinux-imx v4.1.15-phy3
barebox v2017.04.0-phy35.7i.MX6ulPD19.1.0 2.5.3-phy62.5 Sumolinux-mainline v4.14.93-phy3
barebox v2019.01.0-phy35.10i.MX6ulPD19.1.1 2.5.3-phy162.5 Sumolinux-mainline v4.14.184-phy1barebox v2019.01.0-phy75.10i.MX6ulPD19.1.2 2.5.3-phy192.5 Sumolinux-mainline v4.14.213-phy1barebox v2019.01.0-phy95.10i.MX6ulPD21.1.0 3.1.5-phy13.1 Dunfelllinux-mainline v5.4.91-phy1barebox v2020.09.0-phy35.14i.MX6ulPD22.1.1 BSP-Yocto-Ampliphy-i.MX6UL-PD22.1.14.0 Kirkstonelinux-mainline v5.15.102-phy1barebox v2022.02.0-phy15.15i.MX7PD18.1.1 v2.2.3-phy3linux-phytec-fsl v4.9.11i.MX7PD18.2.0 v2.2.3-phy52.2 Mortylinux-phytec-fsl v4.9.11-phy3u-boot v2017.03-phy25.8i.MX7PD19.1.0 v2.5-phy22.6 Thudlinux-phytec-fsl v4.14.78u-boot v2018.03i.MX8MPD19.1.0 2.5.3-phy122.5 Sumolinux-imx v4.14.98-phy4u-boot-imx v2018.03-phy45.10i.MX8MMPD20.1.0 2.7.1-phy22.7 Warriorlinux-imx v4.19.35_1.1.0-phy4u-boot-imx v2019.04_1.1.0-phy55.12i.MX8MMPD22.1.1 BSP-Yocto-NXP-i.MX8MM-PD22.1.13.3 Hardknottlinux-imx v5.10.72_2.2.0-phy17u-boot-imx v2021.04_2.2.0-phy135.15i.MX8MPALPHA2 3.0 Zeuslinux-imx v5.4.70_2.3.0-phy5u-boot-imx v2020.04_2.3.0-phy3i.MX8MPPD21.1.0 3.0.4-phy123.0 Zeuslinux-imx v5.4.70_2.3.2-phy3u-boot-imx v2020.04_2.3.2-phy35.15i.MX8MPPD21.1.1 v3.0.4-phy153.0 Zeuslinux-imx v5.4.70_2.3.2-phy5u-boot-imx v2020.04_2.3.2-phy35.15i.MX8MPPD21.1.3 BSP-Yocto-FSL-i.MX8MP-PD21.1.33.0 Zeuslinux-imx v5.4.70_2.3.2-phy12u-boot-imx v2020.04_2.3.2-phy105.15i.MX8MPPD22.1.0 BSP-Yocto-NXP-i.MX8MP-PD22.1.03.3 Hardknottlinux-imx v5.10.72_2.2.0-phy9u-boot-imx v2021.04_2.2.0-phy75.15i.MX8MPPD22.1.1 BSP-Yocto-NXP-i.MX8MP-PD22.1.13.3 Hardknottlinux-imx v5.10.72_2.2.0-phy17u-boot-imx v2021.04_2.2.0-phy135.15STM32MP1PD20.1.0 2.6.3-phy42.6 Thudlinux-stm32mp v4.19.94u-boot v2018.115.11RK3288PD17.1.1 2.2.1-phy32.2 Mortylinux-mainline v4.9.18-phy1barebox v2016.07.0-phy5
u-boot-spl v2016.01-phy3
5.7RK3288PD17.1.3 2.2.4-phy62.2 Mortylinux-mainline v4.9.98-phy2barebox v2016.07.0-phy5
u-boot-spl v2016.01-phy3
5.7RK3288PD-ALPHA2 2.1.1-phy12.1 Krogothlinux-mainline v4.4.16-phy2barebox v2016.07.0-phy2
u-boot-spl v2016.01-phy2
使用以下指令进去源代码的位置:
bitbake 软件包名称 -c devshell
在进入devshell后,会重新打开一个终端窗口,注意在某些情况下这个窗口可能打不开,如ssh到一台编译服务器时,此时请使用tmux或者其他类似软件。
请注意在devshell中只修改源代码,或者你也可以记下源码的位置直接去修改,不要再devshell中执行make / make menuconfig之类的语句。
当修改源码后重新编译使用以下命令来编译:
bitbake 软件包名称 -c compile -f
使用以下指令来生成镜像:
bitbake 软件包名称 -c deploy
使用以下指令来修改menuconfig
bitbake 软件包名称 -c menuconfig
此时会新建一个shell出来,和devshell很像,打开menuconfig,修改后也需要之前的
bitbake 软件包名称 -c compile -f
来编译。
如果在操作过程中出了问题,可以使用
bitbake 软件包名称 -c clean
来删掉源码(注意修改都会丢失,请注意保存),然后再执行前面的编译指令。