임베디드 | 라즈베리파이 | ARM | 리눅스 | Qt | 딥러닝

2016/11/26 +1

토스터 정리

https://www.yoctoproject.org/docs/2.0/toaster-manual/toaster-manual.html

http://www.yoctoproject.org/docs/latest/toaster-manual/toaster-manual.html


기본적으로 구성할 수 있는 레이어 

http://layers.openembedded.org/layerindex/branch/master/layers/


토스트를 시작하기전에 빌드하면안된다 빌드 정보를 수집 하지 않기 때문 


토스터를 사용하면 볼 수 있는것

See what was built (recipes and packages) and what packages were installed into your final image.

Browse the directory structure of your image.

See the value of all variables in your build configuration, and which files set each value.

Examine error, warning, and trace messages to aid in debugging.

See information about the BitBake tasks executed and reused during your build, including those that used shared state.

See dependency relationships between recipes, packages, and tasks.

See performance information such as build time, task time, CPU usage, and disk I/O.


뭐가 빌트 되었는지, 레시피 그리고 패키지

이미지의 디렉토리 스트럭쳐 구조 

빌드 설정값을 볼 수 있다.

에러, 워닝, trace 메시지 를 볼 수 있다.

레시피, 패키지, tasks 의 의존 관계를 볼 수 있다.

빌드타임, task time, cpu usage, disk IO를 볼 수 있다.



토스터는 싱글, 멀티 모드를 지원해서 

spread across several machines: 이 가능하다




 

3. Python Virtual Environment 설치

이것은 파이썬의 여러버전을 설치하여 의존성을 망가뜨리지 않도록 가상의 환경설정을 해주는 것이다

설치

$ sudo apt-get install python-virtualenv

폴더 설정 및 실행 

$ virtualenv venv    //반드시 ~/폴더 즉  poky 전 폴더에다 해야함 

$ source venv/bin/activate  //source toaster start 하기전에 항상 실행


**참고 venv종료는 

$ deactivate


4.

poky $ pip install -r bitbake/toaster-requirements.txt


5. 로컬 호스트에서 시작하기

소스 디렉토리로 이동 

cd poky

build environement 실행 

poky$ source oe-init-build-env

poky/build 폴더에서 toaster 실행 

source ../bitbake/bin/toaster start


* 위에서 toaster conf json file not found 이 에러나면

파일이 없다는 것이다. 

https://git.yoctoproject.org/cgit/cgit.cgi/poky/    여기 tree 에서 보니 jethro branch 에 json 파일이 존재

git checkout jethro 해줌




이제 서버 접속하면 ok

 http://127.0.0.1:8000


$ xdg-open http://localhost:8000/


토스트 포트 변경

source ../bitbake/bin/toaster webport=8400

기본은 8000


중지

source toaster stop



에러해결방법

toaster has not recorded any builds yet. run a build from the command line to see it here. 가 나옴

이것은 venv   폴더 설정이 제대로 안되서 그렇다. 


terminal에서 빌드해도 화면에 빌드한것이 나타남 

Once Toaster is running, start a build. For example

bitbake core-image-minimal

 



-------- == -------- === -------- ==== 

6. The Directory for Cloning Layers

빌드하는데 필요할 레이어 들을 모아두는 폴더 _toaster_clones

Toaster creates a _toaster_clones directory inside your Source Directory (i.e. poky) 

이 값은 변경할 수있다. 


7. 빌드디렉토리

$TOASTER_DIR/build as the build directory.


8.Creating a Django Superuser


to set up the Toaster system dependencies 하기위하여   virtual environment is activated

source venv/bin/activate


슈퍼 유저로 실행하려면

   $ cd ~/poky/build

   $ ../bitbake/lib/toaster/manage.py createsuperuser

   슈퍼유저 생성

http://127.0.0.1:8000/admin

위 주소로 접속하면 됨           



9. Setting Up a Production Instance of Toaster

멀티플 유저, 리모트 유저 처럼 사용 가능 하도록 수정


9-1 설치 기본 설정

Have all the build requirements as described in "Setting Up the Basic System Requirements" chapter.

//이것은 위에 설치했다. 

$ sudo apt-get install python-virtualenv


Have an Apache webserver.

Have mod-wsgi for the Apache webserver.

Use the Mysql database server.

If you are using Ubuntu 14.04.3, run the following:


   $ sudo apt-get install apache2 libapache2-mod-wsgi mysql-server virtualenv libmysqlclient-dev


9-2 설치

Perform the following steps to install Toaster:


Checkout a copy of poky into the web server directory. You will be using /var/www/toaster:


   $ mkdir -p /var/www/toaster

   $ cd /var/www/toaster/

   $ git clone git://git.yoctoproject.org/poky

   $ git checkout krogoth

                      

