User Manual Orange Pi Zero 3

  Features   |  Use   |  Linux   |    Linux SDK     |  Android   |  Android SRC   |

RU          EN  

Chapt 4. Linux SDK - orangepi-build instruction
Страница:   124    125    126    127    128    129    130    131    132  


4.4. Compile the linux kernel

  • 1) Run the build.sh script, remember to add sudo permission

    test@test:~/orangepi-build$ sudo ./build.sh

  • 2) Select Kernelpackage, then press Enter



    Img 4.9

  • 3) Then you will be prompted whether you need to display the kernel configuration interface. If you do not need to modify the kernel configuration, select the first one. If you need to modify the kernel configuration, select the second one.


    Img 4.10

  • 4) Then select the model of the development board


    Img 4.11

  • 5) Then select the branch type of the kernel source code

      a. current branch will compile linux5.4 kernel source code

      b. The next branch will compile the linux6.1 kernel source code



    Img 4.12

  • 6) If you choose to display the kernel configuration menu (the second option) in step 3), the kernel configuration interface opened by makemenuconfig will pop up. At this time, you can directly modify the kernel configuration, save and exit after modification. Yes, after exiting, it will start compiling the kernel source code.


      Img 4.13

      a. If you do not need to modify the configuration options of the kernel, when running the build.sh script, pass in KERNEL_CONFIGURE=no to temporarily block the pop-up kernel configuration interface

      test@test:~/orangepi-build$ sudo ./build.sh KERNEL_CONFIGURE=no

      b. You can also set KERNEL_CONFIGURE=no in the orangepi-build/userpatches/config-default.conf configuration file, which can permanently disable this function

      c. If the following error is displayed when compiling the kernel, it is because the terminal interface of the Ubuntu PC is too small to display the makemenuconfig interface. Please maximize the terminal of the Ubuntu PC and run the build.sh script again



      Img 4.14

  • 7) Part of the information prompted when compiling the next branch kernel source code is as follows

      a. The version of the linux kernel source code

      [ o.k. ] Compiling current kernel [ 6.1.31 ]

      b. The version of the cross-compilation toolchain used

      [ o.k. ] Compiler version [ aarch64-linux-gnu-gcc 11 ]

      c. The configuration file used by the kernel by default and the path where it is stored are as follows

      [ o.k. ] Using kernel config file
      [ orangepi-build/external/config/kernel/linux-6.1-sun50iw9-next.config ]

      d. The path of the deb package related to the kernel generated by compiling

      [ o.k. ] Target directory [ output/debs/ ]

      e. The package name of the compiled kernel image deb package

      [ o.k. ] File name [ linux-image-next-sun50iw9_x.x.x_arm64.deb ]

      f. The time used for compilation

      [ o.k. ] Runtime [ 10 min ]

      g. Finally, the compilation command to repeatedly compile the kernel selected last time will be displayed. Use the following command to start compiling the kernel source code directly without selecting through the graphical interface

      [ o.k. ] Repeat Build Options [ sudo ./build.sh BOARD=orangepizero3
      BRANCH=next BUILD_OPT=kernel KERNEL_CONFIGURE=no ]

  • 8) View the deb package related to the kernel generated by compilation

      a. linux-dtb-next-sun50iw9_x.x.x_arm64.deb Contains dtb files used by the kernel

      b. linux-headers-next-sun50iw9_x.x.x_arm64.deb Include kernel headers

      c. linux-image-next-sun50iw9_x.x.x_arm64.deb Contains kernel images and kernel modules

      test@test:~/orangepi-build$ ls output/debs/linux-*
      output/debs/linux-dtb-next-sun50iw9_x.x.x_arm64.deb
      output/debs/linux-headers-next-sun50iw9_x.x.x_arm64.deb
      output/debs/linux-image-next-sun50iw9_x.x.x_arm64.deb

  • 9) When the orangepi-bulid compilation system compiles the linux kernel source code, it first synchronizes the linux kernel source code with the linux kernel source code of the github server, so ifyou want to modify the linux kernel source code, you first need to turn off the update function of the source code. The linux kernel needs to be fully compiled once This function can only be turned off after the source code, otherwise it will prompt that the source code of the linux kernel cannot be found. Otherwise the changes made will be restored, the method is as follows:

    Set the IGNORE_UPDATES variable in userpatches/config-default.conf to "yes"

    test@test:~/orangepi-build$ vim userpatches/config-default.conf
    IGNORE_UPDATES="yes"

  • 10) If the kernel has been modified, the following method can be used to update the kernel and kernel modules of the development board linux system

      a. Upload the deb package of the compiled linux kernel to the linux system of the development board

      test@test:~/orangepi-build$ cd output/debs
      test@test:~/orangepi-build/output/debs$ scp \
      linux-image-next-sun50iw9_x.x.x_arm64.deb root@192.168.1.xxx:/root

      b. Install the deb package of the new linux kernel just uploaded

      orangepi@orangepi:~$ sudo dpkg -i linux-image-next-sun50iw9_x.x.x_arm64.deb

      c. Then restart the development board, and then check whether the kernel-related modifications have taken effect

      orangepi@orangepi:~$ sudo reboot

     <         > 


  • Страница:   124    125    126    127    128    129    130    131    132