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

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
kocoman
Posts: 4
Joined: Sun Jun 25, 2023 9:53 am

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

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

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

Post 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.
kocoman
Posts: 4
Joined: Sun Jun 25, 2023 9:53 am

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

Post 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
Ringding
Posts: 10
Joined: Fri Nov 26, 2021 11:08 am

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

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

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

Post 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?
kocoman
Posts: 4
Joined: Sun Jun 25, 2023 9:53 am

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

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