On Thu, Nov 24, 2011 at 06:16:48AM +0200, Zeeshan Ali (Khattak) wrote:
> From: "Zeeshan Ali (Khattak)" <[email protected]>
> 
> Detection tool now prints an environment variable 'OSINFO_MEDIA' with
> the value of the ID of the media in the OS that was positively matched
> against the media in question.
> 
> This implies setting of a udev property for the device by the same name.

Hmm this also means the OSINFO_LIVE/OSINFO_INSTALLER properties are no
longer that useful, we can go from ID to database entry and get these
properties from there. I'm pointing this out since iirc the less things we
stick in udev, the better.

Christophe

> ---
>  data/95-osinfo.rules.in |    6 ++++--
>  tools/osinfo-detect.c   |    2 ++
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/data/95-osinfo.rules.in b/data/95-osinfo.rules.in
> index 2d0defd..917858c 100644
> --- a/data/95-osinfo.rules.in
> +++ b/data/95-osinfo.rules.in
> @@ -28,12 +28,14 @@ ACTION=="change", \
>   ENV{ID_FS_TYPE}!="iso9660", \
>   OSINFO_BOOTABLE="", \
>   OSINFO_INSTALLER="" \
> - OSINFO_LIVE=""
> + OSINFO_LIVE="" \
> + OSINFO_MEDIA=""
>  
>  ACTION=="change", \
>   SUBSYSTEM=="block", \
>   ENV{ID_FS_TYPE}!="udf", \
>   OSINFO_BOOTABLE="", \
>   OSINFO_INSTALLER="" \
> - OSINFO_LIVE=""
> + OSINFO_LIVE="" \
> + OSINFO_MEDIA=""
>  
> diff --git a/tools/osinfo-detect.c b/tools/osinfo-detect.c
> index 750f98f..5413dec 100644
> --- a/tools/osinfo-detect.c
> +++ b/tools/osinfo-detect.c
> @@ -91,6 +91,8 @@ static void print_os(OsinfoOs *os, OsinfoMedia *media)
>              g_print("OSINFO_INSTALLER=%s\n", id);
>          if (osinfo_media_get_live (media))
>              g_print("OSINFO_LIVE=%s\n", id);
> +        g_print("OSINFO_MEDIA=%s\n",
> +                osinfo_entity_get_id(OSINFO_ENTITY(media)));
>      } else {
>          const gchar *name = osinfo_product_get_name(OSINFO_PRODUCT(os));
>  
> -- 
> 1.7.7.1
> 
> _______________________________________________
> virt-tools-list mailing list
> [email protected]
> https://www.redhat.com/mailman/listinfo/virt-tools-list

Attachment: pgppYBCejPW4i.pgp
Description: PGP signature

_______________________________________________
virt-tools-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-tools-list

Reply via email to