#585563 grub2: teach grub-mkconfig to accept a -t <target root> argument

Package:
grub2
Source:
grub2
Description:
GRand Unified Bootloader, version 2 (dummy package)
Submitter:
Alex Chiang
Date:
2010-06-11 18:33:05 UTC
Severity:
wishlist
#585563#5
Date:
2010-06-11 18:30:20 UTC
From:
To:
There may be times where we want to generate a grub.cfg in an environment where the installation /target does not actually contain grub binaries.

Consider a scenario where we copy a squashfs image directly to a hard drive with the intention of booting from it in the future. Note that this differs from a live install in that we are not copying the uncompressed *contents* of the squashfs image, but rather, the compressed image itself.

In this case, we cannot chroot to /target and run grub-mkconfig as we normally might, since various grub scripts will not exist.

Nor can we loopback mount the squashfs image, chroot to it, and execute grub, since that file system will be read-only.

All we really want is to generate a grub.cfg, but for a device that is mounted at some other mountpoint other than /.

The proposed patch may not be the final form, but please consider it an example of what I am proposing. It is intended to serve the same purpose as 'grub-install --root-directory=/target'