diff --git a/README.en.md b/README.en.md index d90b279578f321f8491e14a84537667c08352042..9aa869913ad5d83051002a2b7407d7bc7eb078dd 100644 --- a/README.en.md +++ b/README.en.md @@ -68,27 +68,27 @@ Refer to [Script for building openEuler image for Raspberry Pi](documents/openEu Build script: [build-img.sh](scripts/build-img.sh), which can be set 0/5/7 parameters. -1. Build with default parameters +1. Build with default parameters -`sudo bash build-img.sh` + `sudo bash build-img.sh` -2. Build with custom parameters +2. Build with custom parameters -`sudo bash build-img.sh KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE --cores MAKE_CORES` + `sudo bash build-img.sh KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE --cores MAKE_CORES` -or + or -`sudo bash build-img.sh KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE` + `sudo bash build-img.sh KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE` -The meaning of each parameter: + The meaning of each parameter: -- KERNEL_URL: The URL of kernel source's repository, which defaults to `https://gitee.com/openeuler/raspberrypi-kernel.git`. -- KERNEL_BRANCH: The branch name of kernel source's repository, which defaults to `master`. -- KERNEL_DEFCONFIG: The filename of configuration for compiling kernel, which defaults to `openeuler-raspi_defconfig`. The configuration file should be in the config directory or in arch/arm64/configs of the kernel source. If this configuration file does not exist, the script uses the next parameter: DEFAULT_DEFCONFIG. -- DEFAULT_DEFCONFIG: The filename of configuration for kernel, which defaults to `openeuler-raspi_defconfig`. The configuration file should be in arch/arm64/configs of the kernel source. If both KERNEL_DEFCONFIG and this file do not exist, the process of building image will exit. -- REPO_FILE: The URL or name of openEuler's file, which defaults to `openEuler-20.03-LTS.repo`. Caution, if REPO_FILE is a file name, please make sure this file in the config directory. Otherwise, if REPO_FILE is a URL, please make sure you can get a correct repo file from this URL. -- --cores: Followed by parameter MAKE_CORES -- MAKE_CORES: The number of parallel compilations, according to the actual number of CPU of the server running the script. The default is 18. + - KERNEL_URL: The URL of kernel source's repository, which defaults to `https://gitee.com/openeuler/raspberrypi-kernel.git`. + - KERNEL_BRANCH: The branch name of kernel source's repository, which defaults to `master`. + - KERNEL_DEFCONFIG: The filename of configuration for compiling kernel, which defaults to `openeuler-raspi_defconfig`. The configuration file should be in the config directory or in arch/arm64/configs of the kernel source. If this configuration file does not exist, the script uses the next parameter: DEFAULT_DEFCONFIG. + - DEFAULT_DEFCONFIG: The filename of configuration for kernel, which defaults to `openeuler-raspi_defconfig`. The configuration file should be in arch/arm64/configs of the kernel source. If both KERNEL_DEFCONFIG and this file do not exist, the process of building image will exit. + - REPO_FILE: The URL or name of openEuler's file, which defaults to `openEuler-20.03-LTS.repo`. Caution, if REPO_FILE is a file name, please make sure this file in the config directory. Otherwise, if REPO_FILE is a URL, please make sure you can get a correct repo file from this URL. + - --cores: Followed by parameter MAKE_CORES + - MAKE_CORES: The number of parallel compilations, according to the actual number of CPU of the server running the script. The default is 18. #### Build in a Docker container @@ -96,18 +96,18 @@ Build script: [build-img-docker.sh](scripts/build-img-docker.sh), which can be s Caution, before running the script, you need to install Docker. -1. Build with default parameters +1. Build with default parameters -`sudo bash build-img-docker.sh` + `sudo bash build-img-docker.sh` -2. Build with custom parameters +2. Build with custom parameters -`sudo bash build-img-docker.sh DOCKER_FILE KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE --cores MAKE_CORES` + `sudo bash build-img-docker.sh DOCKER_FILE KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE --cores MAKE_CORES` -or + or -`sudo bash build-img-docker.sh DOCKER_FILE KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE` + `sudo bash build-img-docker.sh DOCKER_FILE KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE` -In addition to the first parameter DOCKER_FILE, the other parameters are the same as the corresponding parameters in "Build on host": + In addition to the first parameter DOCKER_FILE, the other parameters are the same as the corresponding parameters in "Build on host": -- DOCKER_FILE: The URL or name of the Docker image, which defaults to `https://repo.openeuler.org/openEuler-20.03-LTS/docker_img/aarch64/openEuler-docker.aarch64.tar.xz`. With the default parameter, the script will automatically download the Docker image of openEuler 20.03 LTS and import it into the local system. Caution, if DOCKER_FILE is a file name, please make sure this file in the config directory. Otherwise, if DOCKER_FILE is a URL, please make sure you can get a correct Docker image from this URL. + - DOCKER_FILE: The URL or name of the Docker image, which defaults to `https://repo.openeuler.org/openEuler-20.03-LTS/docker_img/aarch64/openEuler-docker.aarch64.tar.xz`. With the default parameter, the script will automatically download the Docker image of openEuler 20.03 LTS and import it into the local system. Caution, if DOCKER_FILE is a file name, please make sure this file in the config directory. Otherwise, if DOCKER_FILE is a URL, please make sure you can get a correct Docker image from this URL. diff --git a/README.md b/README.md index b6ba963f2d6a7eecd2946ead49e2647bbdafd454..fb063d955f2e66f4b762cee9228649e59ada41e2 100644 --- a/README.md +++ b/README.md @@ -70,27 +70,27 @@ openEuler 20.03 LTS 的内测版本镜像,[下载](https://isrc.iscas.ac.cn/eu 构建脚本 [build-img.sh](scripts/build-img.sh),其后可设置 0/5/7 个参数。 -1. 使用脚本默认参数构建 +1. 使用脚本默认参数构建 -`sudo bash build-img.sh` + `sudo bash build-img.sh` -2. 自行设置参数构建 +2. 自行设置参数构建 -`sudo bash build-img.sh KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE --cores MAKE_CORES` + `sudo bash build-img.sh KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE --cores MAKE_CORES` -或 + 或 -`sudo bash build-img.sh KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE` + `sudo bash build-img.sh KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE` -其中,各个参数意义: + 其中,各个参数意义: -- KERNEL_URL:内核源码的项目地址,默认为 `https://gitee.com/openeuler/raspberrypi-kernel.git`。 -- KERNEL_BRANCH:内核源码的对应分支,默认为 `master`。 -- KERNEL_DEFCONFIG:内核编译使用的配置文件名称,默认为 `openeuler-raspi_defconfig`,在本目录的 config 目录下或内核源码的目录 arch/arm64/configs 下。如果该文件不存在则使用配置文件 DEFAULT_DEFCONFIG。 -- DEFAULT_DEFCONFIG:内核默认配置文件名称,默认为 `openeuler-raspi_defconfig`,在内核源码的目录 arch/arm64/configs 下。如果 KERNEL_DEFCONFIG 和该文件均不存在则退出镜像构建过程。 -- REPO_FILE:openEuler 开发源的 repo 文件的 URL 或者文件名称, 默认为 `openEuler-20.03-LTS.repo`。注意,如果 REPO_FILE 为文件名称,需要保证该文件在本目录的 config 文件夹下。否则,如果 REPO_FILE 为 URL,请保证可以通过该链接获取到该 repo 文件。 -- --cores:其后跟参数 MAKE_CORES。 -- MAKE_CORES:并行编译的数量,根据运行脚本的服务器CPU实际数目设定,默认为 18。 + - KERNEL_URL:内核源码的项目地址,默认为 `https://gitee.com/openeuler/raspberrypi-kernel.git`。 + - KERNEL_BRANCH:内核源码的对应分支,默认为 `master`。 + - KERNEL_DEFCONFIG:内核编译使用的配置文件名称,默认为 `openeuler-raspi_defconfig`,在本目录的 config 目录下或内核源码的目录 arch/arm64/configs 下。如果该文件不存在则使用配置文件 DEFAULT_DEFCONFIG。 + - DEFAULT_DEFCONFIG:内核默认配置文件名称,默认为 `openeuler-raspi_defconfig`,在内核源码的目录 arch/arm64/configs 下。如果 KERNEL_DEFCONFIG 和该文件均不存在则退出镜像构建过程。 + - REPO_FILE:openEuler 开发源的 repo 文件的 URL 或者文件名称, 默认为 `openEuler-20.03-LTS.repo`。注意,如果 REPO_FILE 为文件名称,需要保证该文件在本目录的 config 文件夹下。否则,如果 REPO_FILE 为 URL,请保证可以通过该链接获取到该 repo 文件。 + - --cores:其后跟参数 MAKE_CORES。 + - MAKE_CORES:并行编译的数量,根据运行脚本的服务器CPU实际数目设定,默认为 18。 #### Docker 容器内构建 @@ -98,18 +98,18 @@ openEuler 20.03 LTS 的内测版本镜像,[下载](https://isrc.iscas.ac.cn/eu 注意!!!运行该脚本前,需安装 Docker 运行环境。 -1. 使用脚本默认参数构建 +1. 使用脚本默认参数构建 -`sudo bash build-img-docker.sh` + `sudo bash build-img-docker.sh` -2. 自行设置参数构建 +2. 自行设置参数构建 -`sudo bash build-img-docker.sh DOCKER_FILE KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE --cores MAKE_CORES` + `sudo bash build-img-docker.sh DOCKER_FILE KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE --cores MAKE_CORES` -或 + 或 -`sudo bash build-img-docker.sh DOCKER_FILE KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE` + `sudo bash build-img-docker.sh DOCKER_FILE KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE` -其中,除第一个参数 DOCKER_FILE 外,剩余参数与`主机上构建`中对应参数一致: + 其中,除第一个参数 DOCKER_FILE 外,剩余参数与`主机上构建`中对应参数一致: -- DOCKER_FILE:Docker 镜像的 URL 或者文件名称, 默认为 `https://repo.openeuler.org/openEuler-20.03-LTS/docker_img/aarch64/openEuler-docker.aarch64.tar.xz`。使用该默认参数时,脚本会自动下载 openEuler 20.03 LTS 的 Docker 镜像,并导入本机系统中。注意,如果 DOCKER_FILE 为文件名称,需要保证该文件在本目录的 config 文件夹下。否则,如果 DOCKER_FILE 为 URL,请保证可以通过该链接获取到该 Docker 镜像。 + - DOCKER_FILE:Docker 镜像的 URL 或者文件名称, 默认为 `https://repo.openeuler.org/openEuler-20.03-LTS/docker_img/aarch64/openEuler-docker.aarch64.tar.xz`。使用该默认参数时,脚本会自动下载 openEuler 20.03 LTS 的 Docker 镜像,并导入本机系统中。注意,如果 DOCKER_FILE 为文件名称,需要保证该文件在本目录的 config 文件夹下。否则,如果 DOCKER_FILE 为 URL,请保证可以通过该链接获取到该 Docker 镜像。 diff --git "a/documents/openEuler\351\225\234\345\203\217\347\232\204\346\236\204\345\273\272.md" "b/documents/openEuler\351\225\234\345\203\217\347\232\204\346\236\204\345\273\272.md" index 284d0a834a371d28ee3abcea1c99e251f0186984..f1ac04ab8b9d76624e8ea851e27338db1e70c899 100644 --- "a/documents/openEuler\351\225\234\345\203\217\347\232\204\346\236\204\345\273\272.md" +++ "b/documents/openEuler\351\225\234\345\203\217\347\232\204\346\236\204\345\273\272.md" @@ -122,21 +122,20 @@ ### 收集编译结果 -1. 内核 +1. 内核 -`cp ${WORKDIR}/raspberrypi-kernel/arch/arm64/boot/Image ${WORKDIR}/output/` + `cp ${WORKDIR}/raspberrypi-kernel/arch/arm64/boot/Image ${WORKDIR}/output/` -2. 设备树文件等 +2. 设备树文件等 -`cp ${WORKDIR}/raspberrypi-kernel/arch/arm64/boot/dts/broadcom/*.dtb ${WORKDIR}/output/` + `cp ${WORKDIR}/raspberrypi-kernel/arch/arm64/boot/dts/broadcom/*.dtb ${WORKDIR}/output/` -`mkdir ${WORKDIR}/output/overlays` + `mkdir ${WORKDIR}/output/overlays` -`cp ${WORKDIR}/raspberrypi-kernel/arch/arm64/boot/dts/overlays/*.dtb* ${WORKDIR}/output/overlays/` + `cp ${WORKDIR}/raspberrypi-kernel/arch/arm64/boot/dts/overlays/*.dtb* ${WORKDIR}/output/overlays/` 至此,所有内核及内核模块相关内容都在 ${WORKDIR}/output 下了。 - ## 配置引导 ### 下载引导 @@ -179,27 +178,27 @@ ### 下载固件和应用 -1. 进入下载目录 +1. 进入下载目录 -`cd ${WORKDIR}` + `cd ${WORKDIR}` -2. 下载 bluez-firmware +2. 下载 bluez-firmware -`git clone --depth=1 https://github.com/RPi-Distro/bluez-firmware` + `git clone --depth=1 https://github.com/RPi-Distro/bluez-firmware` -得到文件 ${WORKDIR}/bluez-firmware。 + 得到文件 ${WORKDIR}/bluez-firmware。 -3. 下载 firmware-nonfree +3. 下载 firmware-nonfree -`git clone --depth=1 https://github.com/RPi-Distro/firmware-nonfree` + `git clone --depth=1 https://github.com/RPi-Distro/firmware-nonfree` -得到文件 ${WORKDIR}/firmware-nonfree。 + 得到文件 ${WORKDIR}/firmware-nonfree。 -4. 下载 pi-bluetooth +4. 下载 pi-bluetooth -`git clone https://github.com/RPi-Distro/pi-bluetooth` + `git clone https://github.com/RPi-Distro/pi-bluetooth` -得到文件 ${WORKDIR}/pi-bluetooth。 + 得到文件 ${WORKDIR}/pi-bluetooth。 # 制作 openEuler 的 rootfs @@ -247,46 +246,45 @@ etc/ usr/ var/ ### 网络相关 -1. 设置 DNS +1. 设置 DNS -`cp -L /etc/resolv.conf ${WORKDIR}/rootfs/etc/resolv.conf` + `cp -L /etc/resolv.conf ${WORKDIR}/rootfs/etc/resolv.conf` -编辑添加 nameserver: + 编辑添加 nameserver: -`vim ${WORKDIR}/rootfs/etc/resolv.conf` + `vim ${WORKDIR}/rootfs/etc/resolv.conf` -内容: -``` -nameserver 8.8.8.8 -nameserver 114.114.114.114 -``` + 内容: + ``` + nameserver 8.8.8.8 + nameserver 114.114.114.114 + ``` -2. 设置 IP 自动获取 +2. 设置 IP 自动获取 -`mkdir ${WORKDIR}/rootfs/etc/sysconfig/network-scripts` + `mkdir ${WORKDIR}/rootfs/etc/sysconfig/network-scripts` -`vim ${WORKDIR}/rootfs/etc/sysconfig/network-scripts/ifup-eth0` + `vim ${WORKDIR}/rootfs/etc/sysconfig/network-scripts/ifup-eth0` -内容: -``` -TYPE=Ethernet -PROXY_METHOD=none -BROWSER_ONLY=no -BOOTPROTO=dhcp -DEFROUTE=yes -IPV4_FAILURE_FATAL=no -IPV6INIT=yes -IPV6_AUTOCONF=yes -IPV6_DEFROUTE=yes -IPV6_FAILURE_FATAL=no -IPV6_ADDR_GEN_MODE=stable-privacy -NAME=eth0 -UUID=851a6f36-e65c-3a43-8f4a-78fd0fc09dc9 -ONBOOT=yes -AUTOCONNECT_PRIORITY=-999 -DEVICE=eth0 - -``` + 内容: + ``` + TYPE=Ethernet + PROXY_METHOD=none + BROWSER_ONLY=no + BOOTPROTO=dhcp + DEFROUTE=yes + IPV4_FAILURE_FATAL=no + IPV6INIT=yes + IPV6_AUTOCONF=yes + IPV6_DEFROUTE=yes + IPV6_FAILURE_FATAL=no + IPV6_ADDR_GEN_MODE=stable-privacy + NAME=eth0 + UUID=851a6f36-e65c-3a43-8f4a-78fd0fc09dc9 + ONBOOT=yes + AUTOCONNECT_PRIORITY=-999 + DEVICE=eth0 + ``` ## rootfs 内容完善 @@ -316,51 +314,51 @@ mv ${WORKDIR}/rootfs/lib/firmware/BCM4345C0.hcd ${WORKDIR}/rootfs/lib/firmware/b ## rootfs设置 -1. 挂载必要的路径 +1. 挂载必要的路径 -`mount --bind /dev ${WORKDIR}/rootfs/dev` + `mount --bind /dev ${WORKDIR}/rootfs/dev` -`mount -t proc /proc ${WORKDIR}/rootfs/proc` + `mount -t proc /proc ${WORKDIR}/rootfs/proc` -`mount -t sysfs /sys ${WORKDIR}/rootfs/sys` + `mount -t sysfs /sys ${WORKDIR}/rootfs/sys` -2. run chroot +2. run chroot -`chroot ${WORKDIR}/rootfs /bin/bash` + `chroot ${WORKDIR}/rootfs /bin/bash` -3. 开机自启ssh +3. 开机自启ssh -`systemctl enable ssh` + `systemctl enable ssh` -4. 设置root密码 +4. 设置root密码 -`passwd root` + `passwd root` -输入要设置的root密码。 + 输入要设置的root密码。 -5. 设置主机名 +5. 设置主机名 -`echo openEuler > /etc/hostname` + `echo openEuler > /etc/hostname` -6. 设置默认时区为东八区 +6. 设置默认时区为东八区 -`ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime` + `ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime` -7. 开机自启 hciuart +7. 开机自启 hciuart -`systemctl enable hciuart` + `systemctl enable hciuart` -8. 退出 +8. 退出 -`exit` + `exit` -9. 取消临时挂载的目录 +9. 取消临时挂载的目录 -`umount -l ${WORKDIR}/rootfs/dev` + `umount -l ${WORKDIR}/rootfs/dev` -`umount -l ${WORKDIR}/rootfs/proc` + `umount -l ${WORKDIR}/rootfs/proc` -`umount -l ${WORKDIR}/rootfs/sys` + `umount -l ${WORKDIR}/rootfs/sys` # 制作镜像 @@ -406,17 +404,17 @@ add map loop0p3 ... ### 格式化分区 -1. 格式化 boot 分区 +1. 格式化 boot 分区 -`mkfs.vfat -n boot /dev/mapper/loop0p1` + `mkfs.vfat -n boot /dev/mapper/loop0p1` -2. 格式化交换分区 +2. 格式化交换分区 -`mkswap /dev/mapper/loop0p2` + `mkswap /dev/mapper/loop0p2` -3. 格式化根目录分区 +3. 格式化根目录分区 -`mkfs.ext4 /dev/mapper/loop0p3` + `mkfs.ext4 /dev/mapper/loop0p3` ### 创建要挂载的根目录和 boot 分区路径 diff --git "a/documents/\346\240\221\350\216\223\346\264\276\344\275\277\347\224\250.md" "b/documents/\346\240\221\350\216\223\346\264\276\344\275\277\347\224\250.md" index 143caf1032cfdd7aa68aaf34ae7e103caad1d8c1..9b9f6839cf434f4da63637a36fef8b7acf888a18 100644 --- "a/documents/\346\240\221\350\216\223\346\264\276\344\275\277\347\224\250.md" +++ "b/documents/\346\240\221\350\216\223\346\264\276\344\275\277\347\224\250.md" @@ -85,21 +85,21 @@ 登录树莓派有以下两种方式: -1. 本地登录 +1. 本地登录 -树莓派连接显示器(树莓派视频输出接口为 Micro HDMI)、键盘、鼠标后,启动树莓派,可以看到树莓派启动日志输出到显示器上。待树莓派启动成功,输入用户名(root)和密码(openeuler)登录。目前,openEuler 系统无桌面环境,添加桌面支持相关进度可关注 [期望增加桌面支持](https://gitee.com/openeuler/raspberrypi/issues/I1F21F),欢迎大家参与。 + 树莓派连接显示器(树莓派视频输出接口为 Micro HDMI)、键盘、鼠标后,启动树莓派,可以看到树莓派启动日志输出到显示器上。待树莓派启动成功,输入用户名(root)和密码(openeuler)登录。目前,openEuler 系统无桌面环境,添加桌面支持相关进度可关注 [期望增加桌面支持](https://gitee.com/openeuler/raspberrypi/issues/I1F21F),欢迎大家参与。 -2. ssh 远程登录 +2. ssh 远程登录 -树莓派默认采用 DHCP 的方式自动获取 IP。如果树莓派连接已知路由器,可登录路由器查看,新增的 IP 即为树莓派 IP。 + 树莓派默认采用 DHCP 的方式自动获取 IP。如果树莓派连接已知路由器,可登录路由器查看,新增的 IP 即为树莓派 IP。 -![](images/获取IP.png) + ![](images/获取IP.png) -从上图看到,树莓派对应 IP 为:192.168.31.109,使用命令 `ssh root@192.168.1.109` 后输入密码 `openeuler`,即可远程登录树莓派。 + 从上图看到,树莓派对应 IP 为:192.168.31.109,使用命令 `ssh root@192.168.1.109` 后输入密码 `openeuler`,即可远程登录树莓派。 -如下图,登录成功后,树莓派即显示本机相关信息,包括本机 IP。 + 如下图,登录成功后,树莓派即显示本机相关信息,包括本机 IP。 -![](images/登录树莓派.png) + ![](images/登录树莓派.png) # 根目录分区扩展 @@ -365,16 +365,16 @@ hci0: Type: Primary Bus: UART 这里,可能会出现的问题: -1. Attempting to connect to XX:XX:XX:XX:XX:XX +1. Attempting to connect to XX:XX:XX:XX:XX:XX Failed to connect: org.bluez.Error.Failed -解决:重启 pluseaudio。 + 解决:重启 pluseaudio。 -``` -pulseaudio -k -pulseaudio --start -``` -如果重启多次仍然无效。在 `bluetoothctl` 交互命令中删除对应蓝牙设备信息:`remove target-MAC`,然后按照 `pair`、`trust`、`connect` 的过程连接蓝牙。 + ``` + pulseaudio -k + pulseaudio --start + ``` + 如果重启多次仍然无效。在 `bluetoothctl` 交互命令中删除对应蓝牙设备信息:`remove target-MAC`,然后按照 `pair`、`trust`、`connect` 的过程连接蓝牙。 ## 播放音乐