履歴: 電気回路/zynq/Petalinux のビルド
各行は、その日時に書かれた内容です。追加・削除は、1 つ前の版との行数の差です (全 18 版)。「差分」は比較する版、「基準」は比べる相手の版を選びます
| 日時 | タイトル | 文字数 | 追加 | 削除 | 内容 | 差分 | 基準 |
|---|---|---|---|---|---|---|---|
| 2022/10/25 15:21:26 | 電気回路/zynq/Petalinux のビルド 最新版 | 47,023 | +1 | -42 | 表示 | 差分 | — |
| 2022/10/25 15:21:26 | 電気回路/zynq/Petalinux のビルド | 49,525 | +2 | -1 | 表示 | 差分 | 選択 |
| 2017/5/23 0:07:40 | 電気回路/zynq/Petalinux のビルド | 49,524 | +2 | -1 | 表示 | 差分 | 選択 |
| 2017/5/23 0:07:40 | 電気回路/zynq/Petalinux のビルド | 49,519 | +3 | -0 | 表示 | 差分 | 選択 |
| 2017/5/23 0:07:40 | 電気回路/zynq/Petalinux のビルド | 49,468 | +1 | -0 | 表示 | 差分 | 選択 |
| 2017/5/21 12:57:13 | 電気回路/zynq/Petalinux のビルド | 49,365 | +23 | -0 | 表示 | 差分 | 選択 |
| 2017/5/19 11:03:54 | 電気回路/zynq/Petalinux のビルド | 47,852 | +16 | -0 | 表示 | 差分 | 選択 |
| 2017/3/22 17:38:55 | 電気回路/zynq/Petalinux のビルド | 46,973 | +6 | -2 | 表示 | 表示中 | 選択 |
| 2017/3/22 17:38:55 | 電気回路/zynq/Petalinux のビルド | 46,845 | +17 | -9 | 表示 | 差分 | 選択 |
| 2017/3/22 17:38:55 | 電気回路/zynq/Petalinux のビルド | 46,650 | +5 | -0 | 表示 | 差分 | 選択 |
| 2017/2/20 3:18:11 | 電気回路/zynq/Petalinux のビルド | 46,517 | +3 | -2 | 表示 | 差分 | 選択 |
| 2017/2/20 3:18:11 | 電気回路/zynq/Petalinux のビルド | 46,475 | +17 | -0 | 表示 | 差分 | 選択 |
| 2017/2/16 13:27:46 | 電気回路/zynq/Petalinux のビルド | 46,042 | +21 | -2 | 表示 | 差分 | 選択 |
| 2017/2/16 13:27:46 | 電気回路/zynq/Petalinux のビルド | 45,719 | +308 | -23 | 表示 | 差分 | 選択 |
| 2017/2/16 4:45:46 | 電気回路/zynq/Petalinux のビルド | 35,848 | +326 | -2 | 表示 | 差分 | 選択 |
| 2017/2/15 17:01:09 | 電気回路/zynq/Petalinux のビルド | 23,410 | +141 | -9 | 表示 | 差分 | 選択 |
| 2017/2/15 13:18:34 | 電気回路/zynq/Petalinux のビルド | 17,838 | +202 | -322 | 表示 | 差分 | 選択 |
| 2017/2/15 6:25:02 | 電気回路/zynq/Petalinux のビルド | 24,450 | — | — | 表示 | — | 基準 |
基準: 電気回路/zynq/Petalinux のビルド (2017/2/15 6:25:02) → 比較: 電気回路/zynq/Petalinux のビルド (2017/3/22 17:38:55)
@@ -2,10 +2,18 @@
* 概要 [#y122c6a2]
-Petalinux はオープンソースの Xilinx Linux とは別物。Xilinx が開発している。
+Petalinux はオープンソースの Xilinx Linux とは別物。Xilinx が開発しています。
-登録は必要だが無料で使える。
+登録は必要だが無料で使えます。
+とりあえず以下では z-turn ボード用にコンパイルして、Linux が(ギリギリ)起動するところまで進みました。
+
+続編として、開発用にカスタマイズする手順はこちら > [[電気回路/zynq/Petalinux のカスタマイズ]]
+
+全体の流れはこちら > [[電気回路/zynq]]
+
+#contents
+
* ダウンロード [#w38e9003]
https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-design-tools.html
@@ -14,24 +22,38 @@
https://japan.xilinx.com/support/answers/68370.html
-によれば カーネルバージョンは 4.6 だそうだ。
+によれば v2016.4 のカーネルバージョンは 4.6 だそうだ。
-* インストール [#q2587901]
+* 環境は Ubuntu 16.04 LTS [#be55f93b]
-ここでは VirtualBox 内の Debian9 stretch に入れてみる
+VirtualBox に入れた Ubuntu 16.04 LTS 上で開発環境構築を行います。
-インストール方法は、~
+始め Debian 9 で試したのですが、libtool の実行ファイルの名前が違う、
+libc6 のバージョンコンフリクトで mknod, mknodat が見つからず
+"No real function for mknod" などのエラーで止まる、
+などややこしいことが起こり、断念しました。
+
+今時 VirtualBox で気軽に OS を準備できますので、
+Petalinux の推奨する環境を選ぶのが無難そうです。
+
+[[>>> VirtualBox への Ubuntu 16.04 LTS の導入はこちらで紹介しました>電気回路/zynq/VirtualBox に Ubuntu 16.04 LTS を入れる]]
+* インストール [#q2587901]
+
+推奨環境やインストール方法は、~
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 は上記ガイドに書かれていませんが、
+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
+ $ 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 に読ませれば実行できます。
@@ -44,17 +66,30 @@
一方、インストーラを 非root で走らせると、/opt などのルート権限の
必要なフォルダにはインストールできません。
-基本的に、ユーザーのホーム以下へのインストールが期待されているようです?~
+Web上では /opt の下にインストールする例も多いですが、
+基本的にこのインストーラは、ユーザー権限で動かして、
+ユーザーのホームの下のフォルダへインストールすることが想定されているようです。
+(インストール後に単に mv でフォルダを動かしても動作しないと書かれていましたし)
+
ここでは ~/z-turn/petalinux へインストールすることにしました。
+[必要ディスク容量]~
ところでこれ、元のインストールファイルが大きく、/tmp に展開される
-ファイルも大きくて、インストール後も大きいので、インストールファイル
-ダウンロード前の VirtualBox の空き容量が 30GB 弱だと途中でぎりぎり
-Disk Full になりました。35GB もあれば大丈夫そうですが、かなり
-待たされた後でエラーが出るので、余裕を持った方が精神的に楽です。
+ファイルも大きく、インストール後の容量も大きいので、インストールファイル
+ダウンロード前の VirtualBox の空き容量が 30GB 弱だと、途中で Disk Full
+になりました。35GB もあればインストールは大丈夫そうですが、
+VirtualBox の可変サイズの仮想ディスクは、実際に使わない限り実ディスクを
+圧迫しないので、作成時には十分大きな値を設定しておくのが良さそうです。
-インストール後は 15.9 GB でした。
+インストール後にインストーラを削除した段階ではシステム全体の使用容量は 15.9 GB でした。
+このページの一番下で、いろいろ四苦八苦しながら Linux が起動したところで、
+
+- システム全体で 24GB
+- 開発のための ~/z-turn 以下は 20GB
+
+程度でした。
+
LANG:console
$ bash petalinux-v2016.4-final-installer1.run -h
PetaLinux installer.
@@ -96,16 +131,9 @@
INFO: Checking installation environment requirements...
INFO: Checking free disk space
INFO: Checking installed tools
- ERROR: You are missing the following system tools required by PetaLinux:
-
- - libtool
- Please check PetaLinux installation guide - required tools and libraries
- pacakge section for detailed information
-
INFO: Checking installed development libraries
- Please install them with your operating system package manager, and try again
INFO: Checking network and other services
- INFO: Installing PetaLinux SDK to "/home/osamu/z-turn/petalinux/."
+ 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
=================================================
@@ -121,12 +149,9 @@
INFO: PetaLinux Yocto SDK for microblaze has been successfully installed.
INFO: PetaLinux SDK has been installed to /home/osamu/z-turn/petalinux/.
-libtool はすでに入っているのだけれど・・・とりあえず無視して続行します。
-* 動作環境の構築 [#v45a3c2e]
+* 環境変数の設定 [#v45a3c2e]
-libtoolize を libtool として起動できるようにする
-
LANG:console
$ source ~/z-turn/petalinux/settings.sh
PetaLinux environment set to '/home/osamu/z-turn/petalinux'
@@ -134,44 +159,8 @@
bash is PetaLinux recommended shell. Please set your default shell to bash.
INFO: Checking free disk space
INFO: Checking installed tools
- ERROR: You are missing the following system tools required by PetaLinux:
-
- - libtool
- Please check PetaLinux installation guide - required tools and libraries
- pacakge section for detailed information
-
INFO: Checking installed development libraries
- Please install them with your operating system package manager, and try again
INFO: Checking network and other services
- WARNING: No tftp server found - please refer to "PetaLinux SDK Installation Guide"
- for its impact and solution
- $ sudo apt-get install libtool
- libtool はすでに最新バージョン (2.4.6-2) です。
- アップグレード: 0 個、新規インストール: 0 個、削除: 0 個、保留: 336 個。
- $ libtool
- -bash: libtool: コマンドが見つかりません
- $ libtoolize --version
- libtoolize (GNU libtool) 2.4.6
- Written by Gary V. Vaughan <gary@gnu.org>, 2003
-
- 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.
- $ apt-get install libtool-bin
- $ libtool
- -bash: libtool: コマンドが見つかりません
- $ # 別名を付けるだけでいいという噂も?
- $ sudo ln -s /usr/bin/libtoolize /usr/local/bin/libtool
- $ 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
- WARNING: No tftp server found - please refer to "PetaLinux SDK Installation Guide"
- for its impact and solution
$ echo $PETALINUX
/home/osamu/z-turn/petalinux
$ arm-linux-gnueabihf-gcc --version
@@ -188,28 +177,15 @@
パッケージ使用状況のサーベイを off にする
LANG:console
- $ z-turn/petalinux/tools/common/petalinux/bin/petalinux-util --webtalk off
+ $ petalinux-util --webtalk off
INFO: Turn off webtalk feature!
-*** 新しいプロジェクトを作る [#aabc4100]
+* 新しいプロジェクトを作る [#aabc4100]
z-turn ボード用にビルドしたいのだけれど、公式にはサポートされていないので、
-試しに zedboard 用のテンプレートを落としてみた。
+zynq 用の汎用テンプレートを使って作る。
LANG:console
- $ file avnet-digilent-zedboard-v2016.4-final1.bsp
- avnet-digilent-zedboard-v2016.4-final1.bsp: gzip compressed data, last modified: Fri Dec 16 03:02:22 2016, from Unix
- $ tar fxz avnet-digilent-zedboard-v2016.4-final1.bsp
- $ cd avnet-digilent-zedboard-2016.4/
- $ ls
- components config.project hardware pre-built project-spec
-
-かなりいろいろ入ってる。。。
-
-これを元にプロジェクトを作るのというのがチュートリアルだけれど、
-ここではそんな便利なものはないので、zynq 用の汎用テンプレートを使って作る。
-
- LANG:console
$ cd ~/z-turn
$ petalinux-create -t project --template zynq -n zturn-v2016.4
INFO: Create project: zturn-v2016.4
@@ -223,21 +199,28 @@
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 のハードウェア設定を出力する [#a82e50cc]
+* vivado のハードウェア設定を出力する [#a82e50cc]
-z-turn についていた mys-xc7z020-trd.xpr から [File]-[Export]-[Export Hardware...]
+Petalinux をビルドするには *.hdf ファイルが必要になります。
+このファイルは vivado で Export Hardware すると得られます。
-&ref(file-export-hardware.png,,66%);
+Linux を動作可能なPS設定を vivado へ食わせれば良いので、
+ここでは z-turn についていた mys-xc7z020-trd.xpr から [File]-[Export]-[Export Hardware...]
+しました。(参照:[[電気回路/z-turn/基本事項#qd72eb9b]])
+&ref(電気回路/zynq/Linux に平行してベアメタルプログラムを走らせる/file-export-hardware.png,,66%);
+
[Include bitstream], [Local to Project] で OK
-&ref(export-including-bitstream.png,,66%);
+&ref(電気回路/zynq/Linux に平行してベアメタルプログラムを走らせる/export-including-bitstream.png,,66%);
この操作により、
@@ -245,29 +228,29 @@
に design_1_wrapper.bit, ps7_init.* や system.hdf が出力されます。
-&ref(exported-hardware-configuration.png,,66%);
+&ref(電気回路/zynq/Linux に平行してベアメタルプログラムを走らせる/exported-hardware-configuration.png,,66%);
-*** vivado のハードウェア設定を取り込みつつ基本の設定 [#y20ed9c0]
+* vivado のハードウェア設定を取り込みつつ基本の設定 [#y20ed9c0]
上記フォルダ(コピーしたもの)を指定して petalinux-config すると、
ハードウェア設定を取り込んだ後、いろいろ設定可能なメニューが現れます。
LANG:console
- $ cd (petalinux-project-dir)
- $ petalinux-config --get-hw-description=../design_1_wrapper_hw_platform_1
+ $ 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(petalinux-system-configuration.png,,66%);
+&ref(電気回路/zynq/Linux に平行してベアメタルプログラムを走らせる/petalinux-system-configuration.png,,66%);
とりあえず何も変更せずに Exit して設定を保存。
LANG:console
- [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
*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.
@@ -286,12 +269,9 @@
[INFO] generating kernel configuration files
[INFO] generating kconfig for Rootfs
- WARNING: Host distribution "Debian-9.0" has not been validated with this version of the
- build system; you may possibly experience unexpected failures. It is recommended that you
- use a tested distribution.
- Loading cache: 100% |########################################################| ETA: 00:00:00
+ Loading cache: 100% |##############################################################################################| ETA: 00:00:00
Loaded 2937 entries from dependency cache.
- Parsing recipes: 100% |######################################################| Time: 00:00:05
+ 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
@@ -299,271 +279,966 @@
NOTE: PN dependencies saved to 'pn-depends.dot'
NOTE: Package dependencies saved to 'package-depends.dot'
NOTE: Task dependencies saved to 'task-depends.dot'
-
- Summary: There was 1 WARNING message shown.
Generate rootfs kconfig
[INFO] oldconfig rootfs
[INFO] generating petalinux-user-image.bb
$
-Debian はサポートしないと言われたけれど、続行してみます。
+* まずはカーネルをビルドしてみる [#q69e8291]
-*** カーネルをビルドしてみる [#q69e8291]
+ 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
- [INFO] building project
+ $ petalinux-build -c kernel
+ [INFO] building kernel
[INFO] sourcing bitbake
- INFO: bitbake petalinux-user-image
- WARNING: Host distribution "Debian-9.0" has not been validated with this version of the build
- system; you may possibly experience unexpected failures. It is recommended that you use a
- tested distribution.
- Loading cache: 100% |########################################################| ETA: 00:00:00
+ 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 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
- No currently running tasks (803 of 1810)
- No real function for mknod: /home/osamu/z-turn/zturn-v2016.4/build/tmp/sysroots/x86_64-linux/usr/bin/../lib/pseudo/lib64/libpseudo.so: undefined symbol: mknod
- No real function for mknodat: /home/osamu/z-turn/zturn-v2016.4/build/tmp/sysroots/x86_64-linux/usr/bin/../lib/pseudo/lib64/libpseudo.so: undefined symbol: mknodat
- ...
- WARNING: petalinux-user-image-1.0-r0 do_rootfs: No not found in the base feeds (plnx_arm
- cortexa9t2hf-neon cortexa9t2hf-vfp cortexa9hf-neon cortexa9hf-vfp armv7at2hf-neon armv7ahf-neon
- armv7at2hf-vfp armv7ahf-vfp armv6thf-vfp armv6hf-vfp armv5tehf-vfp armv5ehf-vfp armv5thf-vfp
- armv5hf-vfp noarch any all).
+ 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:
- WARNING: petalinux-user-image-1.0-r0 do_rootfs: real not found in the base feeds (plnx_arm
- cortexa9t2hf-neon cortexa9t2hf-vfp cortexa9hf-neon cortexa9hf-vfp armv7at2hf-neon armv7ahf-neon
- armv7at2hf-vfp armv7ahf-vfp armv6thf-vfp armv6hf-vfp armv5tehf-vfp armv5ehf-vfp armv5thf-vfp
- armv5hf-vfp noarch any all).
+ 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
...
- ERROR: petalinux-user-image-1.0-r0 do_rootfs: Unable to install packages. Command
- '/home/osamu/z-turn/zturn-v2016.4/build/tmp/sysroots/x86_64-linux/usr/bin/smart --log-level=warning
- --data-dir=/home/osamu/z-turn/zturn-v2016.4/build/tmp/work/plnx_arm-xilinx-linux-gnueabi/petalinux-
- user-image/1.0-r0/rootfs/var/lib/smart install --attempt -y ' returned 1:
+ !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
- No real function for mknod: /home/osamu/z-turn/zturn-v2016.4/build/tmp/sysroots/x86_64-linux/usr
- /bin/../lib/pseudo/lib64/libpseudo.so: undefined symbol: mknod
+ at org.eclipse.swt.internal.Library.loadLibrary(Library.java:327)
...
-
- ERROR: petalinux-user-image-1.0-r0 do_rootfs: Function failed: do_rootfs
- ERROR: Logfile of failure stored in: /home/osamu/z-turn/zturn-v2016.4/build/tmp/work/plnx_arm-xilinx-linux-gnueabi/petalinux-user-image/1.0-r0/temp/log.do_rootfs.17314
- ERROR: Task 9 (/home/osamu/z-turn/zturn-v2016.4/project-spec/meta-plnx-generated/recipes-core/images/petalinux-user-image.bb, do_rootfs) failed with exit code '1'
- NOTE: Tasks Summary: Attempted 1690 tasks of which 1326 didn't need to be rerun and 1 failed.
- No currently running tasks (1690 of 1810)
+ $ 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
+
+** 言語設定が重要 LANG=C [#y0c5addb]
+
+訳わからん!
+
+となっていたところ、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
+
+マジですか。
+
+なんだかうまく行ってしまいました。
+
+さらに、よくわからないのはビルドターゲットを kernel と指定しているにもかかわらず、
+u-boot や fslb, rootfs などまでできてること。何なんでしょうね、これ。
+
+
+* すべてビルド [#m1fec412]
+
+ 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 ができた。
+
+* ビルドの概要 [#m53ad53f]
+
+make を使っていないので、どのようにビルドが進んでいるのか全然わからない。
+
+気づいたことをここにまとめる。
+
+- 成果は image/ にできる
+- image/linux の内容は build/tmp/deploy/images/plnx_arm/ に作成したのをコピーしたもの
+- build/sstate-cache を見る限り、かなり非人間的なことをしている
+- build/tmp/work-shared/plnx_arm/kernel-source にカーネルソースがある
+-
+
+ LANG:console
+ $ ls build/sstate-cache/00/
+ sstate:device-tree-generation:cortexa9hf-neon-xilinx-linux-gnueabi:xilinx+gitAUTOINC+11f81055d1:r0:cortexa9hf-neon:3:0011197a4f6f3b9759bbaeb0fa81dcbd_compile.tgz.siginfo
+ sstate:petalinux-user-image:plnx_arm-xilinx-linux-gnueabi:1.0:r0:plnx_arm:3:008af769240be40f1a713d1995b36264_image_complete.tgz.siginfo
+
+
+* uImage の作成 [#g1057dbd]
+
+カーネルイメージは上記で生成された image.ub に含まれているそうで、
+実は以下に進むのに uImage を別途作成する必要は無いことが、後からわかりました。
+
+# uImage を別にしておいた方が個別に書き換えられてうれしいので、~
+# 後で image.ub じゃなくて 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.
- Summary: 1 task failed:
- /home/osamu/z-turn/zturn-v2016.4/project-spec/meta-plnx-generated/recipes-core/images/petalinux-user-image.bb, do_rootfs
- Summary: There were 19 WARNING messages shown.
- Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
- ERROR: Failed to build project
- $ apt show libc6
- Package: libc6
- Version: 2.24-9
- ...
+ ### 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
-No real function for mknod について:~
-https://forums.xilinx.com/t5/Embedded-Linux/Strange-messages-about-shared-libraries-in-Petalinux/td-p/729766 ~
-libc6 2.24 固有の問題で出るエラーで、メッセージは無視して良いと書いてある
+すでに zImage ができているところから uImage を作るのにこんなに時間がかかるのはおかしすぎ。
+賢いビルドが働いていない気がする???
-確かに、インストールされているのはバージョン 2.24 だ。。。
+始めから --format uImage としておかないと二度手間過ぎる。
-petalinux が推奨する Ubuntu 16.04 では libc6 は 2.23 になっている。
-たぶん、Ubuntu が 2.24 はやばいと思ってまだ上げていないんだと思う。
+あれ、二度手間とかじゃ無くて、すでにビルドが済んでいる状態でもう一度同じビルドを指示するだけで
+ものすごく時間がかかるのか。何もやることは無いはずなのに、裏で何をやっているのだろう???
- $ cd ~/z-turn/petalinux
- $ find | grep pseudo-1
- ./components/yocto/downloads/pseudo-1.7.5.tar.bz2
- $ cd components/yocto/source/arm/layers/poky/meta/recipes-devtools/pseudo
+* BOOT.bin の作成 [#w888792f]
+
+2016.4 のマニュアルにミスタイプがあるけれど、Zynq UltraScale+ MPSoC 用の記述と比べて考えると、
+正しいのはこう
+
+ LANG:console
+ $ petalinux-package --boot --fsbl images/linux/zynq_fsbl.elf --fpga images/linux/design_1_wrapper.bit --u-boot --force
+ INFO: File in BOOT BIN: "/home/osamu/z-turn/zturn-v2016.4/images/linux/zynq_fsbl.elf"
+ INFO: File in BOOT BIN: "/home/osamu/z-turn/zturn-v2016.4/images/linux/design_1_wrapper.bit"
+ INFO: File in BOOT BIN: "/home/osamu/z-turn/zturn-v2016.4/images/linux/u-boot.elf"
+ INFO: Generating zynq binary package BOOT.BIN...
+ INFO: Binary is ready.
+ WARNING: Unable to access the TFTPBOOT folder /tftpboot!!!
+ WARNING: Skip file copy to TFTPBOOT folder!!!
$ ls
- files/ pseudo.inc pseudo_1.6.7.bb pseudo_1.7.5.bb pseudo_git.bb
- $ ls files/
- 0001-configure-Prune-PIE-flags.patch fallback-group fallback-passwd handle-remove-xattr.patch
- moreretries.patch
+ BOOT.BIN build components config.project images project-spec
-えーと、上記リンクで紹介されているパッチを当てる先が見つからない?
+image/ じゃなくてカレントフォルダにできちゃうのか orz
-https://vendor2.nginfotpdx.net/gitlab/ypp/poky/commit/9df3cdf42d8c1216682f497f0b166a43ef9f4184 ~
-もあるけど、どうも見方がよくわからない。
+でも一応できた。
+(オプションに --force を渡しておかないと、すでにファイルがあるときに上書きできません)
+
+* SD カードにコピー [#ic481ee5]
+
+http://engineernote.hatenablog.com/entry/2016/01/31/012227
+
+によると、
+
+> BOOT.binはbitstreamとFSBL、u-bootをひとつのバイナリに結合したもので、image.ubはkernelとrootfs、デバイスツリーのようです。
+
+とのことなので、まっさらな FAT フォーマットの SD カードに BOOT.bin と image.ub だけ入れればいいらしい。
+
+こうやってファイルをまとめられてしまうと、
+一部だけ書き換えたいとき大変そうに思います・・・
+
+もっと変更しやすい形にする方法を調べないと。
+
+でもまずはこの形で起動まで持って行きたい。
+* 起動中の問題をいろいろ解決 [#ybd92c28]
+
+当然(?)、そのままではまともに起動しませんでした。
+
+起動メッセージを見ながら1つ1つ解決していきます。
+
+正しく動くとこんな風になるはず。~
+http://engineernote.hatenablog.com/entry/2016/01/31/012227
+
+** DONE ダイオードすら点かない [#h00d6c35]
+
+ZYNQ の初期設定が済めばカード上の DONE 発光ダイオードが点るはずなのですが、
+上記でできた BOOT.BIN ではそれすら点きません。
+
+これではどうしようもありません。
+
+BOOT.BIN の生成を、
+
LANG:console
- $ cd ~/z-turn/petalinux/components/yocto
- $ find . -type f -exec grep -l "No real function for" {} \;
- ./source/microblaze_lite/buildtools/sysroots/x86_64-petalinux-linux/usr/lib/pseudo/lib64/libpseudo.so
- ./source/aarch64/buildtools/sysroots/x86_64-petalinux-linux/usr/lib/pseudo/lib64/libpseudo.so
- ./source/microblaze_full/buildtools/sysroots/x86_64-petalinux-linux/usr/lib/pseudo/lib64/libpseudo.so
- ./source/arm/buildtools/sysroots/x86_64-petalinux-linux/usr/lib/pseudo/lib64/libpseudo.so
- $ cd ~/z-turn/petalinux
- $ find | grep pseudo-1
- ./components/yocto/downloads/pseudo-1.7.5.tar.bz2
- $ cd
- $ cd pseudo-1.7.5/
- $ grep -ls "No real function for" *
- pseudo_wrappers.c
- $ cat pseudo_wrappers.c
- ...
- #ifdef PSEUDO_NO_REAL_AT_FUNCTIONS
- char *s = func->name;
- s += strlen(s) - 2;
- /* *at() don't have to exist */
- if (!strcmp(s, "at")) {
- return;
- }
- #else
- if (e != NULL) {
- pseudo_diag("No real function for %s: %s\n", func->name, e);
- }
- #endif
- ...
- $ cd ..
+ $ petalinux-package --boot --fsbl ../design_1_wrapper_hw_platform_1/fsbl.elf --fpga images/linux/design_1_wrapper.bit --u-boot --force
-ここを潰せばいいのは、わかる。
+のようにして、--fsbl に与える .elf を vivado から持ってきた fsbl.elf にしたところ、
+正しく起動しました。
-雰囲気的には meta にパッチを置いておくと、.tar.bz2 を展開し、
-そのパッチを当ててからコンパイルしてくれる感じ?
+z-turn 付属のプロジェクトでは fsbl 生成コードにもカスタマイズが入っているのかもしれません?~
+後で調べる必要がありそうです。
- LANG:c
- $ jed ~/z-turn/petalinux/components/yocto/source/arm/layers/poky/meta/recipes-devtools/pseudo/files/pseudo-glibc-rtld-next-workaround.patch
- We started seeing:
+>>> その後分かったことには、UART のチャンネルを 1 にするカスタマイズが入っている他、
+新しいライブラリコードでは SD カード関連にバグ(?)があるため起動しなかったようです
+
+[[[電気回路/zynq/最新の fsbl で Linux が起動しない理由を調べる]]] で分かった
+- Xilinx SDK の最新コードをちょっと直して U-BOOT をビルド
+- Petalinux 標準の U-BOOT で動くようにハードウェア設定を変える
+
+のどちらかで、最新の U-BOOT を使えるようになりました。
+** FSBL [#ode1428c]
+
+まずメッセージを出すのが fsbl
+
+ LANG:console
+ Xilinx First Stage Boot Loader
+ Release 2014.4 Aug 11 2015-18:06:38
+ Devcfg driver initialized
+ Silicon Version 3.1
+ Boot mode is SD
+ SD: rc= 0
+ SD Init Done
+ Flash Base Address: 0xE0100000
+ Reboot status register: 0x60600000
+ Multiboot Register: 0x0000C000
+ Image Start Address: 0x00000000
+ Partition Header Offset:0x00000C80
+ Partition Count: 3
+ Partition Number: 1
+ Header Dump
+ Image Word Len: 0x000F6EC0
+ Data Word Len: 0x000F6EC0
+ Partition Word Len:0x000F6EC0
+ Load Addr: 0x00000000
+ Exec Addr: 0x00000000
+ Partition Start: 0x000065D0
+ Partition Attr: 0x00000020
+ Partition Checksum Offset: 0x00000000
+ Section Count: 0x00000001
+ Checksum: 0xFFD14B7E
+ Bitstream
+ In FsblHookBeforeBitstreamDload function
+ PCAP:StatusReg = 0x40000A30
+ PCAP:device ready
+ PCAP:Clear done
+ Level Shifter Value = 0xA
+ Devcfg Status register = 0x40000A30
+ PCAP:Fabric is Initialized done
+ PCAP register dump:
+ PCAP CTRL 0xF8007000: 0x4C00E07F
+ PCAP LOCK 0xF8007004: 0x0000001A
+ PCAP CONFIG 0xF8007008: 0x00000508
+ PCAP ISR 0xF800700C: 0x0802000B
+ PCAP IMR 0xF8007010: 0xFFFFFFFF
+ PCAP STATUS 0xF8007014: 0x00002A30
+ PCAP DMA SRC ADDR 0xF8007018: 0x00100001
+ PCAP DMA DEST ADDR 0xF800701C: 0xFFFFFFFF
+ PCAP DMA SRC LEN 0xF8007020: 0x000F6EC0
+ PCAP DMA DEST LEN 0xF8007024: 0x000F6EC0
+ PCAP ROM SHADOW CTRL 0xF8007028: 0xFFFFFFFF
+ PCAP MBOOT 0xF800702C: 0x0000C000
+ PCAP SW ID 0xF8007030: 0x00000000
+ PCAP UNLOCK 0xF8007034: 0x757BDF0D
+ PCAP MCTRL 0xF8007080: 0x30800100
- No real function for mknod: /home/paul/poky_sdk/tmp/sysroots/x86_64-
- linux/usr/bin/../lib/pseudo/lib64/libpseudo.so: undefined symbol: mknod
- No real function for mknodat: /home/paul/poky_sdk/tmp/sysroots/x86_64-
- linux/usr/bin/../lib/pseudo/lib64/libpseudo.so: undefined symbol: mknodat
- ...
- Index: pseudo-1.7.5/pseudo_wrappers.c
- ===================================================================
- --- pseudo-1.7.5.orig/pseudo_wrappers.c
- +++ pseudo-1.7.5/pseudo_wrappers.c
- @@ -146,9 +146,9 @@ pseudo_init_one_wrapper(pseudo_function
- return;
- }
- #else
- - if (e != NULL) {
- + /*if (e != NULL) {
- pseudo_diag("No real function for %s: %s\n", func->name, e);
- - }
- + }*/
- #endif
- }
- }
- $ jed ~/z-turn/petalinux/components/yocto/source/arm/layers/poky/meta/recipes-devtools/pseudo/pseudo_1.7.5.bb
- ...
- file://pseudo-glibc-rtld-next-workaround.patch \
- ...
- $ rm -r build/tmp/work/x86_64-linux/pseudo-native/
- $ petalinux-build
- ...
- | gcc -isystem/home/osamu/z-turn/zturn-v2016.4/build/tmp/sysroots/x86_64-linux/usr/include \
- | -O2 -pipe -pipe -std=gnu99 -Wall -W -Wextra -fPIC -D_LARGEFILE64_SOURCE -D_ATFILE_SOURCE \
- | -isystem/home/osamu/z-turn/zturn-v2016.4/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe \
- | -DPSEUDO_PREFIX='"/home/osamu/z-turn/zturn-v2016.4/build/tmp/sysroots/x86_64-linux/usr"' \
- | -DPSEUDO_SUFFIX='""' -DPSEUDO_BINDIR='"bin"' -DPSEUDO_LIBDIR='"lib/pseudo/lib64"' \
- | -DPSEUDO_LOCALSTATEDIR='"var/pseudo"' -DPSEUDO_VERSION='"1.7.5"' -DUSE_MEMORY_DB \
- | -DPSEUDO_FORCE_ASYNC -DPSEUDO_PASSWD_FALLBACK='NULL' -DPSEUDO_XATTR_SUPPORT \
- | -O2 -g -L/home/osamu/z-turn/zturn-v2016.4/build/tmp/sysroots/x86_64-linux/usr/lib \
- | -I/home/osamu/z-turn/zturn-v2016.4/build/tmp/sysroots/x86_64-linux/usr/include -o bin/pseudo \
- | pseudo.o pseudo_server.o pseudo_client.o pseudo_ipc.o pseudo_db.o pseudo_tables.o pseudo_util.o \
- | /home/osamu/z-turn/zturn-v2016.4/build/tmp/sysroots/x86_64-linux/usr/lib/libsqlite3.a -lpthread \
- | -ldl -lpthread
- | /usr/bin/ld: final link failed: Nonrepresentable section on output
- | collect2: error: ld returned 1 exit status
- | Makefile:110: recipe for target 'bin/pseudo' failed
- | make: *** [bin/pseudo] Error 1
- | WARNING: exit code 1 from a shell command.
- | ERROR: oe_runmake failed
- | ERROR: Function failed: do_compile (log file is located at /home/osamu/z-turn/zturn-v2016.4/build/tmp/work/x86_64-linux/pseudo-native/1.7.5-r0/temp/log.do_compile.25335)
- ERROR: Task 44 (virtual:native:/home/osamu/z-turn/petalinux/components/yocto/source/arm/layers/poky/meta/recipes-devtools/pseudo/pseudo_1.7.5.bb, do_compile) failed with exit code '1'
- NOTE: Tasks Summary: Attempted 126 tasks of which 120 didn't need to be rerun and 1 failed.
- Waiting for 0 running tasks to finish:
+ DMA Done !
- Summary: 1 task failed:
- virtual:native:/home/osamu/z-turn/petalinux/components/yocto/source/arm/layers/poky/meta/recipes-devtools/pseudo/pseudo_1.7.5.bb, do_compile
- Summary: There was 1 WARNING message shown.
- Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
- ERROR: Failed to build kernel
- $ cd build/tmp/work/x86_64-linux/pseudo-native/1.7.5-r0/pseudo-1.7.5
- $ grep -s mknod\( *
- pseudo_wrapfuncs.c:__xmknod(int ver, const char *path, mode_t mode, dev_t *dev) {
- pseudo_wrapfuncs.c: rc = wrap___xmknod(ver, path, mode, dev);
- pseudo_wrapfuncs.c:wrap___xmknod(int ver, const char *path, mode_t mode, dev_t *dev) {
- pseudo_wrapfuncs.c:mknod(const char *path, mode_t mode, dev_t dev) {
- pseudo_wrapfuncs.c: rc = wrap_mknod(path, mode, dev);
- pseudo_wrapfuncs.c:wrap_mknod(const char *path, mode_t mode, dev_t dev) {
- pseudo_wrapfuncs.h:/* int __xmknod(int ver, const char *path, mode_t mode, dev_t *dev) */
- pseudo_wrapfuncs.h:static int wrap___xmknod(int ver, const char *path, mode_t mode, dev_t *dev);
- pseudo_wrapfuncs.h:/* int mknod(const char *path, mode_t mode, dev_t dev) */
- pseudo_wrapfuncs.h:static int wrap_mknod(const char *path, mode_t mode, dev_t dev);
- pseudo_wrapper_table.c: { /* int __xmknod(int ver, const char *path, mode_t mode, dev_t *dev); */
- pseudo_wrapper_table.c: { /* int mknod(const char *path, mode_t mode, dev_t dev); */
- $
+ FPGA Done !
+ In FsblHookAfterBitstreamDload function
+ Partition Number: 2
+ Header Dump
+ Image Word Len: 0x000182C0
+ Data Word Len: 0x000182C0
+ Partition Word Len:0x000182C0
+ Load Addr: 0x00400000
+ Exec Addr: 0x00400000
+ Partition Start: 0x000FD490
+ Partition Attr: 0x00000010
+ Partition Checksum Offset: 0x00000000
+ Section Count: 0x00000001
+ Checksum: 0xFF6BA0BE
+ Application
+ Handoff Address: 0x00400000
+ In FsblHookBeforeHandoff function
+ SUCCESSFUL_HANDOFF
+ FSBL Status = 0x1
-のようにして https://patchwork.openembedded.org/patch/123001/
-の内容を入れたところ、、、今度は
-リンクで失敗している?
+** u-boot [#i553e859]
-むしろ、pseudo-1.7.5/ports/unix/wrapfuncs.in
-から mknod と mknodat をなくしちゃえばいいとか、
-ないのかな?
+ここから U-Boot が起動しています。
- $ cd ~/pseudo-1.7.5
- $ cp ports/unix/wrapfuncs.in ports/unix/wrapfuncs.in_orig
- $ jed ports/unix/wrapfuncs.in
- - int mknod(const char *path, mode_t mode, dev_t dev); /* flags=AT_SYMLINK_NOFOLLOW */
- - int mknodat(int dirfd, const char *path, mode_t mode, dev_t dev); /* flags=AT_SYMLINK_NOFOLLOW */
- + #int mknod(const char *path, mode_t mode, dev_t dev); /* flags=AT_SYMLINK_NOFOLLOW */
- + #int mknodat(int dirfd, const char *path, mode_t mode, dev_t dev); /* flags=AT_SYMLINK_NOFOLLOW */
- $ diff -u ports/unix/wrapfuncs.in_orig ports/unix/wrapfuncs.in
- ...
-
- $ jed ~/z-turn/petalinux/components/yocto/source/arm/layers/poky/meta/recipes-devtools/pseudo/files/pseudo-glibc-rtld-next-workaround.patch
- Does this work?
+ LANG:console
+ U-Boot 2016.07 (Feb 15 2017 - 19:04:54 +0900)
- Index: pseudo-1.7.5/ports/unix/wrapfuncs.in
- ===================================================================
- --- pseudo-1.7.5.orig/ports/unix/wrapfuncs.in
- +++ pseudo-1.7.5/ports/unix/wrapfuncs.in
- @@ -43,8 +43,8 @@
- int mkdirat(int dirfd, const char *path, mode_t mode); /* flags=AT_SYMLINK_NOFOLLOW */
- int mkfifo(const char *path, mode_t mode); /* flags=AT_SYMLINK_NOFOLLOW */
- int mkfifoat(int dirfd, const char *path, mode_t mode); /* flags=AT_SYMLINK_NOFOLLOW */
- -int mknod(const char *path, mode_t mode, dev_t dev); /* flags=AT_SYMLINK_NOFOLLOW */
- -int mknodat(int dirfd, const char *path, mode_t mode, dev_t dev); /* flags=AT_SYMLINK_NOFOLLOW */
- +#int mknod(const char *path, mode_t mode, dev_t dev); /* flags=AT_SYMLINK_NOFOLLOW */
- +#int mknodat(int dirfd, const char *path, mode_t mode, dev_t dev); /* flags=AT_SYMLINK_NOFOLLOW */
- int mkstemp(char *template); /* flags=AT_SYMLINK_NOFOLLOW */
- int rename(const char *oldpath, const char *newpath); /* flags=AT_SYMLINK_NOFOLLOW */
- int renameat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath); /* flags=AT_SYMLINK_NOFOLLOW */
- $ petalinux-build -c kernel
+ DRAM: ECC disabled 1 GiB
+ MMC: sdhci@e0100000: 0
+ SF: Detected W25Q128BV with page size 256 Bytes, erase size 4 KiB, total 16 MiB
+ *** Warning - bad CRC, using default environment
+
+ ## Error: flags type check failure for "serverip" <= "AUTO" (type: i)
+ himport_r: can't insert "serverip=AUTO" into hash table
+ In: serial
+ Out: serial
+ Err: serial
+ Net: ZYNQ GEM: e000b000, phyaddr -1, interface rgmii-id
+ eth0: ethernet@e000b000
+ U-BOOT for
+
+ ethernet@e000b000 Waiting for PHY auto negotiation to complete....... done
+ BOOTP broadcast 1
+ BOOTP broadcast 2
+ BOOTP broadcast 3
+ DHCP client bound to address 10.225.225.104 (1257 ms)
+ Hit any key to stop autoboot: 0
+
+ここでキー入力を待ち、
+
+ LANG:console
+ Device: sdhci@e0100000
+ Manufacturer ID: 27
+ OEM: 5048
+ Name: SD8GB
+ Tran Speed: 50000000
+ Rd Block Len: 512
+ SD version 3.0
+ High Capacity: Yes
+ Capacity: 7.4 GiB
+ Bus Width: 4-bit
+ Erase Group Size: 512 Bytes
+ reading image.ub
+ 9056008 bytes read in 504 ms (17.1 MiB/s)
+ ## Loading kernel from FIT Image at 10000000 ...
+ Using 'conf@1' configuration
+ Verifying Hash Integrity ... OK
+ Trying 'kernel@0' kernel subimage
+ Description: Linux Kernel
+ Type: Kernel Image
+ Compression: uncompressed
+ Data Start: 0x100000d4
+ Data Size: 3828576 Bytes = 3.7 MiB
+ Architecture: ARM
+ OS: Linux
+ Load Address: 0x00008000
+ Entry Point: 0x00008000
+ Hash algo: sha1
+ Hash value: d64f030b600f0f9b4719b9aec3abb54d250dba3b
+ Verifying Hash Integrity ... sha1+ OK
+ ## Loading ramdisk from FIT Image at 10000000 ...
+ Using 'conf@1' configuration
+ Trying 'ramdisk@0' ramdisk subimage
+ Description: ramdisk
+ Type: RAMDisk Image
+ Compression: uncompressed
+ Data Start: 0x103aa360
+ Data Size: 5212087 Bytes = 5 MiB
+ Architecture: ARM
+ OS: Linux
+ Load Address: unavailable
+ Entry Point: unavailable
+ Hash algo: sha1
+ Hash value: 893afc6ebe8b4e92eefa09fbb10d6536a6ab5a05
+ Verifying Hash Integrity ... sha1+ OK
+ ## Loading fdt from FIT Image at 10000000 ...
+ Using 'conf@1' configuration
+ Trying 'fdt@0' fdt subimage
+ Description: Flattened Device Tree blob
+ Type: Flat Device Tree
+ Compression: uncompressed
+ Data Start: 0x103a6d28
+ Data Size: 13702 Bytes = 13.4 KiB
+ Architecture: ARM
+ Hash algo: sha1
+ Hash value: 93252290614dcfbbc551b6db5362ae326e816674
+ Verifying Hash Integrity ... sha1+ OK
+ Booting using the fdt blob at 0x103a6d28
+ Loading Kernel Image ... OK
+ Loading Ramdisk to 07b07000, end 07fff7b7 ... OK
+ Loading Device Tree to 07b00000, end 07b06585 ... OK
+
+RAM ディスクやら何やらを設定しています。
+
+** Kernel [#e2902ea8]
+
+ここからカーネルです。
+
+ LANG:console
+ Starting kernel ...
+
+ Uncompressing Linux... done, booting the kernel.
+ Booting Linux on physical CPU 0x0
+ Linux version 4.6.0-xilinx (osamu@ubuntu16lts) (gcc version 5.2.1 20151005 (Linaro GCC 5.2-2015.11-2) ) #1 SMP PREEMPT Wed Feb 15 18:59:55 JST 2017
+ CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
+ CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
+ Machine model: zturn-v2016.4
+ bootconsole [earlycon0] enabled
+ cma: Reserved 16 MiB at 0x3f000000
+ Memory policy: Data cache writealloc
+ percpu: Embedded 12 pages/cpu @ef7d3000 s19776 r8192 d21184 u49152
+ Built 1 zonelists in Zone order, mobility grouping on. Total pages: 260608
+ Kernel command line: console=ttyPS0,115200 earlyprintk
+ PID hash table entries: 4096 (order: 2, 16384 bytes)
+ Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
+ Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
+ Memory: 1009252K/1048576K available (5286K kernel code, 230K rwdata, 1848K rodata, 1024K init, 222K bss, 22940K reserved, 16384K cma-reserved, 245760K highmem)
+ Virtual kernel memory layout:
+ vector : 0xffff0000 - 0xffff1000 ( 4 kB)
+ fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
+ vmalloc : 0xf0800000 - 0xff800000 ( 240 MB)
+ lowmem : 0xc0000000 - 0xf0000000 ( 768 MB)
+ pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
+ modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
+ .text : 0xc0008000 - 0xc07f793c (8127 kB)
+ .init : 0xc0800000 - 0xc0900000 (1024 kB)
+ .data : 0xc0900000 - 0xc0939ba0 ( 231 kB)
+ .bss : 0xc0939ba0 - 0xc09713a4 ( 223 kB)
+ Preemptible hierarchical RCU implementation.
+ Build-time adjustment of leaf fanout to 32.
+ RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
+ RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=2
+ NR_IRQS:16 nr_irqs:16 16
+ efuse mapped to f0802000
+ slcr mapped to f0804000
+ L2C: platform modifies aux control register: 0x72360000 -> 0x72760000
+ L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000
+ L2C-310 erratum 769419 enabled
+ L2C-310 enabling early BRESP for Cortex-A9
+ L2C-310 full line of zeros enabled for Cortex-A9
+ L2C-310 ID prefetch enabled, offset 1 lines
+ L2C-310 dynamic clock gating enabled, standby mode enabled
+ L2C-310 cache controller enabled, 8 ways, 512 kB
+ L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001
+ zynq_clock_init: clkc starts at f0804100
+ Zynq clock init
+ sched_clock: 64 bits at 333MHz, resolution 3ns, wraps every 4398046511103ns
+ clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x4ce07af025, max_idle_ns: 440795209040 ns
+ Switching to timer-based delay loop, resolution 3ns
+ clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 537538477 ns
+ timer #0 at f080c000, irq=17
+ Console: colour dummy device 80x30
+ Calibrating delay loop (skipped), value calculated using timer frequency.. 666.66 BogoMIPS (lpj=3333333)
+ pid_max: default: 32768 minimum: 301
+ Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
+ Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
+ CPU: Testing write buffer coherency: ok
+ CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
+ Setting up static identity map for 0x100000 - 0x100058
+ CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
+ Brought up 2 CPUs
+ SMP: Total of 2 processors activated (1333.33 BogoMIPS).
+ CPU: All CPU(s) started in SVC mode.
+ devtmpfs: initialized
+ VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
+ clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
+ pinctrl core: initialized pinctrl subsystem
+ NET: Registered protocol family 16
+ DMA: preallocated 256 KiB pool for atomic coherent allocations
+ cpuidle: using governor menu
+ hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
+ hw-breakpoint: maximum watchpoint size is 4 bytes.
+ zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0xf0880000
+ zynq-pinctrl 700.pinctrl: zynq pinctrl initialized
+ vgaarb: loaded
+ SCSI subsystem initialized
+ usbcore: registered new interface driver usbfs
+ usbcore: registered new interface driver hub
+ usbcore: registered new device driver usb
+ media: Linux media interface: v0.10
+ Linux video capture interface: v2.00
+ pps_core: LinuxPPS API ver. 1 registered
+ pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
+ PTP clock support registered
+ EDAC MC: Ver: 3.0.0
+ Advanced Linux Sound Architecture Driver Initialized.
+ clocksource: Switched to clocksource arm_global_timer
+ NET: Registered protocol family 2
+ TCP established hash table entries: 8192 (order: 3, 32768 bytes)
+ TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
+ TCP: Hash tables configured (established 8192 bind 8192)
+ UDP hash table entries: 512 (order: 2, 16384 bytes)
+ UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
+ NET: Registered protocol family 1
+ RPC: Registered named UNIX socket transport module.
+ RPC: Registered udp transport module.
+ RPC: Registered tcp transport module.
+ RPC: Registered tcp NFSv4.1 backchannel transport module.
+ Trying to unpack rootfs image as initramfs...
+ Freeing initrd memory: 5092K (c7b07000 - c8000000)
+ hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
+ futex hash table entries: 512 (order: 3, 32768 bytes)
+ workingset: timestamp_bits=28 max_order=18 bucket_order=0
+ jffs2: version 2.2. (NAND) (SUMMARY) c 2001-2006 Red Hat, Inc.
+ bounce: pool size: 64 pages
+ io scheduler noop registered
+ io scheduler deadline registered
+ io scheduler cfq registered (default)
+ dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330
+ dma-pl330 f8003000.dmac: DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
+ e0000000.serial: ttyPS0 at MMIO 0xe0000000 (irq = 146, base_baud = 6249999) is a xuartps
+ console [ttyPS0] enabled
+ bootconsole [earlycon0] disabled
+
+ここで止まってしまった。
+
+https://forums.xilinx.com/t5/Embedded-Linux/Kernel-hangs-at-quot-bootconsole-earlycon0-disabled-quot/m-p/634200
+
+これっぽい。
+
+現在の設計では、
+- vivado で UART0 と UART1 が両方 ON になっていて、
+- UART0 のピンはユーザーIOとしてピンへ出ているだけ
+- UART1 は USB_UART につながっている
+
+ので、UART1 を使わなければならないのだけど、UART0 を見に行ってしまっているっぽい。
+
+ LANG:console
+ $ less build/tmp/deploy/images/plnx_arm/plnx_arm-system.dts
...
- # やはりエラー
- $ less build/tmp/work/x86_64-linux/pseudo-native/1.7.5-r0/pseudo-1.7.5/ports/unix/wrapfuncs.in
- ...
- int mkfifo(const char *path, mode_t mode); /* flags=AT_SYMLINK_NOFOLLOW */
- int mkfifoat(int dirfd, const char *path, mode_t mode); /* flags=AT_SYMLINK_NOFOLLOW */
- #int mknod(const char *path, mode_t mode, dev_t dev); /* flags=AT_SYMLINK_NOFOLLOW */
- #int mknodat(int dirfd, const char *path, mode_t mode, dev_t dev); /* flags=AT_SYMLINK_NOFOLLOW */
- int mkstemp(char *template); /* flags=AT_SYMLINK_NOFOLLOW */
- int rename(const char *oldpath, const char *newpath); /* flags=AT_SYMLINK_NOFOLLOW */
- ...
- # 正しくパッチはあったっていた
- $
+ chosen {
+ bootargs = "console=ttyPS0,115200 earlyprintk";
+ stdout-path = "serial0:115200ns";
+ };
+
+ aliases {
+ serial0 = "/amba/serial@e0001000";
+ ethernet0 = "/amba/ethernet@e000b000";
+ spi0 = "/amba/spi@e000d000";
+ };
+ ...
+ serial@e0000000 {
+ compatible = "xlnx,xuartps", "cdns,uart-r1p8";
+ status = "okay";
+ clocks = <0x1 0x17 0x1 0x28>;
+ clock-names = "uart_clk", "pclk";
+ reg = <0xe0000000 0x1000>;
+ interrupts = <0x0 0x1b 0x4>;
+ device_type = "serial";
+ port-number = <0x1>;
+ };
+
+ serial@e0001000 {
+ compatible = "xlnx,xuartps", "cdns,uart-r1p8";
+ status = "okay";
+ clocks = <0x1 0x18 0x1 0x29>;
+ clock-names = "uart_clk", "pclk";
+ reg = <0xe0001000 0x1000>;
+ interrupts = <0x0 0x32 0x4>;
+ device_type = "serial";
+ port-number = <0x0>;
+ };
-すなおに Ubuntu にしろってことは、ある。
+earlycon0 がどうしてちゃんと動いているのか謎。
-** Linux ファイルシステムを準備 [#gf284759]
+起動時に現れる数秒入力待ちに ENTER キーで割り込んで、
-ここでは VirtualBox 内の Debian9 stretch に arm のエミュレータを入れて実行してみる。
+ LANG:console
+ Hit any key to stop autoboot: 0 (ENTER)
+ Zynq> setenv bootargs console=ttyPS1,115200 earlyprintk
+ Zynq> boot
-まず [[電気回路/z-turn/Linuxの設定]] の流れで Linux ルートファイルシステムを作る。
-カーネルが 4.6 なので jessie ではなく stretch を入れた。
-(stretch では less や、ifconfig のための net-tools を別途インストールする必要がありました。)
+としたところ、先へ進むことができた。
+後で dts の書き換え方法を調べなければ。。。~
+あるいは UART0, UART1 の出力ピンを入れ替えてしまおうか???
+
+以下、冒頭で文字化けしたり、出力がダブっているのは、ttyPS1 を有効にしてから
+earlycon0 を無効化しているので、その間両方から出力されているのだと思う。
+
+** ttyPS1 に切り替え後 [#y7b6004d]
+
LANG:console
- $ sudo chroot ~/z-turn/rootfs
+ 珮onsole [ttyPS1] enabled
+ console [ttyPS1] enabled
+ bootconsole [earlycon0] disabled
+ bootconsole [earlycon0] disabled
+ xdevcfg f8007000.devcfg: ioremap 0xf8007000 to f0870000
+ [drm] Initialized drm 1.1.0 20060810
+ brd: module loaded
+ loop: module loaded
+ m25p80 spi0.0: found w25q128, expected m25p80
+ m25p80 spi0.0: w25q128 (16384 Kbytes)
+ 4 ofpart partitions found on MTD device spi0.0
+ Creating 4 MTD partitions on "spi0.0":
+ 0x000000000000-0x000000500000 : "boot"
+ 0x000000500000-0x000000520000 : "bootenv"
+ 0x000000520000-0x000000fa0000 : "kernel"
+ 0x000000fa0000-0x000001000000 : "spare"
+ CAN device driver interface
+ gpiod_set_value: invalid GPIO
+ libphy: MACB_mii_bus: probed
+ macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 149 (00:0a:35:00:1e:53)
+ Generic PHY e000b000.etherne:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=e000b000.etherne:00, irq=-1)
+ e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
+ e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
+ ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
+ ehci-pci: EHCI PCI platform driver
+ usbcore: registered new interface driver usb-storage
+ mousedev: PS/2 mouse device common for all mice
+ i2c /dev entries driver
+ cdns-i2c e0004000.i2c: 400 kHz mmio e0004000 irq 142
+ cdns-i2c e0005000.i2c: 400 kHz mmio e0005000 irq 143
+ EDAC MC: ECC not enabled
+ Xilinx Zynq CpuIdle Driver started
+ sdhci: Secure Digital Host Controller Interface driver
+ sdhci: Copyright(c) Pierre Ossman
+ sdhci-pltfm: SDHCI platform and OF driver helper
+ mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using DMA
+ ledtrig-cpu: registered to indicate activity on CPUs
+ usbcore: registered new interface driver usbhid
+ usbhid: USB HID core driver
+ NET: Registered protocol family 10
+ sit: IPv6 over IPv4 tunneling driver
+ NET: Registered protocol family 17
+ can: controller area network core (rev 20120528 abi 9)
+ NET: Registered protocol family 29
+ can: raw protocol (rev 20120528)
+ can: broadcast manager protocol (rev 20120528 t)
+ can: netlink gateway (rev 20130117) max_hops=1
+ Registering SWP/SWPB emulation handler
+ hctosys: unable to open rtc device (rtc0)
+ ALSA device list:
+ No soundcards found.
+ Freeing unused kernel memory: 1024K (c0800000 - c0900000)
+ mmc0: new high speed SDHC card at address 0007
+ INIT: mmcblk0: mmc0:0007 SD8GB 7.42 GiB
+ mmcblk0: p1 p2
+ version 2.88 booting
+ FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
+ EXT4-fs (mmcblk0p2): warning: mounting fs with errors, running e2fsck is recommended
+ EXT4-fs (mmcblk0p2): recovery complete
+ EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
+ random: dd urandom read with 3 bits of entropy available
+ Wed Feb 15 16:39:44 UTC 2017
+ Starting internet superserver: inetd.
+ INIT: Entering runlevel: 5
+ Configuring network interfaces... IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
+ udhcpc (v1.24.1) started
+ Sending discover...
+ Sending discover...
+ macb e000b000.ethernet eth0: link up (1000/Full)
+ IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
+ Sending discover...
+ Sending select for 10.225.225.142...
+ Lease of 10.225.225.142 obtained, lease time 60000
+ /etc/udhcpc.d/50default: Adding DNS 10.225.225.2
+ done.
+ Starting Dropbear SSH server: Generating key, this may take a while...
+ Public key portion is:
+ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCywAVngG8aPxPIv6O1mO+J54MulFaSbDp3piMMUh6pAnB/PuLiauEh8tUubhK+3Fl1qribJ9mSbiEOrrbsbLkNvWQQ4aVT4ERPfc+cSlzIUcE0k+LuaEJBM0qdRXviNQVPUU9lSN/AdnvBND7H3ltixNI8fMAnrzxCoKpnfDw9xjHzMzJx4EEaACWu+lgn7XjAZmJKzBpxFRloFEypuDwTrqz/XiLmvdrVyD+PtPiAGcD47w60Ni9a/GDPstu+m0bOUn+KnV187GFDv6s6QD0GhRjqtXmdcSuhWcIQgjoMR6feEwAz3QoDT6ZUSuRG/fwZwkwYvYqEzUAupUAezfx7 root@plnx_arm
+ Fingerprint: md5 7e:0a:66:19:94:30:ea:76:08:92:61:b0:01:31:52:e0
+ dropbear.
+ Starting syslogd/klogd: done
+ Starting tcf-agent: OK
+ # ここで長時間かかる
+ random: nonblocking pool is initialized
+ EXT4-fs (mmcblk0p2): error count since last fsck: 10
+ EXT4-fs (mmcblk0p2): initial error at time 11: ext4_mb_generate_buddy:756
+ EXT4-fs (mmcblk0p2): last error at time 46: ext4_mb_generate_buddy:756
-これで、qemu 上での root 権限での実行に切り替わります。
+ここで止まった。
+
+でも、表示されたアドレス 10.225.225.142 へ ssh 接続したところ繋がったので、
+システムがハングアップしているわけではなさそう。
+
+本来ならここは、~
+https://forums.xilinx.com/t5/Embedded-Linux/Petalinux-2016-4-boot-from-SD-with-ext4-rootfs/m-p/743890/highlight/true#M18164
+
+のように、
+
+ LANG:console
+ PetaLinux 2016.4 plnx_arm /dev/ttyPS0
+
+ plnx_arm login:
+
+と続いて、すぐにログイン可能になるはずなのですが、
+今の場合 ttyPS0 ではなく ttyPS1 につないでくれないと表示されないので、
+またもやシリアルポート違いで表示&入力受付されていないのだと思われます。
+
+** ssh でつなぐ [#s9a01c56]
+
+表示された 10.225.225.142 へ ssh で繋ぎに言ったところ、ユーザー名とパスワードを聞かれた。
+
+ユーザーなんて作成していないのだけれど・・・
+
+まさかの、
+- ユーザー名 root
+- パスワード root
+
+で、繋がりました。
+
+** 起動後の状態確認 [#c5e928b5]
+
+ LANG:console
+ login as: root
+ root@10.225.225.142's password: root
+ # ls /
+ bin dev home lib mnt root sbin tmp var
+ boot etc init media proc run sys usr
+ # df
+ Filesystem 1K-blocks Used Available Use% Mounted on
+ devtmpfs 64 0 64 0% /dev
+ tmpfs 515876 32 515844 0% /run
+ tmpfs 515876 40 515836 0% /var/volatile
+ tmpfs 64 0 64 0% /dev
+ /dev/mmcblk0p1 65388 13290 52098 20% /run/media/mmcblk0p1
+ # ls /run/media/mmcblk0p1
+ BOOT.BIN System Volume Information image.ub
+ # mount
+ rootfs on / type rootfs (rw,size=504624k,nr_inodes=126156)
+ proc on /proc type proc (rw,relatime)
+ sysfs on /sys type sysfs (rw,relatime)
+ devtmpfs on /dev type devtmpfs (rw,relatime,size=504624k,nr_inodes=126156,mode=755)
+ tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
+ tmpfs on /var/volatile type tmpfs (rw,relatime)
+ tmpfs on /dev type tmpfs (rw,relatime,size=64k,mode=755)
+ devpts on /dev/pts type devpts (rw,relatime,mode=600)
+ /dev/mmcblk0p1 on /run/media/mmcblk0p1 type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
+
+* 起動はうまく行っている [#w71f3723]
+
+というわけで、起動自体はうまく行っていることがわかります。
+
+ LANG:console
+ $ git add .
+ $ git commit -m "起動するようになった"
+
+などとして保存しておきます。
+
+ここまでの作業で、
+
+- components/*
+- project-spec/configs/*
+- project-spec/hw-description/*
+- project-spec/meta-plnx-generated/*
+- project-spec/meta-plnx-user/*
+
+にいろいろファイルができていて、
+多分これらは必要に応じて編集していいファイルなのだと思います。
+
+現状、ルートファイルシステムは RAM ディスクなので
+z-turn のコンソールでルートファイルシステムを変更しても
+再起動すると変更が失われてしまいますし、
+ちょこちょこ書き換えながら開発していくには不向きな感じです。
+
+次は、
+
+- シリアルポートの指定がおかしい
+- カーネル、bootargs、デバイスツリー、ロジック、ルートファイルシステム等を
+別々に書き換えられる形にしたい
+
+あたりを直したいところです。
+
+>>> [[電気回路/zynq/Petalinux のカスタマイズ]] へつづく
+* ちょいメモ [#e29a434c]
+
+参考になりそうなWebページ
+
+http://www.ritsumei.ac.jp/se/re/izumilab/lecture/16zybot/4_IOControl_PetaLinux.html
+
+* 質問・コメント [#e69d9105]
+
+#article_kcaptcha