Initialize a virtual environment and install Toaster dependencies. Using a virtual environment keeps the Python packages isolated from your system-provided packages:


   $ cd /var/www/toaster/

   $ virtualenv venv

   $ source ./venv/bin/activate

   $ pip install -r ./poky/bitbake/toaster-requirements.txt

   $ pip install mysql

   $ pip install MySQL-python

                      

Note

Isolating these packages is not required but is recommended. Alternatively, you can use your operating system's package manager to install the packages.

Configure Toaster by editing /var/www/toaster/poky/bitbake/lib/toaster/toastermain/settings.py as follows:


Edit the DATABASE settings:


   DATABASES = {

       'default': {

           'ENGINE': 'django.db.backends.mysql',

           'NAME': 'toaster_data',

           'USER': 'toaster',

           'PASSWORD': 'yourpasswordhere',

           'HOST': 'localhost',

           'PORT': '3306',

      }

   }

                              

Edit the SECRET_KEY:


   SECRET_KEY = 'your_secret_key'

                              

Edit the STATIC_ROOT:


   STATIC_ROOT = '/var/www/toaster/static_files/'

                              

Add the database and user to the mysql server defined earlier:


   $ mysql -u root -p

   mysql> CREATE DATABASE toaster_data;

   mysql> CREATE USER 'toaster'@'localhost' identified by 'yourpasswordhere';

   mysql> GRANT all on toaster_data.* to 'toaster'@'localhost';

   mysql> quit

                      

Get Toaster to create the database schema, default data, and gather the statically-served files:


   $ cd  /var/www/toaster/poky/

   $ ./bitbake/lib/toaster/manage.py syncdb

   $ ./bitbake/lib/toaster/manage.py migrate

   $ TOASTER_DIR=`pwd` TOASTER_CONF=./meta-poky/conf/toasterconf.json ./bitbake/lib/toaster/manage.py checksettings

   $ ./bitbake/lib/toaster/manage.py collectstatic

                      

For the above set of commands, after moving to the poky directory, the syncdb and migrate commands ensure the database schema has had changes propagated correctly (i.e. migrations).


The next line sets the Toaster root directory TOASTER_DIR and the location of the Toaster configuration file TOASTER_CONF, which is relative to the Toaster root directory TOASTER_DIR. For more information on the Toaster configuration file TOASTER_CONF, see the JSON Files section of this manual.


This line also runs the checksettings command, which configures the location of the Toaster Build directory. The Toaster root directory TOASTER_DIR determines where the Toaster build directory is created on the file system. In the example above, TOASTER_DIR is set as follows:


   /var/www/toaster/poky

                          

This setting causes the Toaster build directory to be:


   /var/www/toaster/poky/build

                          

Finally, the collectstatic command is a Django framework command that collects all the statically served files into a designated directory to be served up by the Apache web server.


Add an Apache configuration file for Toaster to your Apache web server's configuration directory. If you are using Ubuntu or Debian, put the file here:


   /etc/apache2/conf-available/toaster.conf

                      

If you are using Fedora or RedHat, put it here:


   /etc/httpd/conf.d/toaster.conf

                      

Following is a sample Apache configuration for Toaster you can follow:


   Alias /static /var/www/toaster/static_files

   <Directory /var/www/toaster/static_files>

           Order allow,deny

           Allow from all

           Require all granted

   </Directory>


   WSGIDaemonProcess toaster_wsgi python-path=/var/www/toaster/poky/bitbake/lib/toaster:/var/www/toaster/venv/lib/python2.7/site-packages


   WSGIScriptAlias / "/var/www/toaster/poky/bitbake/lib/toaster/toastermain/wsgi.py"

   <Location />

       WSGIProcessGroup toastern_wsgi

   </Location>

                      

If you are using Ubuntu or Debian, you will need to enable the config and module for Apache:


   $ sudo a2enmod wsgi

   $ sudo a2enconf toaster

   $ chmod +x bitbake/lib/toaster/toastermain/wsgi.py

                      

Finally, restart Apache to make sure all new configuration is loaded. For Ubuntu and Debian use:


   $ sudo service apache2 restart

                      

아파치 스톱

http://www.cyberciti.biz/faq/star-stop-restart-apache2-webserver/


For Fedora and RedHat use:


   $ sudo service httpd restart

                      

Install the build runner service. This service needs to be running in order to dispatch builds. Use this command:


   /var/www/toaster/poky/bitbake/lib/toaster/manage.py runbuilds

                      

Here is an example:


   #!/bin/sh

   # toaster run builds dispatcher

   cd /var/www/toaster/

   source ./venv/bin/activate

   ./bitbake/lib/toaster/manage.py runbuilds

                      

You can now open up a browser and start using Toaster.



관련영상

build configuration

https://www.youtube.com/watch?v=qYgDZ8YzV6w

Build Custom Layers

https://www.youtube.com/watch?v=QJzaE_XjX5c



