[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] loopback vs. 'set root='

From: Colin Watson
Subject: [PATCH] loopback vs. 'set root='
Date: Thu, 10 Sep 2009 21:30:43 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

For Wubi, I'd like to do something like this:

  set root=... # actually prepare_grub_to_access_device
  loopback loop0 /ubuntu/disks/root.disk
  set root=(loop0)
  linux /boot/...

Unfortunately, if you set root after running loopback, any attempts to
open files on the loopback device resolve the loopback file name
relative to the *new* root, not the root at the time loopback was
invoked, and so the above recurses until it runs out of stack. I think
it's fairly clear that only the root that was in place when you ran
loopback should be relevant to the loopback file name.

I can see two ways to fix this. One is to save and restore root in
grub_loopback_open while opening the loopback file, and the other is
simply to keep the loopback file open and stash it in the grub_loopback
structure. Having implemented both alternatives, I significantly prefer
the cleanliness of the latter and think it's likely to be more
efficient, but I'm attaching both alternatives to this mail. Please let
me know what you think.


Colin Watson                                       address@hidden

Attachment: loopback-save-root.diff
Description: Text Data

Attachment: loopback-stash-file.diff
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]