m-tmatma / yocto-raspberry-pi

yocto for raspberry pi
0 stars 0 forks source link

raspberrypi ビルド方法 (fedora) #11

Open m-tmatma opened 5 years ago

m-tmatma commented 5 years ago

raspberrypi ビルド方法 (fedora)

m-tmatma commented 5 years ago

https://www.openembedded.org/wiki/Getting_started

sudo dnf groupinstall "Development Tools" -y
sudo dnf install -y python2
sudo dnf install -y gawk make wget tar bzip2 gzip python3 unzip perl patch diffutils diffstat 
sudo dnf install -y git cpp gcc gcc-c++ glibc-devel texinfo chrpath  ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue perl-bignum socat
sudo dnf install -y python3-pexpect findutils which file cpio python python3-pip xz
sudo dnf install -y rpcgen 

↑ "Development Tools" は不要かも

git clone  -b thud  git://git.yoctoproject.org/poky

cd poky
git clone  -b thud  git://git.openembedded.org/meta-openembedded
git clone  -b thud  git://git.yoctoproject.org/meta-raspberrypi
git clone  -b thud  git://github.com/meta-qt5/meta-qt5.git
git clone  -b thud  https://github.com/jumpnow/meta-rpi.git

export DL_DIR=${HOME}/downloads
export MACHINE="raspberrypi3"
source oe-init-build-env build-rpi
mkdir -p ${DL_DIR}
ln -sf ${DL_DIR}

bitbake-layers show-layers

bitbake-layers add-layer ../meta-openembedded/meta-oe
bitbake-layers add-layer ../meta-openembedded/meta-multimedia
bitbake-layers add-layer ../meta-openembedded/meta-python
bitbake-layers add-layer ../meta-openembedded/meta-networking
bitbake-layers add-layer ../meta-qt5
bitbake-layers add-layer ../meta-raspberrypi
bitbake-layers add-layer ../meta-rpi

conf/local.conf

MACHINE = "raspberrypi3"
DL_DIR ?= "${TOPDIR}/../downloads"

# systemd
DISTRO_FEATURES_append = " systemd pam"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_initscripts = ""
bitbake console-basic-image 
m-tmatma commented 5 years ago

http://mickey-happygolucky.hatenablog.com/entry/2016/12/18/111911

git clone git://git.yoctoproject.org/poky.git -b morty poky-morty
cd poky-morty
git clone git://git.yoctoproject.org/meta-raspberrypi -b morty
export DL_DIR=${HOME}/downloads
export MACHINE="raspberrypi3"
source oe-init-build-env build-rpi

conf/local.conf に

ENABLE_UART = "1" を追加する。

ln -sf ${DL_DIR}
bitbake-layers add-layer ../meta-raspberrypi
bitbake rpi-basic-image

→ うまく動かない

m-tmatma commented 5 years ago

途中。メモ

git clone git://git.yoctoproject.org/poky.git -b pyro poky-pyro
cd poky-pyro
git clone git://git.yoctoproject.org/meta-raspberrypi -b pyro

export DL_DIR=${HOME}/downloads
export MACHINE=raspberrypi3
source oe-init-build-env build-rpi
ln -sf ${DL_DIR}
m-tmatma commented 5 years ago

HDMI にログは出た。でも、シリアルには出なかった。

http://mickey-happygolucky.hatenablog.com/entry/2018/12/05/124316

mkdir -p rpi-thud/layers
cd rpi-thud/layers
git clone git://git.yoctoproject.org/poky.git -b thud

git clone git://git.yoctoproject.org/meta-raspberrypi -b thud
git clone git://git.openembedded.org/meta-openembedded -b thud
cd ../
source layers/poky/oe-init-build-env build
bitbake-layers add-layer ../layers/meta-openembedded/meta-oe
bitbake-layers add-layer ../layers/meta-openembedded/meta-python
bitbake-layers add-layer ../layers/meta-openembedded/meta-networking
bitbake-layers add-layer ../layers/meta-raspberrypi/
MACHINE = "raspberrypi3"
DL_DIR ?= "${TOPDIR}/../downloads"

# enable uart
ENABLE_UART = "1"

# systemd
DISTRO_FEATURES_append = " systemd pam"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_initscripts = ""
bitbake core-image-base

https://qiita.com/yamamotomanabu/items/33b6cf0d450051d33d41

dwc_otg.lpm_enable=0 console=tty1 console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

m-tmatma commented 5 years ago

Raspberry Pi 3のシリアル設定 https://tomosoft.jp/design/?p=9721

m-tmatma commented 5 years ago

https://lowreal.net/2016/11/04/1

m-tmatma commented 5 years ago

How to Enable Raspberry Pi 3’s HDMI Video / Display Console https://www.lynxbee.com/how-to-enable-raspberry-pi-3s-hdmi-video-display-console/

↓ これは必要ないかも

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait debug fbcon=map:10 fbcon=font:VGA8x8

m-tmatma commented 5 years ago

シリアルの指定をしないほうがいいかも dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

m-tmatma commented 5 years ago

https://raspberrylife.wordpress.com/2013/02/02/hdmi%E5%87%BA%E5%8A%9B%E8%A8%AD%E5%AE%9A/

m-tmatma commented 5 years ago

https://www.usagi1975.com/24mar172100/

m-tmatma commented 5 years ago

Building a Custom Linux Distribution http://www.informit.com/articles/article.aspx?p=2514911 http://www.informit.com/store/embedded-linux-systems-with-the-yocto-project-9780133443240?w_ptgrevartcl=Building+a+Custom+Linux+Distribution_2514911

m-tmatma commented 5 years ago

bitbake core-image-sato

WARNING: Host distribution "fedora-29" 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% |################################################################################################################################| Time: 0:00:01
Loaded 3055 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies
ERROR: Nothing PROVIDES 'faad2' (but /home/tsuchiyama/rpi-thud/layers/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.14.4.bb DEPENDS on or otherwise requires it)
faad2 was skipped: because it has a restricted license not whitelisted in LICENSE_FLAGS_WHITELIST
NOTE: Runtime target 'gst-examples' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['gst-examples', 'gstreamer1.0-plugins-bad', 'faad2']
NOTE: Runtime target 'packagegroup-core-x11-sato' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['packagegroup-core-x11-sato', 'gst-examples', 'gstreamer1.0-plugins-bad', 'faad2']
ERROR: Required build target 'core-image-sato' has no buildable providers.
Missing or unbuildable dependency chain was: ['core-image-sato', 'packagegroup-core-x11-sato', 'gst-examples', 'gstreamer1.0-plugins-bad', 'faad2']
m-tmatma commented 5 years ago

bitbake core-image-full-cmdline

m-tmatma commented 5 years ago

最初からやり直し

sudo dnf install -y python2
sudo dnf install -y gawk make wget tar bzip2 gzip python3 unzip perl patch diffutils diffstat 
sudo dnf install -y git cpp gcc gcc-c++ glibc-devel texinfo chrpath  ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue perl-bignum socat
sudo dnf install -y python3-pexpect findutils which file cpio python python3-pip xz
sudo dnf install -y rpcgen 
mkdir -p rpi-thud/layers
cd rpi-thud/layers
git clone git://git.yoctoproject.org/poky.git -b thud

git clone git://git.yoctoproject.org/meta-raspberrypi -b thud
git clone git://git.openembedded.org/meta-openembedded -b thud
cd ../
source layers/poky/oe-init-build-env build
bitbake-layers add-layer ../layers/meta-openembedded/meta-oe
bitbake-layers add-layer ../layers/meta-openembedded/meta-python
bitbake-layers add-layer ../layers/meta-openembedded/meta-networking
bitbake-layers add-layer ../layers/meta-raspberrypi/

conf/local.conf

MACHINE = "raspberrypi3"
DL_DIR ?= "${TOPDIR}/../downloads"

# systemd
DISTRO_FEATURES_append = " systemd pam"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_initscripts = ""
bitbake core-image-base
m-tmatma commented 5 years ago

nohup command > out.log 2> error.log &

https://kazmax.zpp.jp/linux/nohup_stdout.html

m-tmatma commented 5 years ago

nohup bitbake core-image-full-cmdline > out.log 2> error.log &

m-tmatma commented 5 years ago

https://jumpnowtek.com/rpi/Raspberry-Pi-Systems-with-Yocto.html

mk2parts.sh

m-tmatma commented 5 years ago
mkdir -p rpi-thud/layers
cd rpi-thud/layers
git clone git://git.yoctoproject.org/poky.git -b thud

git clone git://git.yoctoproject.org/meta-raspberrypi -b thud
git clone git://git.openembedded.org/meta-openembedded -b thud
cd ../

source layers/poky/oe-init-build-env build

bitbake-layers add-layer ../layers/meta-openembedded/meta-oe
bitbake-layers add-layer ../layers/meta-openembedded/meta-python
bitbake-layers add-layer ../layers/meta-openembedded/meta-networking
bitbake-layers add-layer ../layers/meta-raspberrypi/

conf/local.conf

MACHINE = "raspberrypi3"
DL_DIR ?= "${TOPDIR}/../downloads"

# systemd
DISTRO_FEATURES_append = " systemd pam"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_initscripts = ""

nohup bitbake core-image-full-cmdline > out.log 2> error.log &

m-tmatma commented 5 years ago

nohup bitbake core-image-full-cmdline > out.log 2> error.log &

m-tmatma commented 5 years ago

https://www.atnr.net/how-to-output-from-hdmi-with-raspberry-pi-3/

以下の設定ファイルの /boot/config.txt

hdmi_force_hotplug=1

の部分が#でコメントアウトされているんので#を消してオプションを有効にします。

m-tmatma commented 5 years ago

https://raspberrypi.stackexchange.com/questions/31842/how-do-i-generate-configure-config-txt-for-raspberry-pi2-using-yocto

m-tmatma commented 5 years ago
git checkout -b warrior origin/warrior 
cd meta-openembedded ; git checkout -b warrior origin/warrior ; cd .. ;
cd meta-raspberrypi  ; git checkout -b warrior origin/warrior ; cd .. ;
cd meta-qt5          ; git checkout -b warrior origin/warrior ; cd .. ;
cd meta-rpi          ; git checkout -b warrior origin/warrior ; cd .. ;
m-tmatma commented 5 years ago

http://variwiki.com/index.php?title=Adding_yocto_packages

IMAGE_INSTALL_append = " <package>"

IMAGE_INSTALL_append  += " haveged"
IMAGE_FEATURES_append += " haveged"
m-tmatma commented 5 years ago

https://wiki.yoctoproject.org/wiki/Entropy_on_Autobuilders

m-tmatma commented 5 years ago

https://www.google.com/search?q=crng+init+yocto+hang&oq=crng+init+yocto+hang

m-tmatma commented 5 years ago

https://www.google.com/webhp?gl=us&hl=en

m-tmatma commented 5 years ago

https://www.google.com/webhp?gl=us&hl=en&q=crng+init+yocto+hang&oq=crng+init+yocto+hang

m-tmatma commented 5 years ago

strings ./linux-raspberrypi3-standard-build/arch/arm/boot/vmlinux | grep "crng init done"

m-tmatma commented 5 years ago

テスト

DISTRO_FEATURES_append = " systemd"
INHERIT_append = " extrausers"
EXTRA_USERS_PARAMS = "usermod -P Password root;"
IMAGE_INSTALL_append  += " rng-tools"
IMAGE_INSTALL_append  += " haveged"
#IMAGE_FEATURES_append += " haveged"
#IMAGE_INSTALL_append  += " ssh-server-dropbear"
#IMAGE_FEATURES_append += " ssh-server-dropbear"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_initscripts = ""
PREFERRED_VERSION_linux-raspberrypi = "4.19.44"
m-tmatma commented 5 years ago

Raspberry Pi のハードウェア乱数生成器を利用する Raspberry Pi3 Model Bセットアップ RasPI で動く Kernel ビルドとそのデバッグ

m-tmatma commented 5 years ago
git clone  -b thud  git://git.yoctoproject.org/poky

cd poky
git clone  -b thud  git://git.openembedded.org/meta-openembedded
git clone  -b thud  git://git.yoctoproject.org/meta-raspberrypi
git clone  -b thud  git://github.com/meta-qt5/meta-qt5.git
git clone  -b thud  https://github.com/jumpnow/meta-rpi.git
git checkout -b warrior origin/warrior 
cd meta-openembedded ; git checkout -b warrior origin/warrior ; cd .. ;
cd meta-raspberrypi  ; git checkout -b warrior origin/warrior ; cd .. ;
cd meta-qt5          ; git checkout -b warrior origin/warrior ; cd .. ;
cd meta-rpi          ; git checkout -b warrior origin/warrior ; cd .. ;

