Find disk with GRUB

Programming, for all ages and all languages.
Post Reply
grenders22
Posts: 16
Joined: Thu Mar 01, 2018 10:09 am

Find disk with GRUB

Post 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
Octocontrabass
Member
Member
Posts: 5568
Joined: Mon Mar 25, 2013 7:01 pm

Re: Find disk with GRUB

Post 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?
grenders22
Posts: 16
Joined: Thu Mar 01, 2018 10:09 am

Re: Find disk with GRUB

Post 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.
Octocontrabass
Member
Member
Posts: 5568
Joined: Mon Mar 25, 2013 7:01 pm

Re: Find disk with GRUB

Post 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.
Post Reply