2

I am attempting to modify the bio structure (in blk_types.h) for linux-3.2.0 (running Ubuntu). The only thing I need to do to this structure is to add an additional variable to keep track of an integer variable (it is for a tainting algorithm). However, adding a single line such as "int id;" to the structure halts the boot sequence of the OS.

It compiles, but when booting it gives the following error:

>Gave up wiating for root device. Common problems:  
>Boot args  
>check rootdelay= ...  
>check root= ...  
>missing modules (cat /proc/modules; ls /dev)  
>ALERT! /dev/disk/by-uuid/15448888-84a0-4ccf-a02a-0feb3f150a84 does not exist. Dropping to a shell!  
>BusyBox Built In Shell ...  
>(initramfs)

I took a look around using the given shell and could not find the desired file system by uuid or otherwise (no /dev/sda). Any ideas what might be going on?

Thanks,

-Misiu

  • It sounds like you haven't rebuilt your initramfs to include the necessary kernel modules for your newly built kernel. – caf Jan 11 '13 at 05:26
  • I have rebuilt and checked the initrd images. Both the existing (working) and the modified kernels have exactly the same initrd images (the same as in I unzipped and cpio'ed them both into directories and compared them with a recursive diff). Since the change I made is so minor, I assume they should be the same. Please let me know if I am wrong in this assumption. – user1959697 Jan 17 '13 at 15:13
  • You'll need to rebuild all the modules, because they depend on the layout of the `struct bio` that you've changed. – caf Jan 17 '13 at 21:10

2 Answers2

1

I suppose you are trying to modify the Linux kernel header bio.h, not its userland "friend" bui.h.

Said that I must warn you that in many places around kernel sizeof() may be used which is more portable and perhaps some other implementation or API may expect some fixed size. If the later is true then you'll have problems since bio' struct size has been changed by you.

It is a guessing with no further investigation from my side (I mean I hadn't investigate about bio in detail) but when patching the Linux kernel one must make sure of any possible side effects and take the whole scenario on account, specially when modifying lower levels implementation.

Bio helper functions do lots of low level operations on bio struct, take a loot at bio_integrity.c for example.

1

I managed to fix the problem with your help Caf. Though re-building/installing the modules did not seem to help immediately, I was able to get the system to boot by building the SATA drivers into the kernel, as advised by this forum thread: https://unix.stackexchange.com/questions/8405/kernel-cant-find-dev-sda-file-during-boot.

Thanks for your help,

-Misiu

Community
  • 1
  • 1