LoginSignup
1
1

More than 5 years have passed since last update.

PetaLinuxでディレクトリやPythonスクリプトを、Linuxイメージにインストールする

Last updated at Posted at 2018-01-17

この記事の内容は正しいかは不明。とりあえず動いた。

環境

PetaLinux 2017.4

ディレクトリごとコピーする

mydirというディレクトリを全部コピーしたい場合のYoctoレシピ。ここでは、/home/root/instにインストールされる。
myinitというアプリケーションを作り、インストール時にコピーするようにする。(アプリケーション名はなんでもいい)

PetaLinuxコマンド
petalinux-create -t apps --template install -n myinit --enable

mydirproject-spec/meta-user/recipes-apps/myinit/filesにコピーする

project-spec/meta-user/recipes-apps/myinit/myinit.bb
SUMMARY = "Simple myinit application"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "file://mydir"

S = "${WORKDIR}"

do_install() {
    # install a directory
    install -d ${D}/home/root/inst
    cp -r ${S}/mydir ${D}/home/root/inst
}
FILES_${PN} += "/home/root/inst"

Pythonスクリプトをインストールする

Pythonスクリプトをインストールするとき、ファイル先頭に環境設定があるとエラーになった。

追記(2018/1/20): 単にパスを間違えているだけかも。#!/usr/bin/envならOKかも(未確認)

NGだった
#!/bin/env python
# coding: utf-8
import os
...
OKだった
##!/bin/env python  # ignore
# coding: utf-8
import os
...
1
1
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
1
1