https://www.youtube.com/watch?v=f3gDg75FwFo

Configuration:

https://www.youtube.com/watch?v=UW-j-T2TzIg

Tasks

https://www.youtube.com/watch?v=D4-9vGSxQtw

Recipes and Packages Built

https://www.youtube.com/watch?v=x-6dx4huNnw


https://www.youtube.com/watch?v=Cuw1tuVDp-8





okay 기본 적으로 토스터는 잘 실행된다. 

여기에다가 boundary 소스 추가해보자


https://github.com/boundarydevices/boundary-bsp-platform/blob/jethro/default.xml

기본적으로 설치되는 목록이 여기 있다. 이것 그대로 설정해보자 

기본적으로 폴더 구성이 다음과 같이 되어진다

base https://github.com/boundarydevices boundary-bsp-base

meta-boundary https://github.com/boundarydevices

meta-fsl-arm https://git.yoctoproject.org/git

meta-fsl-demos https://github.com/Freescale

meta-qt5 https://github.com/meta-qt5

meta-browser https://github.com/OSSystems

meta-fsl-arm-extra https://github.com/Freescale 이것 설치해야 imx6qsabrelite 머신이 나타난다.(toaster에서)

meta-openembedded https://github.com/openembedded

poky https://git.yoctoproject.org/cgit/cgit.cgi/poky/

Documentation https://github.com/Freescale



fetch --------

yocto

freescale

openembedded  oe

boudnarydevices   boundary

OSSystems   os

meta-qt5


remote --------

remote 는 fetch 의 name 사이트에 접속해서 가져오고 remote 에서 설치할 위치 지정해준다. 

poky yocto

meta-fsl-arm        meta-fsl-arm


meta-openembedded


boundary-bsp-base base


meta-fsl-arm-extra

meta-fsl-demos

Docunetation

meta-browser

meta-qt5

meta-boundary




토스터에서 사브레라이트 설정시 기본적으로 선택되는것

openembedded-core    poky

meta-yocto     poky

meta-yocto-bsp meta-yocto

meta-fsl-arm meta-fsl-arm

meta-fsl-arm-extra   openembeded-core  meta-fsl-arm




토스터에 추가하는 방법 간단하다.

import layer

layer name :  meta-boundary 

레파짓 토리는 https://github.com/boundarydevices/meta-boundary 여기에서 깃 복사하면 나타난다. 

git repository url   : https://github.com/boundarydevices/meta-boundary.git

git version : jethro

layer dependencies : openembedded-core

 

처음에 에러가 나타남 recipes-qt/qt5/qt5.inc  포함할 수 없다고함 

meta-boundary/recipes-qtbrowser/qtbrowser-qt5/qtbrowser-qt5_git.bb 여기에 포함되어있는 require 문제이다. 

상단파일은 jethro/sources/meta-qt5/recipes-qt/qt5

에 있다. 따라서 meta-qt5를 layer dependencies 에 넣어준다 

위에것 방법은 아니다


configuration-layers 에서 meta-qt5 를 add layer 해준다 

위에 문제 해결되어짐 


meta-browser 도 설치해준다. 

meta-gnome 설치



설치안되는 레이어

meta-qt5-extra   이건 지원 안되나보다 



지금 나타나는 문제는 Nothing PROVIDES 'meta 레이어이름' 이다



노트북에서 webkitforwayland 설치해주는데 cairo 관련 에러가 났음

해결방법은 configuration-software recipes - cairo 1.14.0-wpe-r0 를 직접 빌드 



weston build 해주는데 에러남

oe_runconf failed 에러


그냥 core-image-weston 을 빌드하려고했더니 distro feature x11 하라고 나온다.

DISTRO_FEATURES = x11 설정 해주자

distro feature wayland 도 나타남

DISTRO_FEATURES = x11 wayland 

계속 추가 ipv4


configuration - bitbake variables   하단에 add variable


core-image-weston has no buildable providers 에러 나타남

uninative-tarball, nativesdk-glibc 에러 나타남


TCLIBC = „glibc“  이거 넣어주라고한다 



wayland distro_features 넣어줬는데 에러남 그냥 wayland 따로 빌드 하기로

빌드하니까 에러남 

ipv6 distro_featrues 해줘야 할듯



노트북에서 webkitgtk 설치하려니 libc-backtrace, libc-big-macros, libc-bsd, libc-cxx-tests, libc-catgets, libc-charsets libc-crypt libc-crypt-ufc libc-db-aliases libc-envz libc-fcvt 에러

distro_feature 에 추가 


위에 설치하는 것이

http://www.crashcourse.ca/wiki/index.php/Poky_MACHINE_DISTRO_FEATURES

여기 디스트로와 비슷하다? 

