yocto proejct - poky 다운로드

pi@raspberrypi ~/src $ git clone git://git.yoctoproject.org/poky yoctoProject

Cloning into 'yoctoProject'...

remote: Counting objects: 279679, done.

remote: Compressing objects: 100% (68614/68614), done.

Receiving objects: 100% (279679/279679), 112.68 MiB | 1.40 MiB/s, done.

Resolving deltas: 100% (205623/205623), done.

Checking out files: 100% (5101/5101), done. 



meta-raspberrypi layer 다운로드

pi@raspberrypi ~/src $ cd yoctoProject/

pi@raspberrypi ~/src/yoctoProject $ git clone git://git.yoctoproject.org/meta-raspberrypi

Cloning into 'meta-raspberrypi'...

remote: Counting objects: 1924, done.

remote: Compressing objects: 100% (906/906), done.

remote: Total 1924 (delta 841), reused 1924 (delta 841)

Receiving objects: 100% (1924/1924), 351.58 KiB | 255 KiB/s, done.

Resolving deltas: 100% (841/841), done. 


환경변수 및 라즈베리 파이 빌드할 경로 생성

pi@raspberrypi ~/src/yoctoProject $ source oe-init-build-env raspberryPiBuild/

You had no conf/local.conf file. This configuration file has therefore been

created for you with some default values. You may wish to edit it to use a

different MACHINE (target hardware) or enable parallel build options to take

advantage of multiple cores for example. See the file for more information as

common configuration options are commented.


You had no conf/bblayers.conf file. The configuration file has been created for

you with some default values. To add additional metadata layers into your

configuration please add entries to this file.


The Yocto Project has extensive documentation about OE including a reference

manual which can be found at:

    http://yoctoproject.org/documentation


For more information about OpenEmbedded see their website:

    http://www.openembedded.org/



### Shell environment set up for builds. ###


You can now run 'bitbake <target>'


Common targets are:

    core-image-minimal

    core-image-sato

    meta-toolchain

    adt-installer

    meta-ide-support


You can also run generated qemu images with a command like 'runqemu qemux86' 


라즈베리 파이 빌드를 위한 환경 설정 1

pi@raspberrypi ~/src/yoctoProject/raspberryPiBuild $ vim conf/local.conf

MACHINE ?= "raspberrypi" 


라즈베리 파이 빌드를 위한 환경 설정 2

pi@raspberrypi ~/src/yoctoProject/raspberryPiBuild $ vim conf/bblayers.conf

# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf

# changes incompatibly

LCONF_VERSION = "6"


BBPATH = "${TOPDIR}"

BBFILES ?= ""


BBLAYERS ?= " \

  /home/pi/src/yoctoProject/meta \

  /home/pi/src/yoctoProject/meta-yocto \

  /home/pi/src/yoctoProject/meta-yocto-bsp \

  /home/pi/src/yoctoProject/meta-raspberrypi \

  "

BBLAYERS_NON_REMOVABLE ?= " \

  /home/pi/src/yoctoProject/meta \

  /home/pi/src/yoctoProject/meta-yocto \

  "


빌드를 위한 패키지 설치(라즈비안에서 한 120메가 다운로드 / 500메가 용량 필요)

pi@raspberrypi ~/src/yoctoProject/raspberryPiBuild $ sudo apt-get install sed wget cvs subversion git-core coreutils unzip texi2html texinfo libsdl1.2-dev docbook-utils gawk python-pysqlite2 diffstat help2man make gcc build-essential g++ desktop-file-utils chrpath libgl1-mesa-dev libglu1-mesa-dev mercurial autoconf automake groff libtool xterm


빌드 시작

pi@raspberrypi ~/src/yoctoProject/raspberryPiBuild $ bitbake core-sato-image


리부팅후 환경변수 재설정

pi@raspberrypi ~/src/yoctoProject $ source oe-init-build-env 


끄응.. 왜 안되지? 라즈베리에서 라즈베리를 빌드하려고 해서 그런가? ㅋㅋㅋ

pi@raspberrypi ~/src/yoctoProject/raspberryPiBuild $ bitbake core-sato-image

WARNING: Host distribution "Raspbian-GNU-Linux-7" 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.

ERROR: Unable to determine endianness for architecture 'armv6l' | ETA:  --:--:--

ERROR: Please add your architecture to siteinfo.bbclass

ERROR: Failed to parse recipe: /home/pi/src/yoctoProject/meta/recipes-core/coreutils/coreutils_8.24.bb


Summary: There was 1 WARNING message shown.

Summary: There were 3 ERROR messages shown, returning a non-zero exit code.



---

pi@raspberrypi ~/src/yoctoProject $ ls -al

합계 92

drwxr-xr-x 12 pi pi  4096  7월 30 06:33 .

drwxr-xr-x 10 pi pi  4096  7월 30 06:29 ..

drwxr-xr-x  8 pi pi  4096  7월 30 06:33 .git

-rw-r--r--  1 pi pi   346  7월 30 06:32 .gitignore

-rw-r--r--  1 pi pi    66  7월 30 06:32 .templateconf

-rw-r--r--  1 pi pi   515  7월 30 06:32 LICENSE

-rw-r--r--  1 pi pi  2458  7월 30 06:32 README

-rw-r--r--  1 pi pi 19318  7월 30 06:32 README.hardware

drwxr-xr-x  6 pi pi  4096  7월 30 06:32 bitbake

drwxr-xr-x 13 pi pi  4096  7월 30 06:32 documentation

drwxr-xr-x 21 pi pi  4096  7월 30 06:32 meta

drwxr-xr-x 13 pi pi  4096  7월 30 06:33 meta-raspberrypi

drwxr-xr-x  5 pi pi  4096  7월 30 06:32 meta-selftest

drwxr-xr-x  7 pi pi  4096  7월 30 06:32 meta-skeleton

drwxr-xr-x  5 pi pi  4096  7월 30 06:32 meta-yocto

drwxr-xr-x  8 pi pi  4096  7월 30 06:32 meta-yocto-bsp

-rwxr-xr-x  1 pi pi  2002  7월 30 06:32 oe-init-build-env

-rwxr-xr-x  1 pi pi  2432  7월 30 06:32 oe-init-build-env-memres

drwxr-xr-x  8 pi pi  4096  7월 30 06:32 scripts


pi@raspberrypi ~/src $ du -h yoctoProject/

178M    yoctoProject/



