linux:dracut

dracut

$ sudo cp /boot/initramfs-4.19.14-300.fc29.x86_64.img /boot/initramfs-4.19.14-300.fc29.x86_64.img.bak
$ sudo dracut -f /boot/initramfs-4.19.14-300.fc29.x86_64.img 4.19.14-300.fc29.x86_64

-f イメージファイルのパスを指定する。
※オプションに Kernel バージョン 4.19.14-300.fc29.x86_64 を指定します。

# mount --bind /proc /mnt/sysimage/proc
# mount --bind /dev /mnt/sysimage/dev
# mount --bind /sys /mnt/sysimage/sys
# chroot /mnt/sysimage/
# cp /boot/initramfs-4.19.14-300.fc29.x86_64.img /boot/initramfs-4.19.14-300.fc29.x86_64.img.bak
# dracut -f /boot/initramfs-4.19.14-300.fc29.x86_64.img 4.19.14-300.fc29.x86_64
$ sudo lsinitrd /boot/initramfs-4.19.14-300.fc29.x86_64.img 
Image: /boot/initramfs-4.19.14-300.fc29.x86_64.img: 24M
========================================================================
Early CPIO image
========================================================================
drwxr-xr-x   1 root     root            0 Dec  4 19:27 .
-rw-r--r--   1 root     root            2 Dec  4 19:27 early_cpio
drwxr-xr-x   1 root     root            0 Dec  4 19:27 kernel
drwxr-xr-x   1 root     root            0 Dec  4 19:27 kernel/x86
drwxr-xr-x   1 root     root            0 Dec  4 19:27 kernel/x86/microcode
-rw-r--r--   1 root     root        13312 Dec  4 19:27 kernel/x86/microcode/GenuineIntel.bin
========================================================================
Version: dracut-049-25.git20181204.fc29

Arguments: -f

dracut modules:
bash
systemd
systemd-initrd
nss-softokn
i18n
network-legacy
network
ifcfg
drm
plymouth
btrfs
kernel-modules
kernel-modules-extra
kernel-network-modules
resume
rootfs-block
terminfo
udev-rules
dracut-systemd
usrmount
base
fs-lib
shutdown
========================================================================
drwxr-xr-x   1 root     root            0 Dec  4 19:27 .
crw-r--r--   1 root     root       5,   1 Dec  4 19:27 dev/console
crw-r--r--   1 root     root       1,  11 Dec  4 19:27 dev/kmsg
crw-r--r--   1 root     root       1,   3 Dec  4 19:27 dev/null
crw-r--r--   1 root     root       1,   8 Dec  4 19:27 dev/random
crw-r--r--   1 root     root       1,   9 Dec  4 19:27 dev/urandom
lrwxrwxrwx   1 root     root            7 Dec  4 19:27 bin -> usr/bin
drwxr-xr-x   1 root     root            0 Dec  4 19:27 dev
drwxr-xr-x   1 root     root            0 Dec  4 19:27 etc
drwxr-xr-x   1 root     root            0 Dec  4 19:27 etc/cmdline.d
drwxr-xr-x   1 root     root            0 Dec  4 19:27 etc/conf.d
-rw-r--r--   1 root     root          124 Dec  4 19:27 etc/conf.d/systemd.conf
-rw-r--r--   1 root     root          303 Dec  4 19:27 etc/dhclient.conf
-rw-r--r--   1 root     root           32 Dec  4 19:27 etc/fedora-release
〜省略〜
drwxr-xr-x   1 root     root            0 Dec  4 19:27 var
lrwxrwxrwx   1 root     root           11 Dec  4 19:27 var/lock -> ../run/lock
lrwxrwxrwx   1 root     root            6 Dec  4 19:27 var/run -> ../run
drwxr-xr-x   1 root     root            0 Dec  4 19:27 var/tmp
========================================================================

参考文献

  • linux/dracut.txt
  • 最終更新: 2019/05/18 02:23
  • by 非ログインユーザー