编译内核-玩的就是寂寞

编译打包和其他
头像
黄美姬
帖子: 8428
注册时间: 2009-10-08 11:15
来自: 大城市铁岭

编译内核-玩的就是寂寞

#1

帖子 黄美姬 » 2010-05-15 9:15

代码: 全选

安装编译环境:
sudo aptitude install g++ gcc make automake  build-essential kernel-package fakeroot linux-headers-$(uname -r)

去内核官网查找最新内核
http://www.kernel.org/
我令天看到的时linux-2.6.33.4
解压到 /home/user/linux-2.6.33.4

代码: 全选

cd /home/user/linux-2.6.33.4
sudo make menuconfig 
关键是到kernel hacking下面,把kernel debug选项关闭,否则编译出来生成的deb包无比巨大。其它看你硬件办
Screenshot-6.png
Screenshot-10.png

代码: 全选

开始编译内核

$sudo make-kpkg clean 
$sudo make-kpkg -initrd kernel_image kernel-headers
20分钟左右,/home/user/linux-2.6.33.4/的上层目录,生成大便包

linux-headers-2.6.33.4-10.00.Custom_amd64.deb 6.2M
linux-image-2.6.33.4-10.00.Custom_amd64.deb 30M
安装命令:(或者双击安装)
代码:
$ cd ..
$ sudo dpkg -i linux-image-(按tab键)
$ sudo dpkg -ilinux-headers-(按tab键)

编译内核时,下面E文什么意思

代码: 全选

dpkg-shlibdeps: 警告: dependency on libncurses.so.5 could be avoided if "/home/janker/linux-2.6.33.4/debian/linux-headers-2.6.33.4/usr/src/linux-headers-2.6.33.4/scripts/kconfig/conf" were not uselessly linked against it (they use none of its symbols).
编出来DEB包30M,vmlinuz-2.6.33.4有3.3M,启动不了,开机提示:

代码: 全选

[0527599] kernel panic -not syncing:VFS unable to mout root fs on unkown-block(0,0)
看grub.cfg

代码: 全选

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu,Linux 2.6.33.4' --class ubuntu --class gnu-linux --class gnu --class os {
	recordfail
	insmod ext2
	set root='(hd0,7)'
	search --no-floppy --fs-uuid --set dd9ca791-d315-4f04-a55e-303f90664fbf
	linux	/vmlinuz-2.6.33.4 root=/dev/sda13 ro   quiet splash
}
原来少了initrd.img-2.6.33.4,再看/boot/下竟没有生成此文件 :em06
上次由 黄美姬 在 2010-06-03 2:04,总共编辑 11 次。
我们是命运的妓女,它把我们都嫖了

N卡驱动:http://www.nvidia.cn/Download/index.aspx?lang=cn
极品飞车:http://www.geforce.cn/optimize/optimal- ... ts-450-ops
孤岛危机优化设置:http://www.geforce.cn/optimize/optimal- ... tx-450-ops
:cp /etc/skel/.bashrc ~/
PS1="\[\e]2;\u@\H \w\a\e[32;1m\]\T$\[\e[0m\] "
http://cdimage.ubuntu.com/
http://releases.ubuntu.com/
头像
黄美姬
帖子: 8428
注册时间: 2009-10-08 11:15
来自: 大城市铁岭

Re: 编译内核一些警告求翻译

#2

帖子 黄美姬 » 2010-05-15 10:14

(通用版才需要生成此文件,scsi需要生成此文件,那我就必须生成了,我也有scsi)
代码:
cd /lib/modules/2.6.33.4
sudo mkinitramfs -o /boot/initrd.img-2.6.33.4


OK生成

代码:
sudo update-grub2

重启动还是进不了:

代码: 全选

FATAL:could not load /lib/modules/2.6.33.4/modules.dep:NO such file or directory
查看了,此文件是有的
上次由 黄美姬 在 2010-05-19 12:16,总共编辑 3 次。
我们是命运的妓女,它把我们都嫖了

N卡驱动:http://www.nvidia.cn/Download/index.aspx?lang=cn
极品飞车:http://www.geforce.cn/optimize/optimal- ... ts-450-ops
孤岛危机优化设置:http://www.geforce.cn/optimize/optimal- ... tx-450-ops
:cp /etc/skel/.bashrc ~/
PS1="\[\e]2;\u@\H \w\a\e[32;1m\]\T$\[\e[0m\] "
http://cdimage.ubuntu.com/
http://releases.ubuntu.com/
头像
黄美姬
帖子: 8428
注册时间: 2009-10-08 11:15
来自: 大城市铁岭

