電気回路/zynq/Petalinux のビルド のバックアップ(No.3)

更新


公開メモ

概要

Petalinux はオープンソースの Xilinx Linux とは別物。Xilinx が開発している。

登録は必要だが無料で使える。

ダウンロード

https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-design-tools.html

ここから petalinux-v2016.4-final-installer1.run のようなファイルを落とす。

https://japan.xilinx.com/support/answers/68370.html

によれば カーネルバージョンは 4.6 だそうだ。

環境は Ubuntu 16.04 LTS

VirtualBox に入れた Ubuntu 16.04 LTS 上で開発環境構築を行います。

始め Debian 9 で試したのですが、libtool の実行ファイルの名前が違う、 libc6 のバージョンコンフリクトで mknod, mknodat が見つからず "No real function for mknod" などのエラーで止まる、 などややこしいことが起こり、断念しました。

今時 VirtualBox で気軽に OS を準備できますので、 Petalinux の推奨する環境を選ぶのが無難そうです。

>>> VirtualBox への Ubuntu 16.04 LTS の導入はこちらで紹介しました

インストール

インストール方法は、
https://japan.xilinx.com/support/documentation-navigation/development-tools/software-development/petalinux-tools.html から ug1144-petalinux-tools-reference-guide.pdf にあります。

先に petalinux が要求するパッケージを入れます。 diffstat xvfb chrpath xterm libtool socat autoconf unzip texinfo gcc-multilib libsdl1.2-dev libglib2.0-dev zlib1g:i386 は上記ガイドに書かれていませんが、 インストール時に入れろと言われます。 (言われた瞬間に ^Z で中断して、これらのパッケージをインストールしてから再開すれば、 問題なく続行できるようでした。インストーラーの中身をチェックして、解凍して、動き出すまでに ものすごく待たされるので、この対処法はかなり重要です)

LANG:console
$ sudo apt-get install build-essential binutils ncurses-dev u-boot-tools file
$ sudo apt-get install tofrodos iproute2 gawk net-tools libncurses5-dev tftp tftpd-hpa zlib1g-dev libssl-dev flex bison libselinux1
$ sudo apt-get install diffstat xvfb chrpath xterm libtool socat autoconf unzip texinfo gcc-multilib libsdl1.2-dev libglib2.0-dev zlib1g:i386

petalinux のインストーラは巨大なバイナリを含んだ bash スクリプトです。 bash スクリプトなので実行権限が無くても bash に読ませれば実行できます。

インストーラを root で走らせると途中で以下のエラーが出ます。

ERROR: The extensible sdk cannot be installed as root.
ERROR: Failed to install Yocto SDK for zynqMP.

一方、インストーラを 非root で走らせると、/opt などのルート権限の 必要なフォルダにはインストールできません。

基本的にこのインストーラは、ユーザー権限で動かして、 ユーザーのホーム以下へのインストールすることが想定されているようです? (インストール後に単に mv でフォルダを動かしても動作しないと書かれていました)

ここでは ~/z-turn/petalinux へインストールすることにしました。

[必要ディスク容量]
ところでこれ、元のインストールファイルが大きく、/tmp に展開される ファイルも大きく、インストール後の容量も大きいので、インストールファイル ダウンロード前の VirtualBox の空き容量が 30GB 弱だと、途中で Disk Full になりました。35GB もあればインストールは大丈夫そうですが、 ビルド時にはここからさらにカーネルソースが吐き出されますので、 十分余裕をみておくのが良さそうです。

インストール後は 15.9 GB でした。

LANG:console
$ bash petalinux-v2016.4-final-installer1.run -h
 PetaLinux installer.
 
 Usage:
   petalinux-v2016.4-final-installer1.run [--log <LOGFILE>] [INSTALL_DIR]
 
 Options:
   --log <LOGFILE>     specify where the logfile should be created.
                       it will be petalinux_installation_log
                       in your working directory by default.
   [INSTALL_DIR]       specify the directory where you want to
                       install the tool kit. If not specified,
                       it will install to your working directory.

