Page 1 of 1

how can i have grub2-linux-install make the mbr file into a

Posted: Mon Feb 05, 2024 8:07 am
by kocoman
how can i have grub2-linux-install make the mbr file into a 512byte file instead of writing to the MBR? and how to create boot.img to dd to the 1M space thx

Re: how can i have grub2-linux-install make the mbr file int

Posted: Mon Feb 05, 2024 11:39 am
by Octocontrabass
Why do you want to do that? The GRUB installer customizes those files to match your setup. If the GRUB installer doesn't guess the correct settings, you can pass options to override its guesses.

If you're trying to install GRUB on a disk that isn't bootable, the usual strategy is to boot a live CD and chroot into the unbootable system so the installer has access to everything it needs.

Re: how can i have grub2-linux-install make the mbr file int

Posted: Mon Feb 05, 2024 1:38 pm
by kocoman
Octocontrabass wrote:Why do you want to do that? The GRUB installer customizes those files to match your setup. If the GRUB installer doesn't guess the correct settings, you can pass options to override its guesses.

If you're trying to install GRUB on a disk that isn't bootable, the usual strategy is to boot a live CD and chroot into the unbootable system so the installer has access to everything it needs.
Its for turning off the mbp10,1's nvidia via outb commands. I am using bootcamp and the Metro booter can boot a MBR sector .. anyway I am testing vbt debugging blackscreen .. its complicated I don't think I can solve it.

Now I try bosch emulator and install ubuntu server to try to step thru how it gets the 2048 sector to load the 2nd stage img

Re: how can i have grub2-linux-install make the mbr file int

Posted: Tue Feb 06, 2024 8:30 am
by Ringding
I don’t understand the reference to 2048 byte sectors, but in the normal BIOS/MBR boot setup with 512 byte sectors, GRUB does not only occupy the MBR, but also the free space behind it, that is/was traditionally at least 62 sectors. The BIOS only loads the first one, which then loads the rest, and this is enough code space to make it understand filesystems and partitions, and then it goes from there.

Re: how can i have grub2-linux-install make the mbr file int

Posted: Tue Feb 06, 2024 11:04 am
by Octocontrabass
kocoman wrote:Its for turning off the mbp10,1's nvidia via outb commands.
Why do you need to extract the MBR and boot.img to do that? Can't you put those commands in grub.cfg and install it like normal?

Re: how can i have grub2-linux-install make the mbr file int

Posted: Wed Feb 21, 2024 3:50 pm
by kocoman
ok I got it to work. the core.img is compressed is very hard to edit.. (just blank screen with cursor) I got to grub rescue, then booted normally, then rerun the grub-install.. that installed the correct core.img
I got the outb commands to work to disable the dgpu