source oe-init-build-env build-warrior

bitbake-layers show-layers

bitbake-layers add-layer ../meta-openembedded/meta-oe
bitbake-layers add-layer ../meta-openembedded/meta-multimedia
bitbake-layers add-layer ../meta-openembedded/meta-python

bitbake core-image-full-cmdline

sudo umount /dev/sdb?
sudo dd if=./tmp/work/raspberrypi3-poky-linux-gnueabi/core-image-full-cmdline/1.0-r0/deploy-core-image-full-cmdline-image-complete/core-image-full-cmdline-raspberrypi3.rpi-sdimg of=/dev/sdb
m-tmatma commented 5 years ago

https://qiita.com/ryuichi1208/items/7da92868442fd8959c6f http://mickey-happygolucky.hatenablog.com/entry/2019/03/13/082634

bitbake virtual/kernel -c menuconfig

m-tmatma commented 5 years ago

bitbake virtual/kernel -c diffconfig

m-tmatma commented 5 years ago
bitbake virtual/kernel -c do_compile
bitbake virtual/kernel -c do_install
m-tmatma commented 5 years ago
sudo umount /dev/sdb?
sudo dd if=./tmp/work/raspberrypi3-poky-linux-gnueabi/core-image-full-cmdline/1.0-r0/deploy-core-image-full-cmdline-image-complete/core-image-full-cmdline-raspberrypi3.rpi-sdimg of=/dev/sdb
m-tmatma commented 5 years ago

https://qiita.com/Nao1215/items/399b24bf5d9d81ac087d

do_fetch レシピに記載されたURL(SRC_URI)を元に、ソースコードを取得する。
do_unpack ソースコード(tarなど)を展開する。
do_patch ソースコードにパッチを適用する。
do_configure GNU Automakeによって、Makefileを作成する。
do_compile ソースコードをコンパイルする。
do_install 指定のディレクトリに、コンパイルによる生成物をインストールする。
do_populate_sysroot sysrootを作成する。
do_package パッケージを作成する。
m-tmatma commented 5 years ago

http://kronus9.sblo.jp/article/104892924.html

m-tmatma commented 5 years ago

https://boundarydevices.com/what-is-a-yocto-image-and-how-can-i-modify-it/

m-tmatma commented 5 years ago

https://www.yoctoproject.org/docs/1.8/ref-manual/ref-manual.html#configuration-and-compilation-dev-environment

m-tmatma commented 5 years ago

http://mickey-happygolucky.hatenablog.com/entry/2019/03/08/153128

m-tmatma commented 5 years ago

Where do the “virtual/…” terms come from? https://stackoverflow.com/questions/37815066/where-do-the-virtual-terms-come-from

m-tmatma commented 5 years ago

https://www.yoctoproject.org/docs/1.6/bitbake-user-manual/bitbake-user-manual.html

m-tmatma commented 5 years ago

bitbake virtual/kernel -c listtasks

m-tmatma commented 5 years ago

http://kronus9.sblo.jp/category/3949483-1.html

m-tmatma commented 5 years ago
bitbake virtual/kernel -c compile -f
bitbake core-image-full-cmdline
m-tmatma commented 5 years ago

https://raspberrypi.stackexchange.com/questions/31842/how-do-i-generate-configure-config-txt-for-raspberry-pi2-using-yocto

m-tmatma commented 5 years ago

Raspberry Pi3(Linux Kernel)のBoot Sequence Step1:アーキテクチャ依存部 https://debimate.jp/2018/12/31/raspberry-pi3linux-kernel%E3%81%AEboot-sequence-step1%E3%82%A2%E3%83%BC%E3%82%AD%E3%83%86%E3%82%AF%E3%83%81%E3%83%A3%E4%BE%9D%E5%AD%98%E9%83%A8/

m-tmatma commented 5 years ago

https://stackoverflow.com/questions/16390004/change-default-console-loglevel-during-boot-up https://www.kernel.org/doc/Documentation/admin-guide/kernel-parameters.txt

m-tmatma commented 5 years ago

https://elinux.org/Debugging_by_printing

m-tmatma commented 5 years ago

https://elinux.org/Bitbake_Cheat_Sheet