|
|
@ -3,14 +3,14 @@ |
|
|
|
|
|
|
|
\section{准备安装环境} |
|
|
|
\begin{enumerate}[(1)] |
|
|
|
\item 下载 rpi 的 openEuler 系统镜像文件 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
\item 下载 rpi 的 openEuler 系统镜像文件 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
curl -O http://repo.openeuler.org/openEuler-24.03-LTS/raspi_img/\ |
|
|
|
openEuler-24.03-LTS-raspi-aarch64.img.xz |
|
|
|
xz -d openEuler-24.03-LTS-raspi-aarch64.img.xz |
|
|
|
\end{minted} |
|
|
|
\item 准备 aarch64 的系统: |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
\item 准备 aarch64 的系统: |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
sudo losetup -P /dev/loop0 openEuler-24.03-LTS-raspi-aarch64.img |
|
|
|
sudo mount /dev/loop0p3 /media |
|
|
|
mkdir rpi |
|
|
@ -19,27 +19,27 @@ sudo umount /media |
|
|
|
sudo losetup -d /dev/loop0 |
|
|
|
sudo cp /usr/bin/qemu-aarch64-static rpi/usr/bin |
|
|
|
\end{minted} |
|
|
|
\item 切换到安装环境 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
\item 切换到安装环境 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
sudo mount --bind /dev rpi/dev |
|
|
|
sudo mount --bind /dev/pts rpi/dev/pts |
|
|
|
sudo mount -t proc proc rpi/proc |
|
|
|
sudo mount -t sysfs sys rpi/sys |
|
|
|
sudo chroot rpi /usr/bin/qemu-aarch64-static /bin/bash -i |
|
|
|
\end{minted} |
|
|
|
\item 编辑 /etc/resolv.conf |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
\item 编辑 /etc/resolv.conf |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
nameserver 8.8.8.8 |
|
|
|
nameserver 114.114.114.114 |
|
|
|
\end{minted} |
|
|
|
\item 安装依赖包 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
\item 安装依赖包 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
dnf makecache |
|
|
|
dnf install git wget make gcc bison dtc m4 flex bc openssl-devel \ |
|
|
|
tar dosfstools rsync parted dnf-plugins-core tar |
|
|
|
\end{minted} |
|
|
|
\item 创建工作目录 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
\item 创建工作目录 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
export WORKDIR=/root/build |
|
|
|
mkdir -p $WORKDIR |
|
|
|
cd $WORKDIR |
|
|
@ -260,27 +260,27 @@ ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime |
|
|
|
|
|
|
|
\subsection{安装 xfce4 桌面系统 (可选)} |
|
|
|
\begin{enumerate}[(1)] |
|
|
|
\item 安装软件 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
\item 安装软件 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
dnf install -y dejavu-fonts liberation-fonts gnu-*-fonts wqy-zenhei-fonts |
|
|
|
dnf install -y xorg-* |
|
|
|
dnf install -y xfwm4 xfdesktop xfce4-* xfce4-*-plugin |
|
|
|
dnf install -y lightdm lightdm-gtk |
|
|
|
\end{minted} |
|
|
|
\item 设置默认桌面为XFCE 启动 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
\item 设置默认桌面为XFCE 启动 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
echo 'user-session=xfce' >> /etc/lightdm/lightdm.conf.d/\ |
|
|
|
60-lightdm-gtk-greeter.conf |
|
|
|
echo 'autologin-user=euler' >> /etc/lightdm/lightdm.conf.d/\ |
|
|
|
60-lightdm-gtk-greeter.conf |
|
|
|
\end{minted} |
|
|
|
\item 设置开机自启动图形界面 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
\item 设置开机自启动图形界面 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
systemctl enable lightdm |
|
|
|
systemctl set-default graphical.target |
|
|
|
\end{minted} |
|
|
|
\item 添加 /etc/X11/xorg.conf.d/20-modesetting.conf 文件,内容如下: |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
\item 添加 /etc/X11/xorg.conf.d/20-modesetting.conf 文件,内容如下: |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
Section "Device" |
|
|
|
Identifier "Rockchip Graphics" |
|
|
|
Driver "modesetting" |
|
|
@ -326,25 +326,25 @@ EndSection |
|
|
|
ukui 是麒麟软件团队历经多年打造的一款Linux 桌面,主要基于 GTK 和 QT开发。与其他UI界面相比,ukui更加注重易用性和敏捷度,各元件相依性小,可以不依赖其他套件而独自运行,给用户带来亲切和高效的使用体验。 |
|
|
|
|
|
|
|
\begin{enumerate}[(1)] |
|
|
|
\item 安装 ukui |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
\item 安装 ukui |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
dnf install -y dejavu-fonts liberation-fonts gnu-*-fonts wqy-zenhei-fonts |
|
|
|
dnf install ukui |
|
|
|
\end{minted} |
|
|
|
\item 配置允许root登陆 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
\item 配置允许root登陆 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
echo "greeter-show-manual-login=true" >> /usr/share/lightdm/lightdm.conf.d/\ |
|
|
|
95-ukui-greeter.conf |
|
|
|
echo "all-guest=false" >> /usr/share/lightdm/lightdm.conf.d/\ |
|
|
|
95-ukui-greeter.conf |
|
|
|
\end{minted} |
|
|
|
\item 配置 euler 用户自动登陆 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
\item 配置 euler 用户自动登陆 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
echo "autologin-user=euler" >> /usr/share/lightdm/lightdm.conf.d/\ |
|
|
|
95-ukui-greeter.conf |
|
|
|
\end{minted} |
|
|
|
\item 添加 /etc/X11/xorg.conf.d/20-modesetting.conf 文件,内容如下: |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
\item 添加 /etc/X11/xorg.conf.d/20-modesetting.conf 文件,内容如下: |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
Section "Device" |
|
|
|
Identifier "Rockchip Graphics" |
|
|
|
Driver "modesetting" |
|
|
@ -383,12 +383,12 @@ Section "Monitor" |
|
|
|
Option "Rotate" "normal" |
|
|
|
EndSection |
|
|
|
\end{minted} |
|
|
|
\item 切换用户界面(GUI)模式 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
\item 切换用户界面(GUI)模式 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
systemctl set-default graphical.target |
|
|
|
\end{minted} |
|
|
|
还原到文本模式,用下面命令: |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
还原到文本模式,用下面命令: |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
systemctl set-default multi-user.target |
|
|
|
\end{minted} |
|
|
|
\end{enumerate} |
|
|
@ -411,18 +411,18 @@ umount -l $WORKDIR/rootfs/sys |
|
|
|
|
|
|
|
\section{制作镜像} |
|
|
|
\begin{enumerate}[(1)] |
|
|
|
\item 计算镜像容量 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
\item 计算镜像容量 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
IMAGE_SIZE_MB=$(( $(sudo du -sh -m $WORKDIR/rootfs | cut -f1) + 300 )) |
|
|
|
\end{minted} |
|
|
|
|
|
|
|
\item 创建镜像文件 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
\item 创建镜像文件 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
dd if=/dev/zero of=rootfs.img bs=1M count=0 seek=${IMAGE_SIZE_MB} |
|
|
|
\end{minted} |
|
|
|
|
|
|
|
\item 格式化镜像 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
\item 格式化镜像 |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
mkfs.ext4 -d $WORKDIR/rootfs rootfs.img |
|
|
|
\end{minted} |
|
|
|
\end{enumerate} |
|
|
@ -440,7 +440,7 @@ sudo umount -l rpi/sys |
|
|
|
\chapter{构建 openEuler Embedded} |
|
|
|
参考这里 \url{https://embedded.pages.openeuler.org/master/introduction/index.html},把主要步骤记录一下。 |
|
|
|
\section{系统安装 docker } |
|
|
|
用 root 权限执行下面的命令: |
|
|
|
\noindent 用 root 权限执行下面的命令: |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
groupadd docker |
|
|
|
usermod -a -G docker user |
|
|
@ -449,19 +449,66 @@ systemctl restart docker |
|
|
|
chmod o+rw /var/run/docker.sock |
|
|
|
\end{minted} |
|
|
|
|
|
|
|
\section{安装 oebuild} |
|
|
|
\section{准备 oebuild 安装环境} |
|
|
|
\subsection{安装 oebuild} |
|
|
|
\noindent 执行以下命令: |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
pip3 install oebuild |
|
|
|
\end{minted} |
|
|
|
|
|
|
|
\section{制作 Rk3588 镜像和 SDK} |
|
|
|
\subsection{创建安装目录} |
|
|
|
\noindent 执行以下命令: |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
oebuild init yocto-oebuild -b openEuler-24.03-LTS |
|
|
|
cd yocto-oebuild |
|
|
|
oebuild update |
|
|
|
oebuild update docker |
|
|
|
oebuild generate -p ok3588 -f systemd -f openeuler-qt |
|
|
|
cd build/ok3588 |
|
|
|
oebuild generate -p ok3588 -d rk3588 -f systemd |
|
|
|
\end{minted} |
|
|
|
|
|
|
|
\section{制作 Rk3588 镜像和 SDK} |
|
|
|
|
|
|
|
\subsection{添加客户要求软件} |
|
|
|
编辑 ``build/rk3588/compile.yaml'' , 在 ``local.conf:'' 下面添加必要软件,如下示例: |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
local_conf: | |
|
|
|
INIT_MANAGER = "systemd" |
|
|
|
VIRTUAL-RUNTIME_dev_manager = "systemd" |
|
|
|
IMAGE_INSTALL:append = "tcpdump ethtool iperf2 bridge-utils minicom" |
|
|
|
|
|
|
|
PREFERRED_PROVIDER_virtual/kernel ?= "linux-openeuler" |
|
|
|
\end{minted} |
|
|
|
|
|
|
|
其中 ``IMAGE\_INSTALL:append'' 是新增的内容。 |
|
|
|
|
|
|
|
\subsection{编译镜像文件} |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
cd build/rk3588 |
|
|
|
oebuild bitbake openeuler-image |
|
|
|
oebuild bitbake openeuler-image -c do_populate_sdk |
|
|
|
\end{minted} |
|
|
|
|
|
|
|
\subsection{问题处理} |
|
|
|
|
|
|
|
\begin{enumerate}[(1)] |
|
|
|
\item {ERROR - ERROR: tcpdump-4.99.3-r0 do\_fetch: Bitbake Fetcher Error: FetchError(`Unable to fetch URL from any source.', `file://tcpdump-4.99.3.tar.gz')} |
|
|
|
|
|
|
|
先用下面命令下载文件: |
|
|
|
\begin{minted}[bgcolor=lightgray!30,fontsize=\scriptsize]{bash} |
|
|
|
cd yocto-oebuild/src/yocto-meta-openembedded/meta-networking/\ |
|
|
|
recipes-support/tcpdump/tcpdump |
|
|
|
wget -c http://www.tcpdump.org/release/tcpdump-4.99.3.tar.gz |
|
|
|
wget -c https://gitee.com/src-openeuler/tcpdump/raw/master/\ |
|
|
|
backport-0002-Use-getnameinfo-instead-of-gethostbyaddr.patch |
|
|
|
wget -c https://gitee.com/src-openeuler/tcpdump/raw/master/\ |
|
|
|
backport-0007-Introduce-nn-option.patch |
|
|
|
wget -c https://gitee.com/src-openeuler/tcpdump/raw/master/\ |
|
|
|
backport-0009-Change-n-flag-to-nn-in-TESTonce.patch |
|
|
|
\end{minted} |
|
|
|
|
|
|
|
然后修改 ``\texttt{yocto-oebuild/src/yocto-meta-openeuler/meta-\\% |
|
|
|
openeuler/dynamic-layers/networking-layer/recipes-support\\% |
|
|
|
/tcpdump/tcpdump\_\%.bbappend}'' 文件中的 ``SRC\_URI[md5sum]'' 和 |
|
|
|
``SRC\_URI[md5sum]''。 |
|
|
|
|
|
|
|
\end{enumerate} |
|
|
|