Bug#791794: Detecting a d-i context from within /target? (was: Bug#791794: UUID not found for root)

2015-07-22 Thread Steve McIntyre
On Thu, Jul 16, 2015 at 04:50:35PM +0200, Cyril Brulebois wrote:
>Hi,
>
>If adding support for a variable looks like a good idea, how should we
>name it?
>
>Using sources.debian.net, looking for DEBIAN_INSTALLER returns 3 hits:
> - obs-build
> - live-build
> - libdebian-installer
>
>live-build actually uses longer variable names, so not an issue:
>| LB_DEBIAN_INSTALLER
>| LB_MIRROR_DEBIAN_INSTALLER
>| LB_PARENT_DEBIAN_INSTALLER
>| LB_PARENT_MIRROR_DEBIAN_INSTALLER
>
>obs-build uses the same variables.
>
>libdebian-installer uses DEBIAN_INSTALLER__* for define/#include guards,
>plus a LIBDEBIAN_INSTALLER_MAP_REAL #define.
>
>So DEBIAN_INSTALLER shouldn't be an issue. Maybe something more specific
>would make it easier to check for later…

We could use DEBIAN_INSTALLER_STEP or similar to pass on information
about what the state of the installer is, even. Or maybe that's more
detail than we need right now. :-)

DEBIAN_INSTALLER_RUNNING=y for a sensible default to check?

-- 
Steve McIntyre, Cambridge, UK.st...@einval.com
Google-bait:   http://www.debian.org/CD/free-linux-cd
  Debian does NOT ship free CDs. Please do NOT contact the mailing
  lists asking us to send them to you.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#791794: Detecting a d-i context from within /target? (was: Bug#791794: UUID not found for root)

2015-07-16 Thread Cyril Brulebois
Hi,

Colin Watson  (2015-07-16):
> On Thu, Jul 16, 2015 at 10:05:48AM -0400, Martin Michlmayr wrote:
> > On a related note, flash-kernel waits for user input when the UUID of
> > root is not found, which makes sense in an installed system, but not
> > in d-i -- for the user, d-i will just hang with no obvious error.  Is
> > there a good way to solve this?  In particular, is there a way for a
> > postinst in /target to detect that it's run from within d-i?  KiBi
> > doesn't know a way.  I guess a debconf prompt is the way to go?
> 
> I think trying to add debconf prompting to an initramfs hook would
> probably be unwise.  flash-kernel already seems to check for
> DEBIAN_FRONTEND=noninteractive, so you could just set that in
> flash-kernel-installer.postinst when calling flash-kernel.

I'm not aware of other use cases right now, but maybe we could or should
standardize on an environment variable we would set in { all | most |
a particular set of } calls to let scripts know they're being executed
within an installer context?

Right now, provided /proc is mounted within /target, looking at /proc/1
might help one figure out that one /might/ might running within d-i; or
looking for main-menu in ps; both approaches look very fragile.


If adding support for a variable looks like a good idea, how should we
name it?

Using sources.debian.net, looking for DEBIAN_INSTALLER returns 3 hits:
 - obs-build
 - live-build
 - libdebian-installer

live-build actually uses longer variable names, so not an issue:
| LB_DEBIAN_INSTALLER
| LB_MIRROR_DEBIAN_INSTALLER
| LB_PARENT_DEBIAN_INSTALLER
| LB_PARENT_MIRROR_DEBIAN_INSTALLER

obs-build uses the same variables.

libdebian-installer uses DEBIAN_INSTALLER__* for define/#include guards,
plus a LIBDEBIAN_INSTALLER_MAP_REAL #define.

So DEBIAN_INSTALLER shouldn't be an issue. Maybe something more specific
would make it easier to check for later…


Thoughts?

Mraw,
KiBi.


signature.asc
Description: Digital signature