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

Re: dbootstrap: understanding is_cdrom_image

> The problem here is that when the user select "install XXX from
> CD-ROM", I want an accurate test of whether or not this is an official
> CD-ROM or not.  Which *doesn't* rely on the bootargs to be set
> correctly.

That's not what I wrote the function for. So if you need that, use
something else, or add another return value. I say this because certain
things in debian-cd rely on this working properly, so I hope that nothing
will be messed with, since it may unknowingly affect debian-cd.

> Apparently non-zero return values means its some sort of CD-ROM
> ismage.  I would presume that '2' represents booting from a CD-image
> (thus we have /dists).  What I need is something like:
>     if (NAME_ISREG("/cdrom_image",&statbuf) || bootargs.cdrom) {
> 	if (NAME_ISDIR("/dists",&statbuf))
> 	    return 2;
> 	else
> 	    return 1;
>     } elsif (NAME_ISREG("/instmnt/.disks/info") {
> 	return 1;
>     } else
>         return 0;
> Does this seem correct?

You are missing the point of my function. It is meant to test if we are
booting from a cdrom. Your check is something completely different. Might
be better to make a new test just for your purposes, rather than risk
messing up the current function.


/  Ben Collins  --  ...on that fantastic voyage...  --  Debian GNU/Linux   \
`  bcollins@debian.org  --  bcollins@openldap.org  --  bcollins@linux.com  '

Reply to: