无法用 lp 构建 3.10 内核?

Posted

技术标签:

【中文标题】无法用 lp 构建 3.10 内核?【英文标题】:unable to build the 3.10 kernel with the lp? 【发布时间】:2015-10-05 09:18:48 【问题描述】:

你能给出用lp编译linux 3.10内核的步骤吗? 我正在将 3.10 内核移植到 arndale 板,即带有设备树的 exynos。 我通过运行

创建了 defconfig
ARCH=arm scripts/kconfig/merge_config.sh arch/arm/configs/exynos_defconfig android/configs/android-base.cfg

我尝试编译它。

但是会出现类似的编译错误

In file included from include/linux/jbd.h:247:0,
             from fs/ext3/ext3.h:23,
             from fs/ext3/balloc.c:16:
include/linux/jbd_common.h: In function 'jbd_lock_bh_state':
include/linux/jbd_common.h:18:16: error: 'BH_State' undeclared (first use in this function)
bit_spin_lock(BH_State, &bh->b_state);
            ^
include/linux/jbd_common.h:18:16: note: each undeclared identifier is reported only once for each function it appears in
include/linux/jbd_common.h: In function 'jbd_trylock_bh_state':
include/linux/jbd_common.h:23:26: error: 'BH_State' undeclared (first use in this function)
  return bit_spin_trylock(BH_State, &bh->b_state);
                      ^
include/linux/jbd_common.h: In function 'jbd_is_locked_bh_state':
include/linux/jbd_common.h:28:28: error: 'BH_State' undeclared (first use in this function)
  return bit_spin_is_locked(BH_State, &bh->b_state);
                        ^
include/linux/jbd_common.h: In function 'jbd_unlock_bh_state':
include/linux/jbd_common.h:33:18: error: 'BH_State' undeclared (first use in this function)
  bit_spin_unlock(BH_State, &bh->b_state);
              ^
include/linux/jbd_common.h: In function 'jbd_lock_bh_journal_head':
include/linux/jbd_common.h:38:16: error: 'BH_JournalHead' undeclared (first use in this function)
  bit_spin_lock(BH_JournalHead, &bh->b_state);
            ^
include/linux/jbd_common.h: In function 'jbd_unlock_bh_journal_head':
include/linux/jbd_common.h:43:18: error: 'BH_JournalHead' undeclared (first use in this function)
  bit_spin_unlock(BH_JournalHead, &bh->b_state);
              ^
make[2]: *** [fs/ext3/balloc.o] Error 1
make[1]: *** [fs/ext3] Error 2
make: *** [fs] Error 2

谁能告诉我构建内核需要遵循哪些步骤?

在构建内核时我哪里出错了?

【问题讨论】:

根据行号,你有来自不同内核版本的include/linux/jbd.hinclude/linux/jbd_common.h:第一个是3.10版本,但第二个是3.11(使用,例如lxr.free-electrons.com用于查看不同版本文件的内容)。所以BH_* 值的定义丢失了。可能是内核移植不正确。 如何将内核移植到安卓。我有工作 3.10 linaro 内核,以及如何将其移植到 android 如果您想要特定的驱动程序,这在某些 android 内核中不存在,将这个驱动程序从 vanilla 内核移植到 android 内核更容易。移植整个内核意味着重新访问其每个组件以适应 android,并在需要时重写。 【参考方案1】:

1.从基于 arm 的芯片组(如来自 http://releases.linaro.org/15.01/android/vexpress-lcr 的 vexpress)中获取工作的开源 3.10 android 内核

2. 上面的内核已经支持基于 exynos 的芯片组它在 arch/arm/configs/exynos_defconfig 中也有 exynos defconfig 你可以使用这个 defconfig 并在 arndale 上烧写它,内核应该启动,因为 arndale 只使用基于 exynos 的芯片组.

3.此内核仅支持 arndale 中使用的 SoC,即 exynos5250,您需要添加对 arndale 特定更改的支持,如 GUI 相关更改、外围相关更改等,因为您必须参考工作中的 arndale android 内核像http://releases.linaro.org/14.08/android/arndale 这样的来源,并寻找为添加对arndale 的支持所做的更改。 下面是他们添加的第一个补丁,他们开始添加对 arndale 的支持

From 6f50912b63088c098b9a0d14f7384567631df356 Mon Sep 17 00:00:00 2001
From: Girish K S <ks.giri@samsung.com>
Date: Mon, 8 Oct 2012 13:32:56 +0900
Subject: [PATCH 001/130] ARM: DTS: exynos5250-arndale: Add initial board
 support file

以下是添加的最后一个补丁

From 5a93c058f6bd377fc5edad3e07b1f4d9f18f0c32 Mon Sep 17 00:00:00 2001
From: Pranav Tipnis <pranav.tipnis@linaro.org>
Date: Tue, 9 Jul 2013 18:20:41 +0530
Subject: [PATCH 085/130] media: vb2: Activate display as soon as mmap is

您必须研究包括上述两个在内的所有补丁,并将相关更改移植到您的 3.10 内核。 万事如意!。

谢谢, 德瓦什

【讨论】:

【参考方案2】:

解决方法是禁用ext3:

https://review.carbonrom.org/plugins/gitiles/CarbonROM/android_kernel_sony_msm/+/3803380f7b1fd7aaab9637bf0e8e3838b2313aed%5E%21/

-CONFIG_EXT3_FS=y
-# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set

【讨论】:

以上是关于无法用 lp 构建 3.10 内核?的主要内容,如果未能解决你的问题,请参考以下文章

升级CentOS内核 - 2.6升级到3.10

升级centos6.5内核至3.10及安装docker

Redhat 6.7 系统内核离线升级 至3.10

centos7.4内核从3.10升级到4.14详细步骤

升级CentOS内核 - 2.6升级到3.10

如何在CentOS7环境下安装Docker