This service is available only in Japanese-language.

アプリの自動実行について

お世話になります。
起動後、自作したアプリを自動で実行するにはどのように構築すればよろしいでしょうか?
同様の質問https://yoctobbq.lineo.co.jp/?q=node/220を参考にしたのですが、
質問者様が貼っていたリンクhttps://qiita.com/tefunamu/items/e54bb9881aa11c26354eが切れていることもあり解決できませんでした。

ご使用の初期化マネージャがsysvinit系の場合は、既存の質問において質問者の方が紹介している
解決策が参考になります。
また、systemdを使用している場合は、以下のページが参考になるかと。
https://hub.mender.io/t/how-to-create-your-first-recipe-and-enable-auto-...

回答ありがとうございます。

使用しているターゲットの初期化マネージャはsysvinit系のようなので既存回答の通り構築しました。
起動後実行できたのですが、目的が違っおりました。
起動後実行ではなく、ログイン後の自動実行を試みています。
/etc/profile.dに.shを置くとログイン後に実行されるのですが、依存関係のある他の初期化が済んでおらずアプリが正常に動きません。現在構築したシステムにはbash_profileやbashrcはなく、このような処理を行うにはレシピ等の追加が必要となるのでしょうか?

(リンクの件、https://yoctobbq.lineo.co.jp/?q=node/220に様貼り付けてあったものから開こうとすると末尾の>がURLに含まれてしまって余計だったようです。)

以上、よろしくお願いいたします。

当サイトで紹介している方法では、以下が参考になるかと。
https://yoctobbq.lineo.co.jp/?q=comment/148#comment-148

回答ありがとうございます。

紹介いただいた4)を参考に記述しましたが、bitbake core-image-westonでエラーになります。
自作したレイヤーの中にrecipes-coreを作成して参考のような構成で行いました。
base-files_3.0.14.bbappendのdo_install_append()以降を記述しなければエラーとなりません。
このことからrecipes-coreを作成した場所が悪かったのかと思っています。
recipes-coreの上のディレクトリは何が適切でしょうか?

発生したエラーの情報をいただいていないので、推測となりますが、
do_install_append() の中で、
install -d を使用して、インストール先のディレクトリの生成が必要な場合があります。

回答ありがとうございます。

base-files_3.0.14.bbappendは下記の様に書き換えてbitbakeしました。
 FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
 SRC_URI += " \
 file://dot.profile \
 "
 do_install_append() {
  install -d ${D}/home/root/
  install -m 0644 ${WORKDIR}/dot.profile ${D}/home/root/.profile
 }

