Hello, I have cloned and built the latest rc kernel using the default config but on boot, it stucks at "Loading initial ramdisk". I have tried booting after removing the "quiet" option from the kernel parameters just before selecting the kernel from the grub menu. I have also tried adding "dis_ucode_ldr" parameter to the initial parameters but all in vain. How to look for the underlying issue and solve it? Regards, Dileep
On Thu, 21 Dec 2023 17:58:23 +0530, Dileep Sankhla said:
I have cloned and built the latest rc kernel using the default config but on boot, it stucks at "Loading initial ramdisk". I have tried booting after removing the "quiet" option from the kernel parameters just before selecting the kernel from the grub menu.
So when you remove 'quiet', what's the last output you get from the kernel? You might also take a look at whether the initramfs image was installed to the right location, and whether its size/contents seem reasonable.
Hi Valdis, On Fri, Dec 22, 2023 at 10:52 AM Valdis Klētnieks <valdis.kletnieks@vt.edu> wrote:
On Thu, 21 Dec 2023 17:58:23 +0530, Dileep Sankhla said:
I have cloned and built the latest rc kernel using the default config but on boot, it stucks at "Loading initial ramdisk". I have tried booting after removing the "quiet" option from the kernel parameters just before selecting the kernel from the grub menu.
So when you remove 'quiet', what's the last output you get from the kernel?
I see no output from the kernel.
You might also take a look at whether the initramfs image was installed to the right location, and whether its size/contents seem reasonable.
After checking the GRUB config (/boot/grub/grub.cfg) for both bootable and non-bootable kernels, I can confirm that the initramfs image was installed to the right location. Its size is only 18M. The bootable kernel release's initramfs image is 71M in size. I find similar contents in both of them though. Here is the contents of initrd.img-6.7.0-rc6-test (see [1]). Regards, Dileep. [1]: https://pastebin.com/1cDZDvj8
On Thu, Dec 21, 2023 at 05:58:23PM +0530, Dileep Sankhla wrote:
Hello,
I have cloned and built the latest rc kernel using the default config but on boot, it stucks at "Loading initial ramdisk". I have tried booting after removing the "quiet" option from the kernel parameters just before selecting the kernel from the grub menu. I have also tried adding "dis_ucode_ldr" parameter to the initial parameters but all in vain.
For initramfs, make sure to follow instructions specific to your distro (search the web if you're unsure). For example, as I'm on Arch, I use mkinitcpio (see [1]) to generate initramfs after compiling the kernel. Thanks. [1]: https://wiki.archlinux.org/title/Mkinitcpio -- An old man doll... just what I always wanted! - Clara
Hi Bagas, On Fri, Dec 22, 2023 at 12:24 PM Bagas Sanjaya <bagasdotme@gmail.com> wrote:
On Thu, Dec 21, 2023 at 05:58:23PM +0530, Dileep Sankhla wrote:
Hello,
I have cloned and built the latest rc kernel using the default config but on boot, it stucks at "Loading initial ramdisk". I have tried booting after removing the "quiet" option from the kernel parameters just before selecting the kernel from the grub menu. I have also tried adding "dis_ucode_ldr" parameter to the initial parameters but all in vain.
For initramfs, make sure to follow instructions specific to your distro (search the web if you're unsure). For example, as I'm on Arch, I use mkinitcpio (see [1]) to generate initramfs after compiling the kernel.
On "sudo make install", I get an output line as "update-initramfs: Generating /boot/initrd.img-6.7.0-rc6-test". I have not gone through Makefile though. So I think I am using the right tool on my distro (Ubuntu 22.04.03 LTS). As you suggested, I also manually deleted and created the image using update-initramfs (see [1]) after compiling the kernel. Still the same problem.
Thanks.
[1]: https://wiki.archlinux.org/title/Mkinitcpio
-- An old man doll... just what I always wanted! - Clara
Regards, Dileep. [1]: https://manpages.ubuntu.com/manpages/jammy/en/man8/update-initramfs.8.html <https://manpages.ubuntu.com/manpages/jammy/en/man8/update-initramfs.8.html>
Hi Dileep, On Thu, Dec 21, 2023 at 05:58:23PM +0530, Dileep Sankhla wrote:
Hello,
I have cloned and built the latest rc kernel using the default config but on boot, it stucks at "Loading initial ramdisk". I have tried booting after removing the "quiet" option from the kernel parameters just before selecting the kernel from the grub menu. I have also tried adding "dis_ucode_ldr" parameter to the initial parameters but all in vain.
How to look for the underlying issue and solve it?
Regards, Dileep
I had this issue as well. I found a solution on stackexchange(..I think) that I wanted to link here.. but can't seem to find it now. For reference, I was using Ubuntu. This was my case: * Possible reason - initrd.img file is too large I checked the size of initrd.img-<kernel name> at /boot. The file was ~500mb, much larger than the initrd for the kernel that came with Ubuntu(~40mb) * Possible solution - Before installing the kernel, change MODULES=most to MODULES=dep in /etc/initramfs-tools/initramfs.conf to generate smaller initrd.img files. The new initrd's for all other kernels I have installed afterwards have been ~55MB. Regards, Soumya Negi
Hi Soumya, On Fri, Dec 22, 2023 at 2:24 PM Soumya Negi <soumya.negi97@gmail.com> wrote:
Hi Dileep,
On Thu, Dec 21, 2023 at 05:58:23PM +0530, Dileep Sankhla wrote:
Hello,
I have cloned and built the latest rc kernel using the default config but on boot, it stucks at "Loading initial ramdisk". I have tried booting after removing the "quiet" option from the kernel parameters just before selecting the kernel from the grub menu. I have also tried adding "dis_ucode_ldr" parameter to the initial parameters but all in vain.
How to look for the underlying issue and solve it?
Regards, Dileep
I had this issue as well. I found a solution on stackexchange(..I think) that I wanted to link here.. but can't seem to find it now. For reference, I was using Ubuntu. This was my case:
* Possible reason - initrd.img file is too large I checked the size of initrd.img-<kernel name> at /boot. The file was ~500mb, much larger than the initrd for the kernel that came with Ubuntu(~40mb)
* Possible solution - Before installing the kernel, change MODULES=most to MODULES=dep in /etc/initramfs-tools/initramfs.conf to generate smaller initrd.img files. The new initrd's for all other kernels I have installed afterwards have been ~55MB.
Thanks for your solution. Mine is fine in size and I am already using MODULES=dep.
Regards, Soumya Negi
Regards, Dileep.
On Fri, Dec 22, 2023 at 5:07 PM Dileep Sankhla <dileepsankhla.ds@gmail.com> wrote:
Hi Soumya,
On Fri, Dec 22, 2023 at 2:24 PM Soumya Negi <soumya.negi97@gmail.com> wrote:
Hi Dileep,
On Thu, Dec 21, 2023 at 05:58:23PM +0530, Dileep Sankhla wrote:
Hello,
I have cloned and built the latest rc kernel using the default config but on boot, it stucks at "Loading initial ramdisk". I have tried booting after removing the "quiet" option from the kernel parameters just before selecting the kernel from the grub menu. I have also tried adding "dis_ucode_ldr" parameter to the initial parameters but all in vain.
How to look for the underlying issue and solve it?
Regards, Dileep
I had this issue as well. I found a solution on stackexchange(..I think) that I wanted to link here.. but can't seem to find it now. For reference, I was using Ubuntu. This was my case:
* Possible reason - initrd.img file is too large I checked the size of initrd.img-<kernel name> at /boot. The file was ~500mb, much larger than the initrd for the kernel that came with Ubuntu(~40mb)
* Possible solution - Before installing the kernel, change MODULES=most to MODULES=dep in /etc/initramfs-tools/initramfs.conf to generate smaller initrd.img files. The new initrd's for all other kernels I have installed afterwards have been ~55MB.
Thanks for your solution. Mine is fine in size and I am already using MODULES=dep.
Sorry, my bad. I thought 18M was good enough but after asking this on LinuxQuestions.org, I got to know that it was not sufficient for the boot success (see [1]). Copying the existing kernel version's config from `/boot` and running `make olddefconfig` solved the size issue for me. It is now ~78M. The size of the kernel's initrd that I was using earlier is ~71M.
Regards, Soumya Negi
Regards, Dileep.
Regards, Dileep [1]: https://www.linuxquestions.org/questions/linux-newbie-8/boot-freezes-at-load...
Hi Dileep, On Mon, Jan 01, 2024 at 04:46:03PM +0530, Dileep Sankhla wrote:
Thanks for your solution. Mine is fine in size and I am already using MODULES=dep.
Sorry, my bad. I thought 18M was good enough but after asking this on LinuxQuestions.org, I got to know that it was not sufficient for the boot success (see [1]). Copying the existing kernel version's config from `/boot` and running `make olddefconfig` solved the size issue for me. It is now ~78M. The size of the kernel's initrd that I was using earlier is ~71M.
Just for the clarity, the size of initrd being only 18 MB is likely not the root cause for your system not booting, it would likely be that some modules were missing earlier. Likely why you built linux with a default config (defconfig), many modules might have been missing, which are required on your system to boot correctly. For example, file system support for btrfs will require the btrfs module, etc. Generally while creating initrd, `dracut` (on rhel/fedora), or `mkinitcpio`/`mkinitramfs` also copy your kernel's modules (at /lib/modules/new-kernel-version/*) to the initrd. Since you had less modules the first time you built with defconfig, so initrd also had less modules, and hence size was only 18MB. Later when you built using the distro kernel's config, you likely had many more modules, and hence more modules were put in the initrd also, causing it's size to increase, and since you used distro kernel config, so your modules would be similar in the kernel you built, and hence similar size of the initrd ~70MB. It's a good start to use the distro config for building a kernel. PS. I have been able to successfully boot by building with defconfig, then manually enabling some drivers according to error messages during boot, but that is for learning only, normally it might be a waste of time. And also I boot my ArchLinux with no initrd, and have had even smaller initrd and booted successfully, how I did that was building only the modules I knew my system needed as built-in. Regards, Aditya Gupta
Hi Aditya, Yes, I also meant the same. Thanks for the additional info though. Regards, Dileep On Fri, Jan 5, 2024 at 1:33 PM Aditya Gupta <adityag@linux.ibm.com> wrote:
Hi Dileep,
On Mon, Jan 01, 2024 at 04:46:03PM +0530, Dileep Sankhla wrote:
Thanks for your solution. Mine is fine in size and I am already using MODULES=dep.
Sorry, my bad. I thought 18M was good enough but after asking this on LinuxQuestions.org, I got to know that it was not sufficient for the boot success (see [1]). Copying the existing kernel version's config from `/boot` and running `make olddefconfig` solved the size issue for me. It is now ~78M. The size of the kernel's initrd that I was using earlier is ~71M.
Just for the clarity, the size of initrd being only 18 MB is likely not the root cause for your system not booting, it would likely be that some modules were missing earlier.
Likely why you built linux with a default config (defconfig), many modules might have been missing, which are required on your system to boot correctly. For example, file system support for btrfs will require the btrfs module, etc.
Generally while creating initrd, `dracut` (on rhel/fedora), or `mkinitcpio`/`mkinitramfs` also copy your kernel's modules (at /lib/modules/new-kernel-version/*) to the initrd.
Since you had less modules the first time you built with defconfig, so initrd also had less modules, and hence size was only 18MB.
Later when you built using the distro kernel's config, you likely had many more modules, and hence more modules were put in the initrd also, causing it's size to increase, and since you used distro kernel config, so your modules would be similar in the kernel you built, and hence similar size of the initrd ~70MB.
It's a good start to use the distro config for building a kernel.
PS. I have been able to successfully boot by building with defconfig, then manually enabling some drivers according to error messages during boot, but that is for learning only, normally it might be a waste of time. And also I boot my ArchLinux with no initrd, and have had even smaller initrd and booted successfully, how I did that was building only the modules I knew my system needed as built-in.
Regards, Aditya Gupta
On Fri, 05 Jan 2024 10:42:53 +0530, Aditya Gupta said:
It's a good start to use the distro config for building a kernel.
PS. I have been able to successfully boot by building with defconfig, then manually enabling some drivers according to error messages during boot,
'make localmodconfig' is your friend. Make sure to plug in all your various USB or bluetooth etc devices first, so their driver modules get loaded.
On 05/01/24 15:02, Valdis Klētnieks wrote:
On Fri, 05 Jan 2024 10:42:53 +0530, Aditya Gupta said:
It's a good start to use the distro config for building a kernel. PS. I have been able to successfully boot by building with defconfig, then manually enabling some drivers according to error messages during boot, 'make localmodconfig' is your friend.
Make sure to plug in all your various USB or bluetooth etc devices first, so their driver modules get loaded.
Yes, I use it. Thanks for suggesting that Valdis. Thanks, Aditya Gupta
participants (5)
-
Aditya Gupta -
Bagas Sanjaya -
Dileep Sankhla -
Soumya Negi -
Valdis Klētnieks