$ mkdir ~/z-turn/petalinux
$ # インストールに sudo はしません
$ bash petalinux-v2016.4-final-installer1.run ~/z-turn/petalinux
 INFO: Checking installer checksum...
 INFO: Extracting PetaLinux installer...
 INFO: Installing PetaLinux...
 INFO: Checking PetaLinux installer integrity...
 INFO: Extracting Installation files...
                                       # ここまで、ものすごく時間がかかります
 LICENSE AGREEMENTS
 
 PetaLinux SDK contains software from a number of sources.  Please review
 the following licenses and indicate your acceptance of each to continue.
 
 You do not have to accept the licenses, however if you do not then you may
 not use PetaLinux SDK.
 
 Use PgUp/PgDn to navigate the license viewer, and press 'q' to close
 
 Press Enter to display the license agreements
 Do you accept Xilinx End User License Agreement? [y/N] > y
 Do you accept Webtalk Terms and Conditions? [y/N] > y
 Do you accept Third Party End User License Agreement? [y/N] > y
 INFO: Checking installation environment requirements...
 INFO: Checking free disk space
 INFO: Checking installed tools
 INFO: Checking installed development libraries
 INFO: Checking network and other services
 INFO: Installing PetaLinux SDK to "/home/osamu/z-turn/petalinux/." # これもかなりかかる
 INFO: Installing PetaLinux zynqMP Yocto SDK to "/home/osamu/z-turn/petalinux/./components/yocto/source/aarch64"...
 PetaLinux Extensible SDK installer version 2016.4
 =================================================
 You are about to install the SDK to "/home/osamu/z-turn/petalinux/components/yocto/source/aarch64".
 Proceed[Y/n]? Y
 Extracting SDK...............................done
 Setting it up...
 Extracting buildtools...
 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/osamu/z-turn/petalinux/components/yocto/source/microblaze_lite/environment-setup-microblazeel-v10.0-bs-cmp-ml-xilinx-linux
 INFO: PetaLinux Yocto SDK for microblaze has been successfully installed.
 INFO: PetaLinux SDK has been installed to /home/osamu/z-turn/petalinux/.

動作環境の構築

libtoolize を libtool として起動できるようにする必要がありました。

LANG:console
$ source ~/z-turn/petalinux/settings.sh
 PetaLinux environment set to '/home/osamu/z-turn/petalinux'
 WARNING: /bin/sh is not bash!
 bash is PetaLinux recommended shell. Please set your default shell to bash.
 INFO: Checking free disk space
 INFO: Checking installed tools
 INFO: Checking installed development libraries
 INFO: Checking network and other services
$ echo $PETALINUX
 /home/osamu/z-turn/petalinux
$ arm-linux-gnueabihf-gcc --version
 arm-linux-gnueabihf-gcc (Linaro GCC 5.2-2015.11-2) 5.2.1 20151005
 Copyright (C) 2015 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ arm-none-eabi-gcc --version
 arm-none-eabi-gcc (Linaro GCC 5.2-2015.11-2) 5.2.1 20151005
 Copyright (C) 2015 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ 

パッケージ使用状況のサーベイを off にする

LANG:console
$ petalinux-util --webtalk off 
 INFO: Turn off webtalk feature!

新しいプロジェクトを作る

z-turn ボード用にビルドしたいのだけれど、公式にはサポートされていないので、 zynq 用の汎用テンプレートを使って作る。

LANG:console
$ cd ~/z-turn
$ petalinux-create -t project --template zynq -n zturn-v2016.4
 INFO: Create project: zturn-v2016.4
 INFO: New project successfully created in /home/osamu/z-turn/zturn-v2016.4
$ cd zturn-v2016.4
$ git init
 Initialized empty Git repository in /home/osamu/z-turn/zturn-v2016.4/.git/