DISTRO_FEATURES="alsa argp bluetooth ext2 irda largefile pcmcia usbgadget usbhost

  wifi xattr nfs zeroconf pci 3g nfc x11 ipv4 ipv6 libc-backtrace libc-big-macros

  libc-bsd libc-cxx-tests libc-catgets libc-charsets libc-crypt libc-crypt-ufc

  libc-db-aliases libc-envz libc-fcvt libc-fmtmsg libc-fstab libc-ftraverse libc-getlogin

  libc-idn libc-inet-anl libc-libm libc-locales libc-locale-code libc-memusage

  libc-nis libc-nsswitch libc-rcmd libc-rtld-debug libc-spawn libc-streams

  libc-sunrpc libc-utmp libc-utmpx libc-wordexp libc-posix-clang-wchar libc-posix-regexp

  libc-posix-regexp-glibc libc-posix-wchar-io largefile opengl ptest multiarch wayland

  pulseaudio sysvinit"



왜 pc에서는 아무이상이 없이 잘 됐을까? 

노트북은 패키지가 잔뜩 깔려있고

pc는 패키지가 하나도 설치 안돼있다. 



fsl-image-multimedia.bb 보니까

https://github.com/Freescale/meta-fsl-demos/blob/master/recipes-fsl/images/fsl-image-multimedia.bb

'DISTRO_FEATURES', 'wayland', \

'weston weston-init weston-examples \

 gtk+3-demo clutter-1.0-examples'

 등이 설치되어있다.




메인화면에서 우측 layers 에서 meta-webkit 클릭

recipes 클릭 하면 설치 할 수 있는 것이 나오는데 거기에 

webkitforwayland, webkitgtk, webkitgtk 가 있다.




빌드되어진 파일은

u-boot: u-boot-imx53qsb.imx

Kernel image: .bin

Root file system:  .ext3 and  .tar.bz2

SD Card image (include everything)  : .sdcard



노트북에서 fsl-image-mutimedia  빌드 잘된다. 

ACCEPT_FSL_EULA = "1" 설정해줘야한다 


build/tmp/images 에 빌드된것 보니 기존 과는 다르게

tar 로 압축되어있다. 이것을 어떻게 sd카드에 저장하나?


기존 boundary 에서 컴파일 안하고 토스터에서 컴파일하면 출력 목록이 다르다 


6x_bootscript-imx6qsabrelite

6x_bootscript-imx6qsabrelite-v2015.07+gitAUTOINC+6f020cc6fb-r0

6x_upgrade-imx6qsabrelite

6x_upgrade-imx6qsabrelite-v2015.07+gitAUTOINC+6f020cc6fb-r0

fsl-image-multimedia-imx6qsabrelite-20160509225732.rootfs.ext3

fsl-image-multimedia-imx6qsabrelite-20160509225732.rootfs.jffs2

fsl-image-multimedia-imx6qsabrelite-20160509225732.rootfs.manifest

fsl-image-multimedia-imx6qsabrelite-20160509225732.rootfs.tar.bz2

modules--3.14.52-r0-imx6qsabrelite-20160509225732.tgz

zImage

zImage--3.14.52-r0-imx6dl-nitrogen6_vm-20160509225732.dtb

zImage--3.14.52-r0-imx6dl-nitrogen6_vm-magstripe-20160509225732.dtb

zImage--3.14.52-r0-imx6dl-nitrogen6x-20160509225732.dtb

zImage--3.14.52-r0-imx6q-nitrogen6_max-20160509225732.dtb

zImage--3.14.52-r0-imx6q-nitrogen6x-20160509225732.dtb

zImage--3.14.52-r0-imx6qsabrelite-20160509225732.bin

zImage--3.14.52-r0-imx6q-sabrelite-20160509225732.dtb


tar.bz2 복사방법

http://www.acmesystems.it/microsd_backup



boundary 에서 하는 형식으로 한것

6x_bootscript-nitrogen6x

6x_bootscript-nitrogen6x-v2015.07+gitAUTOINC+6f020cc6fb-r0

6x_upgrade-nitrogen6x

6x_upgrade-nitrogen6x-v2015.07+gitAUTOINC+6f020cc6fb-r0

boundary-eval-image-nitrogen6x-20160502032508.rootfs.ext4

boundary-eval-image-nitrogen6x-20160502032508.rootfs.manifest

boundary-eval-image-nitrogen6x-20160502032508.rootfs.sdcard.gz

modules--3.14.52-r0-nitrogen6x-20160502091854.tgz

zImage

zImage--3.14.52-r0-imx6dl-nitrogen6_vm-20160502090859.dtb

zImage--3.14.52-r0-imx6dl-nitrogen6_vm-20160502091854.dtb

zImage--3.14.52-r0-imx6dl-nitrogen6_vm-20160502100200.dtb

zImage--3.14.52-r0-imx6dl-nitrogen6_vm-magstripe-20160502090859.dtb

