Skip to content

Commit

Permalink
Adjust the default installation path of headers files
Browse files Browse the repository at this point in the history
  • Loading branch information
ophub committed Nov 21, 2021
1 parent 145e017 commit 94ecd37
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ armbian-update 5.4.160

默认自动安装主线 u-boot,可以更好的支持 5.10 及以上内核系列的使用。如果选择不安装,请在第 `3` 个输入参数中指定,如 `armbian-update 5.4.160 stable no`

内核中的 `headers` 文件默认安装在 `/use/local/include` 目录下。在编译应用程序的时候,在 `GCC``CFLAG` 参数中添加 `-I /usr/local/include` 即可找到头文件。

- ### 安装 Docker 服务

登录 Armbian 系统 → 输入命令:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ By default, download from [stable](https://github.com/ophub/kernel/tree/main/pub

The mainline u-boot is automatically installed by default, which can better support the use of kernel series 5.10 and above. If you choose not to install, please specify in the `third` input parameter, such as `armbian-update 5.4.160 stable no`

The `headers` files in the kernel is installed in the `/use/local/include` directory. When compiling the application, add `-I /usr/local/include` to the `CFLAG` parameter of `GCC` to find the headers files.

- ### Install Docker Service

Login in to armbian → input command:
Expand Down
2 changes: 1 addition & 1 deletion compile-kernel/README.cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ sudo apt-get install -y $(curl -fsSL git.io/armbian-kernel-server)

3. 如果在 `x86_64` 的环境下使用 `Ubuntu` 等系统进行内核编译,由于交叉编译 `Armbian` 内核时无法生成 [uInitrd](tools/uInitrd) 文件,在打包内核文件时,将自动使用仓库中的相同内核系列的文件进行替代。目前,在 `x86_64` 环境下的交叉编译还不能完全代替真实 `Armbian` 环境下的内核编译,制作的内核存在不稳定性。

4. 内核编译完成后,将会按照 flippy 分享的内核文件的组织方式自动打包成 5 个内核文件,并存放在 `compile-kernel/output` 目录下。这些内核文件会自动从当前内核编译的 Armbian 系统中清除。如果你想在当前系统安装,可进入对应的内核目录如 `compile-kernel/output/5.4.160` 下,执行指定内核安装命令如 `armbian-update 5.4.160` 进行安装。
4. 内核编译完成后,将会按照 flippy 分享的内核文件的组织方式自动打包成 5 个内核文件,并存放在 `compile-kernel/output` 目录下。这些内核文件会自动从当前内核编译的 Armbian 系统中清除。如果你想在当前系统安装,可进入对应的内核目录如 `compile-kernel/output/5.4.160` 下,执行指定内核安装命令如 `armbian-update 5.4.160` 进行安装。内核中的 `headers` 文件默认安装在 `/use/local/include` 目录下。

5. 如果当前 `Armbian` 系统中已经安装了相同名称的内核如 `5.4.160-meson64-beta` ,将会自动停止编译,因为打包时会删除本地相同名称的内核文件,这么做会造成系统瘫痪。

Expand Down
2 changes: 1 addition & 1 deletion compile-kernel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ sudo apt-get install -y $(curl -fsSL git.io/armbian-kernel-server)

3. When cross-compiling the `Armbian` kernel in a system such as `Ubuntu` under the environment of `x86_64`, the [uInitrd](tools/uInitrd) file cannot be generated. When the kernel file is packaged, the file of the same kernel series in the repository will be automatically used instead. At present, cross-compilation in the `x86_64` environment cannot completely replace the kernel compilation in the real `Armbian` environment, and the produced kernel is unstable.

4. After the kernel is compiled, it will be automatically packaged into 5 kernel files according to the organization of the kernel files shared by flippy and stored in the `compile-kernel/output` directory. These kernel files will be automatically cleared from the Armbian system compiled with the current kernel. If you want to install on the current system, you can enter the corresponding kernel directory such as `compile-kernel/output/5.4.160` and execute the specified kernel installation command such as `armbian-update 5.4.160` to install.
4. After the kernel is compiled, it will be automatically packaged into 5 kernel files according to the organization of the kernel files shared by flippy and stored in the `compile-kernel/output` directory. These kernel files will be automatically cleared from the Armbian system compiled with the current kernel. If you want to install on the current system, you can enter the corresponding kernel directory such as `compile-kernel/output/5.4.160` and execute the specified kernel installation command such as `armbian-update 5.4.160` to install. The `headers` files in the kernel is installed in the `/use/local/include` directory.

5. If a kernel with the same name such as `5.4.160-meson64-beta` is already installed in the current `Armbian` system, the compilation will automatically stop, because the local kernel file with the same name will be deleted during packaging, which will cause the system to crash.

Expand Down
5 changes: 3 additions & 2 deletions rebuild
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,10 @@ replace_kernel() {
die "${tmp_armbian}/usr/lib/modules/${new_kernel}-* kernel folder is missing."
fi

# 04 For header files, usr/include
# 04 For header files, usr/local/include
if [[ -n "${build_header}" && -f "${build_header}" ]]; then
tar -xzf ${build_header} -C ${tmp_armbian}/usr && sync
rm -rf ${tmp_armbian}/usr/local/include/* 2>/dev/null && sync
tar -xzf ${build_header} -C ${tmp_armbian}/usr/local && sync
fi

sync
Expand Down
3 changes: 2 additions & 1 deletion recompile
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ make_kernel() {

# Install headers
echo -e "${STEPS} Install headers ..."
make headers_install INSTALL_HDR_PATH=/usr ARCH="${ARCH}" CROSS_COMPILE="${CROSS_COMPILE}" LOCALVERSION="${LOCALVERSION}"
rm -rf /usr/local/include/* 2>/dev/null && sync
make headers_install INSTALL_HDR_PATH=/usr/local ARCH="${ARCH}" CROSS_COMPILE="${CROSS_COMPILE}" LOCALVERSION="${LOCALVERSION}"
[ $? -eq 0 ] && echo -e "${SUCCESS} The headers is installed successfully."

# Install new image
Expand Down

0 comments on commit 94ecd37

Please sign in to comment.