Re: 编译内核一些警告求翻译

#3

帖子 黄美姬 » 2010-05-15 10:42

代码: 全选

janker@souls:/boot$ sudo cp initrd.img-2.6.33.4  initrd.img-2.6.33.4.old
janker@souls:/boot$ sudo depmod -a
janker@souls:/boot$ sudo update-initramfs  -c -k 2.6.33.4
update-initramfs: Generating /boot/initrd.img-2.6.33.4
janker@souls:/boot$ cd /tmp
janker@souls:/tmp$ 

janker@souls:/tmp$ gzip -dc /boot/initrd.img-2.6.33.4| cpio -id
11286 块
janker@souls:/tmp$ touch lib/modules/2.6.33.4/modules.dep
janker@souls:/tmp$ find ./ | cpio -H newc -o > /boot/initrd.img-2.6.33.4.new
bash: /boot/initrd.img-2.6.33.4.new: 权限不够
janker@souls:/tmp$ sudo find ./ | cpio -H newc -o > /boot/initrd.img-2.6.33.4.new
bash: /boot/initrd.img-2.6.33.4.new: 权限不够
janker@souls:/tmp$ 
TMD,看到最后,原来人家此方法也是不行的,

怪事把update-grub2,改为update-grub就可以进入了,虽然提示了一个什么信息,一闪没看清

代码: 全选

janker@souls:~$ uname -r
2.6.33.4
janker@souls:~$ 


上次由 黄美姬 在 2010-05-19 12:18,总共编辑 1 次。
我们是命运的妓女,它把我们都嫖了

N卡驱动:http://www.nvidia.cn/Download/index.aspx?lang=cn
极品飞车:http://www.geforce.cn/optimize/optimal- ... ts-450-ops
孤岛危机优化设置:http://www.geforce.cn/optimize/optimal- ... tx-450-ops
:cp /etc/skel/.bashrc ~/
PS1="\[\e]2;\u@\H \w\a\e[32;1m\]\T$\[\e[0m\] "
http://cdimage.ubuntu.com/
http://releases.ubuntu.com/
头像
黄美姬
帖子: 8428
注册时间: 2009-10-08 11:15
来自: 大城市铁岭

Re: 编译内核-玩的就是寂寞

#4

帖子 黄美姬 » 2010-05-15 12:10

自编的内核启动还慢一点,WHY?
一些日志

代码: 全选

May 15 10:48:53 souls kernel: Kernel logging (proc) stopped.
May 15 10:49:24 souls kernel: imklog: Cannot read proc file system, 1.
May 15 11:59:52 souls kernel: imklog: Cannot read proc file system, 1.
May 15 12:01:28 souls kernel: imklog: Cannot read proc file system, 1.
我们是命运的妓女,它把我们都嫖了

N卡驱动:http://www.nvidia.cn/Download/index.aspx?lang=cn
极品飞车:http://www.geforce.cn/optimize/optimal- ... ts-450-ops
孤岛危机优化设置:http://www.geforce.cn/optimize/optimal- ... tx-450-ops
:cp /etc/skel/.bashrc ~/
PS1="\[\e]2;\u@\H \w\a\e[32;1m\]\T$\[\e[0m\] "
http://cdimage.ubuntu.com/
http://releases.ubuntu.com/
头像
Sucrose
帖子: 261
注册时间: 2009-08-10 14:34

Re: 编译内核-玩的就是寂寞

#5

帖子 Sucrose » 2010-05-15 13:18

围观寂寞
:em01
如果我们过于爽快地承认失败,就可能使自己发觉不了我们非常接近于正确。——卡尔·波普尔
头像
linuin
帖子: 404
注册时间: 2008-06-15 14:47
来自: beijing
联系:

Re: 编译内核-玩的就是寂寞

#6

帖子 linuin » 2010-05-15 13:39

黄美姬 寂寞?????????????????????????????????? :em06 :em06
头像
peteryeh64
论坛版主
帖子: 9386
注册时间: 2008-12-20 15:43
系统: 家kubuntu20.04
来自: 心靈深處

Re: 编译内核-玩的就是寂寞

#7

帖子 peteryeh64 » 2010-05-15 14:16

不會的路過... :em06
[论坛版主行为规定]+[PITIVI簡易教程]+[ubuntu裝迅雷]
[releases.ubuntu.com]+[cdimage.ubuntu.com]+[old-releases.ubuntu.com]
[學ubuntu必須拜讀懶蝸牛"笨兔兔的故事"=viewtopic.php?f=112&t=162040][Linux明日的希望在中國]
头像
黄美姬
帖子: 8428
注册时间: 2009-10-08 11:15
来自: 大城市铁岭

