Skip to contentSkip to conversation

Hi from Outreachy Intern

DISCUSSION Emily Peri 3 participants 5 messages Oct 12, 2022 – Oct 18, 2022

lore
Share & tools
lore

Emily Peri

author
#0 lore raw

Hi everyone,

My name is Emily and I'm a new Outreachy intern for the upcoming phase. I'm looking for projects to get involved in and I'm really intersted in working on Coccinelle!

I started the first patch tutorial, but ran into an issue. I'm currently
using a dual operating system setup-- I have Ubuntu and Windows on the
same machine. The thing is, I have my Ubuntu filesystem on an external
ssd. The boot parition is on the internal disk. Following the tutorial, after compiling and installing the kernel, I tried to reboot with it, which caused a kernel panic. The exact error
was (along with the call trace):

Kernel panic -- not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

From what I read online, one of the problems that may be going on is that the kernel wasn't compiled with the necessary drivers to interact with the external ssd and filesystem. Am I understanding this correctly?
Can this be solved by recompiling with the necessary settings in
.config?

Another thing I'm seeing is that I need to create an initramfs for the new kernel. Do I need to do both? If the kernel can access the root filesystem on the external ssd, would it still need a temporary filesystem for the boot process?

Finally, I'm wondering if I need to set the "root" variable for grub when it loads the kernel. Such as, GRUB_CMDLINE_LINUX_DEFAULT="root=/dev/sb3" where sb3 is the filesystem partition. I'm just not sure if this is necessary
because grub doesn't have trouble loading my current kernel.

Sorry for so many questions! Hopefully I can figure this out, but any help is greatly appreciated!

Best,
Emily

#1 lore raw
Quoted 12 lines · Emily Peri

Hi everyone,

My name is Emily and I'm a new Outreachy intern for the upcoming phase. I'm looking for projects to get involved in and I'm really intersted in working on Coccinelle!

I started the first patch tutorial, but ran into an issue. I'm currently
using a dual operating system setup-- I have Ubuntu and Windows on the
same machine. The thing is, I have my Ubuntu filesystem on an external
ssd. The boot parition is on the internal disk. Following the tutorial, after compiling and installing the kernel, I tried to reboot with it, which caused a kernel panic. The exact error
was (along with the call trace):

Quoted 6 lines
Kernel panic -- not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

From what I read online, one of the problems that may be going on is that the kernel wasn't compiled with the necessary drivers to interact with the external ssd and filesystem. Am I understanding this correctly?
Can this be solved by recompiling with the necessary settings in
.config?

Hello and welcome.

Since you already have Linux running on your machine, did you use the same .config as was being used on your machine? You can find it in the /boot directory. make oldconfig should take this .config file automatically.

julia

Quoted 14 lines

Another thing I'm seeing is that I need to create an initramfs for the new kernel. Do I need to do both? If the kernel can access the root filesystem on the external ssd, would it still need a temporary filesystem for the boot process?

Finally, I'm wondering if I need to set the "root" variable for grub when it loads the kernel. Such as, GRUB_CMDLINE_LINUX_DEFAULT="root=/dev/sb3" where sb3 is the filesystem partition. I'm just not sure if this is necessary
because grub doesn't have trouble loading my current kernel.

Sorry for so many questions! Hopefully I can figure this out, but any help is greatly appreciated!

Best,
Emily

author
#2 lore raw

Thanks Julia for your reply!
I recompiled the kernel following your advice, but am still running into the same kernel panic. After loading the kernel with grub, the following lines are printed:
Loading Linux 6.0.0+ ...
Loading inital ramdisk ...
error: can't allocate initrd.

Press any key to continue...

After I enter a key to continue, I get the same kernel panic as before.

I should mention that after running 'make olddefconfig', I did actually make two changes to the .config, CONFIG_SYSTEM_TRUSTED_KEYS="debian/canonical-certs.pem" -> CONFIG_SYSTEM_TRUSTED_KEYS="" CONFIG_SYSTEM_REVOCATION_KEYS="debian/canonical-revoked-certs.pem" -> CONFIG_SYSTEM_REVOCATION_KEYS="" I changed these options because the kernel wasn't compiling otherwise,
and I saw this had been discussed a previous email thread.

Is there a way to get a debug output when grub runs initrd /boot/initrd.img? Is there any explanation about why the "error: can't allocate initrd" might happen? Any help is appreciated!

Best,
Emily

Quoted 45 lines · Julia Lawall
Quoted 12 lines · Emily Peri

Hi everyone,

My name is Emily and I'm a new Outreachy intern for the upcoming phase. I'm looking for projects to get involved in and I'm really intersted in working on Coccinelle!

I started the first patch tutorial, but ran into an issue. I'm currently
using a dual operating system setup-- I have Ubuntu and Windows on the
same machine. The thing is, I have my Ubuntu filesystem on an external
ssd. The boot parition is on the internal disk. Following the tutorial, after compiling and installing the kernel, I tried to reboot with it, which caused a kernel panic. The exact error
was (along with the call trace):

Quoted 6 lines
Kernel panic -- not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

From what I read online, one of the problems that may be going on is that the kernel wasn't compiled with the necessary drivers to interact with the external ssd and filesystem. Am I understanding this correctly?
Can this be solved by recompiling with the necessary settings in
.config?

Hello and welcome.

Since you already have Linux running on your machine, did you use the same .config as was being used on your machine? You can find it in the /boot directory. make oldconfig should take this .config file automatically.

julia

Quoted 14 lines

Another thing I'm seeing is that I need to create an initramfs for the new kernel. Do I need to do both? If the kernel can access the root filesystem on the external ssd, would it still need a temporary filesystem for the boot process?

Finally, I'm wondering if I need to set the "root" variable for grub when it loads the kernel. Such as, GRUB_CMDLINE_LINUX_DEFAULT="root=/dev/sb3" where sb3 is the filesystem partition. I'm just not sure if this is necessary
because grub doesn't have trouble loading my current kernel.

Sorry for so many questions! Hopefully I can figure this out, but any help is greatly appreciated!

Best,
Emily

#3 lore raw
Quoted 17 lines · Emily Peri

Thanks Julia for your reply!
I recompiled the kernel following your advice, but am still running into the same kernel panic. After loading the kernel with grub, the following lines are printed:
Loading Linux 6.0.0+ ...
Loading inital ramdisk ...
error: can't allocate initrd.

Press any key to continue...

After I enter a key to continue, I get the same kernel panic as before.

I should mention that after running 'make olddefconfig', I did actually make two changes to the .config, CONFIG_SYSTEM_TRUSTED_KEYS="debian/canonical-certs.pem" -> CONFIG_SYSTEM_TRUSTED_KEYS="" CONFIG_SYSTEM_REVOCATION_KEYS="debian/canonical-revoked-certs.pem" -> CONFIG_SYSTEM_REVOCATION_KEYS="" I changed these options because the kernel wasn't compiling otherwise,
and I saw this had been discussed a previous email thread.

Quoted 3 lines

Is there a way to get a debug output when grub runs initrd /boot/initrd.img? Is there any explanation about why the "error: can't allocate initrd" might happen? Any help is appreciated!

Hi,

I'm sorry, but I don't know anything more about this than what you can find in Google. From what I saw, it seemed like it might be a file system problem, maybe it is trying to do something in the wrong place.

There was a suggestion on the list to use a VM. Perhaps that will work directly.

julia

Quoted 52 lines

Best,
Emily

Quoted 45 lines · Julia Lawall
Quoted 12 lines · Emily Peri

Hi everyone,

My name is Emily and I'm a new Outreachy intern for the upcoming phase. I'm looking for projects to get involved in and I'm really intersted in working on Coccinelle!

I started the first patch tutorial, but ran into an issue. I'm currently
using a dual operating system setup-- I have Ubuntu and Windows on the
same machine. The thing is, I have my Ubuntu filesystem on an external
ssd. The boot parition is on the internal disk. Following the tutorial, after compiling and installing the kernel, I tried to reboot with it, which caused a kernel panic. The exact error
was (along with the call trace):

Quoted 6 lines
Kernel panic -- not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

From what I read online, one of the problems that may be going on is that the kernel wasn't compiled with the necessary drivers to interact with the external ssd and filesystem. Am I understanding this correctly?
Can this be solved by recompiling with the necessary settings in
.config?

Hello and welcome.

