2022-07-28

[개발노트] yocto에 my-app 넣기.

사전준비

my custom recipe를 만드는법은 많이 나와있으므로, 생성시킴.

bitbake-layers show-layers
bitbake-layers create-layer --priority 7 ../layers/meta-st/meta-ssonic
bitbake-layers add-layer ../layers/meta-st/meta-ssonic


# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"

# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
            ${LAYERDIR}/recipes-*/*/*.bbappend"

BBFILE_COLLECTIONS += "meta-ssonic"
BBFILE_PATTERN_meta-ssonic = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-ssonic = "7"

LAYERDEPENDS_meta-ssonic = "core"
LAYERSERIES_COMPAT_meta-ssonic = "dunfell"


recipes-*/*/*.bb 와 bbappend를 찾는구조임.

recipes-이름/이름/이름.bb 로 만들면됨.

ex) app이라면, 
recipes-app/app/app.bb 로 그냥 만들면됨

recipes-app/app/files 디렉토리를 만들고 그 안에 소스를 넣는다.

app.bb는 자동생성된것을 수정하여 사용한다.

내용은
SUMMARY = "bitbake-layers recipe"
DESCRIPTION = "Recipe created by bitbake-layers"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

python do_display_banner() {
    bb.plain("***********************************************");
    bb.plain("*                                             *");
    bb.plain("*  Example recipe created by bitbake-layers   *");
    bb.plain("*                                             *");
    bb.plain("***********************************************");
}

addtask display_banner before do_build

SRC_URI = "file://*"

S = "${WORKDIR}"
P = "r01"

inherit cmake

cmake로 된 프로젝트일때 SRC_URI = "file://*"

CMakeLists.txt
cmake_minimum_required(VERSION 3.0.0)

project(hong)

#set (CMAKE_NO_SYSTEM_FROM_IMPORTED ON)
INCLUDE_DIRECTORIES( .)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -lrt -lpthread -ldl -std=gnu99")

add_executable(main main.c)

install (TARGETS main DESTINATION bin)

install은 main이라는 프로그램이 /usr/bin에 들어간다.

끝.


댓글 없음:

댓글 쓰기

암호화 + base64 하고 쉘스크립트.

 #!/bin/bash # IV와 UserKey를 설정합니다 (아스키 문자열을 그대로 사용). IV="0123456789abcdef"  UserKey="0123456789abcdef" # IV와 UserKey를 16...