エラーは長いのですが冒頭と末尾は下記の通りでてきます。
ERROR: core-image-weston-1.0-r0 do_rootfs: Unable to install packages. Command '/home/sa/user_work2/build/tmp/work/iwg20m_g1m-poky-linux-gnueabi/core-image-weston/1.0-r0/recipe-sysroot-native/usr/bin/opkg --volatile-cache -f /home/sa/user_work2/build/tmp/work/iwg20m_g1m-poky-linux-gnueabi/core-image-weston/1.0-r0/opkg.conf -t /home/sa/user_work2/build/tmp/work/iwg20m_g1m-poky-linux-gnueabi/core-image-weston/1.0-r0/temp/ipktemp/ -o /home/sa/user_work2/build/tmp/work/iwg20m_g1m-poky-linux-gnueabi/core-image-weston/1.0-r0/rootfs --force_postinstall --prefer-arch-to-version install configuration kernel-module-ohci-pci kernel-module-libcomposite ntfs-3g-ntfsprogs weston-examples libsocketcan2 ltp libclutter-1.0-examples vsftpd bash gst-helloworld util-linux-swaponoff libdrm-tests ethtool ohci-init lttng-ust kernel-module-g-mass-storage packagegroup-core-boot packagegroup-gstreamer1.0-plugins myapp usbutils libkms1 packagegroup-core-ssh-dropbear audio-init wpa-supplicant fbset run-postinsts minicom pulseaudio-init bluez5 obexftp packagegroup-base-extended usb-otg-init alsa-tools mtd-utils-ubifs util-linux can-utils kernel-module-configfs pciutils kernel-module-pvrsrvkm fuse-exfat gles-user-module util-linux-umount lttng-modules init-ifupdown psplash packagegroup-rzg-multimedia usb-init-wl i2c-tools evtest gtk+3-demo exfat-utils python-datetime opkg libgbm-dev kernel-module-rtl8192cu weston-init kernel-module-usb-f-mass-storage e2fsprogs kernel-module-ohci-hcd packagegroup-qt5-examples memtester libegl-dev libegl1 python-subprocess mtd-utils linux-firmware rt-tests weston iproute2 alsa-utils lttng-tools util-linux-losetup kernel-module-rtl-usb libsmartcols1 kernel-module-dc-linuxfb dosfstools python-json' returned 255:
Removing any system startup links for ohci ...
Removing any system startup links for run-postinsts ...
Removing any system startup links for pulseaudio ...
Removing any system startup links for rc.usb ...
Removing any system startup links for rc.usbwl ...
Removing any system startup links for modutils.sh ...
Removing any system startup links for hwclock.sh ...
Installing configuration (1.0) on root
Downloading file:/home/sa/user_work2/build/tmp/deploy/ipk/cortexa15hf-neon-vfpv4/configuration_1.0-r0_cortexa15hf-neon-vfpv4.ipk.
Installing ntfs-3g-ntfsprogs (2017.3.23) on root
Downloading file:/home/sa/user_work2/build/tmp/deploy/ipk/cortexa15hf-neon-vfpv4/ntfs-3g-ntfsprogs_2017.3.23-r0_cortexa15hf-neon-vfpv4.ipk.
Installing ohci-init (1.0) on root
Downloading file:/home/sa/user_work2/build/tmp/deploy/ipk/all/ohci-init_1.0-r0_all.ipk.
Installing audio-init (1.0) on root
Downloading file:/home/sa/user_work2/build/tmp/deploy/ipk/cortexa15hf-neon-vfpv4/audio-init_1.0-r0_cortexa15hf-neon-vfpv4.ipk.
Installing run-postinsts (1.0) on root
Downloading file:/home/sa/user_work2/build/tmp/deploy/ipk/all/run-postinsts_1.0-r9_all.ipk.
・・・間長いので省略・・・
ERROR: core-image-weston-1.0-r0 do_rootfs: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /home/sa/user_work2/build/tmp/work/iwg20m_g1m-poky-linux-gnueabi/core-image-weston/1.0-r0/temp/log.do_rootfs.21898
ERROR: Task (/home/sa/user_work2/build/../poky/meta/recipes-graphics/images/core-image-weston.bb:do_rootfs) failed with exit code '1'
NOTE: Tasks Summary: Attempted 5590 tasks of which 5586 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
/home/sa/user_work2/build/../poky/meta/recipes-graphics/images/core-image-weston.bb:do_rootfs
Summary: There were 5 WARNING messages shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

他のレシピで .profile を生成している場合は、そのレシピに対するbbappend の中で、login時に起動する処理を
追加する方法をとることも可能かと。

回答ありがとうございます。

ターゲットボードで検索したとこと.profileは2つ見つかりました。他のレシピで.profileが生成されているのでしょうか。
/etc/skel/.profile
/home/root/.profile

log.do_rootfs.21898のerrorは下記の様になっておりました。
Collected errors:
* check_data_file_clashes: Package base-files wants to install file /home/sa/user_work2/build/tmp/work/iwg20m_g1m-poky-linux-gnueabi/core-image-weston/1.0-r0/rootfs/home/root/.profile
But that file is already provided by package * configuration

poky/meta/recipes-core/base-files/base-files/share/に dot.profileがあったので、
自作レイヤー下にrecipes-core/base-files/base-files/share/dot.profileを作成し自動で起動したいコマンドを追記しました。
ところがターゲット起動後の/root/.profileには内容が反映されませんでした。
recipes-core/base-files/にはbase-files_%.bbapendを置いて下記のように記述しています。
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
これで元のファイルに変更内容が追加されると思っていましたが、構築方法に間違い不足があるのでしょうか?

今回のファイル以外に、vsftpd.confも元々存在しているものから変更するようにしましたが結果に反映されません。
自作レイヤー下にrecipes-demons/vsftpd/files/vsftpd.confを作成し、追記しました。
recipes-demons/vsftpd/にはvsftpd_%.bbappendを置いて先ほどと同じ内容を記述しています。

一般に既存ファイルを変更する方法を行ったつもりですが認識間違っておりますでしょうか?
それともさらに上書きされる記述がどこかに存在するのでしょうか?
以上、よろしくお願いいたします。

既に他のレシピから生成されたパッケージに.profileが生成されているのであれば、
パッケージを展開してrootfsが構成された後に .profile に追記する処理を作成することで対応可能かと。

https://www.yoctoproject.org/docs/3.1.2/dev-manual/dev-manual.html#new-r...