Skip to contentSkip to conversation

future of grub commands setup and install ?

DISCUSSION lode leroy 5 participants 5 messages Sep 10, 2010

lore
Share & tools
lore

lode leroy

author
#0 lore raw
Quoted 8 lines

GRUB lacks filesystem write support (intentionally). Therefore, installing GRUB from GRUB is not possible. Given that setup command can only perform part of this, it is unrealistic to pretend setup command is useful. This is why it was removed.

Signature · 1 line
Robert Millan

I think it would be helpful if a command existed to install grub from grub, given a directory /boot/grub/ already present, i.e. Write boot sector+stage1 to the disk. It may be easy to copy files onto the filesystem, but not-so-easy to create a working native grub.

-- lode

#1 lore raw

2010/9/10, lode leroy <[email protected]>:

Quoted 3 lines

It may be easy to copy files onto the filesystem, but not-so-easy
to create a working native grub.

What's hard about grub-install /dev/sda ?

Signature · 1 line
Robert Millan
#2 lore raw
Quoted 4 lines

What's hard about grub-install /dev/sda ?

you need a running unix linux ...

Bernhard

#3 lore raw
In reply to lode leroy
Quoted 4 lines · lode leroy

I think it would be helpful if a command existed to install grub from grub, given a directory /boot/grub/ already present, i.e. Write boot sector+stage1 to the disk. It may be easy to copy files onto the filesystem, but not-so-easy to create a working native grub.

grub2 doesn't have a stage1. It creates one after examining the system it is running on to determine which modules have to be used to create the stage1.

Of course it also needs to understand how much space there is for this stage1 file, which means understanding filesystems or at least partition layout specifics.

Also, should it be generating an efi, or pc-bios, or ieee-* image?

With grub1 it was simple. There was one stage1, and a certain set of stage1.5 files (one per supported filesystem) and a stage2. That was it. nothing modular, nothing to assemble. If you take all the modules for grub2, you end up with a 1MB+ stage1 file, which you can't embed in one track.

Signature · 1 line
Len Sorensen
#4 lore raw
Quoted 9 lines · Lennart Sorensen
Quoted 4 lines · lode leroy

I think it would be helpful if a command existed to install grub from grub, given a directory /boot/grub/ already present, i.e. Write boot sector+stage1 to the disk. It may be easy to copy files onto the filesystem, but not-so-easy to create a working native grub.

grub2 doesn't have a stage1. It creates one after examining the system it is running on to determine which modules have to be used to create the stage1.

You and lode leroy are both confusing GRUB Legacy's Stage 1.5 (or possibly Stage 2) with Stage 1. GRUB Legacy's Stage 1 is the boot sector, and is precisely equivalent to GRUB 2's boot.img, which is a single 512-byte file.

Quoted 1 line

Also, should it be generating an efi, or pc-bios, or ieee-* image?

This is clearly specific to the GRUB build you're using.

Quoted 5 lines

With grub1 it was simple. There was one stage1, and a certain set of stage1.5 files (one per supported filesystem) and a stage2. That was it. nothing modular, nothing to assemble. If you take all the modules for grub2, you end up with a 1MB+ stage1 file, which you can't embed in one track.

Modules are built into a core.img object which is analogous to something a bit like GRUB Legacy's Stage 1.5 and a bit like Stage 2. See
http://www.gnu.org/software/grub/manual/grub.html#Images for a conversion chart.

Signature · 1 line
Colin Watson                                       [[email protected]]