【问题标题】:"missing kernel .config file" error while compiling linux source code for android为 android 编译 linux 源代码时出现“缺少内核 .config 文件”错误
【发布时间】:2011-03-19 04:10:56
【问题描述】:

我正在为android emulator 编译linux source code。我做了所有的先决条件。我使用以下命令从android emulator(1.5) 中提取了.config 文件

$adb pull /proc/config.gz . # get compressed .config file from the emulator.

$gunzip config.gz # uncompress it.
$cp config .config # rename it into .config

现在配置文件在我的 /android-sdk-linux_x86/tools 目录中。我已经根据我的需要对其进行了修改。现在,当我尝试制作(用于构建和交叉编译 linux 源代码)时,出现以下错误。

root@ubuntu:~# cd common
root@ubuntu:~/common# ARCH=arm CROSS_COMPILE=/home/preetam/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- make
  HOSTCC  scripts/basic/fixdep
scripts/basic/fixdep.c: In function ‘traps’:
scripts/basic/fixdep.c:377: warning: dereferencing type-punned pointer will break strict-aliasing rules
scripts/basic/fixdep.c:379: warning: dereferencing type-punned pointer will break strict-aliasing rules
  HOSTCC  scripts/basic/docproc
  HOSTCC  scripts/basic/hash
  HOSTCC  scripts/kconfig/conf.o
scripts/kconfig/conf.c: In function ‘conf_askvalue’:
scripts/kconfig/conf.c:105: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
scripts/kconfig/conf.c: In function ‘conf_choice’:
scripts/kconfig/conf.c:307: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
  HOSTCC  scripts/kconfig/kxgettext.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/lex.zconf.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf -s arch/arm/Kconfig
***
*** You have not yet configured your kernel!
*** (missing kernel .config file)
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
make[2]: *** [silentoldconfig] Error 1
make[1]: *** [silentoldconfig] Error 2
  CHK     include/linux/version.h
  UPD     include/linux/version.h
  Generating include/asm-arm/mach-types.h
make: *** No rule to make target `include/config/auto.conf', needed by `include/config/kernel.release'.  Stop.
root@ubuntu:~/common# 

我正在遵循http://linuxclues.blogspot.com/2010/05/build-compile-linux-kernel-android.html的指示

"common" 目录是我的 android 内核源代码所在的位置。该错误与.config 文件有关。我应该在哪里放置 .config 文件?或者如何解决这个问题?

请帮忙。谢谢!

【问题讨论】:

    标签: android-emulator linux-kernel arm cross-compiling embedded-linux


    【解决方案1】:

    我认为您可以从“make menuconfig”显式加载配置文件。这可能是个好主意,因为您的新内核可能会使用当前“.config”中不可用的选项。如果这样做,“menuconfig”将使用旧的“.config”作为模板。

    【讨论】:

    • 感谢您的回答。但我将修改后的 .config 文件复制到 /common 目录中,它起作用了!
    【解决方案2】:

    如果 .config 存在,那么你需要删除文件 include/config/auto.conf

    【讨论】:

      猜你喜欢
      • 2013-06-03
      • 2022-07-07
      • 2013-09-27
      • 2019-04-24
      • 1970-01-01
      • 1970-01-01
      • 2015-07-23
      • 2020-09-11
      • 1970-01-01
      相关资源
      最近更新 更多