How does grub knows to boot into initramfs ?
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 10 of 10
  1. #1
    Join Date
    Aug 2019
    Location
    israel
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How does grub knows to boot into initramfs ?

    Hello,

    I recently updated kernel from 3.10 to a new one.
    I built a custom kernel and installed with.
    It seemed to work well, but now I noticed that there is no /run/initramfs/ folder,
    and I suspect that initramfs is not running.

    Another strange thing is that even if I totally remove grub line "initrd16 <ramfs_file>, linux still boots !!??

    Is there some configuration in kernel which can explain it or some grub issues ?

    Thanks

  2. #2
    Join Date
    Feb 2005
    Location
    London, UK
    Posts
    1,103
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: How does grub knows to boot into initramfs ?

    Ho did you build the kernel? You don't necessarily need initramfs if the kernel has all the drivers compiled in.

  3. #3
    Join Date
    Aug 2019
    Location
    israel
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How does grub knows to boot into initramfs ?

    Hi,

    Thank you very much.
    I actually work with the default distribution which has in grub:
    initrd16 <ramfs_file>

    I just want to understand how kernel knows that it should use the above initramfs file.
    Is it some configuration in kernel ? which ?

    Thank you,
    ranran

  4. #4
    Join Date
    Jul 2009
    Posts
    22
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: How does grub knows to boot into initramfs ?

    Quote Originally Posted by ranran
    Hi,

    Thank you very much.
    I actually work with the default distribution which has in grub:
    initrd16 <ramfs_file>

    I just want to understand how kernel knows that it should use the above initramfs file.
    Is it some configuration in kernel ? which ?

    Thank you,
    ranran
    from where exact u deleted the info for boot, when u chage the grub files it dont save until u run grub2-mkconfig, u can delet all config files but if u dont make the comand grub dont save it, the initramfs is on /boot folder.

  5. #5
    Join Date
    Jun 2005
    Location
    Montreal, Que, Canada
    Posts
    6,151
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: How does grub knows to boot into initramfs ?

    Quote Originally Posted by ranran
    Hi,

    Thank you very much.
    I actually work with the default distribution which has in grub:
    initrd16 <ramfs_file>

    I just want to understand how kernel knows that it should use the above initramfs file.
    Is it some configuration in kernel ? which ?

    Thank you,
    ranran
    When a new kernel is downloaded for upgrade, the rpm file includes a script to rebuild the initramfs and it is done once. I believe it is a common file to all kernels. It is referenced by all kernels since the thinking is that your hardware/drivers are what you have now, not what you had 3 kernel updates ago.
    Leslie in Montreal

    Interesting web sites list
    http://forums.fedoraforum.org/showth...40#post1697840

  6. #6
    Join Date
    Aug 2019
    Location
    israel
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How does grub knows to boot into initramfs ?

    The issue was a missing config in kernel CONFIG_BLK_DEV_INITRD=y
    Thanks

  7. #7
    Join Date
    Feb 2005
    Location
    London, UK
    Posts
    1,103
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: How does grub knows to boot into initramfs ?

    Quote Originally Posted by ranran
    The issue was a missing config in kernel CONFIG_BLK_DEV_INITRD=y
    Thanks
    It's a bit late now as you've obviously got the new kernel working. However, did you successfully run "make oldconfig" on the standard fedora kernel's config first? That should take all the old config options and apply them to the new kernel's config which is a good starting point.

  8. #8
    Join Date
    Feb 2009
    Location
    Florida
    Posts
    677
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How does grub knows to boot into initramfs ?

    It seems you have solved you specific problem and you may well have discovered all answers to your original post. However, I thought I would add the following comments.

    even if I totally remove grub line "initrd16 <ramfs_file>, linux still boots !!??
    It used to be quite easy to find GRUB2 boot menu. I haven't found where this instruction even exists in F30 ( please provide pointer if you know) In the older GRUB2 process this command was associated with the BIOS boot option. "initrd16" was the real mode 16 bit code required while still in the initial state provided by BIOS BOOT handoff to the boot process. IF you are booting in UEFI mode you are already in protected mode and 32/64 bit code can be used. This would mean changing the "initrd16" would have no affect since this code path is not executed.

    In a vanilla F30 implementation, there is a complete copy of the major execution and configuration files in "/boot". These are: config-{kernel ver}, System.map-{kernel ver}, initramfs-(kernel ver}, and vmlinuz-{kernel ver} the last being the actual kernel image to be booted.

    The configuration files used in an UEFI boot and define what components are loaded at boot time are located in "/boot/loader/entries". The files are named {Machine ID}{kernel ver}. This approach looks very much like a "systemd-boot" configuration. I'm thinking there is an attempt underway to align GRUB2 UEFI boot process and systemd-boot process. I assume GRUB2 is still fully in place and using the "/boot/loader/entries" file to assemble what used to be the "menuentry linuxefi" line in the old process.

    I don't fully understand what the UEFI "grub.cfg" file is doing, there is no longer a "menuentry" line. Its completely different from older versions as used in F29 and appears to be dynamically assembling the "linuxefi" line.

    IF you think I am way off here, I would greatly appreciate a course correction.

    Evidence for my "systemd-boot" convergence, compare to current GRUB2 process https://systemd.io/BOOT_LOADER_SPECIFICATION as current specification.
    Last edited by Kobuck; 15th August 2019 at 02:57 PM. Reason: Added boot spec link
    Laptop: Toshiba / Intel B960 2.20Ghz x2/ 4GB/ 320GB SataII/ Intel HD/ fc30.x86_64
    Tower: GigaByte (970A) / AMD FX 8320 3.5Ghz x8/ 16GB/ 9TB Sata III/ AMD 6770HD/ fc30.x86_64
    Bookshelf: Shuttle DS61 (H61)/ i3-3225 3.3Ghz x2/ 16GB/ 320GB Sata II/ Intel HD 4000/ fc29.x86_64
    Embedded: BeagleBone Blk / ARM AM3358 1 GHz x1/ 512MB/ 2GB eMMC/ PowerVR SGX530/ fc27.armv7hl

  9. #9
    Join Date
    Jun 2005
    Location
    Montreal, Que, Canada
    Posts
    6,151
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: How does grub knows to boot into initramfs ?

    Quote Originally Posted by Kobuck
    It seems you have solved you specific problem and you may well have discovered all answers to your original post. However, I thought I would add the following comments.


    It used to be quite easy to find GRUB2 boot menu. I haven't found where this instruction even exists in F30 ( please provide pointer if you know) In the older GRUB2 process this command was associated with the BIOS boot option. "initrd16" was the real mode 16 bit code required while still in the initial state provided by BIOS BOOT handoff to the boot process. IF you are booting in UEFI mode you are already in protected mode and 32/64 bit code can be used. This would mean changing the "initrd16" would have no affect since this code path is not executed.

    In a vanilla F30 implementation, there is a complete copy of the major execution and configuration files in "/boot". These are: config-{kernel ver}, System.map-{kernel ver}, initramfs-(kernel ver}, and vmlinuz-{kernel ver} the last being the actual kernel image to be booted.

    The configuration files used in an UEFI boot and define what components are loaded at boot time are located in "/boot/loader/entries". The files are named {Machine ID}{kernel ver}. This approach looks very much like a "systemd-boot" configuration. I'm thinking there is an attempt underway to align GRUB2 UEFI boot process and systemd-boot process. I assume GRUB2 is still fully in place and using the "/boot/loader/entries" file to assemble what used to be the "menuentry linuxefi" line in the old process.

    I don't fully understand what the UEFI "grub.cfg" file is doing, there is no longer a "menuentry" line. Its completely different from older versions as used in F29 and appears to be dynamically assembling the "linuxefi" line.

    IF you think I am way off here, I would greatly appreciate a course correction.

    Evidence for my "systemd-boot" convergence, compare to current GRUB2 process https://systemd.io/BOOT_LOADER_SPECIFICATION as current specification.
    grub.cfg is found with /boot/efi/EFI/fedora
    The boot/efi is a separate partition --the shim, typically fat32 or fat16

    If you had a second distribution on the same disk, and you decided to share the /boot/efi, then that system's grub would be found via
    /boot/efi/EFI/second_distro where second distro could be one of tumbleweed, ubuntu, manjaro, ...
    Leslie in Montreal

    Interesting web sites list
    http://forums.fedoraforum.org/showth...40#post1697840

  10. #10
    Join Date
    Feb 2009
    Location
    Florida
    Posts
    677
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How does grub knows to boot into initramfs ?

    grub.cfg is found with /boot/efi/EFI/fedora
    That is correct, but it makes no use of "initrd16" as referenced in OP. I really wouldn't expect it to, since this is a UEFI boot area.

    Don't have enough info from OP to know whether my info directly applies since initrd16 implies BIOS BOOT and latest F30 may not be the kernel he is building.
    Laptop: Toshiba / Intel B960 2.20Ghz x2/ 4GB/ 320GB SataII/ Intel HD/ fc30.x86_64
    Tower: GigaByte (970A) / AMD FX 8320 3.5Ghz x8/ 16GB/ 9TB Sata III/ AMD 6770HD/ fc30.x86_64
    Bookshelf: Shuttle DS61 (H61)/ i3-3225 3.3Ghz x2/ 16GB/ 320GB Sata II/ Intel HD 4000/ fc29.x86_64
    Embedded: BeagleBone Blk / ARM AM3358 1 GHz x1/ 512MB/ 2GB eMMC/ PowerVR SGX530/ fc27.armv7hl

Similar Threads

  1. [SOLVED]
    Fedora 25 boot problem /run/initramfs...
    By yigit in forum Using Fedora
    Replies: 4
    Last Post: 25th May 2017, 03:09 PM
  2. Replies: 0
    Last Post: 7th October 2015, 01:11 AM
  3. Replies: 3
    Last Post: 27th January 2014, 09:35 AM
  4. [SOLVED]
    kernel update doesn't edit grub.conf vmlinuz and initramfs missing
    By justforgetme in forum Using Fedora
    Replies: 2
    Last Post: 23rd December 2010, 06:37 PM
  5. initramfs created instead of initrd - can't boot new kernel
    By Jongi in forum Fedora 12 Alpha, Beta & Release Candidates
    Replies: 12
    Last Post: 9th November 2009, 02:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •