[virt-tools-list] [libosinfo] Detection tool should set env for media ID

Christophe Fergeau cfergeau at redhat.com
Thu Nov 24 08:55:25 UTC 2011


On Thu, Nov 24, 2011 at 06:16:48AM +0200, Zeeshan Ali (Khattak) wrote:
> From: "Zeeshan Ali (Khattak)" <zeeshanak at gnome.org>
> 
> 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
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20111124/f9732e11/attachment.sig>


More information about the virt-tools-list mailing list