# Hello-Embedded-Linux **Repository Path**: iMing999/Hello-Embedded-Linux ## Basic Information - **Project Name**: Hello-Embedded-Linux - **Description**: 嵌入式Linux系统基本操作介绍。Introduction to basic operation of Embedded-Linux system. - **Primary Language**: HTML - **License**: GPL-2.0 - **Default Branch**: main - **Homepage**: https://heygoda.github.io/Hello-Embedded-Linux/ - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2022-02-15 - **Last Updated**: 2022-02-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README - [概述](#概述) - [准备工作](#准备工作) - [使用 Buildroot 构建系统](#使用-buildroot-构建系统) - [使用 OpenWrt 构建系统](#使用-openwrt-构建系统) - [使用 Yocto 构建系统](#使用-yocto-构建系统) - [内容简介](#内容简介) - [认识和操作嵌入式 Linux 系统](#认识和操作嵌入式-linux-系统) - [系统初始化](#系统初始化) - [命令行 - vi 和 shell](#命令行---vi-和-shell) - [系统资源及其配置](#系统资源及其配置) - [交叉编译](#交叉编译) - [硬件设备操作](#硬件设备操作) - [网络操作](#网络操作) ## 概述 嵌入式 Linux 设备多种多样,因 Linux 系统内核、驱动、应用等的自由裁剪和组合,导致不同设备上的软件系统,开发和测试人员在面对一个新设备时难免会感到困惑,在此总结一些通用知识,介绍几个主流嵌入式 Linux 系统之间的异同点,及其跟桌面 Linux 发行版之间的差别,方便熟悉和掌握各种不同的嵌入式 Linux 系统操作方法。 ### 准备工作 本文档大部分情况下采用 [QEMU](https://www.qemu.org/) 来模拟嵌入式设备,如果你已经有嵌入式开发板或设备,则可以结合本文档来实操,而不一定需要安装 QEMU; QEMU 是一个开源的硬件模拟器和虚拟器,当用作硬件模拟器时,QEMU 可以在一台机器(例如 PC)上运行为另一台机器(例如 ARM 开发板)制作的操作系统和程序;本文档使用 [Buildroot](https://buildroot.org/)、[OpenWrt](https://openwrt.org/)、[Yocto](https://www.yoctoproject.org/) 等构建系统来制作嵌入式 Linux 操作系统及程序,以下在桌面版 Ubuntu 20.4 系统中分别说明其制作方法; > 请先确保系统安装了 QEMU,执行以下命令: > > ```shell > sudo apt install qemu > ``` #### 使用 Buildroot 构建系统 Buildroot 是一个简单、高效、易用的构建工具,通过交叉编译生成嵌入式 Linux 系统,支持多种嵌入式 Linux 开发板,同时也支持一些 QEMU 板级;以下使用 Buildroot 板级 `qemu_arm_vexpress_defconfig` 来构建固件,对应 qemu 机器 `vexpress-a9`; 安装必要的软件(参考链接: [The Buildroot user manual](https://buildroot.org/downloads/manual/manual.html#requirement)): ```shell sudo apt install which sed make binutils build-essential gcc g++ bash patch gzip bzip2 perl tar cpio unzip rsync file bc wget git ``` 下载 Buildroot 源码并更新到需要的版本: ```shell # 使用git下载源码库 # git clone https://git.busybox.net/buildroot # 镜像下载 git clone https://gitee.com/mirrors/buildroot.git cd buildroot git reset --hard 2021.02.2 ``` 执行默认配置的编译对应板级的固件: ```shell # cd buildroot make qemu_arm_vexpress_defconfig make ``` 编译成功后固件在 `output/images/` 目录下,如图:







