-
f
编译
initramfs
,如果
initramfs
文件
存在,
文件
-
f
dracut
--
add
-
drivers
列表:在原本的默
核心模
中,增加某些你想要的模
!模
位于核心所在目
/lib/modules/$(uname
-
r)/kernel/*
initramfs
檔名
:就是你需要的檔名!
开头
最好就是
initramfs
,后面½版本与功能
核心版本
预设当
然是目前
作中的核心版本,不
你也可以手
动输
入其他不同版本!
dracut
有很多功能,例如底下的几
个参数
也可以
考看看:
--
modules
½
dracut
所提供的
机所需模
(
核心核模
)
,可用模
在底下的目
录内
/usr/lib/dracut/modules.d/
--
gzip|
--
bzip2|
--
xz
尝试
使用哪一种
压缩
方式
来½
initramfs
压缩
预设
使用
gzip
喔!
--
filesystems
:加入某些
外的文件系
支持!
范例一:以
dracut
的默
功能½立一
initramfs
虚拟
文件
[root@study ~]#
dracut
-
v initramfs
-
test.img $(uname
-
r)
Executing: /sbin/dracut
-
v initramfs
-
test.img 3.10.0
-
229.el7.x86_64
*** Including module: bash ***
#
先加
dracut
本身的模
支持
*** Including module: nss
-
softokn ***
*** Including modules done ***
.....(
省略
).....
#
底下
行在
理核心模
*** Installing kernel module dependencies and firmware ***
*** Installing kernel module dependencies and firmware done ***
.....(
省略
).....
*** Generating early
-
microcode cpio image ***
#
½立微指令集
*** Constructing GenuineIntel.bin ****
*** Store current command line parameters ***
*** Creating image file ***
#
始½立
initramfs
*** Creating image file done ***
范例二:
外加入
e1000e
网卡
驱动
ext4/nfs
文件系
在新的
initramfs
[root@study ~]#
dracut
-
v
--
add
-
drivers "e1000e"
--
filesystems "ext4 nfs"
\
>
initramfs
-
new.img $(uname
-
r)
[root@study ~]#
lsinitrd initramfs
-
new.img | grep
-
E '(e1000|ext4|nfs)'
usr/lib/modules/3.10.0
-
229.
el7.x86_64/kernel/drivers/net/ethernet/intel/e1000e
usr/lib/modules/3.10.0
-
229.el7.x86_64/kernel/drivers/net/ethernet/intel/e1000e/e1000e.ko
usr/lib/modules/3.10.0
-
229.el7.x86_64/kernel/fs/ext4
usr/lib/modules/3.10.0
-
229.el7.x86_64/kernel/fs/ext4/ext4.ko
usr/lib/modules/3.10.0
-
229.el7.x86_64/kernel/fs/nfs
usr/lib/modules/3.10.0
-
229.el7.x86_64/kernel/fs/nfs/nfs.ko
#
你可以看得到,新增的模
块现
在正在新的
initramfs
中了呢!很愉快喔!
initramfs
½立完成之后,同时核心也处理完毕后,我们就可以使用
grub2
来½立选单了!底下继续
瞧一瞧吧!