出于纯粹的好奇心,我尝试在我的slackware机器上编译2.6.0内核.
root@darkstar:/home/linux-2.6.0# uname -a
Linux darkstar 2.6.37.6-smp #2 SMP Sat Apr 9 23:39:07 CDT 2011 i686 Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz GenuineIntel GNU/Linux
Run Code Online (Sandbox Code Playgroud)
当我尝试编译时,我得到: -
root@darkstar:/home/linux-2.6.0# make menuconfig
HOSTCC scripts/fixdep
scripts/fixdep.c: In function 'traps':
scripts/fixdep.c:359:2: warning: dereferencing type-punned pointer will break strict-aliasing rules
scripts/fixdep.c:361:4: warning: dereferencing type-punned pointer will break strict-aliasing rules
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/mconf.o
scripts/kconfig/mconf.c:91:21: error: static declaration of 'current_menu' follows non-static declaration
scripts/kconfig/lkc.h:63:21: note: previous declaration of 'current_menu' was here
make[1]: *** [scripts/kconfig/mconf.o] Error 1
make: *** [menuconfig] Error 2
Run Code Online (Sandbox Code Playgroud)
关于我做错什么的一些暗示?谢谢!
你是如何开始这样做的?
通常,您从kernel.org下载最新的内核,将tarball复制到/ usr/src,然后:
1. tar -zxvvf linux-2.6.xxxx.tar.gz
2. ln -nsf linux-2.6.xxxx linux # ie: Update the "/usr/src/linux" symbolic link to
# point to the new kernel source directory
3. make menuconfig # or make xconfig
4. make modules # Build the kernel modules
5. make modules_install # Install the previously built modules for the
# new kernel
6. make bzImage # Create the boot image
Run Code Online (Sandbox Code Playgroud)
此时,请勿运行make install.大多数导游说这样做,但这是错误的!相反,将新创建的bzImage文件复制到/ boot(即:find -name bzImage /usr/src/linux,然后复制cp到/boot),然后编辑LILO配置文件(编辑/etc/lilo.conf,完成后运行lilo),然后重新启动系统(即:init 6或shutdown -r now),并尝试新的核心.
跳过该make install步骤的重点是因为它会覆盖/替换现有内核.我上面描述的步骤允许您同时安装和运行新内核和现有内核.如果新内核被破坏或您遗漏了一个重要选项,您仍然可以回退到现有的稳定/可用内核而无需启动/恢复CD/DVD.
| 归档时间: |
|
| 查看次数: |
906 次 |
| 最近记录: |