[링크 : http://ric96.blogspot.in/2014/09/yocto-for-raspberry-pi-build-guide.html]

'프로그램 사용 > yocto project' 카테고리의 다른 글

imx8 yocto  (0) 2023.08.28
imx8 yocto build on ubuntu 22.04  (0) 2023.02.10
yocto project 구조  (0) 2015.07.29
라즈베리 파이 2 yocto 프로젝트?  (0) 2015.06.08
rpi in yocto project  (0) 2015.04.29
Posted by 구차니
프로그램 사용/gcc2015. 7. 30. 10:10

-c -o gch를 통해서 gcc precompiled header를 생성이 가능하다.

물론 gch가 생성되면 원래 헤더파일이 사라져도 문제없이 컴파일 된다.

pi@raspberrypi ~/src/pch $ g++ -c stdafx.h -o stdafx.h.gch


pi@raspberrypi ~/src/pch $ ls -al

합계 4244

drwxr-xr-x 2 pi pi    4096  7월 30 00:58 .

drwxr-xr-x 9 pi pi    4096  7월 30 00:58 ..

-rw-r--r-- 1 pi pi      37  7월 30 00:58 1

-rw-r--r-- 1 pi pi      91  7월 30 00:58 a.cpp

-rw-r--r-- 1 pi pi      37  7월 30 00:58 stdafx.h

-rw-r--r-- 1 pi pi 4324036  7월 30 00:59 stdafx.h.gch


pi@raspberrypi ~/src/pch $ file stdafx.h.gch

stdafx.h.gch: GCC precompiled header (version 013) for C++


pi@raspberrypi ~/src/pch $ mv stdafx.h stdafx.h.bak

pi@raspberrypi ~/src/pch $ g++ a.cpp 


확장자 gch로 확인하기 때문에 다른 확장자로 변경시 gch 헤더를 찾지 못한다.

pi@raspberrypi ~/src/pch $ mv stdafx.h.gch stdafx.h.gch.bak

pi@raspberrypi ~/src/pch $ ls -al

합계 4248

drwxr-xr-x 2 pi pi    4096  7월 30 01:01 .

drwxr-xr-x 9 pi pi    4096  7월 30 00:58 ..

-rw-r--r-- 1 pi pi      91  7월 30 00:58 a.cpp

-rwxr-xr-x 1 pi pi    6492  7월 30 01:00 a.out

-rw-r--r-- 1 pi pi      37  7월 30 00:58 stdafx.h.bak

-rw-r--r-- 1 pi pi 4324036  7월 30 00:59 stdafx.h.gch.bak

pi@raspberrypi ~/src/pch $ g++ a.cpp

a.cpp:1:20: fatal error: stdafx.h: 그런 파일이나 디렉터리가 없습니다

compilation terminated.


-c가 좀더 간편한듯.

-x c++-hedaer

-x c-header는 너무 길어 -_-

pi@raspberrypi ~/src/pch $ gcc -x c++-header stdafx.h -o stdafx.h.gch

pi@raspberrypi ~/src/pch $ ls -al

합계 4248

drwxr-xr-x 2 pi pi    4096  7월 30 01:01 .

drwxr-xr-x 9 pi pi    4096  7월 30 00:58 ..

-rw-r--r-- 1 pi pi      91  7월 30 00:58 a.cpp

-rwxr-xr-x 1 pi pi    6492  7월 30 01:00 a.out

-rw-r--r-- 1 pi pi      37  7월 30 00:58 stdafx.h

-rw-r--r-- 1 pi pi 4324036  7월 30 01:01 stdafx.h.gch  


-c는 찾는거 포기 -_-

-x language

Specify explicitly the language for the following input files (rather than letting the compiler choose a default based on the file name suffix). This option applies to all following input files until the next -x option. Possible values for language are:

c  c-header  c-cpp-output

c++  c++-header  c++-cpp-output

objective-c  objective-c-header  objective-c-cpp-output

objective-c++ objective-c++-header objective-c++-cpp-output

assembler  assembler-with-cpp

ada

f77  f77-cpp-input f95  f95-cpp-input

java


-o file

Place output in file file. This applies regardless to whatever sort of output is being produced, whether it be an executable file, an object file, an assembler file or preprocessed C code.

If -o is not specified, the default is to put an executable file in a.out, the object file for source.suffix in source.o, its assembler file in source.s, a precompiled header file in source.suffix.gch, and all preprocessed C source on standard output.

[링크 : http://linux.die.net/man/1/gcc] 


췟 이건 안되네 -_-

pi@raspberrypi ~/src/pch $ gcc stdafx.h -o stdafx.h.gch

stdafx.h:1:18: fatal error: string: 그런 파일이나 디렉터리가 없습니다

compilation terminated. 



결론 -c -o .gch로 하자


2015/07/29 - [프로그램 사용/gcc] - gcc에서 precompiled header 사용하기




'프로그램 사용 > gcc' 카테고리의 다른 글

gcc -M -MM  (0) 2015.12.17
gcc 초기화 관련  (0) 2015.10.21
gcc에서 precompiled header 사용하기  (0) 2015.07.29
gcc 64bit 변수 선언하기  (0) 2015.07.14
gcc 32bit/ 64bit 컴파일하기  (0) 2015.07.14
Posted by 구차니
프로그램 사용/gcc2015. 7. 29. 13:47

한번 시도는 해봐야겠다.


g++ -Wall -fexceptions -H  -g     -c main.cpp -o obj/Debug/main.o

! /usr/local/include/boost/xpressive/xpressive.hpp.gch

main.cpp

. /usr/include/c++/4.4/iostream

.. /usr/include/c++/4.4/x86_64-linux-gnu/bits/c++config.h

.. /usr/include/c++/4.4/ostream

.. /usr/include/c++/4.4/istream

main.cpp

The ! means that the compiler was able to use the precompiled header. An x means it was not able to use it. Using the appropriate compiler flags is crucial. I took off the -H and ran some speed tests. The precompiled header had an improvement from 14 seconds to 11 seconds. Not bad but not great.


Note: Here's the link to the example: http://www.boost.org/doc/libs/1_43_0/doc/html/xpressive/user_s_guide.html#boost_xpressive.user_s_guide.examples I couldn't get it to work in the post.

[링크 : http://stackoverflow.com/questions/58841/precompiled-headers-with-gcc]



Caution: There are a few known situations where GCC will crash when trying to use a precompiled header. If you have trouble with a precompiled header, you should remove the precompiled header and compile without it.


To create a precompiled header file, simply compile it as you would any other file, if necessary using the -x option to make the driver treat it as a C or C++ header file.


Each of the following options must be the same when building and using the precompiled header:

          -fexceptions -funit-at-a-time


[링크 : https://gcc.gnu.org/onlinedocs/gcc-4.0.0/gcc/Precompiled-Headers.html]



아래는 cpp 의 경우,

g++ -x c++-header stdafx.h -o stdafx.h.gch

아래는 c 의 경우,

gcc -x c-header stdafx.h -o stdafx.h.gch

[링크 : https://kldp.org/node/22714]



Precompiled headers are supported in GCC (3.4 and newer).

[링크 : http://softwareji.tistory.com/65]

Posted by 구차니

일단은 yocto 프로젝트의 코어인 poky를 받고(빌드 환경 구성 + 커널 등등?)

하드웨어 의존적인 metadata layer를 다운로드 받는다(meta-raspberrypi)


1.     Clone the Yocto Project Git repo

2.     Get the meta-raspberrypi layer

3.     Setup the build environment

4.     Configure the build

5.     Next up, we need to add the meta-rasperrypi layer we cloned earlier to the file conf/bblayers.conf.

6.     Build a minimal distribution

[링크 : http://ric96.blogspot.in/2014/09/yocto-for-raspberry-pi-build-guide.html]

[링크 : http://git.yoctoproject.org/cgit/cgit.cgi/meta-raspberrypi/about/]



Poky is a reference system of the Yocto Project - a collection of Yocto Project tools and metadata that serves as a set of working examples. To use the Yocto Project tools, you can download Poky and use it to bootstrap your own distribution.


Poky is the platform-independent, cross-compiling integration layer that utilizes OpenEmbedded Core. It provides the mechanism to build and combine thousands of distributed open source projects together to form a fully customizable, complete, coherent Linux software stack.

[링크 : https://www.yoctoproject.org/tools-resources/projects/poky]



[링크 : http://git.yoctoproject.org/]

[링크 : http://www.yoctoproject.org/docs/1.8/ref-manual/ref-manual.html]


'프로그램 사용 > yocto project' 카테고리의 다른 글

imx8 yocto  (0) 2023.08.28
imx8 yocto build on ubuntu 22.04  (0) 2023.02.10
라즈베리 파이 with yocto project  (2) 2015.07.30
라즈베리 파이 2 yocto 프로젝트?  (0) 2015.06.08
rpi in yocto project  (0) 2015.04.29
Posted by 구차니

lighttpd 설정관련해서 epoll이 먼지 조사...

읽어봐도 모르겠다.. -_-


현재 epoll은 realtime signal과 함께 가장 빠른 입출력 처리 방식 중 하나로 알려져 있습니다.

[링크 : http://www.joinc.co.kr/modules/moniwiki/wiki.php/Site/Network_Programing/AdvancedComm/epoll24]


리얼타임 시그날 (RealTime Sinal)의 대안으로 제안

[링크 : http://www.xevious7.com/52]


epoll은 '한 대의 서버에서 아주많은 동시접속자를 처리하기 위한 수단'이다.

M$ window$ 환경의 개발자라면 이미 iocp 라는 훌륭한 도구가 있고 ?FreeBSD라면 kqueue라는 도구가 있다.

[링크 : http://biscuit.cafe24.com/moniwiki/wiki.php/epoll]



Event Handlers

--------------


The first one is the Event Handler which takes care of notifying the server

that one of the connections is ready to send or receive. As you can see,

every OS has at least the select() call which has some limitations.


============ ========== ===============

OS           Method     Config Value

============ ========== ===============

all          select     select

Unix         poll       poll

Linux 2.4+   rt-signals linux-rtsig

Linux 2.6+   epoll      linux-sysepoll

Solaris      /dev/poll  solaris-devpoll

FreeBSD, ... kqueue     freebsd-kqueue

NetBSD       kqueue     kqueue

============ ========== ===============


For more information on this topic take a look at http://www.kegel.com/c10k.html


[링크 : http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_Performance/16]

[링크 : http://redmine.lighttpd.net/projects/1/wiki/Server_event-handlerDetails]


epoll

This is the recommended edge-triggered poll replacement for the 2.6 Linux kernel.

On 11 July 2001, Davide Libenzi proposed an alternative to realtime signals; his patch provides what he now calls /dev/epoll www.xmailserver.org/linux-patches/nio-improve.html. This is just like the realtime signal readiness notification, but it coalesces redundant events, and has a more efficient scheme for bulk event retrieval.


Epoll was merged into the 2.5 kernel tree as of 2.5.46 after its interface was changed from a special file in /dev to a system call, sys_epoll. A patch for the older version of epoll is available for the 2.4 kernel.


There was a lengthy debate about unifying epoll, aio, and other event sources on the linux-kernel mailing list around Halloween 2002. It may yet happen, but Davide is concentrating on firming up epoll in general first.

[링크 : http://www.kegel.com/c10k.html]

'프로그램 사용 > lighttpd' 카테고리의 다른 글

lighttpd cgi.assign  (0) 2017.07.28
lighttpd / mod-websocket  (0) 2014.12.30
Posted by 구차니
프로그램 사용/docker2015. 7. 27. 15:34

웹 개발시 많이 쓰는 녀석으로

개발환경을 동일하게 만들고 배포하는데 쓰인다고 한다.


[링크 : https://www.freebsd.org/doc/handbook/jails.html]

[링크 : https://en.wikipedia.org/wiki/FreeBSD_jail]


[링크 : https://www.docker.com/]

[링크 : http://pyrasis.com/Docker/Docker-HOWTO]

[링크 : http://pyrasis.com/docker.html]

'프로그램 사용 > docker' 카테고리의 다른 글

docker 개념 다시 조사..  (0) 2019.02.01
docker 설명..  (0) 2019.02.01
docker run = create + start  (0) 2019.02.01
docker howto  (4) 2018.11.23
docker static ip  (0) 2018.11.23
Posted by 구차니
프로그램 사용/gcc2015. 7. 14. 16:59


$ cat size.c
#include <stdio.h>
#include <stdint.h>

void main()
{
        int a;
        int64_t b;

        printf("%d\n", sizeof(a));
        printf("%d\n", sizeof(b));

} 


$ ./a.out

4
8


+

#include <stdint.h>를 넣지 않으면 에러가 발생한다.

$ gcc size.c

size.c: In function ‘main’:

size.c:6:2: error: unknown type name ‘int64_t’


2013/01/13 - [프로그램 사용/gcc] - gcc 64bit 확장


Posted by 구차니
프로그램 사용/gcc2015. 7. 14. 16:47

나중에 리눅스 서버 하나 다시 만들어서 해봐야지


These -m switches are supported in addition to the above on AMD x86-64 processors in 64-bit environments.


-m32

-m64

Generate code for a 32-bit or 64-bit environment. The 32-bit environment sets int, long and pointer to 32 bits and generates code that runs on any i386 system. The 64-bit environment sets int to 32 bits and long and pointer to 64 bits and generates code for AMD's x86-64 architecture. 


[링크 : https://gcc.gnu.org/onlinedocs/gcc-3.1/gcc/i386-and-x86-64-Options.html]


64bit 우분투에서 빌드 하려니 에러가 발생한다. multilib을 설치하라는데..

$ gcc -m32 void.c

In file included from /usr/include/stdio.h:28:0,

                 from void.c:1:

/usr/include/features.h:324:26: fatal error: bits/predefs.h: No such file or directory

compilation terminated.


$ sudo apt-get install gcc-multilib

[링크 : http://uce.uniovi.es/tips/Programming/Cpp/forc32bitscompilation.html] 

[링크 : http://stackoverflow.com/questions/22355436/how-to-compile-32-bit-apps-on-64-bit-ubuntu]


'프로그램 사용 > gcc' 카테고리의 다른 글

gcc에서 precompiled header 사용하기  (0) 2015.07.29
gcc 64bit 변수 선언하기  (0) 2015.07.14
gcc 특정 표준 따르도록 강제하기  (0) 2015.07.14
크기가 0인 배열 허용  (0) 2015.06.29
ubuntu gcc가 바보  (2) 2013.09.19
Posted by 구차니
프로그램 사용/gcc2015. 7. 14. 16:34


-ansi

In C mode, this is equivalent to -std=c90. In C++ mode, it is equivalent to -std=c++98.


-std=

A value for this option must be provided; possible values are

‘c90’

‘c89’

‘iso9899:1990’

Support all ISO C90 programs (certain GNU extensions that conflict with ISO C90 are disabled). Same as -ansi for C code. 

‘iso9899:199409’

ISO C90 as modified in amendment 1. 

‘c99’

‘c9x’


[링크 : https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html]

'프로그램 사용 > gcc' 카테고리의 다른 글

gcc 64bit 변수 선언하기  (0) 2015.07.14
gcc 32bit/ 64bit 컴파일하기  (0) 2015.07.14
크기가 0인 배열 허용  (0) 2015.06.29
ubuntu gcc가 바보  (2) 2013.09.19
gcc 64bit 확장  (0) 2013.01.13
Posted by 구차니
프로그램 사용/Putty2015. 7. 14. 14:21

putty를 통해서 CR+LF로 전송이 가능한가 했더니..

보이는 부분에 대해서만 가능한 듯...

기본적으로 putty는 \n 만 보내는 것으로 보인다.



LF는 line feed - \n 으로 대개 표기되며

CR은 carriage return - \r 로 대개 표기된다.


4.3.3 ‘Implicit CR in every LF’

Most servers send two control charactersCR and LF, to start a new line of the screen. The CR character makes the cursor return to the left-hand side of the screen. The LF character makes the cursor move one line down (and might make the screen scroll).

Some servers only send LF, and expect the terminal to move the cursor over to the left automatically. If you come across a server that does this, you will see a stepped effect on the screen, like this:

First line of text
                  Second line
                             Third line

If this happens to you, try enabling the ‘Implicit CR in every LF’ option, and things might go back to normal:

First line of text
Second line
Third line

4.3.4 ‘Implicit LF in every CR’

Most servers send two control characters, CR and LF, to start a new line of the screen. The CR character makes the cursor return to the left-hand side of the screen. The LF character makes the cursor move one line down (and might make the screen scroll).

Some servers only send CR, and so the newly written line is overwritten by the following line. This option causes a line feed so that all lines are displayed.


[링크 : http://tartarus.org/~simon/putty-snapshots/htmldoc/Chapter4.html]


'프로그램 사용 > Putty' 카테고리의 다른 글

ssh X11 forwarding 속도 향상.. 2?  (0) 2016.02.03
putty chrome socks5 / dns remote  (0) 2014.12.18
putty로 proxy 설정하기 (socks5 + firefox)  (0) 2014.12.17
linux용 putty  (2) 2011.09.21
putty를 이용한 vnc 터널링  (1) 2011.06.21
Posted by 구차니