Re: 编译内核-玩的就是寂寞

#8

帖子 黄美姬 » 2010-05-15 18:53

问题来了,ctrl+F1,,F6都进不了tty :em04 :em04 :em04 :em06 :em06 :em06
我们是命运的妓女,它把我们都嫖了

N卡驱动:http://www.nvidia.cn/Download/index.aspx?lang=cn
极品飞车:http://www.geforce.cn/optimize/optimal- ... ts-450-ops
孤岛危机优化设置:http://www.geforce.cn/optimize/optimal- ... tx-450-ops
:cp /etc/skel/.bashrc ~/
PS1="\[\e]2;\u@\H \w\a\e[32;1m\]\T$\[\e[0m\] "
http://cdimage.ubuntu.com/
http://releases.ubuntu.com/
头像
peteryeh64
论坛版主
帖子: 9386
注册时间: 2008-12-20 15:43
系统: 家kubuntu20.04
来自: 心靈深處

Re: 编译内核-玩的就是寂寞

#9

帖子 peteryeh64 » 2010-05-19 10:39

:em04 ......美姬姐.....您這個算是編譯內核的成功範例嗎...... :em20 (can i follow you...?)
[论坛版主行为规定]+[PITIVI簡易教程]+[ubuntu裝迅雷]
[releases.ubuntu.com]+[cdimage.ubuntu.com]+[old-releases.ubuntu.com]
[學ubuntu必須拜讀懶蝸牛"笨兔兔的故事"=viewtopic.php?f=112&t=162040][Linux明日的希望在中國]
ppdayz
帖子: 3
注册时间: 2008-10-14 12:51

Re: 编译内核-玩的就是寂寞

#10

帖子 ppdayz » 2010-05-21 18:01

现在在玩LFS这个不错的,玩好了准备自己也把ubuntu 再搞一遍
头像
playeryang
帖子: 249
注册时间: 2009-04-04 12:55
来自: 四川...泸州||江苏...镇江

Re: 编译内核-玩的就是寂寞

#11

帖子 playeryang » 2010-05-21 19:16

:em11
头像
iamfbi
帖子: 1081
注册时间: 2009-02-06 9:18
来自: 小僧乃吐蕃国大雪山大轮寺护国法师座下四大护法之西域妖僧是也

Re: 编译内核-玩的就是寂寞

#12

帖子 iamfbi » 2010-05-28 10:17

类似问题,我编了也没生成initrd.img,后来我把原版的initrd.img复制一份给他用
不知道是不是编少了什么
Laptop: i5-460m hm55 4g 320g hd5470 14'led 2.3kg (acer 4738g)
Windows XP 7 8 all in one partition.
Ubuntu 10.04 LTS
Mac OS X 10.6.7
折腾笔记
论坛随手记
头像
bobo4548
帖子: 661
注册时间: 2007-07-17 22:52
来自: cn,shandong

Re: 编译内核-玩的就是寂寞

#13

帖子 bobo4548 » 2010-05-29 20:36

成功后继续共享,关注中
头像
xjpvictor
帖子: 2837
注册时间: 2007-08-22 15:55
系统: Archlinux
来自: 新加坡
联系:

Re: 编译内核-玩的就是寂寞

#14

帖子 xjpvictor » 2010-05-29 21:11

都是高手啊。。
Entschuldigung. Ich habe keine ahnung.
Secure with PGP: gpg --recv-keys 0x68b6e3d8
Fingerprint: 5556 517C F52F E402 DDF5 5400 6D30 F13E 68B6 E3D8
Towards A Sustainable Earth: Print Only When Necessary
头像
黄美姬
帖子: 8428
注册时间: 2009-10-08 11:15
来自: 大城市铁岭

Re: 编译内核-玩的就是寂寞

#15

帖子 黄美姬 » 2010-05-30 0:05

bobo4548 写了:成功后继续共享,关注中

看四楼,
viewtopic.php?f=139&t=275762
我们是命运的妓女,它把我们都嫖了

N卡驱动:http://www.nvidia.cn/Download/index.aspx?lang=cn
极品飞车:http://www.geforce.cn/optimize/optimal- ... ts-450-ops
孤岛危机优化设置:http://www.geforce.cn/optimize/optimal- ... tx-450-ops
:cp /etc/skel/.bashrc ~/
PS1="\[\e]2;\u@\H \w\a\e[32;1m\]\T$\[\e[0m\] "
http://cdimage.ubuntu.com/
http://releases.ubuntu.com/
回复