LoginSignup
3
3

More than 5 years have passed since last update.

Petalinux 固定IP設定するまでの流れ

Last updated at Posted at 2018-04-05

目標

Petalinuxを固定IPで起動させる

環境

  • Petalinux version 
    Petalinux 2017.2

  • 動作環境
    Petalinux QEMU

作業手順

下記Xilinxのページから、IPアドレス設定に用いるフォルダ、ファイルを作成する
https://japan.xilinx.com/support/answers/69119.html

  1. フォルダを作成
  2. mkdir -p /project-spec/meta-user/recipes-core/init-ifupdown/init-ifupdown
  3. カスタム インターフェイス ファイルをコピー(ファイルは上記リンク先から取得可能)
  4. $ cp /project-spec/meta-user/recipes-core/init-ifupdown/init-ifupdown/interfaces
  5. bbappend ファイルを作成
  6. $ vim /project-spec/meta-user/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend
      
  7. init-ifupdown_1.0.bbappend ファイルに下記コードを追加
  8. FILESEXTRAPATHS_prepend :="\${THISDIR}/${PN}:"
  9. 次のコンテンツを/project-spec/meta-user/conf/petalinuxbsp.conf ファイルに追加
  10. SIGGEN_UNLOCKED_RECIPES += "init-ifupdown"
    1.~5.で設定用ファイルの作成は完了。次はIPの設定 最初に貼ったリンクの添付ファイル内容は下記の通り
    auto eth0

    iface eth0 inet static

    address 192.168.0.100

    netmask 255.255.255.0

    gateway 192.168.0.1

    dns-nameservers 4.4.4.4

    dns-nameservers 8.8.8.8

    この中身を自分の設定に変更し、保存する

  11. すべて終わったら init-ifupdown レシピを再構築し、petalinux-buildを行う(プロジェクトファイルのルートディレクトリで行う)
  12. \$ petalinux-build -c init-ifupdown

    $ petalinux-build

起動後のIPアドレス設定は完了。
以上、ただのメモ書き

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3