diff --git a/README.en.md b/README.en.md index 49ee80a751896c9027fb86cf5d472d14a4080310..365e1cdc5eb4537db2a9cf5bdbd3fed5a25027c3 100644 --- a/README.en.md +++ b/README.en.md @@ -21,29 +21,48 @@ You can get introduction of openEuler RaspberryPi SIG from [sig-RaspberryPi](htt ## Files and Directories - [scripts](./scripts): Script for building openEuler image for Raspberry Pi - - [Build on host](scripts/build-img.sh) - - [Build in a Docker container](scripts/build-img-docker.sh) + - [Quickly Build(without kernel compilation)](scripts/build-image.sh) + - [Build on host(with kernel compilation)](scripts/build-image-common.sh) + - [Build in a Docker container(with kernel compilation)](scripts/build-image-docker.sh) - [documents](./documents/): - [Building openEuler image for Raspberry Pi](documents/openEuler镜像的构建.md) - [Cross-compile the kernel](documents/交叉编译内核.md) - [Install openEuler on a SD card](documents/刷写镜像.md) - [How to use Raspberry Pi](documents/树莓派使用.md) - - [ChangeLog](documents/changelog.en.md) + - [openEuler 20.03 LTS ChangeLog](documents/changelog.en.md) + - [openEuler 20.09 ChangeLog](documents/changelog-20.09.en.md) ## How to download latest image -Alpha version of openEuler 20.03 LTS image for Raspberry Pi, [download](https://isrc.iscas.ac.cn/eulixos/repo/others/openeuler-raspberrypi/images/openEuler-20.03-LTS-aarch64-raspi.img.xz). +1. openEuler 20.03 LTS -Basic information of the above image: + Alpha version of openEuler 20.03 LTS image for Raspberry Pi, [download](https://isrc.iscas.ac.cn/eulixos/repo/others/openeuler-raspberrypi/images/openEuler-20.03-LTS-aarch64-raspi.img.xz). -- [ChangeLog](documents/changelog.en.md) -- Release date: 2020-08-10 -- Size: 259 MiB -- OS version: openEuler 20.03 LTS -- Kernel version: 4.19.90-2005.2.0.0002 -- Firmware source: [firmware](https://github.com/raspberrypi/firmware), [bluez-firmware](https://github.com/RPi-Distro/bluez-firmware), [firmware-nonfree](https://github.com/RPi-Distro/firmware-nonfree) -- Repository of rootfs: [openEuler-20.03-LTS](http://repo.openeuler.org/openEuler-20.03-LTS/everything/aarch64/) -- Repository inside the image: [openEuler 20.03 LTS repository](https://gitee.com/openeuler/raspberrypi/blob/master/scripts/config/openEuler-20.03-LTS.repo) + Basic information of the above image: + + - [ChangeLog](documents/changelog.en.md) + - Release date: 2020-08-10 + - Size: 259 MiB + - OS version: openEuler 20.03 LTS + - Kernel version: 4.19.90-2005.2.0.0002 + - Firmware source: [firmware](https://github.com/raspberrypi/firmware), [bluez-firmware](https://github.com/RPi-Distro/bluez-firmware), [firmware-nonfree](https://github.com/RPi-Distro/firmware-nonfree) + - Repository of rootfs: [openEuler 20.03 LTS](rhttp://repo.openeuler.org/openEuler-20.03-LTS/everything/aarch64/) + - Repository inside the image: [openEuler 20.03 LTS repository](https://gitee.com/openeuler/raspberrypi/blob/master/scripts/config-common/openEuler-20.03-LTS.repo) + +2. openEuler 20.09 + + Alpha version of openEuler 20.09 image for Raspberry Pi, [download](https://isrc.iscas.ac.cn/eulixos/repo/others/openeuler-raspberrypi/images/openEuler-20.09-aarch64-raspi.img.xz). + + Basic information of the above image: + + - [ChangeLog](documents/changelog-20.09.en.md) + - Release date: 2020-09-04 + - Size: 237 MiB + - OS version: openEuler 20.09 + - Kernel version: 4.19.140-2008.3.0.0001 + - Firmware source: [firmware](https://github.com/raspberrypi/firmware), [bluez-firmware](https://github.com/RPi-Distro/bluez-firmware), [firmware-nonfree](https://github.com/RPi-Distro/firmware-nonfree) + - Repository of rootfs: [openEuler 20.09 repository built daily](http://119.3.219.20:82/openEuler:/Mainline/standard_aarch64/) + - Repository inside the image: [openEuler 20.09 repository](https://gitee.com/src-openeuler/openEuler-repos/blob/openEuler-20.09/generic.repo) ## How to Use image @@ -66,11 +85,14 @@ Refer to [Script for building openEuler image for Raspberry Pi](documents/openEu #### Quickly Build without kernel compilation(Recommended) +>![](public_sys-resources/icon-notice.gif) **NOTICE:** +>Only openEuler 20.09 is supported currently. + Build images with packages of raspberrypi-kernel, raspberrypi-firmware, and raspberrypi-bluetooth. Run the following command to build an image: -`sudo bash build-img-quick.sh -d DIR -r REPO -n IMAGE_NAME` +`sudo bash build-image.sh -d DIR -r REPO -n IMAGE_NAME` The meaning of each parameter: @@ -84,17 +106,32 @@ The meaning of each parameter: The URL/path of target repo file, or the list of repositories' baseurls. Note that, the baseurls should be separated by space and enclosed in double quotes. - By default, the parameter is the path of the repo file which should be in the `openEuler` directory. Examples are as follows: + Examples are as follows: - - The URL of target repo file: `https://gitee.com/src-openeuler/openEuler-repos/blob/openEuler-20.03-LTS/generic.repo` - - The path of target repo file: `/opt/raspi-image-build/openEuler/openEuler-20.03-LTS.repo` - - List of repo's baseurls: `"http://repo.openeuler.org/openEuler-20.03-LTS/OS/aarch64/ http://repo.openeuler.org/openEuler-20.03-LTS/EPOL/aarch64/ http://repo.openeuler.org/openEuler-20.03-LTS/source"` + - The URL of target repo file: *currently unavailable* + - The path of target repo file: `./openEuler-20.09.repo` + + The content of the repo file is as follows: + ``` + [MAINLINE] + name=MAINLINE + baseurl=http://119.3.219.20:82/openEuler:/Mainline/standard_aarch64/ + enabled=1 + gpgcheck=0 + + [EPOL] + name=EPOL + baseurl=http://119.3.219.20:82/openEuler:/Epol/standard_aarch64/ + enabled=1 + gpgcheck=0 + ``` + - List of repo's baseurls: `"http://119.3.219.20:82/openEuler:/Mainline/standard_aarch64/ http://119.3.219.20:82/openEuler:/Epol/standard_aarch64/"` 3. -n, --name IMAGE_NAME The image name to be built. - For example, `openEuler-20.03-LTS.img`. The default is `openEuler-20.09-aarch64-raspi.img`, or it is automatically generated based on parameter: `-r, --repo REPO_INFO`. + For example, `openEuler-20.09.img`. The default is `openEuler-aarch64-raspi.img`, or it is automatically generated based on parameter: `-r, --repo REPO_INFO`. 4. -h, --help @@ -108,7 +145,7 @@ Here, we provide two approaches to build an image, which both include compiling Run the following command to build an image: -`sudo bash build-img.sh -n IMAGE_NAME -k KERNEL_URL -b KERNEL_BRANCH -c KERNEL_DEFCONFIG -r REPO --cores N` +`sudo bash build-image-common.sh -n IMAGE_NAME -k KERNEL_URL -b KERNEL_BRANCH -c KERNEL_DEFCONFIG -r REPO --cores N` The meaning of each parameter: @@ -116,7 +153,7 @@ The meaning of each parameter: The image name to be built. - For example, `openEuler-20.03-LTS.img`. The default is `openEuler-20.03-LTS-aarch64-raspi.img`, or it is automatically generated based on parameter: `-r, --repo REPO_INFO`. + For example, `openEuler-20.03-LTS.img`. The default is `openEuler-aarch64-raspi.img`, or it is automatically generated based on parameter: `-r, --repo REPO_INFO`. 2. -k, --kernel KERNEL_URL @@ -134,10 +171,12 @@ The meaning of each parameter: The URL/path of target repo file, or the list of repositories' baseurls. Note that, the baseurls should be separated by space and enclosed in double quotes. - By default, the parameter is the path of the repo file which should be in the `openEuler` directory. Examples are as follows: + Examples are as follows: - The URL of target repo file: `https://gitee.com/src-openeuler/openEuler-repos/blob/openEuler-20.03-LTS/generic.repo` - - The path of target repo file: `/opt/raspi-image-build/openEuler/openEuler-20.03-LTS.repo` + - The path of target repo file: `./openEuler-20.03-LTS.repo` + + Refer to `https://gitee.com/src-openeuler/openEuler-repos/blob/openEuler-20.03-LTS/generic.repo` for details about the content of the repo file. - List of repo's baseurls: `"http://repo.openeuler.org/openEuler-20.03-LTS/OS/aarch64/ http://repo.openeuler.org/openEuler-20.03-LTS/EPOL/aarch64/ http://repo.openeuler.org/openEuler-20.03-LTS/source"` 6. --cores N @@ -148,7 +187,7 @@ The meaning of each parameter: Run the following command to build an image: -`sudo bash build-img-docker.sh -d DOCKER_FILE -n IMAGE_NAME -k KERNEL_URL -b KERNEL_BRANCH -c KERNEL_DEFCONFIG -r REPO --cores N` +`sudo bash build-image-docker.sh -d DOCKER_FILE -n IMAGE_NAME -k KERNEL_URL -b KERNEL_BRANCH -c KERNEL_DEFCONFIG -r REPO --cores N` Caution, before running the script, you need to install Docker. The script will automatically import the Docker image into the local system according to the script's parameter: DOCKER_FILE. diff --git a/README.md b/README.md index caf37eff7614d9ef581736bf8cc24a14735e65b3..788a5e0f7af80ccf54b6db23b71d3d7efb667d98 100644 --- a/README.md +++ b/README.md @@ -19,30 +19,48 @@ SIG 组基本信息位于 [sig-RaspberryPi](https://gitee.com/jianminw/community ## 仓库目录 - [scripts](./scripts): 构建 openEuler 树莓派镜像的脚本 - - [主机上构建](scripts/build-img.sh) - - [Docker 容器中构建](scripts/build-img-docker.sh) + - [快速构建(不编译内核)](scripts/build-image.sh) + - [主机上构建(编译内核)](scripts/build-image-common.sh) + - [Docker 容器中构建(编译内核)](scripts/build-image-docker.sh) - [documents](./documents/): 使用文档 - [openEuler 镜像的构建](documents/openEuler镜像的构建.md) - [交叉编译内核](documents/交叉编译内核.md) - [刷写镜像](documents/刷写镜像.md) - [树莓派使用](documents/树莓派使用.md) - - [更新日志](documents/changelog.md) + - [openEuler 20.03 LTS 更新日志](documents/changelog.md) + - [openEuler 20.09 更新日志](documents/changelog-20.09.md) ## 最新镜像 -openEuler 20.03 LTS 的内测版本镜像,[下载](https://isrc.iscas.ac.cn/eulixos/repo/others/openeuler-raspberrypi/images/openEuler-20.03-LTS-aarch64-raspi.img.xz)。 +1. openEuler 20.03 LTS + openEuler 20.03 LTS 的内测版本镜像,[下载](https://isrc.iscas.ac.cn/eulixos/repo/others/openeuler-raspberrypi/images/openEuler-20.03-LTS-aarch64-raspi.img.xz)。 -该镜像的基本信息: + 该镜像的基本信息: -- [更新日志](documents/changelog.md) -- 发布时间:2020-08-10 -- 大小:259 MiB -- 操作系统版本:openEuler 20.03 LTS -- 内核版本:4.19.90-2005.2.0.0002 -- 固件来源:[firmware](https://github.com/raspberrypi/firmware)、[bluez-firmware](https://github.com/RPi-Distro/bluez-firmware)、[firmware-nonfree](https://github.com/RPi-Distro/firmware-nonfree) -- 构建文件系统的源仓库:[openEuler-20.03-LTS](http://repo.openeuler.org/openEuler-20.03-LTS/everything/aarch64/) -- 镜像内置源仓库:[openEuler 20.03 LTS 源仓库](https://gitee.com/openeuler/raspberrypi/blob/master/scripts/config/openEuler-20.03-LTS.repo) + - [更新日志](documents/changelog.md) + - 发布时间:2020-08-10 + - 大小:259 MiB + - 操作系统版本:openEuler 20.03 LTS + - 内核版本:4.19.90-2005.2.0.0002 + - 固件来源:[firmware](https://github.com/raspberrypi/firmware)、[bluez-firmware](https://github.com/RPi-Distro/bluez-firmware)、[firmware-nonfree](https://github.com/RPi-Distro/firmware-nonfree) + - 构建文件系统的源仓库:[openEuler 20.03 LTS](http://repo.openeuler.org/openEuler-20.03-LTS/everything/aarch64/) + - 镜像内置源仓库:[openEuler 20.03 LTS 源仓库](https://gitee.com/src-openeuler/openEuler-repos/blob/openEuler-20.03-LTS/generic.repo) + +2. openEuler 20.09 + + openEuler 20.09 的内测版本镜像,[下载](https://isrc.iscas.ac.cn/eulixos/repo/others/openeuler-raspberrypi/images/openEuler-20.09-aarch64-raspi.img.xz)。 + + 该镜像的基本信息: + + - [更新日志](documents/changelog-20.09.md) + - 发布时间:2020-09-04 + - 大小:237 MiB + - 操作系统版本:openEuler 20.09 + - 内核版本:4.19.140-2008.3.0.0001 + - 固件来源:[firmware](https://github.com/raspberrypi/firmware)、[bluez-firmware](https://github.com/RPi-Distro/bluez-firmware)、[firmware-nonfree](https://github.com/RPi-Distro/firmware-nonfree) + - 构建文件系统的源仓库:[openEuler 20.09 每日构建的源仓库](http://119.3.219.20:82/openEuler:/Mainline/standard_aarch64/) + - 镜像内置源仓库:[openEuler 20.09 源仓库](https://gitee.com/src-openeuler/openEuler-repos/blob/openEuler-20.09/generic.repo) ## 使用镜像 @@ -68,11 +86,14 @@ openEuler 20.03 LTS 的内测版本镜像,[下载](https://isrc.iscas.ac.cn/eu #### 快速构建(无需编译内核,推荐) +>![](public_sys-resources/icon-notice.gif) **须知:** +>当前只支持 openEuler 20.09 版本。 + 使用已有的树莓派内核、固件、蓝牙等 RPM 包构建镜像。 构建镜像需执行命令: -`sudo bash build-img-quick.sh -d DIR -r REPO -n IMAGE_NAME` +`sudo bash build-image.sh -d DIR -r REPO -n IMAGE_NAME` 各个参数意义: @@ -86,16 +107,31 @@ openEuler 20.03 LTS 的内测版本镜像,[下载](https://isrc.iscas.ac.cn/eu 开发源 repo 文件的 URL 或者路径,也可以是开发源中资源库的 baseurl 列表。注意,如果该参数为资源库的 baseurl 列表,该参数需要使用双引号,各个 baseurl 之间以空格隔开。 - 默认使用脚本所在目录的 openEuler 文件夹下的 repo 文件。下面分别举例: - - 开发源 repo 文件的 URL:`https://gitee.com/src-openeuler/openEuler-repos/blob/openEuler-20.03-LTS/generic.repo` - - 开发源的 repo 文件路径:`/opt/raspi-image-build/openEuler/openEuler-20.03-LTS.repo` - - 资源库的 baseurl 列表:`"http://repo.openeuler.org/openEuler-20.03-LTS/OS/aarch64/ http://repo.openeuler.org/openEuler-20.03-LTS/EPOL/aarch64/ http://repo.openeuler.org/openEuler-20.03-LTS/source"` + 下面分别举例: + - 开发源 repo 文件的 URL:*暂无* + - 开发源的 repo 文件路径:`./openEuler-20.09.repo` + + 该文件的内容如下: + ``` + [MAINLINE] + name=MAINLINE + baseurl=http://119.3.219.20:82/openEuler:/Mainline/standard_aarch64/ + enabled=1 + gpgcheck=0 + + [EPOL] + name=EPOL + baseurl=http://119.3.219.20:82/openEuler:/Epol/standard_aarch64/ + enabled=1 + gpgcheck=0 + ``` + - 资源库的 baseurl 列表:`"http://119.3.219.20:82/openEuler:/Mainline/standard_aarch64/ http://119.3.219.20:82/openEuler:/Epol/standard_aarch64/"` 3. -n, --name IMAGE_NAME 构建的镜像名称。 - 例如,`openEuler-20.03-LTS.img`。默认为`openEuler-20.09-aarch64-raspi.img`,或者根据 `-r, --repo REPO_INFO` 参数自动生成。 + 例如,`openEuler-20.09.img`。默认为`openEuler-aarch64-raspi.img`,或者根据 `-r, --repo REPO_INFO` 参数自动生成。 4. -h, --help @@ -111,7 +147,7 @@ openEuler 20.03 LTS 的内测版本镜像,[下载](https://isrc.iscas.ac.cn/eu 构建镜像需执行命令: -`sudo bash build-img.sh -n IMAGE_NAME -k KERNEL_URL -b KERNEL_BRANCH -c KERNEL_DEFCONFIG -r REPO --cores N` +`sudo bash build-image-common.sh -n IMAGE_NAME -k KERNEL_URL -b KERNEL_BRANCH -c KERNEL_DEFCONFIG -r REPO --cores N` 各个参数意义: @@ -119,7 +155,7 @@ openEuler 20.03 LTS 的内测版本镜像,[下载](https://isrc.iscas.ac.cn/eu 构建的镜像名称。 - 例如,`openEuler-20.03-LTS.img`。默认为`openEuler-20.03-LTS-aarch64-raspi.img`,或者根据 `-r, --repo REPO_INFO` 参数自动生成。 + 例如,`openEuler-20.03-LTS.img`。默认为`openEuler-aarch64-raspi.img`,或者根据 `-r, --repo REPO_INFO` 参数自动生成。 2. -k, --kernel KERNEL_URL @@ -137,9 +173,11 @@ openEuler 20.03 LTS 的内测版本镜像,[下载](https://isrc.iscas.ac.cn/eu 开发源 repo 文件的 URL 或者路径,也可以是开发源中资源库的 baseurl 列表。注意,如果该参数为资源库的 baseurl 列表,该参数需要使用双引号,各个 baseurl 之间以空格隔开。 - 默认使用脚本所在目录的 openEuler 文件夹下的 repo 文件。下面分别举例: + 下面分别举例: - 开发源 repo 文件的 URL:`https://gitee.com/src-openeuler/openEuler-repos/blob/openEuler-20.03-LTS/generic.repo` - - 开发源的 repo 文件路径:`/opt/raspi-image-build/openEuler/openEuler-20.03-LTS.repo` + - 开发源的 repo 文件路径:`./openEuler-20.03-LTS.repo` + + 该文件内容参考 `https://gitee.com/src-openeuler/openEuler-repos/blob/openEuler-20.03-LTS/generic.repo`。 - 资源库的 baseurl 列表:`"http://repo.openeuler.org/openEuler-20.03-LTS/OS/aarch64/ http://repo.openeuler.org/openEuler-20.03-LTS/EPOL/aarch64/ http://repo.openeuler.org/openEuler-20.03-LTS/source"` 6. --cores N @@ -150,7 +188,7 @@ openEuler 20.03 LTS 的内测版本镜像,[下载](https://isrc.iscas.ac.cn/eu 构建镜像需执行命令: -`sudo bash build-img-docker.sh -d DOCKER_FILE -n IMAGE_NAME -k KERNEL_URL -b KERNEL_BRANCH -c KERNEL_DEFCONFIG -r REPO --cores N` +`sudo bash build-image-docker.sh -d DOCKER_FILE -n IMAGE_NAME -k KERNEL_URL -b KERNEL_BRANCH -c KERNEL_DEFCONFIG -r REPO --cores N` 注意!!!运行该脚本前,需安装 Docker 运行环境。该脚本会自动将 DOCKER_FILE 参数对应的 Docker 镜像导入本机系统中。 diff --git a/documents/changelog-20.09.en.md b/documents/changelog-20.09.en.md new file mode 100644 index 0000000000000000000000000000000000000000..d9c9f9fd1069dbce6c01e63cddef945c82b20f86 --- /dev/null +++ b/documents/changelog-20.09.en.md @@ -0,0 +1,15 @@ +## Feature Release Log + +English | [简体中文](./changelog-20.09.md) + +### 2020-09-04 + +#### Basic information + +- Release date: 2020-09-04 +- Size: 237 MiB +- OS version: openEuler 20.09 +- Kernel version: 4.19.140-2008.3.0.0001 +- Firmware source: [firmware](https://github.com/raspberrypi/firmware), [bluez-firmware](https://github.com/RPi-Distro/bluez-firmware), [firmware-nonfree](https://github.com/RPi-Distro/firmware-nonfree) +- Repository of rootfs: [openEuler 20.09 repository built daily](http://119.3.219.20:82/openEuler:/Mainline/standard_aarch64/) +- Repository inside the image: [openEuler 20.09 repository](https://gitee.com/src-openeuler/openEuler-repos/blob/openEuler-20.09/generic.repo) \ No newline at end of file diff --git a/documents/changelog-20.09.md b/documents/changelog-20.09.md new file mode 100644 index 0000000000000000000000000000000000000000..1bb55c4d07d231ac42f0d345c569f3f04cded773 --- /dev/null +++ b/documents/changelog-20.09.md @@ -0,0 +1,15 @@ +## Feature Release Log + +[English](./changelog-20.09.en.md) | 简体中文 + +### 2020-09-04 + +#### 基本信息 + +- 发布时间:2020-09-04 +- 大小:237 MiB +- 操作系统版本:openEuler 20.09 +- 内核版本:4.19.140-2008.3.0.0001 +- 固件来源:[firmware](https://github.com/raspberrypi/firmware)、[bluez-firmware](https://github.com/RPi-Distro/bluez-firmware)、[firmware-nonfree](https://github.com/RPi-Distro/firmware-nonfree) +- 构建文件系统的源仓库:[openEuler 20.09 每日构建的源仓库](http://119.3.219.20:82/openEuler:/Mainline/standard_aarch64/) +- 镜像内置源仓库:[openEuler 20.09 源仓库](https://gitee.com/src-openeuler/openEuler-repos/blob/openEuler-20.09/generic.repo) \ No newline at end of file diff --git "a/documents/\345\210\267\345\206\231\351\225\234\345\203\217.md" "b/documents/\345\210\267\345\206\231\351\225\234\345\203\217.md" index 39c65c23475aaa7248fcac816883023a68c8739b..b50ad7bccc6e7b1fd52408e94768ca9bd3b53bbd 100644 --- "a/documents/\345\210\267\345\206\231\351\225\234\345\203\217.md" +++ "b/documents/\345\210\267\345\206\231\351\225\234\345\203\217.md" @@ -64,8 +64,8 @@ 1. 下载并安装刷写镜像的工具,以下操作以 Win32 Disk Imager 工具为例。 2. 右键选择“以管理员身份运行”,打开 Win32 Disk Imager。 -3. 选择镜像 img 文件。 -4. 选择待写入的 SD 卡盘符。 +3. 在“映像文件”中选择 img 格式的镜像文件路径。 +4. 在“设备”中选择待写入的 SD 卡盘符。 5. 单击“写入”。如下图所示,界面通过任务进度条显示写入 SD 卡的进度。 ![](images/写入SD.png) diff --git a/scripts/build-img.sh b/scripts/build-image-common.sh similarity index 95% rename from scripts/build-img.sh rename to scripts/build-image-common.sh index b9b55c2ab26a40616958859337deca78d5bc2731..c04c45283cb51ff77f81c8304c3d5483af31957f 100644 --- a/scripts/build-img.sh +++ b/scripts/build-image-common.sh @@ -2,7 +2,7 @@ set -e __usage=" -Usage: build-img [OPTIONS] +Usage: build-image-common [OPTIONS] Build raspberrypi image. Options: @@ -10,7 +10,7 @@ Options: -k, --kernel KERNEL_URL The URL of kernel source's repository, which defaults to https://gitee.com/openeuler/raspberrypi-kernel.git. -b, --branch KERNEL_BRANCH The branch name of kernel source's repository, which defaults to master. -c, --config KERNEL_DEFCONFIG The name/path of defconfig file when compiling kernel, which defaults to openeuler-raspi_defconfig. - -r, --repo REPO_INFO The URL/path of target repo file or list of repo's baseurls which should be a space separated list. + -r, --repo REPO_INFO Required! The URL/path of target repo file or list of repo's baseurls which should be a space separated list. --cores N The number of cpu cores to be used during making. -h, --help Show command help. " @@ -23,6 +23,10 @@ help() parseargs() { + if [ "x$#" == "x0" ]; then + return 1 + fi + while [ "x$#" != "x0" ]; do if [ "x$1" == "x-h" -o "x$1" == "x--help" ]; then @@ -87,8 +91,10 @@ prepare(){ echo `date` - ERROR, config file $default_defconfig can not be found. exit 2 fi - - if [ "x${repo_file:0:4}" = "xhttp" ]; then + if [ "x$repo_file" == "x" ] ; then + echo `date` - ERROR, \"-r REPO_INFO or --repo REPO_INFO\" missing. + help 2 + elif [ "x${repo_file:0:4}" = "xhttp" ]; then if [ "x${repo_file:0-5}" == "x.repo" ]; then wget ${repo_file} -P ${tmp_dir}/ repo_file_name=${repo_file##*/} @@ -110,9 +116,6 @@ prepare(){ repo_file=${repo_file_tmp} fi else - if [ "x$repo_file" == "x" ] ; then - repo_file=`ls ${euler_dir}/*.repo 2>/dev/null| head -n 1` - fi if [ ! -f $repo_file ]; then echo `date` - ERROR, repo file $repo_file can not be found. exit 2 @@ -142,16 +145,9 @@ prepare(){ mkdir ${cur_dir}/log fi LOG "prepare begin..." - rmp_names=("bison" "flex" "parted" "wget" "multipath-tools") - rmp_install_names=("bison" "flex" "parted" "wget" "kpartx") - rmp_len=${#rmp_names[@]} - for (( i=0; i<${rmp_len}; i++ )) - do - rpm -qa | grep ${rmp_names[i]} &> /dev/null - [ $? -eq 0 ] || yum install -y ${rmp_install_names[i]} &> /dev/null - [ $? -ne 0 ] && ERROR "yum install ${rmp_install_names[i]} failed." && yum_right=3 - done - [ $yum_right ] && exit 3 + dnf makecache + dnf install -y bison flex wget dnf-plugins-core tar parted dosfstools grep bash xz kpartx + if [ ! -d ${run_dir}/img ]; then mkdir ${run_dir}/img fi @@ -457,8 +453,8 @@ make_rootfs(){ cp pi-bluetooth/debian/pi-bluetooth.bthelper\@.service ${rootfs_dir}/lib/systemd/system/bthelper\@.service cp pi-bluetooth/debian/pi-bluetooth.hciuart.service ${rootfs_dir}/lib/systemd/system/hciuart.service cp -r ${output_dir}/lib/modules ${rootfs_dir}/lib/ - mkdir -p /usr/share/licenses/raspi - cp -a ${euler_dir}/License/* /usr/share/licenses/raspi/ + mkdir -p ${rootfs_dir}/usr/share/licenses/raspi + cp -a ${euler_dir}/License/* ${rootfs_dir}/usr/share/licenses/raspi/ cp ${euler_dir}/chroot.sh ${rootfs_dir}/chroot.sh chmod +x ${rootfs_dir}/chroot.sh mount --bind /dev ${rootfs_dir}/dev @@ -605,7 +601,7 @@ output_dir=${run_dir}/output rootfs_dir=${run_dir}/rootfs_${builddate} root_mnt=${run_dir}/root boot_mnt=${run_dir}/boot -euler_dir=${cur_dir}/config +euler_dir=${cur_dir}/config-common CONFIG_RPM_LIST=${euler_dir}/rpmlist prepare diff --git a/scripts/build-img-docker.sh b/scripts/build-image-docker.sh similarity index 89% rename from scripts/build-img-docker.sh rename to scripts/build-image-docker.sh index d77ccd88fd3e1dc8cd236502ea6ef282be0b76f6..4c10e4a41d492a3efcee702b6c87f40191c650c5 100644 --- a/scripts/build-img-docker.sh +++ b/scripts/build-image-docker.sh @@ -3,7 +3,7 @@ set -e __usage=" -Usage: build-img-docker [OPTIONS] +Usage: build-image-docker [OPTIONS] Build raspberrypi image. Options: @@ -12,7 +12,7 @@ Options: -k, --kernel KERNEL_URL The URL of kernel source's repository, which defaults to https://gitee.com/openeuler/raspberrypi-kernel.git. -b, --branch KERNEL_BRANCH The branch name of kernel source's repository, which defaults to master. -c, --config KERNEL_DEFCONFIG The name/path of defconfig file when compiling kernel, which defaults to openeuler-raspi_defconfig. - -r, --repo REPO_INFO The URL/path of target repo file or list of repo's baseurls which should be a space separated list. + -r, --repo REPO_INFO Required! The URL/path of target repo file or list of repo's baseurls which should be a space separated list. --cores N The number of cpu cores to be used during making. -h, --help Show command help. " @@ -25,6 +25,10 @@ help() parseargs() { + if [ "x$#" == "x0" ]; then + return 1 + fi + while [ "x$#" != "x0" ]; do if [ "x$1" == "x-h" -o "x$1" == "x--help" ]; then @@ -125,6 +129,11 @@ else exit 2 fi +if [ "x$repo_file" == "x" ] ; then + echo `date` - ERROR, \"-r REPO_INFO or --repo REPO_INFO\" missing. + help 2 +fi + buildid=$(date +%Y%m%d%H%M%S) builddate=${buildid:0:8} @@ -136,7 +145,7 @@ docker_file_name=${docker_file##*/} docker_img_name=`docker load --input ${cur_dir}/tmp/${docker_file_name}` docker_img_name=${docker_img_name##*: } -(echo "FROM $docker_img_name" && grep -v FROM ${cur_dir}/config/Dockerfile_makeraspi) | docker build -t ${docker_img_name}-${buildid} --no-cache -f- . +(echo "FROM $docker_img_name" && grep -v FROM ${cur_dir}/config-common/Dockerfile_makeraspi) | docker build -t ${docker_img_name}-${buildid} --no-cache -f- . echo docker run --rm --privileged=true -v ${cur_dir}:/work ${docker_img_name}-${buildid} ${params} docker run --rm --privileged=true -v ${cur_dir}:/work ${docker_img_name}-${buildid} ${params} chmod -R a+r ${cur_dir}/img diff --git a/scripts/build-img-quick.sh b/scripts/build-image.sh similarity index 92% rename from scripts/build-img-quick.sh rename to scripts/build-image.sh index 5e95c3a203ba9eb5b1e5d883a4e6b4317a3a536f..32f489d1a5371f4a641fe592d5de0885b195034a 100644 --- a/scripts/build-img-quick.sh +++ b/scripts/build-image.sh @@ -3,12 +3,12 @@ set -e __usage=" -Usage: build-img-quick [OPTIONS] -Build raspberrypi image. +Usage: build-image [OPTIONS] +Build raspberrypi image. Options: - -d, --dir DIR The directory for storing the image and other temporary files. If the DIR does not exist, it will be created automatically. - -r, --repo REPO_INFO The URL/path of target repo file or list of repo's baseurls which should be a space separated list. + -d, --dir DIR The directory for storing the image and other temporary files, which defaults to be the directory in which the script resides. If the DIR does not exist, it will be created automatically. + -r, --repo REPO_INFO Required! The URL/path of target repo file or list of repo's baseurls which should be a space separated list. -n, --name IMAGE_NAME The raspberrypi image name to be built. -h, --help Show command help. " @@ -21,6 +21,10 @@ help() parseargs() { + if [ "x$#" == "x0" ]; then + return 1 + fi + while [ "x$#" != "x0" ]; do if [ "x$1" == "x-h" -o "x$1" == "x--help" ]; then @@ -60,7 +64,10 @@ prepare(){ else rm -rf ${tmp_dir}/* fi - if [ "x${repo_file:0:4}" = "xhttp" ]; then + if [ "x$repo_file" == "x" ] ; then + echo `date` - ERROR, \"-r REPO_INFO or --repo REPO_INFO\" missing. + help 2 + elif [ "x${repo_file:0:4}" == "xhttp" ]; then if [ "x${repo_file:0-5}" == "x.repo" ]; then wget ${repo_file} -P ${tmp_dir}/ repo_file_name=${repo_file##*/} @@ -82,9 +89,6 @@ prepare(){ repo_file=${repo_file_tmp} fi else - if [ "x$repo_file" == "x" ] ; then - repo_file=`ls ${euler_dir}/*.repo 2>/dev/null| head -n 1` - fi if [ ! -f $repo_file ]; then echo `date` - ERROR, repo file $repo_file can not be found. exit 2 @@ -114,8 +118,8 @@ prepare(){ mkdir -p ${log_dir} fi LOG "prepare begin..." - # dnf makecache - # dnf install -y dnf-plugins-core tar parted dosfstools + dnf makecache + dnf install -y dnf-plugins-core tar parted dosfstools grep bash xz kpartx if [ -d ${rootfs_dir} ]; then rm -rf ${rootfs_dir} @@ -320,14 +324,15 @@ if [ "$EUID" -ne 0 ]; then exit fi -workdir=$(cd $(dirname $0);pwd) +cur_dir=$(cd $(dirname $0);pwd) +workdir=${cur_dir} parseargs "$@" || help $? -if [ "x$workdir" == "x" ] ; then +if [ "x$workdir" == "x" ]; then echo `date` - ERROR, \"-d DIR or --dir DIR\" missing. help 2 -elif [ ! -d ${workdir} ] ; then +elif [ ! -d ${workdir} ]; then echo `date` - INFO, output dir ${workdir} does not exists. mkdir -p ${workdir} echo `date` - INFO, output dir: ${workdir} created. @@ -335,7 +340,6 @@ fi OS_NAME=openEuler -cur_dir=$(cd $(dirname $0);pwd) workdir=$(cd "$(dirname $workdir)"; pwd)/$(basename $workdir) rootfs_dir=${workdir}/raspi_output/rootfs root_mnt=${workdir}/raspi_output/root @@ -343,10 +347,9 @@ boot_mnt=${workdir}/raspi_output/boot tmp_dir=${workdir}/raspi_output/tmp log_dir=${workdir}/raspi_output/log img_dir=${workdir}/raspi_output/img -euler_dir=${cur_dir}/config-quick +euler_dir=${cur_dir}/config CONFIG_RPM_LIST=${euler_dir}/rpmlist - builddate=$(date +%Y%m%d) prepare diff --git a/scripts/config/Dockerfile_makeraspi b/scripts/config-common/Dockerfile_makeraspi similarity index 58% rename from scripts/config/Dockerfile_makeraspi rename to scripts/config-common/Dockerfile_makeraspi index 345449e6a0895f01d6097fd8dcad085c715adeb9..7fee3d90468f73eb3449ce9996e27ada9f4e820a 100644 --- a/scripts/config/Dockerfile_makeraspi +++ b/scripts/config-common/Dockerfile_makeraspi @@ -2,15 +2,15 @@ FROM openeuler-20.03-lts:latest RUN dnf clean expire-cache -COPY config/openEuler-20.03-LTS.repo /etc/yum.repos.d/openEuler-20.03-LTS.repo +COPY config-common/openEuler-20.03-LTS.repo /etc/yum.repos.d/openEuler-20.03-LTS.repo RUN dnf -y install cmake gdb gcc gcc-c++ libstdc++-static ncurses ncurses-devel make python bash coreutils && \ dnf -y clean all -RUN dnf -y install module-init-tools git openssl-devel bc bison flex dosfstools parted wget device-mapper-multipath +RUN dnf -y install module-init-tools git openssl-devel bc bison flex dnf-plugins-core dosfstools parted wget device-mapper-multipath grep xz kpartx RUN dnf -y install tar passwd diffutils ENV SHELL=/bin/bash -ENTRYPOINT ["/bin/bash", "/work/build-img.sh"] +ENTRYPOINT ["/bin/bash", "/work/build-image-common.sh"] diff --git a/scripts/config/License/LICENCE.COPYING.linux b/scripts/config-common/License/LICENCE.COPYING.linux similarity index 100% rename from scripts/config/License/LICENCE.COPYING.linux rename to scripts/config-common/License/LICENCE.COPYING.linux diff --git a/scripts/config/License/LICENCE.bluez-firmware b/scripts/config-common/License/LICENCE.bluez-firmware similarity index 100% rename from scripts/config/License/LICENCE.bluez-firmware rename to scripts/config-common/License/LICENCE.bluez-firmware diff --git a/scripts/config/License/LICENCE.broadcom b/scripts/config-common/License/LICENCE.broadcom similarity index 100% rename from scripts/config/License/LICENCE.broadcom rename to scripts/config-common/License/LICENCE.broadcom diff --git a/scripts/config/License/LICENCE.broadcom_bcm43xx b/scripts/config-common/License/LICENCE.broadcom_bcm43xx similarity index 100% rename from scripts/config/License/LICENCE.broadcom_bcm43xx rename to scripts/config-common/License/LICENCE.broadcom_bcm43xx diff --git a/scripts/config/License/LICENCE.pi-bluetooth b/scripts/config-common/License/LICENCE.pi-bluetooth similarity index 100% rename from scripts/config/License/LICENCE.pi-bluetooth rename to scripts/config-common/License/LICENCE.pi-bluetooth diff --git a/scripts/config/License/LICENCE.wireless-regdb b/scripts/config-common/License/LICENCE.wireless-regdb similarity index 100% rename from scripts/config/License/LICENCE.wireless-regdb rename to scripts/config-common/License/LICENCE.wireless-regdb diff --git a/scripts/config-quick/chroot.sh b/scripts/config-common/chroot.sh similarity index 100% rename from scripts/config-quick/chroot.sh rename to scripts/config-common/chroot.sh diff --git a/scripts/config-quick/config.txt b/scripts/config-common/config.txt similarity index 100% rename from scripts/config-quick/config.txt rename to scripts/config-common/config.txt diff --git a/scripts/config-common/hosts b/scripts/config-common/hosts new file mode 120000 index 0000000000000000000000000000000000000000..6f4bd482aad4935d48ae256e53c70c9cdd43b99d --- /dev/null +++ b/scripts/config-common/hosts @@ -0,0 +1 @@ +../config/hosts \ No newline at end of file diff --git a/scripts/config-quick/ifup-eth0 b/scripts/config-common/ifup-eth0 similarity index 100% rename from scripts/config-quick/ifup-eth0 rename to scripts/config-common/ifup-eth0 diff --git a/scripts/config/openEuler-20.03-LTS.repo b/scripts/config-common/openEuler-20.03-LTS.repo similarity index 100% rename from scripts/config/openEuler-20.03-LTS.repo rename to scripts/config-common/openEuler-20.03-LTS.repo diff --git a/scripts/config-quick/rpmlist b/scripts/config-common/rpmlist similarity index 71% rename from scripts/config-quick/rpmlist rename to scripts/config-common/rpmlist index 59f2fea6426d422f923698aa13b824c7ab19673a..e5e664bcd9e213aac3e163dbca1aa073f6d90975 100644 --- a/scripts/config-quick/rpmlist +++ b/scripts/config-common/rpmlist @@ -12,7 +12,4 @@ hostname ntp bluez pulseaudio-module-bluetooth -raspberrypi-kernel -raspberrypi-firmware -raspberrypi-bluetooth openEuler-repos \ No newline at end of file diff --git a/scripts/config-quick/hosts b/scripts/config-quick/hosts deleted file mode 120000 index 9318ace721c086b3a316198594f67a9166008b42..0000000000000000000000000000000000000000 --- a/scripts/config-quick/hosts +++ /dev/null @@ -1 +0,0 @@ -../config//hosts \ No newline at end of file diff --git a/scripts/config-quick/openEuler-20.09.repo b/scripts/config-quick/openEuler-20.09.repo deleted file mode 100644 index eec36e7543e0ba92e53ce5e2a964deb9fafef4be..0000000000000000000000000000000000000000 --- a/scripts/config-quick/openEuler-20.09.repo +++ /dev/null @@ -1,20 +0,0 @@ -#generic-repos is licensed under the Mulan PSL v2. -#You can use this software according to the terms and conditions of the Mulan PSL v2. -#You may obtain a copy of Mulan PSL v2 at: -# http://license.coscl.org.cn/MulanPSL2 -#THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR -#IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR -#PURPOSE. -#See the Mulan PSL v2 for more details. - -[MAINLINE] -name=MAINLINE -baseurl=http://119.3.219.20:82/openEuler:/Mainline/standard_aarch64/ -enabled=1 -gpgcheck=0 - -[EPOL] -name=EPOL -baseurl=http://119.3.219.20:82/openEuler:/Epol/standard_aarch64/ -enabled=1 -gpgcheck=0 diff --git a/scripts/config-quick/99-com.rules b/scripts/config/99-com.rules similarity index 100% rename from scripts/config-quick/99-com.rules rename to scripts/config/99-com.rules diff --git a/scripts/config-quick/LICENCE.raspberrypi-sys-mods b/scripts/config/LICENCE.raspberrypi-sys-mods similarity index 100% rename from scripts/config-quick/LICENCE.raspberrypi-sys-mods rename to scripts/config/LICENCE.raspberrypi-sys-mods diff --git a/scripts/config/chroot.sh b/scripts/config/chroot.sh index 954cf62c0570c5e6cc47f737ebb37643567326d3..405262a7e39ac8232cf261a5e9c67b5cf278bddf 100755 --- a/scripts/config/chroot.sh +++ b/scripts/config/chroot.sh @@ -1,5 +1,4 @@ #!/bin/bash -set -e systemctl enable sshd systemctl enable ntpd systemctl enable hciuart diff --git a/scripts/config/config.txt b/scripts/config/config.txt index 548f4accc250b9b572789ce14af9d47b4ee4466c..9a8ef128917d7577e52e4043631dda8389104955 100644 --- a/scripts/config/config.txt +++ b/scripts/config/config.txt @@ -1,65 +1,65 @@ -# For more options and information see -# http://rpf.io/configtxt -# Some settings may impact device functionality. See link above for details - -# uncomment if you get no picture on HDMI for a default "safe" mode -#hdmi_safe=1 - -# uncomment this if your display has a black border of unused pixels visible -# and your display can output without overscan -#disable_overscan=1 - -# uncomment the following to adjust overscan. Use positive numbers if console -# goes off screen, and negative if there is too much border -#overscan_left=16 -#overscan_right=16 -#overscan_top=16 -#overscan_bottom=16 - -# uncomment to force a console size. By default it will be display's size minus -# overscan. -#framebuffer_width=1280 -#framebuffer_height=720 - -# uncomment if hdmi display is not detected and composite is being output -#hdmi_force_hotplug=1 - -# uncomment to force a specific HDMI mode (this will force VGA) -#hdmi_group=1 -#hdmi_mode=1 - -# uncomment to force a HDMI mode rather than DVI. This can make audio work in -# DMT (computer monitor) modes -#hdmi_drive=2 - -# uncomment to increase signal to HDMI, if you have interference, blanking, or -# no display -#config_hdmi_boost=4 - -# uncomment for composite PAL -#sdtv_mode=2 - -#uncomment to overclock the arm. 700 MHz is the default. -#arm_freq=800 - -# Uncomment some or all of these to enable the optional hardware interfaces -#dtparam=i2c_arm=on -#dtparam=i2s=on -#dtparam=spi=on - -# Uncomment this to enable infrared communication. -#dtoverlay=gpio-ir,gpio_pin=17 -#dtoverlay=gpio-ir-tx,gpio_pin=18 - -# Additional overlays and parameters are documented /boot/overlays/README - -# Enable audio (loads snd_bcm2835) -dtparam=audio=on - -[pi4] -# Enable DRM VC4 V3D driver on top of the dispmanx display stack -dtoverlay=vc4-fkms-v3d -max_framebuffers=2 - -[all] -#dtoverlay=vc4-fkms-v3d +# For more options and information see +# http://rpf.io/configtxt +# Some settings may impact device functionality. See link above for details + +# uncomment if you get no picture on HDMI for a default "safe" mode +#hdmi_safe=1 + +# uncomment this if your display has a black border of unused pixels visible +# and your display can output without overscan +#disable_overscan=1 + +# uncomment the following to adjust overscan. Use positive numbers if console +# goes off screen, and negative if there is too much border +#overscan_left=16 +#overscan_right=16 +#overscan_top=16 +#overscan_bottom=16 + +# uncomment to force a console size. By default it will be display's size minus +# overscan. +#framebuffer_width=1280 +#framebuffer_height=720 + +# uncomment if hdmi display is not detected and composite is being output +#hdmi_force_hotplug=1 + +# uncomment to force a specific HDMI mode (this will force VGA) +#hdmi_group=1 +#hdmi_mode=1 + +# uncomment to force a HDMI mode rather than DVI. This can make audio work in +# DMT (computer monitor) modes +#hdmi_drive=2 + +# uncomment to increase signal to HDMI, if you have interference, blanking, or +# no display +#config_hdmi_boost=4 + +# uncomment for composite PAL +#sdtv_mode=2 + +#uncomment to overclock the arm. 700 MHz is the default. +#arm_freq=800 + +# Uncomment some or all of these to enable the optional hardware interfaces +#dtparam=i2c_arm=on +#dtparam=i2s=on +#dtparam=spi=on + +# Uncomment this to enable infrared communication. +#dtoverlay=gpio-ir,gpio_pin=17 +#dtoverlay=gpio-ir-tx,gpio_pin=18 + +# Additional overlays and parameters are documented /boot/overlays/README + +# Enable audio (loads snd_bcm2835) +dtparam=audio=on + +[pi4] +# Enable DRM VC4 V3D driver on top of the dispmanx display stack +dtoverlay=vc4-fkms-v3d +max_framebuffers=2 + +[all] +#dtoverlay=vc4-fkms-v3d diff --git a/scripts/config/rpmlist b/scripts/config/rpmlist index e5e664bcd9e213aac3e163dbca1aa073f6d90975..59f2fea6426d422f923698aa13b824c7ab19673a 100644 --- a/scripts/config/rpmlist +++ b/scripts/config/rpmlist @@ -12,4 +12,7 @@ hostname ntp bluez pulseaudio-module-bluetooth +raspberrypi-kernel +raspberrypi-firmware +raspberrypi-bluetooth openEuler-repos \ No newline at end of file