| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 |
- bare metal
- Debug
- STM32
- raspberrypi
- Debugging
- Visual Studio
- AArch64
- Arduino
- atmel
- UART
- esp32
- nucleo
- 라즈베리파이
- Visual Studio Code
- yocto
- Linux
- MVVM
- 디버깅
- C++
- vscode
- buildroot
- QEMU
- WPF
- 아두이노
- AVR
- GPIO
- 회로
- c#
- Raspberry
- avr-gcc
- Today
- Total
임베디드를 좋아하는 조금 특이한 개발자?
[Yocto Project] Github 배포하기 위한 프로젝트 구성 본문
- 개발 환경
개발 보드 : Raspberrypi 4
WSL2 (Ubuntu 22.04 LTS)
Yocto Project : Scarthgap
- 소스 코드
https://github.com/MainForm/yocto_rpi4_template
GitHub - MainForm/yocto_rpi4_template
Contribute to MainForm/yocto_rpi4_template development by creating an account on GitHub.
github.com
1. 서론
Yocto Project로 구성한 프로젝트를 git으로 형상관리를 하거나 github를 통해 배포를 하고 싶을 때가 있습니다. 하지만 Yocto project로 리눅스를 빌드하게 되면 많은 소스코드와 용량이 많은 산출물이 발생하게 됩니다. 그렇기 때문에 Yocto Project를 배포하기 위해서는 프로젝트를 어떻게 구성하는지가 매우 중요합니다. 이번 포스트에서는 Yocto Project로 개발한 프로젝트를 git으로 관리하기 위한 간단한 방법을 알아보겠습니다.
2. Git 초기화
먼저 git을 초기화한 git ignore 폴더를 생성해 필요없는 파일들을 무시하도록 합니다.
# git 초기화
git init
- git ignore 파일
### Visual studio code ###
.vscode
.codex
.agents
### Yocto ###
build*/*
!build*/conf/
!build*/conf/**
3. 프로젝트 구성
그 다음으로 기본적인 Layer를 submodule로 추가하고 build 폴더를 구성합니다.
- Layer 및 build 폴더 구성
// layer를 관리하기 위한 sources 폴더 생성
mkdir sources && cd -P ./sources
// 필요한 레이어를 submodule로 추가
git clone git://git.yoctoproject.org/poky --branch scarthgap
git clone git://git.openembedded.org/meta-openembedded --branch scarthgap
git clone git://git.yoctoproject.org/meta-raspberrypi --branch scarthgap
cd ..
// build 폴더 구성
source ./sources/poky/oe-init-build-env ./build-rpi4
그 다음 "bblayers.conf" 파일을 수정해야합니다. "bblayers.conf"은 Layer의 위치를 나타내는 파일입니다. 하지만, 기본적으로 Layer는 절대 경로로 나타내기 때문에 github로 배포시 다른 사람의 환경에서는 Layer를 찾지 못하는 에러가 발생합니다. 그러므로 Layer의 위치를 상태 경로로 변경해주어야 합니다.

- bblayers.conf 파일 내용
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
${TOPDIR}/../sources/poky/meta \
${TOPDIR}/../sources/poky/meta-poky \
${TOPDIR}/../sources/poky/meta-yocto-bsp \
${TOPDIR}/../sources/meta-openembedded/meta-oe \
${TOPDIR}/../sources/meta-openembedded/meta-python \
${TOPDIR}/../sources/meta-raspberrypi \
"

그 다음 기본적인 local.conf 파일을 수정하여 machine을 변경합니다.
- local.conf 파일 내용
MACHINE ??= "raspberrypi4-64"
LICENSE_FLAGS_ACCEPTED = "synaptics-killswitch"
4. 리눅스 빌드
bitbake core-image-base'Embedded > Yocto Project' 카테고리의 다른 글
| [Yocto Project] KAS를 통한 개발 환경 자동 구성 (0) | 2026.06.17 |
|---|---|
| [Yocto Project] QT5 예제 실행하기 (0) | 2025.04.10 |
| [Yocto Project] Linux kernel module 개발 (0) | 2025.04.08 |
| [Yocto Project] networkmanager를 통해 wifi 연결 (0) | 2025.04.01 |
| [Yocto Project] 라즈베리파이 WIFI 연결 (0) | 2025.03.31 |