0

In my system, (ubunt 16.04), when I type uname -r, I get

4.15.0-33-generic

when I do ls /boot/*4.15.0-33* -l, I get

-rw-r--r-- 1 root root  1537455  8월 16 06:00 /boot/abi-4.15.0-33-generic
-rw-r--r-- 1 root root   216913  8월 16 06:00 /boot/config-4.15.0-33-generic
-rw-r--r-- 1 root root 53435246  8월 25 06:29 /boot/initrd.img-4.15.0-33-generic
-rw-r--r-- 1 root root        0  8월 16 06:00 /boot/retpoline-4.15.0-33-generic
-rw------- 1 root root  4041375  8월 16 06:00 /boot/System.map-4.15.0-33-generic
-rw------- 1 root root  8108600  8월 17 03:58 /boot/vmlinuz-4.15.0-33-generic

I know initramfs is a kind of simple file system temporarily used during the boot (actually, the final file systems are mounted?). But what are those many files each used for? Just a brief explanations would be appreciated.

Chan Kim
  • 1,969

1 Answers1

0

Here is a brief explanation based on information gathered and note I am not proficient in this area [Warning geeky stuff]:

  1. /boot/System.map-4.15.0-33-generic

    • Contains the location of the kernel.
  2. boot/vmlinuz-4.15.0-33-generic

    • Normally the kernel or symbolic link to the kernel.
  3. /boot/config-4.15.0-33-generic

    • Installed kernel configuration. This file is most useful when compiling kernels on other systems or device modules. Below is a small sample of what the contents of the file looks like.

       CONFIG_X86=y
       CONFIG_MICROCODE=m
       CONFIG_X86_MSR=m
       CONFIG_MATH_EMULATION=y
       CONFIG_MTRR=y
       CONFIG_MODULES=y
       CONFIG_MODVERSIONS=y
       CONFIG_SCSI_DEBUG=m
       CONFIG_I2O=m
       CONFIG_ARCNET_ETH=y
       CONFIG_FMV18X=m
       CONFIG_HPLAN_PLUS=m
       CONFIG_ETH16I=m
       CONFIG_NE2000=m
       CONFIG_HISAX_HFC_PCI=y
       CONFIG_ISDN_DRV_AVMB1_C4=m
       CONFIG_USB_RIO500=m
       CONFIG_QUOTA=y
       CONFIG_AUTOFS_FS=m
       CONFIG_ADFS_FS=m
       CONFIG_AFFS_FS=m
       CONFIG_HFS_FS=m
       CONFIG_FAT_FS=y
       CONFIG_MSDOS_FS=y
       CONFIG_UMSDOS_FS=m
       CONFIG_FBCON_VGA=m
       CONFIG_FONT_8x8=y
       CONFIG_FONT_8x16=y
       CONFIG_SOUND=m
       CONFIG_SOUND_CMPCI=m
       CONFIG_AEDSP16=m
      
  4. /boot/abi-4.15.0-33-generic

    • General: In computer software, an application binary interface (ABI) is an interface between two binary program modules; often, one of these modules is a library or operating system facility, and the other is a program that is being run by a user.

      An ABI defines how data structures or computational routines are accessed in machine code, which is a low-level, hardware-dependent format;

    • Linux Specific: An ABI is a set of conventions that allows a linker to combine separately compiled modules into one unit without recompilation, such as calling conventions, machine interface, and operating-system interface. Among other things, an ABI defines the binary interface between these units. ... The benefits of conforming to an ABI are that it allows linking object files compiled by different compilers.

    • My understanding is that it helps in communication between programs, code, libraries etc. [ Layman's view ]

    • See: https://softwareengineering.stackexchange.com/questions/97478/understanding-application-binary-interface-abi
    • https://stackoverflow.com/questions/2171177/what-is-an-application-binary-interface-abi
  5. /boot/retpoline-4.15.0-33-generic

    • A retpoline is a return trampoline that uses an infinite loop that is never executed to prevent the CPU from speculating on the target of an indirect jump.
  6. /boot/initrd.img-4.15.0-33-generic

    • The initrd image contains the necessary executables and system files to support the second-stage boot of a Linux system.
  7. initramfs-4.15.0-33-generic(?)

    • The initramfs is a complete set of directories that you would find on a normal root filesystem. It is bundled into a single cpio archive and compressed with one of several compression algorithms. At boot time, the boot loader loads the kernel and the initramfs image into memory and starts the kernel

Note: For 7 and 8:

  • As Wikipedia nicely describes, initrd (initial ramdisk) is a scheme for loading a temporary file system into memory in the boot process of the Linux kernel. Initrd and initramfs refer to slightly different methods of achieving this. Both are commonly used to make preparations before the real root file system can be mounted, but there is a difference.

    Initrd is a fixed-size block device, which requires to be 'formatted' by a filesystem such as ext2. It sits on /dev/ram0 by default, and cannot be enlarged or shortened.

    On the other hand, initramfs is a cpio archive which is simply unpacked during boot to ramfs memory. This memory is of dynamic size and thus can be shortened or enlarged as needed.

    So initramfs seems better, right? Not necessarily. The main problem is that it doesn't support pivot_root. What pivot_root does? It basically 'switches' from initrd to the new root (unioned data structures mounted from CD/USB), but initramfs somehow is not capable of that. It seems there was some circular reference and kernel developers disabled pivot_root for initramfs at all. And without pivot_root we cant transpose the current root with the new one. -- source --, see also this.

George Udosen
  • 36,677
  • Thank, can you add brief explanation about initrd- files? I find file initrd-img.4.15.0-33-generic uder /boot in this ubuntu 16.04 but I remember I found initramfs-4.15.0-33-generic(?) in centos machine. What's the difference between initrd and initramfs? initramfs is the newer version? – Chan Kim Aug 27 '18 at 14:40