Since you already have Linux running on your machine, did you use the same .config as was being used on your machine? You can find it in the /boot directory. make oldconfig should take this .config file automatically.

julia

Quoted 14 lines

Another thing I'm seeing is that I need to create an initramfs for the new kernel. Do I need to do both? If the kernel can access the root filesystem on the external ssd, would it still need a temporary filesystem for the boot process?

Finally, I'm wondering if I need to set the "root" variable for grub when it loads the kernel. Such as, GRUB_CMDLINE_LINUX_DEFAULT="root=/dev/sb3" where sb3 is the filesystem partition. I'm just not sure if this is necessary
because grub doesn't have trouble loading my current kernel.

Sorry for so many questions! Hopefully I can figure this out, but any help is greatly appreciated!

Best,
Emily

#4 lore raw
Quoted 25 lines · Julia Lawall
Quoted 17 lines · Emily Peri

Thanks Julia for your reply!
I recompiled the kernel following your advice, but am still running into the same kernel panic. After loading the kernel with grub, the following lines are printed:
Loading Linux 6.0.0+ ...
Loading inital ramdisk ...
error: can't allocate initrd.

Press any key to continue...

After I enter a key to continue, I get the same kernel panic as before.

I should mention that after running 'make olddefconfig', I did actually make two changes to the .config, CONFIG_SYSTEM_TRUSTED_KEYS="debian/canonical-certs.pem" -> CONFIG_SYSTEM_TRUSTED_KEYS="" CONFIG_SYSTEM_REVOCATION_KEYS="debian/canonical-revoked-certs.pem" -> CONFIG_SYSTEM_REVOCATION_KEYS="" I changed these options because the kernel wasn't compiling otherwise,
and I saw this had been discussed a previous email thread.

Quoted 3 lines

Is there a way to get a debug output when grub runs initrd /boot/initrd.img? Is there any explanation about why the "error: can't allocate initrd" might happen? Any help is appreciated!

Quoted 8 lines

Hi,

I'm sorry, but I don't know anything more about this than what you can find in Google. From what I saw, it seemed like it might be a file system problem, maybe it is trying to do something in the wrong place.

There was a suggestion on the list to use a VM. Perhaps that will work directly.

I switched to using VMPlayer and setup Debian as my guest OS for the patches. I have removed the reference to .pem values in my copied .config file [set the parameters to =""]. That helped me compile the latest staging tree successfully and generate 6.0.0 build. I was then able to follow the rest of the instructions and boot into the new release in the VM.
My host continues to run under secure boot.

HTH.

./drv

Quoted 57 lines

julia

Quoted 52 lines

Best,
Emily

Quoted 45 lines · Julia Lawall
Quoted 12 lines · Emily Peri

Hi everyone,

My name is Emily and I'm a new Outreachy intern for the upcoming phase. I'm looking for projects to get involved in and I'm really intersted in working on Coccinelle!

I started the first patch tutorial, but ran into an issue. I'm currently
using a dual operating system setup-- I have Ubuntu and Windows on the
same machine. The thing is, I have my Ubuntu filesystem on an external
ssd. The boot parition is on the internal disk. Following the tutorial, after compiling and installing the kernel, I tried to reboot with it, which caused a kernel panic. The exact error
was (along with the call trace):

Quoted 6 lines
Kernel panic -- not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

From what I read online, one of the problems that may be going on is that the kernel wasn't compiled with the necessary drivers to interact with the external ssd and filesystem. Am I understanding this correctly?
Can this be solved by recompiling with the necessary settings in
.config?

Hello and welcome.

Since you already have Linux running on your machine, did you use the same .config as was being used on your machine? You can find it in the /boot directory. make oldconfig should take this .config file automatically.

julia

Quoted 14 lines

Another thing I'm seeing is that I need to create an initramfs for the new kernel. Do I need to do both? If the kernel can access the root filesystem on the external ssd, would it still need a temporary filesystem for the boot process?

Finally, I'm wondering if I need to set the "root" variable for grub when it loads the kernel. Such as, GRUB_CMDLINE_LINUX_DEFAULT="root=/dev/sb3" where sb3 is the filesystem partition. I'm just not sure if this is necessary
because grub doesn't have trouble loading my current kernel.

Sorry for so many questions! Hopefully I can figure this out, but any help is greatly appreciated!

Best,
Emily