Page 1 of 1

Find disk with GRUB

Posted: Fri Nov 02, 2018 4:23 am
by grenders22
Good day! I can not set the correct parameters for GRUB. No matter how hard I try, I end up with zero connected modules / mods. In GRUB checked the disk, UUID and partition, in grub indicated correctly.

Code: Select all

insmod part_msdos
insmod ext2
set root='hd0,msdos1'

menuentry "os" {
	search --no-floppy --fs-uuid --set=root a15a3016-0700-4ca1-8f4f-e05f0d946417
	multiboot /boot/os root=UUID=a15a3016-0700-4ca1-8f4f-e05f0d946417
}

Code: Select all

if(mboot_ptr->mods_count > 0) //always a false

Re: Find disk with GRUB

Posted: Fri Nov 02, 2018 4:43 am
by Octocontrabass
I don't see you loading any modules for your OS, just modules for GRUB.

Maybe you're confusing the insmod and module commands?

Re: Find disk with GRUB

Posted: Fri Nov 02, 2018 4:52 am
by grenders22
Octocontrabass wrote:Maybe you're confusing the insmod and module commands?
Maybe. Previously, I used the module for loading the initd. Maybe my question will be stupid. But how then can I connect the hard disk partition through the modules?

Code: Select all

menuentry "os" {
	multiboot /boot/os
	module ????
}
I'm trying to get at least some superblock information.

Re: Find disk with GRUB

Posted: Fri Nov 02, 2018 5:11 am
by Octocontrabass
Isn't that what the UUID in your kernel command line is for? Scan the available partitions for the one with the matching UUID.

Modules have to be files for GRUB to load them, so I don't see any way to have a partition be a module.