zImage--3.14.52-r0-imx6dl-nitrogen6_vm-magstripe-20160502091854.dtb

zImage--3.14.52-r0-imx6dl-nitrogen6_vm-magstripe-20160502100200.dtb

zImage--3.14.52-r0-imx6dl-nitrogen6x-20160502090859.dtb

zImage--3.14.52-r0-imx6dl-nitrogen6x-20160502091854.dtb

zImage--3.14.52-r0-imx6dl-nitrogen6x-20160502100200.dtb

zImage--3.14.52-r0-imx6q-nitrogen6_max-20160502090859.dtb

zImage--3.14.52-r0-imx6q-nitrogen6_max-20160502091854.dtb

zImage--3.14.52-r0-imx6q-nitrogen6_max-20160502100200.dtb

zImage--3.14.52-r0-imx6q-nitrogen6x-20160502090859.dtb

zImage--3.14.52-r0-imx6q-nitrogen6x-20160502091854.dtb

zImage--3.14.52-r0-imx6q-nitrogen6x-20160502100200.dtb

zImage--3.14.52-r0-imx6q-sabrelite-20160502090859.dtb

zImage--3.14.52-r0-imx6q-sabrelite-20160502091854.dtb

zImage--3.14.52-r0-imx6q-sabrelite-20160502100200.dtb

zImage--3.14.52-r0-nitrogen6x-20160502090859.bin

zImage--3.14.52-r0-nitrogen6x-20160502091854.bin

zImage--3.14.52-r0-nitrogen6x-20160502100200.bin



/sources/meta-fsl-arm-extra/conf/machine/ 에서 아래 처럼 출력 값이 설정되어진다. 

include conf/machine/include/imx-base.inc

include conf/machine/include/tune-cortexa9.inc


SOC_FAMILY = "mx6:mx6dl:mx6q"


KERNEL_DEVICETREE = "imx6q-sabrelite.dtb \

                       imx6q-nitrogen6_max.dtb \

                       imx6q-nitrogen6x.dtb imx6dl-nitrogen6x.dtb \

                       imx6dl-nitrogen6_vm.dtb imx6dl-nitrogen6_vm-magstripe.dtb \

"

KERNEL_IMAGETYPE = "zImage"


PREFERRED_PROVIDER_u-boot = "u-boot-boundary"

PREFERRED_PROVIDER_virtual/kernel ?= "linux-boundary"


# Use SPI NOR U-Boot by default

IMAGE_BOOTLOADER ?= ""


# Ensure boot scripts will be available at rootfs time

do_rootfs[depends] += "u-boot-script-boundary:do_deploy"


# Boot scripts to install

BOOT_SCRIPTS = "6x_bootscript-${MACHINE}:6x_bootscript"


UBOOT_MACHINE ?= "nitrogen6q_config"


SERIAL_CONSOLE = "115200 ttymxc1"


MACHINE_EXTRA_RRECOMMENDS += "linux-firmware-wl12xx"


MACHINE_FEATURES += " pci wifi bluetooth"


/home/ko/jethro/sources/meta-fsl-arm/conf/machine/include/imx-base.inc 가 있고 여기에 sdcard.gz 설정 값이 존재한다.



toaster의 경우

/home/kono/poky/_toaster_clones/_git___github.com_Freescale_meta-fsl-arm-extra.git_jethro/conf/machine

/home/kono/poky/_toaster_clones/_git___git.yoctoproject.org_meta-fsl-arm_jethro/conf/machine/include

위 두개 폴더이다. 

SOC_DEFAULT_IMAGE_FSTYPES = "sdcard.gz"

SOC_DEFAULT_IMAGE_FSTYPES_mxs = "uboot.mxsboot-sdcard sdcard.gz"

IMAGE_FSTYPES ?= "${SOC_DEFAULT_IMAGE_FSTYPES}"



위에서 수정해줘도 되지만

토스터에서 bitbake variables 에서

IMAGE_FSTYPES 를 수정해도 될듯 하다



meta-fsl-arm/conf/machine/include/imx-base.inc 여기에 아래와 같이 수정하면 sdcard 가나타난다고함 


http://www.sinby.com/backyard-report/008-Yocto/how-to-use-meta-sinby.html

IMAGE_FSTYPES = "tar.gz ext4 sdcard"  이렇게?


IMAGE_FSTYPES="tar.bz2 ext3 sdcard"   



sudo dd if=core-image-base-nitrogen6x.sdcard of=/dev/sdc

zcat core-image-sato-dev-nitrogen6x.sdcard.gz | sudo dd of=/dev/sdb bs=1M



Or use .gz file directly:

gunzip -c imagename-imx53qsb.sdcard.gz | sudo dd of=/dev/sdb bs=4M

Flash rootfs only

sudo mount /dev/sdb3 /mnt/card sudo tar xf imagename-imx53qsb.tar.bz2 -C /mnt/card


