Khi thực hành theo các bài trong series, có những câu lệnh mình thường dùng, có 1 số lý thuyết có thể dễ quên, và 1 số tài liệu phụ. Ở bài này mình sẽ tổng hợp lại để cho các bạn dễ theo dõi, làm theo hơn .
1. Lý thuyết
Yocto Project là gì ?
Dự án mã nguồn mở giúp build hệ điều hành Linux tùy chỉnh cho thiết bị nhúng.
Poky là gì ?
Reference distribution của Yocto Project.
Nó không phải là một Linux distro cho người dùng cuối
Mà là bộ “demo + template”: gồm BitBake, metadata cơ bản (recipes, classes, conf)
và các layer chuẩn (meta, meta-poky, meta-yocto-bsp).
Open Embedded là gì ?
Framework nền tảng của Yocto, cung cấp metadata, recipes và công cụ để build Linux
Bitbake là gì ?
Công cụ build chính của Yocto (giống make), đọc recipe và thực thi các bước build.
Recipes là gì ?
File mô tả cách fetch, compile, cài đặt gói phần mềm (giống công thức build).
Layer là gì ?
Tập hợp recipes, config, class… để tổ chức và mở rộng build (vd: meta-oe, meta-bbb).
File .bb, .bbappend, .bbclass
.bb: recipe chính.
.bbappend: file bổ sung/ghi đè recipe gốc mà không cần sửa trực tiếp.
.bbclass: File tái sử dụng logic chung cho nhiều recipes
2. Tài liệu
- Reference Manual Beaglebone Black : https://www.ti.com/lit/ug/spruh73q/spruh73q.pdf?ts=1757666524292&ref_url=https%253A%252F%252Fwww.google.com%252F
- Yocto Project Reference Manual: https://docs.yoctoproject.org/ref-manual/index.html
3. Câu lệnh thường dùng
3.1 Yocto command
source poky/oe-init-build-end <build-dir>
#Khởi tạo môi trường build, add bitbake vào PATH
bitbake <recipes>
# build <recipes>
bitbake -c <task> <recipes>
# build <recipes> từ đầu cho đến hết <task>
bitbake -e <recipes> | grep ^<Variable>
# lấy được các biến môi trường (env) của recipes
# grep dòng bắt đầu bởi <Variable>
bitbake-layers show-recipes
# Hiển thị địa chỉ toàn bộ recipes (file .bb) đang để tại meta-layer nào
# Nếu chỉ đích danh <recipes> thì chỉ hiện meta-layer chứa nó
bitbake-layers show-recipes <recipes>
bitbake-layers show-appends <recipes>
# Tương tự với câu lệnh trên nhưng sẽ hiển thị địa chỉ file append (bbapend)
bitbake-layers show-layers
# Hiển thị toàn bộ layers trong <build-dir>/conf/bbalyers.conf với Priority
bitbake-layers create-layer
# Tạo layer mới
bitbake-layers add-layer
# add layer tới bblayers.conf
oe-pkgdata-util lookup-recipe kernel
# Tim recipes kernel để các bạn có thể tạo file append
bitbake -c menuconfig virtual/kernel
# Bật menuconfig sửa kernel build config
3.2 Linux command
lsblk
# list block, dùng để check địa chỉ thẻ nhớ
# ví dụ như /dev/sda, /dev/sdb, /dev/mmcblk0
bmaptool copy <yocto-build-image>.wic.xz <uSD disk>
# Flash thẻ nhớ với image, ví dụ như
bmaptool copy core-image-minimal-beaglebone.wic.xz /dev/mmcblk0
find . -name <file-name>
# dùng để tìm kiếm đệ quy bắt đầu từ folder hiện tại tìm file-name
df -h
# disk filesystem
# -h : Human readable, đổi sang hệ Gb, Mb, Kb cho ngừời dễ đọc
free -h
# check dung lượng memory (RAM)
Bình luận về bài viết này