KernelVer and README and update kernel.tar.gz

This commit is contained in:
yafen 2020-07-02 21:27:28 +08:00
parent 88c82c74f8
commit 4f33e0b2e5
3 changed files with 49 additions and 16 deletions

View File

@ -4,7 +4,7 @@
Kernel Image of Raspberry Pi. Kernel Image of Raspberry Pi.
kernel.tar.gz is from https://gitee.com/openeuler/raspberrypi-kernel. After you put your public ssh key into your account in gitee, you can get kernel.tar.gz with executing command `. SOURCE`. The `kernel.tar.gz` is from <https://gitee.com/openeuler/raspberrypi-kernel>. After you put your public ssh key into your account in gitee, you can obtain `kernel.tar.gz` by executing command `. SOURCE`. You can directly use the `kernel.tar.gz` in this repository instead.
#### Software Architecture #### Software Architecture
@ -12,13 +12,27 @@ AArch64
#### Installation #### Installation
dnf install raspberrypi-kernel `dnf install raspberrypi-kernel`
#### Instructions #### Instructions
1. The version of raspberrypi kernel end with `.raspi`. 1. The version of raspberrypi kernel ends with `.raspi`, e.g., `4.19.90-2005.2.0.0036.raspi.aarch64 `.
2. The module files is installed into /lib/modules. 2. The module files will be installed into `/lib/modules`. The directory name of these module files is the same as the version of raspberrypi kernel, such as `4.19.90-2005.2.0.0036.raspi.aarch64`.
3. The image files and other files of kernel is installed into /boot/. 3. The image file will be installed into `/boot`, whose filename is like `vmlinuz-4.19.90-2005.2.0.0036.raspi.aarch64`. Note that the image file is in GZ compression format by default. You can decompress this file, and then rename it to `kernel8.img` as follows.
```
cd /boot
cp vmlinuz-4.19.90-2005.2.0.0036.raspi.aarch64 Image.gz
gunzip Image.gz
mv Image kernel8.img
```
4. The device tree files will be installed into `/boot`. The directory name of these files looks like `dtb-4.19.90-2005.2.0.0036.raspi.aarch64`. You need to copy the device tree files to `/boot` as follows.
```
cd /boot
cp dtb-4.19.90-2005.2.0.0036.raspi.aarch64/*.dtb ./
```
#### Contribution #### Contribution

View File

@ -1,9 +1,10 @@
# raspberrypi-kernel # raspberrypi-kernel
#### 介绍 #### 介绍
Raspberry Pi 内核映像文件。 Raspberry Pi 内核映像文件。
kernel.tar.gz 来自 https://gitee.com/openeuler/raspberrypi-kernel 仓库,将 SSH 公钥添加到 gitee.com 的账户中后,可通过执行 . SOURCE 来获取 kernel.tar.gz。 `kernel.tar.gz` 来自 <https://gitee.com/openeuler/raspberrypi-kernel> 仓库,将 SSH 公钥添加到 gitee.com 的账户中后,可通过执行 `. SOURCE` 来获取 `kernel.tar.gz`。也可以采用本仓库通过 Git LFS 上传的 `kernel.tar.gz`
#### 软件架构 #### 软件架构
@ -11,13 +12,31 @@ AArch64
#### 安装教程 #### 安装教程
dnf install raspberrypi-kernel `dnf install raspberrypi-kernel`
#### 使用说明 #### 使用说明
1. 内核版本号后缀增加 `.raspi` 标识。 安装 raspberrypi-kernel 后,
2. 内核模块安装在 /lib/modules 目录下。
3. 内核映像文件等在 /boot/ 目录下。 1. 内核版本号后缀增加 `.raspi` 标识,形如 `4.19.90-2005.2.0.0036.raspi.aarch64`
2. 内核模块安装在 `/lib/modules` 目录下,对应文件夹名称同内核版本号,如 `4.19.90-2005.2.0.0036.raspi.aarch64`
3. 内核映像文件在 `/boot` 目录下,映像文件名形如 `vmlinuz-4.19.90-2005.2.0.0036.raspi.aarch64`。注意,该文件默认是采用 GZ 压缩格式的压缩文件,需要解压缩后重命名为 `kernel8.img`
具体过程:
```
cd /boot
cp vmlinuz-4.19.90-2005.2.0.0036.raspi.aarch64 Image.gz
gunzip Image.gz
mv Image kernel8.img
```
4. 设备树文件在 `/boot` 目录下的文件夹下,该文件夹名称形如 `dtb-4.19.90-2005.2.0.0036.raspi.aarch64`,需要将其中的设备树文件拷贝到 `/boot` 目录下。
具体过程:
```
cd /boot
cp dtb-4.19.90-2005.2.0.0036.raspi.aarch64/*.dtb ./
```
#### 参与贡献 #### 参与贡献

View File

@ -1,14 +1,14 @@
%global Arch $(echo %{_host_cpu} | sed -e s/i.86/x86/ -e s/x86_64/x86/ -e s/aarch64.*/arm64/) %global Arch $(echo %{_host_cpu} | sed -e s/i.86/x86/ -e s/x86_64/x86/ -e s/aarch64.*/arm64/)
%global KernelVer %{version}-%{release}.%{_target_cpu} %global KernelVer %{version}-%{release}.raspi.%{_target_cpu}
%global hulkrelease 2003.4.0 %global hulkrelease 2005.2.0
%global debug_package %{nil} %global debug_package %{nil}
Name: raspberrypi-kernel Name: raspberrypi-kernel
Version: 4.19.90 Version: 4.19.90
Release: %{hulkrelease}.0036.raspi Release: %{hulkrelease}.0036
Summary: Linux Kernel Summary: Linux Kernel
License: GPLv2 License: GPLv2
URL: http://www.kernel.org/ URL: http://www.kernel.org/
@ -35,8 +35,6 @@ AutoProv: yes
Provides: raspberrypi-kernel-aarch64 = %{version}-%{release} Provides: raspberrypi-kernel-aarch64 = %{version}-%{release}
Requires: linux-firmware >= 20100806-2 raspberrypi-firmware >= 20200512
ExclusiveArch: aarch64 ExclusiveArch: aarch64
ExclusiveOS: Linux ExclusiveOS: Linux
@ -56,7 +54,7 @@ find . -name .gitignore -exec rm -f {} \; >/dev/null
%build %build
cd linux-%{KernelVer} cd linux-%{KernelVer}
perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{release}.%{_target_cpu}/" Makefile perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{release}.raspi.%{_target_cpu}/" Makefile
make ARCH=%{Arch} %{?_smp_mflags} openeuler-raspi_defconfig make ARCH=%{Arch} %{?_smp_mflags} openeuler-raspi_defconfig
make ARCH=%{Arch} dtbs make ARCH=%{Arch} dtbs
@ -72,6 +70,7 @@ cd linux-%{KernelVer}
## install linux ## install linux
make ARCH=%{Arch} INSTALL_MOD_PATH=$RPM_BUILD_ROOT modules_install KERNELRELEASE=%{KernelVer} make ARCH=%{Arch} INSTALL_MOD_PATH=$RPM_BUILD_ROOT modules_install KERNELRELEASE=%{KernelVer}
rm -rf $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/source $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build
mkdir -p $RPM_BUILD_ROOT/boot mkdir -p $RPM_BUILD_ROOT/boot
install -m 755 $(make -s image_name) $RPM_BUILD_ROOT/boot/vmlinuz-%{KernelVer} install -m 755 $(make -s image_name) $RPM_BUILD_ROOT/boot/vmlinuz-%{KernelVer}
@ -81,6 +80,7 @@ install -m 644 System.map $RPM_BUILD_ROOT/boot/System.map-%{KernelVer}
mkdir -p $RPM_BUILD_ROOT/boot/dtb-%{KernelVer}/overlays mkdir -p $RPM_BUILD_ROOT/boot/dtb-%{KernelVer}/overlays
install -m 644 $(find arch/%{Arch}/boot/dts/broadcom/ -name "*.dtb") $RPM_BUILD_ROOT/boot/dtb-%{KernelVer}/ install -m 644 $(find arch/%{Arch}/boot/dts/broadcom/ -name "*.dtb") $RPM_BUILD_ROOT/boot/dtb-%{KernelVer}/
install -m 644 $(find arch/%{Arch}/boot/dts/overlays/ -name "*.dtbo") $RPM_BUILD_ROOT/boot/dtb-%{KernelVer}/overlays/ install -m 644 $(find arch/%{Arch}/boot/dts/overlays/ -name "*.dtbo") $RPM_BUILD_ROOT/boot/dtb-%{KernelVer}/overlays/
install -m 644 arch/%{Arch}/boot/dts/overlays/README $RPM_BUILD_ROOT/boot/dtb-%{KernelVer}/overlays/
%files %files
%defattr (-, root, root) %defattr (-, root, root)