만약 sdcard로 안하고 직접 포맷해서 분할하여 할 경우

https://lists.yoctoproject.org/pipermail/yocto/2015-April/024405.html

 



I'm using image_types_fsl from meta-fsl-arm and running into

some issues.  If I set

   IMAGE_FSTYPES="tar.bz2 ext3 sdcard"

   IMAGE_CLASSES="image_types_fsl"

I only end up with .ext3 and .sdcard images - no .tar.bz2.

If I use the default

   IMAGE_CLASSES="image_types"

then I get .tar.bz2 but no .sdcard



IMAGE_CLASSES = "image_types image_types_fsl"


sdcard 를 지정해줄 수 있는 곳은

/home/kono/poky/_toaster_clones/_git___git.yoctoproject.org_meta-fsl-arm_jethro/classes/image_types_fsl.bbclass


bitbake yourimage -e may help to understand how IMAGE_FSTYPES is built.

Other idea for debug is the log.do_rootfs


Usually I don't touch IMAGE_CLASSES but only IMAGE_FSTYPES

(as IMAGE_CLASSES is set by IMAGE_CLASSES += "image_types_fsl"

in ./conf/machine/include/fsl-default-settings.inc)


Note that I'm not changing IMAGE_CLASSES nor IMAGE_FSTYPES anywhere.


sdcard 사용하는 방법 쉽게 설명되어있음

https://community.freescale.com/docs/DOC-105521


관련글

http://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#json-config-area

http://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#var-IMAGE_FSTYPES

http://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#var-IMAGE_TYPES



토스터에서 간단하게 sdcard 파일 출력할 수있다.

image_fstypes = ext4 tar.bz2 해놓고

IMAGE_CLASSES = image_types_fsl  추가하고 빌드하면rootfs.sdcard, rootfs.tar.gz, ext4 가 생ㅅ어되어진다.


그리고 해당  build-toaster-2 폴더에 conf/local.conf 파일에 IMAGE_FSTYPES = "tar.gz ext4 sdcard" 도 추가해줬음

conf/local.conf 에다가 반드시 추가해야 sdcard 파일이 생성되어짐 


 build-toaster-2/conf/ 폴더에다가 했음 


됐다 sdcard 에도 잘올라가고 사브레 라이트에서도 구동 잘됨

여기 폴드 디렉토리 구조보니

/opt/fsl-gpu-sdk/ 에 샘플이있다. 


/home/kono/poky/build-toaster-2/conf/toaster.conf   에 local.conf 수정 내용이 그대로 있다. 웹에서 configure 해준게 있다. 






fsl-image-multimedia 빌드 완료후 

webkit 올리기

https://github.com/Freescale/meta-fsl-demos/blob/master/recipes-fsl/images/fsl-image-multimedia.bb

여기보니까

