>
bs=11264 skip=1
[root@study initramfs]#
ll initramfs.gz; file initramfs.gz
-
rw
-
r
--
r
--
. 1 root root 18558166 Aug 24 19:38 initramfs.gz
initramfs.gz: gzip compressed data, from Unix, last modi
fied: Mon May 4 17:56:47 2015,
max compression
# 2.
上面看到
文件
gzip
压缩
文件,所以
½
它½
压缩
后,再查
一下
文件
型!
[root@study initramfs]#
gzip
-
d initramfs.gz
[root@study initramfs]#
file initramfs
initramfs: ASCII cpio archive (SVR4 with no CRC)
# 3.
½
后又
生一
cpio
文件
,得要
½
它用
cpio
的方法½
!加上不要
绝对
参数½
[root@study initramfs]#
cpio
-
i
-
d
-
H newc
--
no
-
absolute
-
filenames < initramfs
[root@study initramfs]#
ll
lrwxrwxrwx. 1 root root 7 Aug 24 19:40 bin
-
> usr/bin
drwxr
-
xr
-
x. 2 root root 42 Aug 24 19:40 dev
drwxr
-
xr
-
x. 12 root root 4096 Aug 24 19:40 etc
lrwxrwxrwx. 1 root root 23 Aug 24 19:40 init
-
> usr/lib/systemd/systemd
-
rw
-
r
--
r
--
. 1 root root 42263552 Aug 24 19:38 initramfs
lrwxrwxrwx. 1 root root 7 Aug 24 19:40 lib
-
> usr/lib
lrwxrwxrwx. 1
root root 9 Aug 24 19:40 lib64
-
> usr/lib64
drwxr
-
xr
-
x. 2 root root 6 Aug 24 19:40 proc
drwxr
-
xr
-
x. 2 root root 6 Aug 24 19:40 root
drwxr
-
xr
-
x. 2 root root 6 Aug 24 19:40 run
lrwxrwxrwx. 1 root root 8 Aug 24 19:40 sbi
n
-
> usr/sbin
-
rwxr
-
xr
-
x. 1 root root 3041 Aug 24 19:40 shutdown
drwxr
-
xr
-
x. 2 root root 6 Aug 24 19:40 sys
drwxr
-
xr
-
x. 2 root root 6 Aug 24 19:40 sysroot
drwxr
-
xr
-
x. 2 root root 6 Aug 24 19:40 tmp
drwxr
-
xr
-
x. 7 root root
61 Aug 24 19:40 usr
drwxr
-
xr
-
x. 3 root root 47 Aug 24 19:40 var
#
看吧!上面几乎就像是一
小型的文件系
根目
耶!
这样
就能
kernel
去挂
了!
# 4.
½下
瞧一瞧到底
这个
小型的文件系
中,
systemd
是要以哪
target
来执
机呢?
[root@study initramfs]#
ll usr/lib/systemd/system/default.target
lrwxrwxrwx. 1 root root 13 Aug 24 19:40 usr/lib/systemd/system/default.target
-
>
initrd.target
# 5.
瞧一瞧系
统内
initrd.target
相依的所有服
务数
据吧!
[root@study initramfs]#
systemctl list
-
dependencies initrd.target
initrd.target
├─
dracut
-
cmdline.service
.....(
省略
).....
├─
basic.target
├─
alsa
-
restore.service