自己编译内核,initrd.img文件过大

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
askme
帖子: 45
注册时间: 2007-07-08 15:24

自己编译内核,initrd.img文件过大

#1

帖子 askme » 2007-08-17 23:21

我自己编译了一次内核,内核make xconfig里面的配置基本上都是默认的。
最后用mkinitrd 来生成initrd.img文件时,发现竟然有51M
而系统自带的initrd.img,只有6M
这个文件这么大有什么坏处吗?如何让它变小点?
头像
xhy
帖子: 3916
注册时间: 2005-12-28 1:16
系统: Ubuntu 12.10 X64
来自: 火星

#2

帖子 xhy » 2007-08-17 23:54

initrd.img文件其实不需要
按照标准的内核编译方式编译就可以丢掉这个文件

lrwxrwxrwx 1 root root 1 2007-08-14 11:27 boot -> .
lrwxrwxrwx 1 root root 23 2007-08-14 11:27 config -> config-2.6.20-gentoo-r8
-rw-r--r-- 1 root root 31K 2007-07-06 15:47 config-2.6.20-gentoo-r8
drwxr-xr-x 2 root root 1.0K 2007-07-06 14:58 grub
lrwxrwxrwx 1 root root 27 2007-08-14 11:27 System.map -> System.map-2.6.20-gentoo-r8
-rw-r--r-- 1 root root 724K 2007-07-06 15:47 System.map-2.6.20-gentoo-r8
lrwxrwxrwx 1 root root 24 2007-08-14 11:27 vmlinuz -> vmlinuz-2.6.20-gentoo-r8
-rw-r--r-- 1 root root 1.2M 2007-07-06 15:47 vmlinuz-2.6.20-gentoo-r8

内核有2M就足够了
目前负债150多万
雕啸长空
帖子: 1897
注册时间: 2006-09-12 14:09

#3

帖子 雕啸长空 » 2007-08-18 0:27

fideas@zerone /boot $ ls -lh
total 2.4M
lrwxrwxrwx 1 root root 23 2007-08-15 09:40 config -> config-2.6.22-gentoo-r3
-rw-r--r-- 1 root root 48K 2007-08-17 21:02 config-2.6.22-gentoo-r3
drwxr-xr-x 2 root root 1.0K 2007-08-15 20:23 grub
drwx------ 2 root root 12K 2007-08-15 09:34 lost+found
lrwxrwxrwx 1 root root 27 2007-08-15 09:40 System.map -> System.map-2.6.22-gentoo-r3
-rw-r--r-- 1 root root 733K 2007-08-15 09:40 System.map-2.6.22-gentoo-r3
lrwxrwxrwx 1 root root 24 2007-08-15 09:40 vmlinuz -> vmlinuz-2.6.22-gentoo-r3
-rw-r--r-- 1 root root 1.6M 2007-08-17 21:02 vmlinuz-2.6.22-gentoo-r3
Fair winds and following seas !
头像
zmcbb30
帖子: 2717
注册时间: 2006-09-30 0:32
来自: 巴拉特星系第四行星──海尼森

#4

帖子 zmcbb30 » 2007-08-18 0:35

楼上两个编译狂 ...... :em25 :em65 :em65
头可断,血可流,靓女不可不追求
相艾唔好口,够姜就只抽

BARTON 2500+/1536MDDR400
EP8RDA3G/MX4000 128M64bit 8X
DiamondPlus9-6Y080L0-ATA133
Samsung743DF
HiweedDesktop-1.0
头像
fanhe
帖子: 2357
注册时间: 2007-03-24 23:45

#5

帖子 fanhe » 2007-08-18 2:05

配置的时候把kernel hacker的debug项全部去掉
回复