bb.utils.contains('DISTRO_FEATURES', 'wayland', \

'weston weston-init weston-examples \

gtk+3-demo clutter-1.0-examples', '', d), d)} \

이렇게 올라가있다

따라서 webkitgtk 를 올릴때 webkkitforwayland 로 올리면 잘 구동 되지 않을까?

software recipes 에서 webkitforwayland 선택하여 빌드하였음 

99%에서 오류남, 잘못껐다가 켜서 그런듯?


configuration > layers > 검색 webkit 치면 meta-webkit 나옴 add layer

이름 클릭후  recepes 보면 cairo, webitforwayland, webkitgtk 등 설치 할 수 있는 것이 나타난다. 



meta-webkit 의 webkitgtk 2.8.5버전으로 빌드하니까 잘된다.




기본 설치해야할 것

nodejs    

npm   npm 은 nodejs 빌드하고 나서 build summary->packages 보면 nodejs-npm이 포함 되어 있는 것을 볼 수 있다. 

openssh

nano

v4l-utils


이후 software recipes 에서 필요한거 빌드한후에 bitbake variables > image_install_append 에 추가해준다

nodejs openssh v4l-utils webkitgtk nano 설치했음

npm 은 nodejs 설치하면 자동으로 npm이 구성으로 들어간다.


커널 모듈을 설정해주려면 kernel-devsrc 를 설치해줘야한다.

kernel-devsrc 설치해주고 menuconfig 해서 드라이버 체크해준후


/home/ko/poky/build-toaster-2/tmp/work-shared/imx6qsabrelite/kernel-source/drivers/media/

폴더로 이동해서 수정해주고

make 해주니까 메이크 된다.


근데 드라이버가 꽤 많이 설정되어있다 왜그러지?


kernel-dev 사용방법 

http://git.yoctoproject.org/cgit.cgi/poky/plain/documentation/kernel-dev/kernel-dev-examples.xml

http://www.yoctoproject.org/docs/2.0/kernel-dev/kernel-dev.html



kernel-dev 설치하면

/home/ko/poky/build-toaster-2/tmp/work/imx6qsabrelite-poky-linux-gnueabi/kernel-devsrc/1.0-r0/image/usr/src/kernel

여기에 설치되어짐 



노트북에서 linux-boundary 설치하니 에러생김 로그보니 make mrproper 해주라고함 

tmp/work-shared/imx6qsabrelite/kernel-source/make mrproper 해줌 



toaster 에서 menuconfig 하려면

~/poky/build$ bitbake -c menuconfig virtual/kernel



pc work-shared/imx6sabrelite 에서 kernel-source/make menuconfig 하니까 별게 다 선택되어져있어서 폴더 삭제해줬다.

software recipes -> linux-boundary  찾아서 빌드해줌 이렇게하면 폴더가 생성된다?

MACHINE=imx6qsabrelite bitbake virtual/kernel  하면 커널이 생성된다?   이러면 qemu가 생겼던것 같다.




make menuconfig 하려면 ncurses-devel 설치해줘야함

apt-get install ncurses-dev



kernel-source 지우고 노트북꺼 폴더복사해줬는데 make menuconfig 가 동작된다



대박! toaster사용시 아래 폴더에 linux-boundary 가 있다 하단 폴더로 가서

/home/kono/poky/build-toaster-2/tmp/work/imx6qsabrelite-poky-linux-gnueabi/linux-boundary/3.14.52-r0/build

make menuconfig 해서 설정해준다

위에 폴더에서 menuconfig는 실행된다.

소스는 tmp/work-shared/ 폴더에 있는것을 수정해준다.

make는 따로 해줄 필요없이 toaster에서 빌드해주면 됨

 


수정하고 linux-boundary 만 빌드해주면 새로 modules, zImage 가 빌드되어진다. 

만약 위에서 모듈 파일 지웟으면

모듈 새로 안생기면 fsl-iamge-multimedia,  빌드해줘야 모듈이 빌드되어짐


sd카드에 모듈 압축파일 복사한후 

tar xvzf 파일명.tgz


??? modules 에 파일이 안들어가있다?

/home/kono/poky/build-toaster-2/tmp/work-shared/imx6qsabrelite/kernel-build-artifacts/make menuconfig

여기에서 menuconfig 해주면 올라갈까?  마찬가지로 올라가지 않음




/home/kono/poky/build-toaster-2/tmp/log/cooker/imx6qsabrelite 폴더에 log가 나타남 마지막 것 로그보니 아래와 같이 실행되어졌다. 

 

NOTE: Logfile for task /home/kono/poky/build-toaster-2/tmp/work/imx6qsabrelite-poky-linux-gnueabi/linux-boundary/3.14.52-r0/temp/log.do_package_qa_setscene.26261

NOTE: Logfile for task /home/kono/poky/build-toaster-2/tmp/work/imx6qsabrelite-poky-linux-gnueabi/linux-boundary/3.14.52-r0/temp/log.do_deploy_setscene.26263

NOTE: Logfile for task /home/kono/poky/build-toaster-2/tmp/work/imx6qsabrelite-poky-linux-gnueabi/linux-boundary/3.14.52-r0/temp/log.do_package_write_rpm_setscene.26262

NOTE: Logfile for task /home/kono/poky/build-toaster-2/tmp/work/imx6qsabrelite-poky-linux-gnueabi/linux-boundary/3.14.52-r0/temp/log.do_packagedata_setscene.26329

NOTE: Logfile for task /home/kono/poky/build-toaster-2/tmp/work/imx6qsabrelite-poky-linux-gnueabi/linux-boundary/3.14.52-r0/temp/log.do_populate_sysroot_setscene.26328 


NOTE: Logfile for task /home/kono/poky/build-toaster-2/tmp/work/x86_64-linux/gcc-cross-arm/5.2.0-r0/temp/log.do_populate_sysroot_setscene.27421 




상관없다.

log.do_populate_sysroot_setscene.26328  파일보니

Staging files from /home/kono/poky/build-toaster-2/tmp/work/imx6qsabrelite-poky-linux-gnueabi/linux-boundary/3.14.52-r0/sysroot-destdir to /home/kono/poky/build-toaster-2/tmp/sysroots/imx6qsabrelite

이렇게 되어있다. 


log.do_package_write_rpm_setscene.26262

/home/kono/poky/build-toaster-2/tmp/work/imx6qsabrelite-poky-linux-gnueabi/linux-boundary/3.14.52-r0/deploy-rpms to /home/kono/poky/build-toaster-2/tmp/deploy/rpm




아래 폴더에서 configure 를 체크해보니

/home/kono/poky/build-toaster-2/tmp/work/imx6qsabrelite-poky-linux-gnueabi/linux-boundary/3.14.52-r0/temp/$ nano run.do_configure


home/kono/poky/build-toaster-2/tmp/work/imx6qsabrelite-poky-linux-gnueabi/linux-boundary/3.14.52-r0/defconfig' >> '/home/kono/poky/build-toaster-2/tmp/work/imx6qsabrelite-poky-linux-gnueabi/linux-boundary/3.14.52-r0/build/.config

로 되어있다 즉, 다시 기본값으로 defconfig 되어짐, 이 값을 변경해야한다.


또다른 것으로 아래와 같이 되어있다. 

  mv "/home/kono/poky/build-toaster-2/tmp/work/imx6qsabrelite-poky-linux-gnueabi/linux-boundary/3.14.52-r0/git/.config" "/home/kono/poky/build-toaster-2/tmp/work/imx6qsabrelite-poky-linux-gnueabi/linux-boundary/3.14.52-r0/build/.config

git/.config 파일 보면 대부분 값이 선택되어져 있는 것




make menuconfig 로 수정해준 값을 

/home/kono/poky/build-toaster-2/tmp/work/imx6qsabrelite-poky-linux-gnueabi/linux-boundary/3.14.52-r0/build/.config

이값을 하단폴더에 defconfig 파일로 복사해준다

마찬가지로 안됨 



/home/kono/poky/build-toaster-2/tmp/work/imx6qsabrelite-poky-linux-gnueabi/linux-boundary/3.14.52-r0/build/.config 파일을

아래 폴더에 복사해준다.

/home/kono/poky/_toaster_clones/_git___github.com_Freescale_meta-fsl-arm-extra.git_jethro/recipes-kernel/linux/linux-boundary-3.14.52  마찬가지로 안됨



run.do_configure

 #echo "" > /home/kono/poky/build-toaster-2/tmp/work/imx6qsabrelite-poky-linux-gnueabi/linux-boundary/3.14.52-r0/build/.config

     위에것 주석처리해줬다 .config 값을 "" 없애버리니까. 




참고

/home/kono/poky/build-toaster-2/tmp/work/imx6qsabrelite-poky-linux-gnueabi/linux-boundary/3.14.52-r0/deploy-linux-boundary

이 폴더에도 구워져있다. 


기본적으로 설치되는 커널 모듈들이 나타나있다.

/home/kono/poky/build-toaster-2/tmp/work/imx6qsabrelite-poky-linux-gnueabi/linux-boundary/3.14.52-r0/pkgdata/linux-boundary




make menuconfig 할 수 있는 곳 

/home/kono/poky/build-toaster-2/tmp/work/imx6qsabrelite-poky-linux-gnueabi/linux-boundary/3.14.52-r0/build




여기에서 지금 구운 모듈에 뭐가 포함됐나 볼 수 있다 

/home/kono/poky/build-toaster-2/tmp/work/imx6qsabrelite-poky-linux-gnueabi/linux-boundary/3.14.52-r0/temp

 cat log.do_packagedata_setscene





/home/kono/poky/build-toaster-2/tmp/work/imx6qsabrelite-poky-linux-gnueabi/linux-boundary/3.14.52-r0/temp






import layer 하면 웹상에서 뭐가 안나타난다.

그럴때 해당 recipes-qt 하단에 있는 qt5 를 build 해주면 알아서 검사해서 다음부터 추가된다.

이때 _toaster_clone_ 폴더에 깃허브 가 복사되어진다.

아니면 다운받은 github value를 _toaster_clone/폴더에 위치하여 준다.


지금 qt설치하는데 문제는 위에거 하나였고 

다른문제는 master 에서 origin 으로 변경한 문제였다

또다른 문제   could not inherit file 

classes/qmake5_base.bbclass:50: could not inherit classe/remove-libtool.bbclass

nano remove-libtool.bbclass 만들어줌

https://github.com/openembedded/openembedded-core/blob/master/meta/classes/remove-libtool.bbclass

http://patchwork.openembedded.org/patch/116983/


console 에서 git branch jethro 해주니 remove-libtool 관련 명령어 사라짐



http://layers.openembedded.org/layerindex/branch/master/layers/

sudo find / -iname "*json*"






----------------------------------=========================================================================

토스터 설치 참고 


1.

krogoth


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

혹은   master branch

git clone http://git.yoctoproject.org/git/poky

git checkout krogoth


위에거 하면안된고

git clone http://git.yoctoproject.org/git/poky

git checkout 없이 클론만 해야한다 

위에 http 에서 하면 가끔 제대로 설치가 안될때가 있다? 

git clone  git://git.yoctoproject.org/poky.git



$ virtualenv venv    //반드시 ~/폴더 즉  poky 전 폴더에다 해야함 

$ source venv/bin/activate  //source toaster start 하기전에 항상 실행


poky$  pip install -r bitbake/toaster-requirements.txt


source oe-init-build-env

source ../bitbake/bin/toaster start


xdg-open http://localhost:8000/