diff --git a/README.en.md b/README.en.md index 9aa869913ad5d83051002a2b7407d7bc7eb078dd..49ee80a751896c9027fb86cf5d472d14a4080310 100644 --- a/README.en.md +++ b/README.en.md @@ -64,50 +64,96 @@ For other architecture hardware, you can use [QEMU](https://www.qemu.org/) to bu Refer to [Script for building openEuler image for Raspberry Pi](documents/openEuler镜像的构建.md) for details. -#### Build on host +#### Quickly Build without kernel compilation(Recommended) -Build script: [build-img.sh](scripts/build-img.sh), which can be set 0/5/7 parameters. +Build images with packages of raspberrypi-kernel, raspberrypi-firmware, and raspberrypi-bluetooth. -1. Build with default parameters +Run the following command to build an image: - `sudo bash build-img.sh` +`sudo bash build-img-quick.sh -d DIR -r REPO -n IMAGE_NAME` -2. Build with custom parameters +The meaning of each parameter: - `sudo bash build-img.sh KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE --cores MAKE_CORES` +1. -d, --dir DIR - or + 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. - `sudo bash build-img.sh KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE` + After building the image, you can find the image in `DIR/raspi_output/img/` as shown in the script output. - The meaning of each parameter: +2. -r, --repo REPO_INFO - - 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. + 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: + + - 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"` -#### Build in a Docker container +3. -n, --name IMAGE_NAME -Build script: [build-img-docker.sh](scripts/build-img-docker.sh), which can be set 0/6/8 parameters. The script will automatically download a Docker image of openEuler and import it into the local system. The Docker image version is determined by the script's parameter: DOCKER_FILE. + 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`. -Caution, before running the script, you need to install Docker. +4. -h, --help + + Display help information. -1. Build with default parameters +#### Build with kernel compilation - `sudo bash build-img-docker.sh` +Here, we provide two approaches to build an image, which both include compiling kernel and downloading firmware files of Raspberry Pi. These approaches will take considerably longer. -2. Build with custom parameters +##### Build on host - `sudo bash build-img-docker.sh DOCKER_FILE KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE --cores MAKE_CORES` +Run the following command to build an image: - or +`sudo bash build-img.sh -n IMAGE_NAME -k KERNEL_URL -b KERNEL_BRANCH -c KERNEL_DEFCONFIG -r REPO --cores N` - `sudo bash build-img-docker.sh DOCKER_FILE KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE` +The meaning of each parameter: - In addition to the first parameter DOCKER_FILE, the other parameters are the same as the corresponding parameters in "Build on host": +1. -n, --name IMAGE_NAME - - 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. + 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`. + +2. -k, --kernel KERNEL_URL + + The URL of kernel source's repository, which defaults to `https://gitee.com/openeuler/raspberrypi-kernel.git`. + +3. -b, --branch KERNEL_BRANCH + + The branch name of kernel source's repository, which defaults to `master`. + +4. -c, --config KERNEL_DEFCONFIG + + The filename/path of configuration for compiling kernel, which defaults to `openeuler-raspi_defconfig`. If this parameter is the filename of configuration, please make sure the configuration file in arch/arm64/configs of the kernel source. + +5. -r, --repo REPO_INFO + + 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: + + - 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"` + +6. --cores N + + The number of parallel compilations, according to the actual number of CPU of the host running the script. The default is the number of processing units available. + +##### Build in a Docker container + +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` + +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. + +In addition to the parameter DOCKER_FILE, the other parameters are the same as the corresponding parameters in [Build on host](#Build-on-host): + +1. -d, --docker DOCKER_FILE + + The URL/path 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. diff --git a/README.md b/README.md index fb063d955f2e66f4b762cee9228649e59ada41e2..caf37eff7614d9ef581736bf8cc24a14735e65b3 100644 --- a/README.md +++ b/README.md @@ -66,50 +66,96 @@ openEuler 20.03 LTS 的内测版本镜像,[下载](https://isrc.iscas.ac.cn/eu 详细过程参见 [openEuler 镜像的构建](documents/openEuler镜像的构建.md)。 -#### 主机上构建 +#### 快速构建(无需编译内核,推荐) -构建脚本 [build-img.sh](scripts/build-img.sh),其后可设置 0/5/7 个参数。 +使用已有的树莓派内核、固件、蓝牙等 RPM 包构建镜像。 -1. 使用脚本默认参数构建 +构建镜像需执行命令: - `sudo bash build-img.sh` +`sudo bash build-img-quick.sh -d DIR -r REPO -n IMAGE_NAME` -2. 自行设置参数构建 +各个参数意义: - `sudo bash build-img.sh KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE --cores MAKE_CORES` +1. -d, --dir DIR - 或 + 构建镜像和临时文件的输出目录,默认为脚本所在目录。如果 `DIR` 不存在则会自动创建。 + + 脚本运行结束后,会提示镜像的存储位置,默认保存在 `DIR/raspi_output/img/` 下。 - `sudo bash build-img.sh KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE` +2. -r, --repo REPO_INFO - 其中,各个参数意义: + 开发源 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"` - - 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。 +3. -n, --name IMAGE_NAME + + 构建的镜像名称。 + + 例如,`openEuler-20.03-LTS.img`。默认为`openEuler-20.09-aarch64-raspi.img`,或者根据 `-r, --repo REPO_INFO` 参数自动生成。 -#### Docker 容器内构建 +4. -h, --help + + 显示帮助信息。 -构建脚本 [build-img-docker.sh](scripts/build-img-docker.sh),其后可设置 0/6/8 个参数。该脚本会自动下载 openEuler 的 Docker 镜像,并导入本机系统中,下载并导入的 Docker 镜像版本由该脚本参数 DOCKER_FILE 决定。 +#### 完全构建(包括编译内核) -注意!!!运行该脚本前,需安装 Docker 运行环境。 +包含编译内核、下载树莓派相关固件等过程,速度相对较慢。 -1. 使用脚本默认参数构建 +这里,提供两种构建方式。 - `sudo bash build-img-docker.sh` +##### 主机上构建 -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.sh -n IMAGE_NAME -k KERNEL_URL -b KERNEL_BRANCH -c KERNEL_DEFCONFIG -r REPO --cores N` - 或 +各个参数意义: - `sudo bash build-img-docker.sh DOCKER_FILE KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE` +1. -n, --name IMAGE_NAME + + 构建的镜像名称。 + + 例如,`openEuler-20.03-LTS.img`。默认为`openEuler-20.03-LTS-aarch64-raspi.img`,或者根据 `-r, --repo REPO_INFO` 参数自动生成。 - 其中,除第一个参数 DOCKER_FILE 外,剩余参数与`主机上构建`中对应参数一致: +2. -k, --kernel KERNEL_URL + + 内核源码仓库的项目地址,默认为 `https://gitee.com/openeuler/raspberrypi-kernel.git`。 - - 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 镜像。 +3. -b, --branch KERNEL_BRANCH + + 内核源码的对应分支,默认为 `master`。 + +4. -c, --config KERNEL_DEFCONFIG + + 内核编译使用的配置文件名称或路径,默认为 `openeuler-raspi_defconfig`。如果该参数为配置文件名称,请确保该文件在内核源码的目录 arch/arm64/configs 下。 + +5. -r, --repo REPO_INFO + + 开发源 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"` + +6. --cores N + + 并行编译的数量,根据运行脚本的宿主机 CPU 实际数目设定,默认为可用的 CPU 总数。 + +##### Docker 容器内构建 + +构建镜像需执行命令: + +`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` + +注意!!!运行该脚本前,需安装 Docker 运行环境。该脚本会自动将 DOCKER_FILE 参数对应的 Docker 镜像导入本机系统中。 + +除参数 DOCKER_FILE 外,剩余参数与[主机上构建](#主机上构建)中对应参数一致: + +1. -d, --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 镜像,并导入本机系统中。 \ No newline at end of file diff --git a/scripts/build-img-docker.sh b/scripts/build-img-docker.sh index 7f9b0a72a566738fbdf14caf18bb584560aa8536..d77ccd88fd3e1dc8cd236502ea6ef282be0b76f6 100644 --- a/scripts/build-img-docker.sh +++ b/scripts/build-img-docker.sh @@ -2,58 +2,95 @@ set -e -cur_dir=$(cd $(dirname $0);pwd) -cd "${cur_dir}" - -if [[ $# -ne 0 && $# -ne 6 && $# -ne 8 ]]; then - echo Error: params length: $# is not 0/6/8. - echo Example1: bash $0 - echo Example2: bash $0 DOCKER_FILE KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE --cores MAKE_CORES - echo Example3: bash $0 DOCKER_FILE KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE - exit 1 -fi +__usage=" +Usage: build-img-docker [OPTIONS] +Build raspberrypi image. -docker_file="https://repo.openeuler.org/openEuler-20.03-LTS/docker_img/aarch64/openEuler-docker.aarch64.tar.xz" -kernel_url="https://gitee.com/openeuler/raspberrypi-kernel.git" -kernel_branch="master" -kernel_defconfig="openeuler-raspi_defconfig" -default_defconfig="openeuler-raspi_defconfig" -repo_file=openEuler-20.03-LTS.repo - -make_cores=18 -if [[ $# -eq 6 || $# -eq 8 ]]; then - if [[ $1 != "" ]]; then - docker_file=$1 - fi - if [[ $2 != "" ]]; then - kernel_url=$2 - fi - if [[ $3 != "" ]]; then - kernel_branch=$3 - fi - if [[ $4 != "" ]]; then - kernel_defconfig=$4 - fi - if [[ $5 != "" ]]; then - default_defconfig=$5 - fi - if [[ $6 != "" ]]; then - repo_file=$6 - fi -fi -if [[ $# -eq 8 && $7 == "--cores" && $8 -ne 0 ]]; then - make_cores=$8 -fi +Options: + -d, --docker DOCKER_FILE The URL/path of the Docker image, which defaults to https://repo.openeuler.org/openEuler-20.03-LTS/docker_img/aarch64/openEuler-docker.aarch64.tar.xz. + -n, --name IMAGE_NAME The raspberrypi image name to be built. + -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. + --cores N The number of cpu cores to be used during making. + -h, --help Show command help. +" -buildid=$(date +%Y%m%d%H%M%S) -builddate=${buildid:0:8} +help() +{ + echo "$__usage" + exit $1 +} -if [ ! -d ${cur_dir}/log ]; then - mkdir ${cur_dir}/log -fi -if [ ! -d ${cur_dir}/tmp ]; then - mkdir ${cur_dir}/tmp -fi +parseargs() +{ + while [ "x$#" != "x0" ]; + do + if [ "x$1" == "x-h" -o "x$1" == "x--help" ]; then + return 1 + elif [ "x$1" == "x" ]; then + shift + elif [ "x$1" == "x-d" -o "x$1" == "x--docker" ]; then + docker_file=`echo $2` + shift + shift + elif [ "x$1" == "x-n" -o "x$1" == "x--name" ]; then + img_name=`echo $2` + params="${params} -n ${img_name}" + shift + shift + elif [ "x$1" == "x-k" -o "x$1" == "x--kernel" ]; then + kernel_url=`echo $2` + params="${params} -k ${kernel_url}" + shift + shift + elif [ "x$1" == "x-b" -o "x$1" == "x--branch" ]; then + kernel_branch=`echo $2` + params="${params} -b ${kernel_branch}" + shift + shift + elif [ "x$1" == "x-c" -o "x$1" == "x--config" ]; then + default_defconfig=`echo $2` + if [ "x$default_defconfig" != "x" ]; then + if [ ! -f $default_defconfig ]; then + echo `date` - ERROR, config file $default_defconfig can not be found. + exit 2 + else + cp $default_defconfig ${cur_dir}/params/ + defconfig_name=${default_defconfig##*/} + default_defconfig=/work/params/${defconfig_name} + fi + fi + params="${params} -c ${default_defconfig}" + shift + shift + elif [ "x$1" == "x-r" -o "x$1" == "x--repo" ]; then + repo_file=`echo $2` + if [ "x$repo_file" != "x" -a "x${repo_file:0:4}" != "xhttp" ]; then + if [ ! -f $repo_file ]; then + echo `date` - ERROR, repo file $repo_file can not be found. + exit 2 + else + cp $repo_file ${cur_dir}/params/ + repo_file_name=${repo_file##*/} + repo_file=/work/params/${repo_file_name} + fi + fi + params="${params} -r ${repo_file}" + shift + shift + elif [ "x$1" == "x--cores" ]; then + make_cores=`echo $2` + params="${params} --cores ${make_cores}" + shift + shift + else + echo `date` - ERROR, UNKNOWN params "$@" + return 2 + fi + done +} ERROR(){ echo `date` - ERROR, $* | tee -a ${cur_dir}/log/log_${builddate}.log @@ -63,21 +100,45 @@ LOG(){ echo `date` - INFO, $* | tee -a ${cur_dir}/log/log_${builddate}.log } -docker_file_name=${docker_file##*/} -if [ "${docker_file:0:4}" = "http" ]; then - if [ ! -f ${cur_dir}/tmp/${docker_file_name} ]; then - wget ${docker_file} -P ${cur_dir}/tmp/ - fi +cur_dir=$(cd $(dirname $0);pwd) + +docker_file="https://repo.openeuler.org/openEuler-20.03-LTS/docker_img/aarch64/openEuler-docker.aarch64.tar.xz" + +if [ -d ${cur_dir}/tmp ]; then + rm -rf ${cur_dir}/tmp +fi +mkdir ${cur_dir}/tmp + +if [ -d ${cur_dir}/params ]; then + rm -rf ${cur_dir}/params +fi +mkdir ${cur_dir}/params + +parseargs "$@" || help $? + +if [ "x${docker_file:0:4}" == "xhttp" ]; then + wget ${docker_file} -P ${cur_dir}/tmp/ +elif [ -f $docker_file ]; then + cp ${docker_file} ${cur_dir}/tmp/ else - cp ${cur_dir}/config/${docker_file} ${cur_dir}/tmp/ + echo `date` - ERROR, docker file $docker_file can not be found. + exit 2 +fi + +buildid=$(date +%Y%m%d%H%M%S) +builddate=${buildid:0:8} + +if [ ! -d ${cur_dir}/log ]; then + mkdir ${cur_dir}/log fi + +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 config/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} $kernel_url $kernel_branch $kernel_defconfig $default_defconfig $repo_file --cores $make_cores -docker run --rm --privileged=true -v ${cur_dir}:/work ${docker_img_name}-${buildid} $kernel_url $kernel_branch $kernel_defconfig $default_defconfig $repo_file --cores $make_cores - +(echo "FROM $docker_img_name" && grep -v FROM ${cur_dir}/config/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 docker image rm ${docker_img_name}-${buildid} echo diff --git a/scripts/build-img-quick.sh b/scripts/build-img-quick.sh new file mode 100644 index 0000000000000000000000000000000000000000..5e95c3a203ba9eb5b1e5d883a4e6b4317a3a536f --- /dev/null +++ b/scripts/build-img-quick.sh @@ -0,0 +1,355 @@ +#!/bin/bash + +set -e + +__usage=" +Usage: build-img-quick [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. + -n, --name IMAGE_NAME The raspberrypi image name to be built. + -h, --help Show command help. +" + +help() +{ + echo "$__usage" + exit $1 +} + +parseargs() +{ + while [ "x$#" != "x0" ]; + do + if [ "x$1" == "x-h" -o "x$1" == "x--help" ]; then + return 1 + elif [ "x$1" == "x" ]; then + shift + elif [ "x$1" == "x-r" -o "x$1" == "x--repo" ]; then + repo_file=`echo $2` + shift + shift + elif [ "x$1" == "x-n" -o "x$1" == "x--name" ]; then + img_name=`echo $2` + shift + shift + elif [ "x$1" == "x-d" -o "x$1" == "x--dir" ]; then + workdir=`echo $2` + shift + shift + else + echo `date` - ERROR, UNKNOWN params "$@" + return 2 + fi + done +} + +ERROR(){ + echo `date` - ERROR, $* | tee -a ${log_dir}/${builddate}.log +} + +LOG(){ + echo `date` - INFO, $* | tee -a ${log_dir}/${builddate}.log +} + +prepare(){ + if [ ! -d ${tmp_dir} ]; then + mkdir -p ${tmp_dir} + else + rm -rf ${tmp_dir}/* + fi + if [ "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##*/} + repo_file=${tmp_dir}/${repo_file_name} + else + repo_file_name=tmp.repo + repo_file_tmp=${tmp_dir}/${repo_file_name} + index=1 + for baseurl in ${repo_file// / } + do + echo [repo${index}] >> ${repo_file_tmp} + echo name=repo${index} to build raspi image >> ${repo_file_tmp} + echo baseurl=${baseurl} >> ${repo_file_tmp} + echo enabled=1 >> ${repo_file_tmp} + echo gpgcheck=0 >> ${repo_file_tmp} + echo >> ${repo_file_tmp} + index=$(($index+1)) + done + 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 + else + cp $repo_file ${tmp_dir}/ + repo_file_name=${repo_file##*/} + repo_file=${tmp_dir}/${repo_file_name} + fi + fi + + repo_suffix=${repo_file_name%.*} + if [ "x$img_name" == "x" ]; then + if [[ "${repo_suffix}" =~ ^${OS_NAME}.* ]]; then + img_name=${repo_suffix} + else + img_name=${OS_NAME} + fi + img_name=${img_name}-aarch64-raspi.img + else + if [ "x${img_name:0-4}" != "x.img" ]; then + img_name=${img_name}.img + fi + fi + img_file=${img_dir}/${img_name} + + if [ ! -d ${log_dir} ]; then + mkdir -p ${log_dir} + fi + LOG "prepare begin..." + # dnf makecache + # dnf install -y dnf-plugins-core tar parted dosfstools + + if [ -d ${rootfs_dir} ]; then + rm -rf ${rootfs_dir} + fi + if [ ! -d ${img_dir} ]; then + mkdir -p ${img_dir} + fi + + repo_info_names=`cat ${repo_file} | grep "^\["` + repo_baseurls=`cat ${repo_file} | grep "^baseurl="` + index=1 + for repo_name in ${repo_info_names} + do + repo_name_list[$index]=${repo_name:1:-1} + index=$((index+1)) + done + index=1 + for baseurl in ${repo_baseurls} + do + repo_info="${repo_info} --repofrompath ${repo_name_list[$index]}-tmp,${baseurl:8}" + index=$((index+1)) + done + set +e + os_release_name=${OS_NAME}-release + # yumdownloader --downloaddir=${tmp_dir} ${os_release_name} -c ${repo_file} + dnf ${repo_info} --disablerepo="*" --downloaddir=${tmp_dir}/ download ${os_release_name} + if [ $? != 0 ]; then + ERROR "Fail to download ${os_release_name}!" + exit 2 + fi + os_release_name=`ls -r ${tmp_dir}/${os_release_name}*.rpm 2>/dev/null| head -n 1` + if [ -z "${os_release_name}" ]; then + ERROR "${os_release_name} can not be found!" + exit 2 + fi + set -e + LOG "prepare end." +} + +make_rootfs(){ + LOG "make rootfs for ${repo_file} begin..." + if [[ -d ${rootfs_dir} ]]; then + if [[ -d ${rootfs_dir}/dev && `ls ${rootfs_dir}/dev | wc -l` -gt 1 ]]; then + umount -l ${rootfs_dir}/dev + fi + if [[ -d ${rootfs_dir}/proc && `ls ${rootfs_dir}/proc | wc -l` -gt 0 ]]; then + umount -l ${rootfs_dir}/proc + fi + if [[ -d ${rootfs_dir}/sys && `ls ${rootfs_dir}/sys | wc -l` -gt 0 ]]; then + umount -l ${rootfs_dir}/sys + fi + rm -rf ${rootfs_dir} + fi + mkdir -p ${rootfs_dir} + mkdir -p ${rootfs_dir}/var/lib/rpm + rpm --root ${rootfs_dir} --initdb + rpm -ivh --nodeps --root ${rootfs_dir}/ ${os_release_name} + mkdir -p ${rootfs_dir}/etc/rpm + chmod a+rX ${rootfs_dir}/etc/rpm + echo "%_install_langs en_US" > ${rootfs_dir}/etc/rpm/macros.image-language-conf + if [[ ! -d ${rootfs_dir}/etc/yum.repos.d ]]; then + mkdir -p ${rootfs_dir}/etc/yum.repos.d + fi + cp ${repo_file} ${rootfs_dir}/etc/yum.repos.d/tmp.repo + # dnf --installroot=${rootfs_dir}/ install dnf --nogpgcheck -y # --repofrompath=tmp,${rootfs_dir}/etc/yum.repos.d/tmp.repo --disablerepo="*" + dnf --installroot=${rootfs_dir}/ makecache + # dnf --installroot=${rootfs_dir}/ install -y alsa-utils wpa_supplicant vim net-tools iproute iputils NetworkManager openssh-server passwd hostname ntp bluez pulseaudio-module-bluetooth + # dnf --installroot=${rootfs_dir}/ install -y raspberrypi-kernel raspberrypi-firmware openEuler-repos + set +e + for item in $(cat $CONFIG_RPM_LIST) + do + dnf --installroot=${rootfs_dir}/ install -y $item + if [ $? == 0 ]; then + LOG install $item. + else + ERROR can not install $item. + fi + done + cat ${rootfs_dir}/etc/ntp.conf | grep "^server*" + if [ $? -ne 0 ]; then + echo -e "\nserver 0.cn.pool.ntp.org\nserver 1.asia.pool.ntp.org\nserver 2.asia.pool.ntp.org\nserver 127.0.0.1">>${rootfs_dir}/etc/ntp.conf + fi + cat ${rootfs_dir}/etc/ntp.conf | grep "^fudge*" + if [ $? -ne 0 ]; then + echo -e "\nfudge 127.0.0.1 stratum 10">>${rootfs_dir}/etc/ntp.conf + fi + set -e + cp ${euler_dir}/hosts ${rootfs_dir}/etc/hosts + if [ ! -d $rootfs_dir/etc/sysconfig/network-scripts ]; then + mkdir -p $rootfs_dir/etc/sysconfig/network-scripts + fi + cp ${euler_dir}/ifup-eth0 $rootfs_dir/etc/sysconfig/network-scripts/ifup-eth0 + mkdir -p ${rootfs_dir}/usr/bin ${rootfs_dir}/lib/udev/rules.d ${rootfs_dir}/lib/systemd/system + cp ${euler_dir}/*.rules ${rootfs_dir}/lib/udev/rules.d/ + cp ${euler_dir}/chroot.sh ${rootfs_dir}/chroot.sh + chmod +x ${rootfs_dir}/chroot.sh + mount --bind /dev ${rootfs_dir}/dev + mount -t proc /proc ${rootfs_dir}/proc + mount -t sysfs /sys ${rootfs_dir}/sys + chroot ${rootfs_dir} /bin/bash -c "echo 'Y' | /chroot.sh" + umount -l ${rootfs_dir}/dev + umount -l ${rootfs_dir}/proc + umount -l ${rootfs_dir}/sys + rm ${rootfs_dir}/etc/yum.repos.d/tmp.repo + rm ${rootfs_dir}/chroot.sh + LOG "make rootfs for ${repo_file} end." +} + +make_img(){ + LOG "make ${img_file} begin..." + size=`du -sh --block-size=1MiB ${rootfs_dir} | cut -f 1 | xargs` + size=$(($size+1100)) + losetup -D + dd if=/dev/zero of=${img_file} bs=1MiB count=$size && sync + parted ${img_file} mklabel msdos mkpart primary fat32 8192s 593919s + parted ${img_file} -s set 1 boot + parted ${img_file} mkpart primary linux-swap 593920s 1593343s + parted ${img_file} mkpart primary ext4 1593344s 100% + device=`losetup -f --show -P ${img_file}` + LOG "after losetup: ${device}" + LOG "image ${img_file} created and mounted as ${device}" + # loopX=`kpartx -va ${device} | sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1` + # LOG "after kpartx: ${loopX}" + kpartx -va ${device} + loopX=${device##*\/} + partprobe ${device} + bootp=/dev/mapper/${loopX}p1 + swapp=/dev/mapper/${loopX}p2 + rootp=/dev/mapper/${loopX}p3 + LOG "bootp: " ${bootp} "rootp: " ${rootp} + mkfs.vfat -n boot ${bootp} + mkswap ${swapp} + mkfs.ext4 ${rootp} + set +e + if [ -d ${root_mnt} ]; then + df -lh | grep ${root_mnt} + if [ $? -eq 0 ]; then + umount ${root_mnt} + fi + rm -rf ${root_mnt} + fi + if [ -d ${boot_mnt} ]; then + df -lh | grep ${boot_mnt} + if [ $? -eq 0 ]; then + umount ${boot_mnt} + fi + rm -rf ${boot_mnt} + fi + set -e + mkdir -p ${root_mnt} ${boot_mnt} + mount -t vfat -o uid=root,gid=root,umask=0000 ${bootp} ${boot_mnt} + mount -t ext4 ${rootp} ${root_mnt} + fstab_array=("" "" "" "") + for line in `blkid | grep /dev/mapper/${loopX}p` + do + uuid=${line#*UUID=\"} + fstab_array[${line:18:1}]=${uuid%%\"*} + done + echo "UUID=${fstab_array[3]} / ext4 defaults,noatime 0 0" > ${rootfs_dir}/etc/fstab + echo "UUID=${fstab_array[1]} /boot vfat defaults,noatime 0 0" >> ${rootfs_dir}/etc/fstab + echo "UUID=${fstab_array[2]} swap swap defaults,noatime 0 0" >> ${rootfs_dir}/etc/fstab + + cp -a ${rootfs_dir}/boot/* ${boot_mnt}/ + cp ${euler_dir}/config.txt ${boot_mnt}/ + echo "console=serial0,115200 console=tty1 root=/dev/mmcblk0p3 rootfstype=ext4 elevator=deadline rootwait" > ${boot_mnt}/cmdline.txt + + if [ -f ${tmp_dir}/rootfs.tar ]; then + rm ${tmp_dir}/rootfs.tar + fi + pushd ${rootfs_dir} + rm -rf boot + tar cpf ${tmp_dir}/rootfs.tar . + popd + pushd ${root_mnt} + tar xpf ${tmp_dir}/rootfs.tar -C . + popd + sync + sleep 10 + umount ${root_mnt} + umount ${boot_mnt} + + kpartx -d ${device} + losetup -d ${device} + + rm ${tmp_dir}/rootfs.tar + rm -rf ${rootfs_dir} + losetup -D + pushd ${img_dir} + if [ -f ${img_file} ]; then + sha256sum $(basename ${img_file}) > ${img_file}.sha256sum + xz -T 20 -z -c ${img_file} > ${img_file}.xz + sha256sum $(basename ${img_file}.xz) > ${img_file}.xz.sha256sum + LOG "made sum files for ${img_file}" + fi + popd + LOG "write ${img_file} done." + LOG "make ${img_file} end." +} + +if [ "$EUID" -ne 0 ]; then + echo `date` - ERROR, Please run as root! + exit +fi + +workdir=$(cd $(dirname $0);pwd) + +parseargs "$@" || help $? + +if [ "x$workdir" == "x" ] ; then + echo `date` - ERROR, \"-d DIR or --dir DIR\" missing. + help 2 +elif [ ! -d ${workdir} ] ; then + echo `date` - INFO, output dir ${workdir} does not exists. + mkdir -p ${workdir} + echo `date` - INFO, output dir: ${workdir} created. +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 +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 +CONFIG_RPM_LIST=${euler_dir}/rpmlist + + +builddate=$(date +%Y%m%d) + +prepare +IFS=$'\n' +make_rootfs +make_img \ No newline at end of file diff --git a/scripts/build-img.sh b/scripts/build-img.sh index dd85f2b9840ae801d64869a52d1c7f7ab7f01f61..b9b55c2ab26a40616958859337deca78d5bc2731 100644 --- a/scripts/build-img.sh +++ b/scripts/build-img.sh @@ -1,55 +1,64 @@ #!/bin/bash set -e -if [[ $# -ne 0 && $# -ne 5 && $# -ne 7 ]]; then - echo "params length: $# is not 0/5/7." - echo Example1: bash $0 - echo Example2: bash $0 KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE --cores MAKE_CORES - echo Example3: bash $0 KERNEL_URL KERNEL_BRANCH KERNEL_DEFCONFIG DEFAULT_DEFCONFIG REPO_FILE - exit 1 -fi -cur_dir=$(cd $(dirname $0);pwd) -run_dir=${cur_dir} -kernel_url="https://gitee.com/openeuler/raspberrypi-kernel.git" -kernel_branch="master" -kernel_defconfig="openeuler-raspi_defconfig" -default_defconfig="openeuler-raspi_defconfig" -repo_file=openEuler-20.03-LTS.repo +__usage=" +Usage: build-img [OPTIONS] +Build raspberrypi image. -buildid=$(date +%Y%m%d%H%M%S) -builddate=${buildid:0:8} -output_dir=${run_dir}/output -rootfs_dir=${run_dir}/rootfs_${builddate} -root_mnt=${run_dir}/root -boot_mnt=${run_dir}/boot -make_cores=18 -if [[ $# -eq 5 || $# -eq 7 ]]; then - if [[ $1 != "" ]]; then - kernel_url=$1 - fi - if [[ $2 != "" ]]; then - kernel_branch=$2 - fi - if [[ $3 != "" ]]; then - kernel_defconfig=$3 - fi - if [[ $4 != "" ]]; then - default_defconfig=$4 - fi - if [[ $5 != "" ]]; then - repo_file=$5 - fi -fi -if [[ $# -eq 7 && $6 == "--cores" && $7 -ne 0 ]]; then - make_cores=$7 -fi -kernel_name=${kernel_url##*/} -kernel_name=${kernel_name%.*} -repo_file_name=${repo_file##*/} -img_suffix=${repo_file_name%%-*} -img_suffix=`echo $img_suffix | grep -Eo "^[a-zA-Z ]*"` -os_release_name=${img_suffix}-release -img_file=${run_dir}/img/${builddate}/${repo_file_name%.*}-aarch64-raspi-${buildid}.img +Options: + -n, --name IMAGE_NAME The raspberrypi image name to be built. + -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. + --cores N The number of cpu cores to be used during making. + -h, --help Show command help. +" + +help() +{ + echo "$__usage" + exit $1 +} + +parseargs() +{ + while [ "x$#" != "x0" ]; + do + if [ "x$1" == "x-h" -o "x$1" == "x--help" ]; then + return 1 + elif [ "x$1" == "x" ]; then + shift + elif [ "x$1" == "x-n" -o "x$1" == "x--name" ]; then + img_name=`echo $2` + shift + shift + elif [ "x$1" == "x-k" -o "x$1" == "x--kernel" ]; then + kernel_url=`echo $2` + shift + shift + elif [ "x$1" == "x-b" -o "x$1" == "x--branch" ]; then + kernel_branch=`echo $2` + shift + shift + elif [ "x$1" == "x-c" -o "x$1" == "x--config" ]; then + default_defconfig=`echo $2` + shift + shift + elif [ "x$1" == "x-r" -o "x$1" == "x--repo" ]; then + repo_file=`echo $2` + shift + shift + elif [ "x$1" == "x--cores" ]; then + make_cores=`echo $2` + shift + shift + else + echo `date` - ERROR, UNKNOWN params "$@" + return 2 + fi + done +} ERROR(){ echo `date` - ERROR, $* | tee -a ${cur_dir}/log/log_${builddate}.log @@ -60,6 +69,75 @@ LOG(){ } prepare(){ + if [ ! -d ${tmp_dir} ]; then + mkdir -p ${tmp_dir} + else + rm -rf ${tmp_dir}/* + fi + + kernel_name=${kernel_url##*/} + kernel_name=${kernel_name%.*} + + if [ "x$default_defconfig" == "x" ] ; then + default_defconfig=$kernel_defconfig + elif [ -f $default_defconfig ]; then + cp $default_defconfig ${tmp_dir}/ + kernel_defconfig=${tmp_dir}/${default_defconfig##*/} + else + 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:0-5}" == "x.repo" ]; then + wget ${repo_file} -P ${tmp_dir}/ + repo_file_name=${repo_file##*/} + repo_file=${tmp_dir}/${repo_file_name} + else + repo_file_name=tmp.repo + repo_file_tmp=${tmp_dir}/${repo_file_name} + index=1 + for baseurl in ${repo_file// / } + do + echo [repo${index}] >> ${repo_file_tmp} + echo name=repo${index} to build raspi image >> ${repo_file_tmp} + echo baseurl=${baseurl} >> ${repo_file_tmp} + echo enabled=1 >> ${repo_file_tmp} + echo gpgcheck=0 >> ${repo_file_tmp} + echo >> ${repo_file_tmp} + index=$(($index+1)) + done + 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 + else + cp $repo_file ${tmp_dir}/ + repo_file_name=${repo_file##*/} + repo_file=${tmp_dir}/${repo_file_name} + fi + fi + + repo_suffix=${repo_file_name%.*} + if [ "x$img_name" == "x" ]; then + if [[ "${repo_suffix}" =~ ^${OS_NAME}.* ]]; then + img_name=${repo_suffix} + else + img_name=${OS_NAME} + fi + img_name=${img_name}-aarch64-raspi-${buildid}.img + else + if [ "x${img_name:0-4}" != "x.img" ]; then + img_name=${img_name}.img + fi + fi + img_file=${run_dir}/img/${builddate}/${img_name} + if [ ! -d ${cur_dir}/log ]; then mkdir ${cur_dir}/log fi @@ -71,40 +149,45 @@ prepare(){ do rpm -qa | grep ${rmp_names[i]} &> /dev/null [ $? -eq 0 ] || yum install -y ${rmp_install_names[i]} &> /dev/null - [ $? -ne 0 ] && echo "yum install ${rmp_install_names[i]} failed." && ERROR "yum install ${rmp_install_names[i]} failed." && yum_right=3 + [ $? -ne 0 ] && ERROR "yum install ${rmp_install_names[i]} failed." && yum_right=3 done [ $yum_right ] && exit 3 if [ ! -d ${run_dir}/img ]; then mkdir ${run_dir}/img fi - if [ ! -d ${cur_dir}/tmp ]; then - mkdir ${cur_dir}/tmp - fi - if [ "${repo_file:0:4}" = "http" ]; then - # rpm_url=`wget -q -O - ${repo_file} | grep "^baseurl=" | cut -d '=' -f 2 | xargs` - rm -f ${cur_dir}/tmp/*.repo - wget ${repo_file} -P ${cur_dir}/tmp/ - else - # rpm_url=`cat ${repo_file} | grep "^baseurl=" | grep "everything" | cut -d '=' -f 2 | xargs` - cp ${cur_dir}/config/${repo_file} ${cur_dir}/tmp/${repo_file_name} + repo_info_names=`cat ${repo_file} | grep "^\["` + repo_baseurls=`cat ${repo_file} | grep "^baseurl="` + index=1 + for repo_name in ${repo_info_names} + do + repo_name_list[$index]=${repo_name:1:-1} + index=$((index+1)) + done + index=1 + for baseurl in ${repo_baseurls} + do + repo_info="${repo_info} --repofrompath ${repo_name_list[$index]}-tmp,${baseurl:8}" + index=$((index+1)) + done + set +e + os_release_name=${OS_NAME}-release + # yumdownloader --downloaddir=${tmp_dir} ${os_release_name} -c ${repo_file} + dnf ${repo_info} --disablerepo="*" --downloaddir=${tmp_dir}/ download ${os_release_name} + if [ $? != 0 ]; then + ERROR "Fail to download ${os_release_name}!" + exit 2 fi - if [ $? -ne 0 ]; then - ERROR ${repo_file} not found. - exit 1 - else - yumdownloader --downloaddir=${cur_dir}/tmp/ $os_release_name -c ${cur_dir}/tmp/${repo_file_name} - os_release_name=`ls -r ${cur_dir}/tmp/${os_release_name}*.rpm | head -n 1` - if [ -z "${os_release_name}" ]; then - ERROR "Fail to download ${os_release_name}!" - exit 1 - fi + os_release_name=`ls -r ${tmp_dir}/${os_release_name}*.rpm 2>/dev/null| head -n 1` + if [ -z "${os_release_name}" ]; then + ERROR "${os_release_name} can not be found!" + exit 2 fi - rm -f ${cur_dir}/tmp/*.rules - wget https://raw.githubusercontent.com/RPi-Distro/raspberrypi-sys-mods/master/etc.armhf/udev/rules.d/99-com.rules -P ${cur_dir}/tmp/ - rm -f ${cur_dir}/tmp/regulatory.db* - wget https://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git/tree/regulatory.db.p7s -P ${cur_dir}/tmp/ - wget https://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git/tree/regulatory.db -P ${cur_dir}/tmp/ + set -e + + wget https://raw.githubusercontent.com/RPi-Distro/raspberrypi-sys-mods/master/etc.armhf/udev/rules.d/99-com.rules -P ${tmp_dir}/ + wget https://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git/tree/regulatory.db.p7s -P ${tmp_dir}/ + wget https://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git/tree/regulatory.db -P ${tmp_dir}/ if [ ! -d ${run_dir}/img/${builddate} ]; then mkdir -p ${run_dir}/img/${builddate} fi @@ -174,41 +257,26 @@ update_firmware_app(){ } make_kernel(){ - LOG "make kernel begin..." + LOG "make kernel(${default_defconfig}) begin..." kernel_dir_tmp=$1 cd "${kernel_dir_tmp}" - if [[ ${kernel_defconfig} != "" ]]; then - if [[ -f ${cur_dir}/config/${kernel_defconfig} ]]; then - cur_config=${cur_dir}/config/${kernel_defconfig} - elif [[ -f arch/arm64/configs/${kernel_defconfig} ]]; then - cur_config=arch/arm64/configs/${kernel_defconfig} - else - ERROR "kernel config: ${kernel_defconfig} not found." - exit 1 + if [ "x${kernel_defconfig:0:1}" != "x/" ]; then + if [ ! -f arch/arm64/configs/${kernel_defconfig} ]; then + ERROR "config file ${kernel_defconfig} can not be found in kernel source". + exit 2 fi - elif [[ -f arch/arm64/configs/${default_defconfig} ]]; then - cur_config=arch/arm64/configs/${default_defconfig} - kernel_defconfig=${default_defconfig} - else - ERROR "kernel config: ${default_defconfig} not found." - exit 1 - fi - # make ARCH=arm64 ${kernel_defconfig} - # if [[ $? -eq 0 ]]; then - # #### - # else - # ERROR "make ARCH=arm64 ${kernel_defconfig} failed!" - # exit 1 - # fi - kernel_commitid=$(git rev-parse HEAD) - output_dir=${output_dir}/${kernel_commitid} - if [ -f ${output_dir}/.${kernel_defconfig}.DONE ] ; then - echo This kernel has already been built successfully before. Use the last built kernel image. - return 0 + kernel_commitid=$(git rev-parse HEAD) + output_dir=${output_dir}/${kernel_commitid} + if [ -f ${output_dir}/.${kernel_defconfig}.DONE ] ; then + LOG This kernel has already been built successfully before. Use the last built kernel image. + return 0 + fi + kernel_defconfig=arch/arm64/configs/${kernel_defconfig} fi find ${output_dir}/ -mindepth 1 -maxdepth 1 -print0 | xargs -0 rm -rf make distclean - cp ${cur_config} .config + cp ${kernel_defconfig} .config + kernel_defconfig=${kernel_defconfig##*/} make ARCH=arm64 -j${make_cores} if [[ $? -eq 0 ]]; then mkdir -p ${output_dir} @@ -228,7 +296,7 @@ make_kernel(){ exit 1 fi touch ${output_dir}/.${kernel_defconfig}.DONE - LOG "make kernel end." + LOG "make kernel(${default_defconfig}) end." } update_kernel(){ @@ -291,8 +359,6 @@ update_kernel(){ branch=${branch##*\ } if [[ ${branch} = "remotes/origin/${kernel_branch}" ]]; then git checkout remotes/origin/${kernel_branch} - # git config --global user.name "yafen" - # git config --global user.email "yafen@iscas.ac.cn" git checkout -b ${kernel_branch} LOG "git checkout -b ${kernel_branch} done." exist_branch=1 @@ -345,14 +411,26 @@ make_rootfs(){ mkdir -p ${rootfs_dir}/var/lib/rpm rpm --root ${rootfs_dir} --initdb rpm -ivh --nodeps --root ${rootfs_dir}/ ${os_release_name} + mkdir -p ${rootfs_dir}/etc/rpm + chmod a+rX ${rootfs_dir}/etc/rpm + echo "%_install_langs en_US" > ${rootfs_dir}/etc/rpm/macros.image-language-conf if [[ ! -d ${rootfs_dir}/etc/yum.repos.d ]]; then mkdir -p ${rootfs_dir}/etc/yum.repos.d fi - cp ${cur_dir}/tmp/*.repo $rootfs_dir/etc/yum.repos.d/ - dnf --installroot=${rootfs_dir}/ install dnf --nogpgcheck -y #--repofrompath=${repo_file_name},${rootfs_dir}/etc/yum.repos.d/${repo_file_name} - dnf --installroot=${rootfs_dir}/ makecache - dnf --installroot=${rootfs_dir}/ install -y alsa-utils wpa_supplicant vim net-tools iproute iputils NetworkManager openssh-server passwd hostname ntp bluez pulseaudio-module-bluetooth + cp ${repo_file} ${rootfs_dir}/etc/yum.repos.d/tmp.repo + # dnf --installroot=${rootfs_dir}/ install dnf --nogpgcheck -y #--repofrompath=${repo_file_name},${rootfs_dir}/etc/yum.repos.d/${repo_file_name} + # dnf --installroot=${rootfs_dir}/ makecache + # dnf --installroot=${rootfs_dir}/ install -y alsa-utils wpa_supplicant vim net-tools iproute iputils NetworkManager openssh-server passwd hostname ntp bluez pulseaudio-module-bluetooth set +e + for item in $(cat $CONFIG_RPM_LIST) + do + dnf --installroot=${rootfs_dir}/ install -y $item + if [ $? == 0 ]; then + LOG install $item. + else + ERROR can not install $item. + fi + done cat ${rootfs_dir}/etc/ntp.conf | grep "^server*" if [ $? -ne 0 ]; then echo -e "\nserver 0.cn.pool.ntp.org\nserver 1.asia.pool.ntp.org\nserver 2.asia.pool.ntp.org\nserver 127.0.0.1">>${rootfs_dir}/etc/ntp.conf @@ -362,25 +440,26 @@ make_rootfs(){ echo -e "\nfudge 127.0.0.1 stratum 10">>${rootfs_dir}/etc/ntp.conf fi set -e - cp ${cur_dir}/config/hosts ${rootfs_dir}/etc/hosts - # cp ${cur_dir}/config/resolv.conf $rootfs_dir/etc/resolv.conf + cp ${euler_dir}/hosts ${rootfs_dir}/etc/hosts if [ ! -d $rootfs_dir/etc/sysconfig/network-scripts ]; then mkdir -p $rootfs_dir/etc/sysconfig/network-scripts fi - cp ${cur_dir}/config/ifup-eth0 $rootfs_dir/etc/sysconfig/network-scripts/ifup-eth0 + cp ${euler_dir}/ifup-eth0 $rootfs_dir/etc/sysconfig/network-scripts/ifup-eth0 mkdir -p ${rootfs_dir}/lib/firmware ${rootfs_dir}/usr/bin ${rootfs_dir}/lib/udev/rules.d ${rootfs_dir}/lib/systemd/system cp bluez-firmware/broadcom/* ${rootfs_dir}/lib/firmware/ cp -r firmware-nonfree/brcm/ ${rootfs_dir}/lib/firmware/ mv ${rootfs_dir}/lib/firmware/BCM43430A1.hcd ${rootfs_dir}/lib/firmware/brcm/ mv ${rootfs_dir}/lib/firmware/BCM4345C0.hcd ${rootfs_dir}/lib/firmware/brcm/ - cp ${cur_dir}/tmp/regulatory.db* ${rootfs_dir}/lib/firmware/ - cp ${cur_dir}/tmp/*.rules ${rootfs_dir}/lib/udev/rules.d/ + cp ${tmp_dir}/regulatory.db* ${rootfs_dir}/lib/firmware/ + cp ${tmp_dir}/*.rules ${rootfs_dir}/lib/udev/rules.d/ cp pi-bluetooth/usr/bin/* ${rootfs_dir}/usr/bin/ cp pi-bluetooth/lib/udev/rules.d/90-pi-bluetooth.rules ${rootfs_dir}/lib/udev/rules.d/ 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/ - cp ${cur_dir}/scripts/chroot.sh ${rootfs_dir}/chroot.sh + mkdir -p /usr/share/licenses/raspi + cp -a ${euler_dir}/License/* /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 mount -t proc /proc ${rootfs_dir}/proc @@ -389,6 +468,7 @@ make_rootfs(){ umount -l ${rootfs_dir}/dev umount -l ${rootfs_dir}/proc umount -l ${rootfs_dir}/sys + rm ${rootfs_dir}/etc/yum.repos.d/tmp.repo rm ${rootfs_dir}/chroot.sh LOG "make rootfs for ${repo_file} end." } @@ -451,7 +531,7 @@ make_img(){ cp -rf --preserve=mode,timestamps --no-preserve=ownership ${run_dir}/firmware/boot/* ${boot_mnt}/ pushd ${boot_mnt}/ rm -f *.dtb cmdline.txt kernel.img kernel7.img kernel7l.img - cp ${cur_dir}/config/config.txt ./ + cp ${euler_dir}/config.txt ./ echo "console=serial0,115200 console=tty1 root=/dev/mmcblk0p3 rootfstype=ext4 elevator=deadline rootwait" > cmdline.txt popd cp --preserve=mode,timestamps --no-preserve=ownership ${output_dir}/Image ${boot_mnt}/kernel8.img @@ -499,11 +579,39 @@ make_img(){ LOG "make ${img_file} end." } -IFS=$'\n' +if [ "$EUID" -ne 0 ]; then + echo `date` - ERROR, Please run as root! + exit +fi + +kernel_url="https://gitee.com/openeuler/raspberrypi-kernel.git" +kernel_branch="master" +kernel_defconfig="openeuler-raspi_defconfig" +default_defconfig="" +make_cores=$(nproc) + +parseargs "$@" || help $? + +OS_NAME=openEuler + +cur_dir=$(cd $(dirname $0);pwd) + +run_dir=${cur_dir} +tmp_dir=${cur_dir}/tmp + +buildid=$(date +%Y%m%d%H%M%S) +builddate=${buildid:0:8} +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 +CONFIG_RPM_LIST=${euler_dir}/rpmlist + prepare +IFS=$'\n' update_firmware_app update_kernel make_rootfs -make_img - +make_img \ No newline at end of file diff --git a/scripts/config-quick/99-com.rules b/scripts/config-quick/99-com.rules new file mode 100644 index 0000000000000000000000000000000000000000..8911a525a8d33458eb764b0e6b843d636c0167e6 --- /dev/null +++ b/scripts/config-quick/99-com.rules @@ -0,0 +1,54 @@ +SUBSYSTEM=="input", GROUP="input", MODE="0660" +SUBSYSTEM=="i2c-dev", GROUP="i2c", MODE="0660" +SUBSYSTEM=="spidev", GROUP="spi", MODE="0660" +SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660" +SUBSYSTEM=="rpivid-*", GROUP="video", MODE="0660" + +KERNEL=="vcsm-cma", GROUP="video", MODE="0660" + +SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660" +SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\ + chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\ + chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770 /sys/devices/virtual/gpio;\ + chown -R root:gpio /sys$devpath && chmod -R 770 /sys$devpath\ +'" + +SUBSYSTEM=="pwm*", PROGRAM="/bin/sh -c '\ + chown -R root:gpio /sys/class/pwm && chmod -R 770 /sys/class/pwm;\ + chown -R root:gpio /sys/devices/platform/soc/*.pwm/pwm/pwmchip* && chmod -R 770 /sys/devices/platform/soc/*.pwm/pwm/pwmchip*\ +'" + +KERNEL=="ttyAMA0", PROGRAM="/bin/sh -c '\ + ALIASES=/proc/device-tree/aliases; \ + if cmp -s $ALIASES/uart0 $ALIASES/serial0; then \ + echo 0;\ + elif cmp -s $ALIASES/uart0 $ALIASES/serial1; then \ + echo 1; \ + else \ + exit 1; \ + fi\ +'", SYMLINK+="serial%c" + +KERNEL=="ttyAMA1", PROGRAM="/bin/sh -c '\ + ALIASES=/proc/device-tree/aliases; \ + if [ -e /dev/ttyAMA0 ]; then \ + exit 1; \ + elif cmp -s $ALIASES/uart0 $ALIASES/serial0; then \ + echo 0;\ + elif cmp -s $ALIASES/uart0 $ALIASES/serial1; then \ + echo 1; \ + else \ + exit 1; \ + fi\ +'", SYMLINK+="serial%c" + +KERNEL=="ttyS0", PROGRAM="/bin/sh -c '\ + ALIASES=/proc/device-tree/aliases; \ + if cmp -s $ALIASES/uart1 $ALIASES/serial0; then \ + echo 0; \ + elif cmp -s $ALIASES/uart1 $ALIASES/serial1; then \ + echo 1; \ + else \ + exit 1; \ + fi \ +'", SYMLINK+="serial%c" diff --git a/scripts/config-quick/LICENCE.raspberrypi-sys-mods b/scripts/config-quick/LICENCE.raspberrypi-sys-mods new file mode 100644 index 0000000000000000000000000000000000000000..bb23a05024edcc76fb2a96ffd7e6c07fe06a14c4 --- /dev/null +++ b/scripts/config-quick/LICENCE.raspberrypi-sys-mods @@ -0,0 +1,32 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: raspberrypi-sys-mods +Source: https://github.com/RPi-Distro/raspberrypi-sys-mods + +Files: * +Copyright: 2015 Raspberry Pi Foundation +License: BSD-3-Clause + +License: BSD-3-Clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE HOLDERS OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/scripts/config-quick/chroot.sh b/scripts/config-quick/chroot.sh new file mode 120000 index 0000000000000000000000000000000000000000..be300e6afb8a4ee0299eae4e365ed9882cd140b6 --- /dev/null +++ b/scripts/config-quick/chroot.sh @@ -0,0 +1 @@ +../config/chroot.sh \ No newline at end of file diff --git a/scripts/config-quick/config.txt b/scripts/config-quick/config.txt new file mode 120000 index 0000000000000000000000000000000000000000..072156274a67a1e8b307aee385ea1c4c95149a9a --- /dev/null +++ b/scripts/config-quick/config.txt @@ -0,0 +1 @@ +../config/config.txt \ No newline at end of file diff --git a/scripts/config-quick/hosts b/scripts/config-quick/hosts new file mode 120000 index 0000000000000000000000000000000000000000..9318ace721c086b3a316198594f67a9166008b42 --- /dev/null +++ b/scripts/config-quick/hosts @@ -0,0 +1 @@ +../config//hosts \ No newline at end of file diff --git a/scripts/config-quick/ifup-eth0 b/scripts/config-quick/ifup-eth0 new file mode 120000 index 0000000000000000000000000000000000000000..494c56cce61b1f531849977a60c31e561211d9cc --- /dev/null +++ b/scripts/config-quick/ifup-eth0 @@ -0,0 +1 @@ +../config/ifup-eth0 \ No newline at end of file diff --git a/scripts/config-quick/openEuler-20.09.repo b/scripts/config-quick/openEuler-20.09.repo new file mode 100644 index 0000000000000000000000000000000000000000..eec36e7543e0ba92e53ce5e2a964deb9fafef4be --- /dev/null +++ b/scripts/config-quick/openEuler-20.09.repo @@ -0,0 +1,20 @@ +#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/rpmlist b/scripts/config-quick/rpmlist new file mode 100644 index 0000000000000000000000000000000000000000..59f2fea6426d422f923698aa13b824c7ab19673a --- /dev/null +++ b/scripts/config-quick/rpmlist @@ -0,0 +1,18 @@ +dnf +alsa-utils +wpa_supplicant +vim +net-tools +iproute +iputils +NetworkManager +openssh-server +passwd +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/License/LICENCE.COPYING.linux b/scripts/config/License/LICENCE.COPYING.linux new file mode 100644 index 0000000000000000000000000000000000000000..ca442d313d86dc67e0a2e5d584b465bd382cbf5c --- /dev/null +++ b/scripts/config/License/LICENCE.COPYING.linux @@ -0,0 +1,356 @@ + + NOTE! This copyright does *not* cover user programs that use kernel + services by normal system calls - this is merely considered normal use + of the kernel, and does *not* fall under the heading of "derived work". + Also note that the GPL below is copyrighted by the Free Software + Foundation, but the instance of code that it refers to (the Linux + kernel) is copyrighted by me and others who actually wrote it. + + Also note that the only valid version of the GPL as far as the kernel + is concerned is _this_ particular version of the license (ie v2, not + v2.2 or v3.x or whatever), unless explicitly otherwise stated. + + Linus Torvalds + +---------------------------------------- + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/scripts/config/License/LICENCE.bluez-firmware b/scripts/config/License/LICENCE.bluez-firmware new file mode 100644 index 0000000000000000000000000000000000000000..3912109b5cd65a68039d473c11c9f7ac2303e06d --- /dev/null +++ b/scripts/config/License/LICENCE.bluez-firmware @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/scripts/config/License/LICENCE.broadcom b/scripts/config/License/LICENCE.broadcom new file mode 100644 index 0000000000000000000000000000000000000000..d5793b5ffd637a0f19f991d461d9d032e2fc163a --- /dev/null +++ b/scripts/config/License/LICENCE.broadcom @@ -0,0 +1,31 @@ +Copyright (c) 2006, Broadcom Corporation. +Copyright (c) 2015, Raspberry Pi (Trading) Ltd +All rights reserved. + +Redistribution. Redistribution and use in binary form, without +modification, are permitted provided that the following conditions are +met: + +* This software may only be used for the purposes of developing for, + running or using a Raspberry Pi device, or authorised derivative + device manufactured via the element14 Raspberry Pi Customization Service +* Redistributions must reproduce the above copyright notice and the + following disclaimer in the documentation and/or other materials + provided with the distribution. +* Neither the name of Broadcom Corporation nor the names of its suppliers + may be used to endorse or promote products derived from this software + without specific prior written permission. + +DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + diff --git a/scripts/config/License/LICENCE.broadcom_bcm43xx b/scripts/config/License/LICENCE.broadcom_bcm43xx new file mode 100644 index 0000000000000000000000000000000000000000..ff26fdd72fe125000d73c0aaa227b9e88dbe71db --- /dev/null +++ b/scripts/config/License/LICENCE.broadcom_bcm43xx @@ -0,0 +1,65 @@ +SOFTWARE LICENSE AGREEMENT + +The accompanying software in binary code form (“Software”), is licensed to you, +or, if you are accepting on behalf of an entity, the entity and its affiliates +exercising rights hereunder (“Licensee”) subject to the terms of this software +license agreement (“Agreement”), unless Licensee and Broadcom Corporation +(“Broadcom”) execute a separate written software license agreement governing +use of the Software. ANY USE, REPRODUCTION, OR DISTRIBUTION OF THE SOFTWARE +CONSTITUTES LICENSEE’S ACCEPTANCE OF THIS AGREEMENT. + +1. License. Subject to the terms and conditions of this Agreement, +Broadcom hereby grants to Licensee a limited, non-exclusive, non-transferable, +royalty-free license: (i) to use and integrate the Software with any other +software; and (ii) to reproduce and distribute the Software complete, +unmodified, and as provided by Broadcom, solely for use with Broadcom +proprietary integrated circuit product(s) sold by Broadcom with which the +Software was designed to be used, or their successors. + +2. Restrictions. Licensee shall distribute Software with a copy of this +Agreement. Licensee shall not remove, efface or obscure any copyright or +trademark notices from the Software. Reproductions of the Broadcom copyright +notice shall be included with each copy of the Software, except where such +Software is embedded in a manner not readily accessible to the end user. +Licensee shall not: (i) use, license, sell or otherwise distribute the Software +except as provided in this Agreement; (ii) attempt to modify in any way, +reverse engineer, decompile or disassemble any portion of the Software; or +(iii) use the Software or other material in violation of any applicable law or +regulation, including but not limited to any regulatory agency. This Agreement +shall automatically terminate upon Licensee’s failure to comply with any of the +terms of this Agreement. In such event, Licensee will destroy all copies of the +Software and its component parts. + +3. Ownership. The Software is licensed and not sold. Title to and +ownership of the Software, including all intellectual property rights thereto, +and any portion thereof remain with Broadcom or its licensors. Licensee hereby +covenants that it will not assert any claim that the Software created by or for +Broadcom infringe any intellectual property right owned or controlled by +Licensee. + +4. Disclaimer. THE SOFTWARE IS OFFERED “AS IS,” AND BROADCOM PROVIDES AND +GRANTS AND LICENSEE RECEIVES NO SUPPORT AND NO WARRANTIES OF ANY KIND, EXPRESS +OR IMPLIED, BY STATUTE, COMMUNICATION OR CONDUCT WITH LICENSEE, OR OTHERWISE. +BROADCOM SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A SPECIFIC PURPOSE, OR NONINFRINGEMENT CONCERNING THE SOFTWARE OR +ANY UPGRADES TO OR DOCUMENTATION FOR THE SOFTWARE. WITHOUT LIMITATION OF THE +ABOVE, BROADCOM GRANTS NO WARRANTY THAT THE SOFTWARE IS ERROR-FREE OR WILL +OPERATE WITHOUT INTERRUPTION, AND GRANTS NO WARRANTY REGARDING ITS USE OR THE +RESULTS THEREFROM INCLUDING, WITHOUT LIMITATION, ITS CORRECTNESS, ACCURACY, OR +RELIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM +OR ANY OF ITS LICENSORS HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER FOR BREACH OF CONTRACT, TORT (INCLUDING NEGLIGENCE) OR +OTHERWISE, ARISING OUT OF THIS AGREEMENT OR USE, REPRODUCTION, OR DISTRIBUTION +OF THE SOFTWARE, INCLUDING BUT NOT LIMITED TO LOSS OF DATA AND LOSS OF PROFITS, +EVEN IF SUCH PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THESE +LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF ANY +LIMITED REMEDY. + +5. Export Laws. LICENSEE UNDERSTANDS AND AGREES THAT THE SOFTWARE IS +SUBJECT TO UNITED STATES AND OTHER APPLICABLE EXPORT-RELATED LAWS AND +REGULATIONS AND THAT LICENSEE MAY NOT EXPORT, RE-EXPORT OR TRANSFER THE +SOFTWARE OR ANY DIRECT PRODUCT OF THE SOFTWARE EXCEPT AS PERMITTED UNDER THOSE +LAWS. WITHOUT LIMITING THE FOREGOING, EXPORT, RE-EXPORT, OR TRANSFER OF THE +SOFTWARE TO CUBA, IRAN, NORTH KOREA, SUDAN, AND SYRIA IS PROHIBITED. + diff --git a/scripts/config/License/LICENCE.pi-bluetooth b/scripts/config/License/LICENCE.pi-bluetooth new file mode 100644 index 0000000000000000000000000000000000000000..316c2c6fd6c11c2dd18a01b75518a399d036bd58 --- /dev/null +++ b/scripts/config/License/LICENCE.pi-bluetooth @@ -0,0 +1,32 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: pi-bluetooth +Source: https://github.com/RPi-Distro/pi-bluetooth + +Files: * +Copyright: 2016 Raspberry Pi (Trading) Ltd. +License: BSD-3-Clause + +License: BSD-3-Clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE HOLDERS OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/scripts/config/License/LICENCE.wireless-regdb b/scripts/config/License/LICENCE.wireless-regdb new file mode 100644 index 0000000000000000000000000000000000000000..652a6dd672ac4506767721dc910df0449c08e088 --- /dev/null +++ b/scripts/config/License/LICENCE.wireless-regdb @@ -0,0 +1,16 @@ +Copyright (c) 2008, Luis R. Rodriguez +Copyright (c) 2008, Johannes Berg +Copyright (c) 2008, Michael Green + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/scripts/scripts/chroot.sh b/scripts/config/chroot.sh similarity index 100% rename from scripts/scripts/chroot.sh rename to scripts/config/chroot.sh diff --git a/scripts/config/rpmlist b/scripts/config/rpmlist new file mode 100644 index 0000000000000000000000000000000000000000..e5e664bcd9e213aac3e163dbca1aa073f6d90975 --- /dev/null +++ b/scripts/config/rpmlist @@ -0,0 +1,15 @@ +dnf +alsa-utils +wpa_supplicant +vim +net-tools +iproute +iputils +NetworkManager +openssh-server +passwd +hostname +ntp +bluez +pulseaudio-module-bluetooth +openEuler-repos \ No newline at end of file