$ cat <<EOT > .gitignore
.petalinux
build
images
EOT
$ git add .
$ git config --global user.email "osamu@big.jp"
$ git config --global user.name "Osamu Takeuchi"
$ git commit -m "newly created"
$ ls project-spec/
 attributes  configs  hw-description  meta-user

どうやら project-spec/ というのが petalinux のプロジェクト本体のようだ。

vivado のハードウェア設定を出力する

z-turn についていた mys-xc7z020-trd.xpr から [File]-[Export]-[Export Hardware...]

&ref(): File not found: "file-export-hardware.png" at page "電気回路/zynq/Petalinux のビルド";

[Include bitstream], [Local to Project] で OK

&ref(): File not found: "export-including-bitstream.png" at page "電気回路/zynq/Petalinux のビルド";

この操作により、

(project dir)/(project-name).sdk/design_1_wrapper_hw_platform_0/*

に design_1_wrapper.bit, ps7_init.* や system.hdf が出力されます。

&ref(): File not found: "exported-hardware-configuration.png" at page "電気回路/zynq/Petalinux のビルド";

vivado のハードウェア設定を取り込みつつ基本の設定

上記フォルダ(コピーしたもの)を指定して petalinux-config すると、 ハードウェア設定を取り込んだ後、いろいろ設定可能なメニューが現れます。

LANG:console
$ cd ~/z-turn/zturn-v2016.4
$ petalinux-config --get-hw-description=path/to/design_1_wrapper_hw_platform_1
 INFO: Getting hardware description...
 [INFO] generating Kconfig for project

 [INFO] menuconfig project
 /home/osamu/z-turn/zturn-v2016.4/build/misc/config/Kconfig.syshw:30:warning: defaults for cho
 /home/osamu/z-turn/zturn-v2016.4/build/misc/config/Kconfig:546:warning: config symbol defined
 configuration written to /home/osamu/z-turn/zturn-v2016.4/project-spec/configs/config

&ref(): File not found: "petalinux-system-configuration.png" at page "電気回路/zynq/Petalinux のビルド";

とりあえず何も変更せずに Exit して設定を保存。

LANG:console
 
 *** End of the configuration.
 *** Execute 'make' to start the build or try 'make help'.
 
 [INFO] sourcing bitbake
 [INFO] generating plnxtool conf
 [INFO] generating meta-plnx-generated layer
 ~/z-turn/zturn-v2016.4/build/misc/plnx-generated ~/z-turn/zturn-v2016.4
 ~/z-turn/zturn-v2016.4
 [INFO] generating machine configuration
 [INFO] generating bbappends for project . This may take time !
 ~/z-turn/zturn-v2016.4/build/misc/plnx-generated ~/z-turn/zturn-v2016.4
 # ここでものすごく時間がかかります
 ~/z-turn/zturn-v2016.4
 [INFO] generating u-boot configuration files
 
 [INFO] generating kernel configuration files
 [INFO] generating kconfig for Rootfs
 Loading cache: 100% |##############################################################################################| ETA:  00:00:00
 Loaded 2937 entries from dependency cache.
 Parsing recipes: 100% |############################################################################################| Time: 00:00:05
 Parsing of 2325 .bb files complete (2285 cached, 40 parsed). 2940 targets, 196 skipped, 0 masked, 0 errors.
 NOTE: Resolving any missing task queue dependencies
 NOTE: Preparing RunQueue
 NOTE: PN build list saved to 'pn-buildlist'
 NOTE: PN dependencies saved to 'pn-depends.dot'
 NOTE: Package dependencies saved to 'package-depends.dot'
 NOTE: Task dependencies saved to 'task-depends.dot'
 Generate rootfs kconfig
 [INFO] oldconfig rootfs
 [INFO] generating petalinux-user-image.bb
$

まずはカーネルをビルドしてみる

LANG:console
$ petalinux-build --help
 petalinux-build             (c) 2005-2013 Xilinx, Inc.
 
 Builds the project or the specified components.
 
 Usage:
   petalinux-build [options]
 
 Required:
 
 Options:
   -h, --help                         show function usage
   -p, --project <PROJECT>            path to PetaLinux SDK project.
                                      Default is working project.
   -c, --component <COMPONENT>        Specify the component
                                      it will build the specified component and its dependencies
                                      E.g. -c rootfs
                                      E.g. -c myapp
   -x, --execute <tasks of bitbake>   Specify a bitbake task of the component
                                      To know the list tasks for a component:
                                      E.g. -x do_listtasks
   -f,--force                         Force run a specific task ignoring the stamps
                                      Force run has to be for a component or its tasks
                                      E.g. -c myapp -f
                                      E.g. -c myapp -x compile -f
   -v, --verbose                      Show compile messages verbose mode
 
 EXAMPLES:
 
 Build the project:
   $ petalinux-build
   the bootable images are in <PROJECT>/images/linux/.
 
 Build kernel only:
   $ petalinux-build -c kernel
 
 Compile kernel forcefully:
   $ petalinux-build -c kernel -x compile -f
 
 Deploy kernel forcefully:
   $ petalinux-build -c kernel -x deploy -f
 
 Build kernel and update the bootable images:
   $ petalinux-build -c kernel
   $ petalinux-build -x package
 
 Build rootfs only:
   $ petalinux-build -c rootfs
 
 Build myapp of rootfs only:
   $ petalinux-build -c rootfs/myapp
 
 Clean up u-boot and build again:
   $ petalinux-build -c u-boot -x distclean
   ## above command will remove the <PROJECT>/build/linux/u-boot/ directory.
   $ petalinux-build -c u-boot
 
 Clean up the project build and build again:
   $ petalinux-build -x distclean
   ## above command will remove the <PROJECT>/build/ directory.
   $ petalinux-build
 
 Clean up the project build and the generated bootable images:
   $ petalinux-build -x mrproper
   ## above command will remove <PROJECT>/images/ and <PROJECT>/build/ directories

他にもいろいろビルドできるらしい。

LANG:console
$ petalinux-build -c kernel
 [INFO] building kernel
 [INFO] sourcing bitbake
 INFO: bitbake virtual/kernel
 Loading cache: 100% |##############################################################################################| ETA:  00:00:00
 Loaded 2938 entries from dependency cache.
 Parsing recipes: 100% |############################################################################################| Time: 00:00:05
 Parsing of 2325 .bb files complete (2291 cached, 34 parsed). 2940 targets, 196 skipped, 0 masked, 0 errors.
 NOTE: Resolving any missing task queue dependencies
 NOTE: Preparing RunQueue
 NOTE: Checking sstate mirror object availability (for 597 objects)
 NOTE: Executing SetScene Tasks
 NOTE: Executing RunQueue Tasks
 Currently 1 running tasks (851 of 1810):
 0: linux-xlnx-4.6-xilinx+gitAUTOINC+2762bc9163-r0 do_compile (pid 17351)
 # ここでかなり時間がかかる
 # で、エラーが出た
 ERROR: fsbl-0.2+xilinx+gitAUTOINC+ef07b552f4-r0 do_configure: Function failed: do_configure 
  (log file is located at /home/osamu/z-turn/zturn-v2016.4/build/tmp/work/cortexa9hf-neon-
   xilinx-linux-gnueabi/fsbl/0.2+xilinx+gitAUTOINC+ef07b552f4-r0/temp/log.do_configure.13899)
 ERROR: Logfile of failure stored in: /home/osamu/z-turn/zturn-v2016.4/build/tmp/work/cortexa9hf-
  neon-xilinx-linux-gnueabi/fsbl/0.2+xilinx+gitAUTOINC+ef07b552f4-r0/temp/log.do_configure.13899
 Log data follows:
 | DEBUG: Executing python function sysroot_cleansstate
 | DEBUG: Python function sysroot_cleansstate finished
 | DEBUG: Executing shell function do_configure
 | MISC_ARG is -yamlconf /home/osamu/z-turn/zturn-v2016.4/build/tmp/work/cortexa9hf-neon-
     xilinx-linux-gnueabi/fsbl/0.2+xilinx+gitAUTOINC+ef07b552f4-r0/fsbl.yaml
 | APP_ARG is  -app "Zynq FSBL"
 | cmd is: xsct /home/osamu/z-turn/zturn-v2016.4/build/tmp/work/cortexa9hf-neon-xilinx-linux-
     gnueabi/fsbl/0.2+xilinx+gitAUTOINC+ef07b552f4-r0/app.tcl -ws /home/osamu/z-turn/zturn-v2016.4
     /build/../components/plnx_workspace -pname fsbl -rp none -processor ps7_cortexa9_0 -hdf 
     /home/osamu/z-turn/zturn-v2016.4/build/tmp/deploy/images/plnx_arm/Xilinx-plnx_arm.hdf -arch 32  
     -app "Zynq FSBL" -yamlconf /home/osamu/z-turn/zturn-v2016.4/build/tmp/work/cortexa9hf-
     neon-xilinx-linux-gnueabi/fsbl/0.2+xilinx+gitAUTOINC+ef07b552f4-r0/fsbl.yaml
 | Starting SDK. This could take few seconds... Eclipse:
 | An error has occurred. See the log file
 | /home/osamu/z-turn/zturn-v2016.4/components/plnx_workspace/.metadata/.log.
 | Eclipse:
 | GTK+ Version Check
 | XSCTHELPER INFO: Empty WorkSpace
 | Starting SDK. This could take few seconds... Eclipse:
 | An error has occurred. See the log file
 | /home/osamu/z-turn/zturn-v2016.4/components/plnx_workspace/.metadata/.log.
 | Eclipse:
 | GTK+ Version Check
 | timeout while establishing a connection with SDK
 |     while executing
 | "error "timeout while establishing a connection with SDK""
 |     (procedure "getsdkchan" line 108)
 |     invoked from within
 | "getsdkchan"
 |     (procedure "getprojects" line 19)
 |     invoked from within
 | "getprojects -type hw"
 |     invoked from within
 | "if { $params(ws) ne "" } {
 |       #Local Work Space available
 |       setws $params(ws)
 |       if { [catch {importprojects $params(ws)} result] } {
 |               puts "XSCTHELPER IN..."
 |     (file "/home/osamu/z-turn/zturn-v2016.4/build/tmp/work/cortexa9hf-neon-xilinx-linux-
        gnueabi/fsbl/0.2+xilinx+gitAUTOINC+ef07b552f4-r0/app.tcl" line 111)
 | WARNING: exit code 1 from a shell command.
 | ERROR: Function failed: do_configure (log file is located at /home/osamu/z-turn/zturn-v2016.4
     /build/tmp/work/cortexa9hf-neon-xilinx-linux-gnueabi/fsbl/0.2+xilinx+gitAUTOINC+ef07b552f4-
     r0/temp/log.do_configure.13899)
 ERROR: Task 592 (/home/osamu/z-turn/petalinux/components/yocto/source/arm/layers/meta-xilinx-
     tools/recipes-fsbl/fsbl/fsbl_git.bb, do_configure) failed with exit code '1'
 NOTE: Tasks Summary: Attempted 1797 tasks of which 1326 didn't need to be rerun and 1 failed.
 Waiting for 0 running tasks to finish:
 
 Summary: 1 task failed:
   /home/osamu/z-turn/petalinux/components/yocto/source/arm/layers/meta-xilinx-tools/recipes-fsbl/fsbl/fsbl_git.bb, do_configure
 Summary: There was 1 ERROR message shown, returning a non-zero exit code.
 ERROR: Failed to build kernel

エラーが出ました。

言われたとおりログを見ると libgtk-x11-2.0.so.0 が見つからないといっているように見えるけれど、 ちゃんと /usr/lib/x86_64-linux-gnu に入っているし、このフォルダはロードパスに含まれている。

LANG:console
$ less /home/osamu/z-turn/zturn-v2016.4/components/plnx_workspace/.metadata/.log
 ...
 !MESSAGE Application error
 !STACK 1
 java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
         /home/osamu/.Xilinx/SDK/2016.4/org.eclipse.osgi/317/0/.cp/libswt-pi-gtk-4527.so: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
         no swt-pi-gtk in java.library.path
         Can't load library: /home/osamu/.swt/lib/linux/x86_64/libswt-pi-gtk-4527.so
         Can't load library: /home/osamu/.swt/lib/linux/x86_64/libswt-pi-gtk.so
         /home/osamu/.swt/lib/linux/x86_64/libswt-pi-gtk-4527.so: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
 
         at org.eclipse.swt.internal.Library.loadLibrary(Library.java:327)
 ...
$ find /usr/lib -name "libgtk-x11-2.0*"
 /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.30
 /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
$ echo $LD_LIBRARY_PATH
$ cat /etc/ld.so.conf
 include /etc/ld.so.conf.d/*.conf
$ cat /etc/ld.so.conf.d/*
 /usr/lib/x86_64-linux-gnu/libfakeroot
 # Multiarch support
 /lib/i386-linux-gnu
 /usr/lib/i386-linux-gnu
 /lib/i686-linux-gnu
 /usr/lib/i686-linux-gnu
 # libc default configuration
 /usr/local/lib
 # Multiarch support
 /lib/x86_64-linux-gnu
 /usr/lib/x86_64-linux-gnu
 /usr/lib/x86_64-linux-gnu/mesa-egl
 /usr/lib/x86_64-linux-gnu/mesa
 # Legacy biarch compatibility support
 /lib32
 /usr/lib32
 # Legacy biarch compatibility support
 /libx32
 /usr/libx32

訳わからん!

となっていたところ、http://engineernote.hatenablog.com/entry/2016/02/15/010118 こちらで、

PetaLinuxのビルドを行います。LANG=Cを忘れずに!

と書かれていました。

いやいや、そういう問題じゃなくて、ですね・・・

LANG:console
$ LANG=C petalinux-build -c kernel
 [INFO] building kernel
 [INFO] sourcing bitbake
 INFO: bitbake virtual/kernel
 Loading cache: 100% |###########################################################################################| ETA:  00:00:00
 Loaded 2938 entries from dependency cache.
 Parsing recipes: 100% |#########################################################################################| Time: 00:00:05
 Parsing of 2325 .bb files complete (2291 cached, 34 parsed). 2940 targets, 196 skipped, 0 masked, 0 errors.
 NOTE: Resolving any missing task queue dependencies
 NOTE: Preparing RunQueue
 NOTE: Checking sstate mirror object availability (for 74 objects)
 NOTE: Executing SetScene Tasks
 NOTE: Executing RunQueue Tasks
 NOTE: Tasks Summary: Attempted 1810 tasks of which 1796 didn't need to be rerun and all succeeded.
 INFO: Copying Images from deploy to images
 INFO: Creating images/linux directory
 [INFO] successfully built kernel
$ ls images/linux/
 System.map.linux      rootfs.cpio     rootfs.tar.gz  u-boot.bin  vmlinux  zynq_fsbl.elf
 design_1_wrapper.bit  rootfs.cpio.gz  system.dtb     u-boot.elf  zImage

マジですか。

なんだかうまく行ってしまいました。かかる時間も大幅に減っているし、 LANG の設定だけでこんなに変わるのは本当に不思議。

さらに、よくわからないのはビルドターゲットを kernel と指定しているにもかかわらず、 u-boot や fslb, rootfs などまでできてること。何なんでしょうね、これ。

すべてビルド

LANG:console
$ LANG=C petalinux-build
 [INFO] building project
 [INFO] sourcing bitbake
 INFO: bitbake petalinux-user-image
 Loading cache: 100% |###########################################################################################| ETA:  00:00:00
 Loaded 2938 entries from dependency cache.
 Parsing recipes: 100% |#########################################################################################| Time: 00:00:05
 Parsing of 2325 .bb files complete (2291 cached, 34 parsed). 2940 targets, 196 skipped, 0 masked, 0 errors.
 NOTE: Resolving any missing task queue dependencies
 NOTE: Preparing RunQueue
 NOTE: Checking sstate mirror object availability (for 68 objects)
 NOTE: Executing SetScene Tasks
 NOTE: Executing RunQueue Tasks
 NOTE: Tasks Summary: Attempted 1810 tasks of which 1806 didn't need to be rerun and all succeeded.
 INFO: generating FIT Image
 INFO: bitbake petalinux-user-image -c do_image_xilinx_fitimage -R /home/osamu/z-turn/zturn-v2016.4/build/conf/fit-image.conf
 Parsing recipes: 100% |#########################################################################################| Time: 00:03:28
 Parsing of 2325 .bb files complete (0 cached, 2325 parsed). 2940 targets, 196 skipped, 0 masked, 0 errors.
 NOTE: Resolving any missing task queue dependencies
 NOTE: Preparing RunQueue
 NOTE: Checking sstate mirror object availability (for 73 objects)
 NOTE: Executing SetScene Tasks
 NOTE: Executing RunQueue Tasks
 NOTE: Tasks Summary: Attempted 1322 tasks of which 1307 didn't need to be rerun and all succeeded.
 INFO: Copying Images from deploy to images
 [INFO] successfully built project
$ ls images/linux/
 System.map.linux      image.ub     rootfs.cpio.gz  system.dtb  u-boot.elf  zImage
 design_1_wrapper.bit  rootfs.cpio  rootfs.tar.gz   u-boot.bin  vmlinux     zynq_fsbl.elf
$ tar ftz images/linux/rootfs.tar.gz | less
$ ls -l images/linux/image.ub
 -rw-r--r-- 1 osamu osamu 9056008  2月 16 01:39 images/linux/image.ub

image.ub と rootfs.tar.gz ができた。

uImage の作成

LANG:console
$ LANG=C petalinux-package --image -c kernel --format uImage
 SDK environment now set up; additionally you may now run devtool to perform development tasks.
 Run devtool --help for further details.
 
 ### Shell environment set up for builds. ###
 
 You can now run 'bitbake <target>'
 
 INFO: generating uImage
 INFO: bitbake -R /home/osamu/z-turn/zturn-v2016.4/build/conf/kerneltype.conf virtual/kernel
 Loading cache: 100% |###########################################################################################| ETA:  00:00:00
 Loaded 2 entries from dependency cache.
 Parsing recipes: 100% |#########################################################################################| Time: 00:03:21
 Parsing of 2325 .bb files complete (1 cached, 2324 parsed). 2940 targets, 196 skipped, 0 masked, 0 errors.
 NOTE: Resolving any missing task queue dependencies
 NOTE: Preparing RunQueue
 NOTE: Checking sstate mirror object availability (for 75 objects)
 NOTE: Executing SetScene Tasks
 NOTE: Executing RunQueue Tasks
 NOTE: Tasks Summary: Attempted 1810 tasks of which 1778 didn't need to be rerun and all succeeded.
$ ls images/linux/
 System.map.linux      image.ub     rootfs.cpio.gz  system.dtb  u-boot.elf  vmlinux  zynq_fsbl.elf
 design_1_wrapper.bit  rootfs.cpio  rootfs.tar.gz   u-boot.bin  uImage      zImage

すでに zImage ができているところから uImage を作るのにこんなに時間がかかるのはおかしすぎ。 賢いビルドが働いていない気がする???

始めから --format uImage としておかないと二度手間過ぎる。

あれ、二度手間とかじゃ無くて、すでにビルドが済んでいる状態でもう一度同じビルドを指示するだけで ものすごく時間がかかるのか。何もやることは無いはずなのに、裏で何をやっているのだろう???

BOOT.BIN の作成

動作テスト


Counter: 59735 (from 2010/06/03), today: 20, yesterday: 0