After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 740697 - grub2: If using --sysroot, run in chroot
grub2: If using --sysroot, run in chroot
Status: RESOLVED FIXED
Product: ostree
Classification: Infrastructure
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: OSTree maintainer(s)
OSTree maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-11-25 16:47 UTC by Colin Walters
Modified: 2014-11-25 17:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
grub2: If using --sysroot, run in chroot (3.99 KB, patch)
2014-11-25 16:47 UTC, Colin Walters
committed Details | Review

Description Colin Walters 2014-11-25 16:47:26 UTC
In Anaconda, we're using "ostree admin --sysroot=/mnt/sysimage
instutil set-kargs", and it was working before, but newer versions of
lorax strip out /etc/system-release which grub2 wants.

That was wrong anyways as we want the /etc/system-release from the
target root.

(Man, grub2 sucks...give me a declarative config file format I can just
 write)
Comment 1 Colin Walters 2014-11-25 16:47:28 UTC
Created attachment 291477 [details] [review]
grub2: If using --sysroot, run in chroot
Comment 2 Matthew Barnes 2014-11-25 17:11:48 UTC
Review of attachment 291477 [details] [review]:

If I understand the issue correctly, basically grub2 hard-codes reading from "/etc/system-release", so you need to manipulate the file system to trick it into reading a different file.  That right?

A slightly easier way to check for root might be

  !g_file_has_parent (self->sysroot->path, NULL)

but I leave that up to you.

Otherwise patch looks okay to me.
Comment 3 Colin Walters 2014-11-25 17:24:57 UTC
Attachment 291477 [details] pushed as 1218799 - grub2: If using --sysroot, run in chroot