Embedded Linux & Yocto Roadmap
Lộ trình ngắn gọn để làm quen với Embedded Linux và Yocto Project, từ kiến thức Linux cơ bản đến build và debug image cho board thực tế.
1. Linux Fundamentals
- Thành thạo shell, quyền file (
chmod,chown), process,systemd, network và SSH. - Hiểu cấu trúc thư mục Linux (FHS):
/etc,/var,/proc,/sys,/dev. - Xem thêm: Linux CLI Cheatsheet và The Unix Shell.
2. Cross-Compilation & Bootloader
- Hiểu khái niệm host vs. target, cross-toolchain (
gcc,sysroot,pkg-config). - Nắm quy trình boot trên hệ thống nhúng: ROM Bootloader → SPL → U-Boot → Linux Kernel → Rootfs.
- Làm quen U-Boot CLI qua serial console (
printenv,setenv,saveenv, boot qua TFTP/NFS).
3. Linux Kernel & Rootfs
- Hiểu Device Tree (
.dts/.dtsi/.dtb) để mô tả phần cứng (GPIO, I2C, SPI, UART). - Cấu hình và build kernel (
menuconfig,defconfig, kernel modules.ko). - Hiểu vai trò của
init(systemdhoặcSysVinit), BusyBox và cấu trúc root filesystem.
4. Yocto Project & OpenEmbedded
- Nắm các khái niệm cốt lõi: BitBake, Metadata, Layers (
meta-*), Recipes (.bb,.bbappend), Machine, Distro và Image. - Tạo custom layer riêng (
bitbake-layers create-layer), thêm package vào image và viết recipe đơn giản cho app C/C++ hoặc Python. - Dùng
devtoolđể chỉnh sửa mã nguồn kernel/app và tạo patch nhanh mà không sửa tay từng file. - Xem thêm: Yocto & BitBake Cheatsheet.
5. Debug, SDK & Production
- Xuất SDK (
bitbake -c populate_sdk <image>) để team application cross-compile độc lập. - Debug trên board qua serial (
WinSerial), SSH (WinSSH),dmesg,journalctlvàgdbserver. - Tìm hiểu cơ chế cập nhật OTA (Mender, RAUC hoặc SWUpdate) và cấu hình read-only rootfs.
Tham khảo để học sâu hơn
- Yocto Project Official Documentation — Tài liệu chính thức, đầy đủ nhất (bắt đầu từ Quick Build và Overview and Concepts).
- Bootlin Training Materials — Slide và lab miễn phí cực kỳ chất lượng về Embedded Linux, Linux Kernel và Yocto.
- Mastering Embedded Linux Programming — Tài liệu tham khảo thực tế về toolchain, U-Boot, kernel và Yocto.
- The Linux Kernel Documentation — Tài liệu gốc về kernel subsystem và Device Tree.