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

Alex Chiang achiang at canonical.com
Fri Jun 11 18:30:20 UTC 2010


Package: grub2
Version: 1.98
Severity: wishlist
Tags: patch

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'


-- System Information:
Debian Release: squeeze/sid
  APT prefers lucid-updates
  APT policy: (500, 'lucid-updates'), (500, 'lucid-security'), (500, 'lucid')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-22-generic (SMP w/2 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 978_grub-mkconfig_target_root.diff
Type: text/x-diff
Size: 2353 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20100611/0f0a68bd/attachment.diff>


More information about the Pkg-grub-devel mailing list