From 4f33e0b2e58790fa56acfb7cc86af4ea7fa20220 Mon Sep 17 00:00:00 2001 From: yafen Date: Thu, 2 Jul 2020 21:27:28 +0800 Subject: [PATCH] KernelVer and README and update kernel.tar.gz --- README.en.md | 24 +++++++++++++++++++----- README.md | 29 ++++++++++++++++++++++++----- raspberrypi-kernel.spec | 12 ++++++------ 3 files changed, 49 insertions(+), 16 deletions(-) diff --git a/README.en.md b/README.en.md index fb1aa77..1fb789e 100644 --- a/README.en.md +++ b/README.en.md @@ -4,7 +4,7 @@ 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 . 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 @@ -12,13 +12,27 @@ AArch64 #### Installation -dnf install raspberrypi-kernel +`dnf install raspberrypi-kernel` #### Instructions -1. The version of raspberrypi kernel end with `.raspi`. -2. The module files is installed into /lib/modules. -3. The image files and other files of kernel is installed into /boot/. +1. The version of raspberrypi kernel ends with `.raspi`, e.g., `4.19.90-2005.2.0.0036.raspi.aarch64 `. +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 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 diff --git a/README.md b/README.md index 1e01938..85e9a04 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ # raspberrypi-kernel #### 介绍 + Raspberry Pi 内核映像文件。 -kernel.tar.gz 来自 https://gitee.com/openeuler/raspberrypi-kernel 仓库,将 SSH 公钥添加到 gitee.com 的账户中后,可通过执行 . SOURCE 来获取 kernel.tar.gz。 +`kernel.tar.gz` 来自 仓库,将 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` 标识。 -2. 内核模块安装在 /lib/modules 目录下。 -3. 内核映像文件等在 /boot/ 目录下。 +安装 raspberrypi-kernel 后, + +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 ./ + ``` #### 参与贡献 diff --git a/raspberrypi-kernel.spec b/raspberrypi-kernel.spec index 0fd79d6..3853f97 100644 --- a/raspberrypi-kernel.spec +++ b/raspberrypi-kernel.spec @@ -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 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} Name: raspberrypi-kernel Version: 4.19.90 -Release: %{hulkrelease}.0036.raspi +Release: %{hulkrelease}.0036 Summary: Linux Kernel License: GPLv2 URL: http://www.kernel.org/ @@ -35,8 +35,6 @@ AutoProv: yes Provides: raspberrypi-kernel-aarch64 = %{version}-%{release} -Requires: linux-firmware >= 20100806-2 raspberrypi-firmware >= 20200512 - ExclusiveArch: aarch64 ExclusiveOS: Linux @@ -56,7 +54,7 @@ find . -name .gitignore -exec rm -f {} \; >/dev/null %build 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} dtbs @@ -72,6 +70,7 @@ cd linux-%{KernelVer} ## install linux 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 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 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 arch/%{Arch}/boot/dts/overlays/README $RPM_BUILD_ROOT/boot/dtb-%{KernelVer}/overlays/ %files %defattr (-, root, root)