From rjones at redhat.com Thu Aug 13 17:58:02 2015 From: rjones at redhat.com (Richard W.M. Jones) Date: Thu, 13 Aug 2015 18:58:02 +0100 Subject: [Libosinfo] RFC: Splitting off database into separate package In-Reply-To: <20150722104623.GF12010@redhat.com> References: <20150722104623.GF12010@redhat.com> Message-ID: <20150813175802.GA13226@redhat.com> On Wed, Jul 22, 2015 at 11:46:23AM +0100, Daniel P. Berrange wrote: > - Is XML the format we want to use long term ? libguestfs reads the XML directly. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW From zeeshanak at gnome.org Mon Aug 17 18:14:28 2015 From: zeeshanak at gnome.org (Zeeshan Ali (Khattak)) Date: Mon, 17 Aug 2015 19:14:28 +0100 Subject: [Libosinfo] [PATCH 1/2] script: API to query username pattern Message-ID: <1439835269-22596-1-git-send-email-zeeshanak@gnome.org> Add API to allow applications to query the expected pattern of username from install scripts. --- data/schemas/libosinfo.rng | 5 +++++ osinfo/libosinfo.syms | 5 +++++ osinfo/osinfo_install_script.c | 16 ++++++++++++++++ osinfo/osinfo_install_script.h | 2 ++ osinfo/osinfo_loader.c | 1 + 5 files changed, 29 insertions(+) diff --git a/data/schemas/libosinfo.rng b/data/schemas/libosinfo.rng index b23d210..a019894 100644 --- a/data/schemas/libosinfo.rng +++ b/data/schemas/libosinfo.rng @@ -603,6 +603,11 @@ + + + + + diff --git a/osinfo/libosinfo.syms b/osinfo/libosinfo.syms index 68d54ff..7e83f8b 100644 --- a/osinfo/libosinfo.syms +++ b/osinfo/libosinfo.syms @@ -520,6 +520,11 @@ LIBOSINFO_0.2.12 { osinfo_media_get_volume_size; } LIBOSINFO_0.2.11; +LIBOSINFO_0.2.13 { + global: + osinfo_install_script_get_username_pattern; +} LIBOSINFO_0.2.12; + /* Symbols in next release... LIBOSINFO_0.0.2 { diff --git a/osinfo/osinfo_install_script.c b/osinfo/osinfo_install_script.c index 9ded116..6842d3c 100644 --- a/osinfo/osinfo_install_script.c +++ b/osinfo/osinfo_install_script.c @@ -441,6 +441,22 @@ const gchar *osinfo_install_script_get_product_key_format(OsinfoInstallScript *s OSINFO_INSTALL_SCRIPT_PROP_PRODUCT_KEY_FORMAT); } +/** + * osinfo_install_script_get_username_pattern: + * @script: the install script + * + * If this function returns a non-NULL string, it means that the @script + * requires the username to match the returned regular expression string. + * + * Returns: (transfer none) (allow-nullable): Regular express string that + * username must match, or %NULL. + */ +const gchar *osinfo_install_script_get_username_pattern(OsinfoInstallScript *script) +{ + return osinfo_entity_get_param_value(OSINFO_ENTITY(script), + OSINFO_INSTALL_SCRIPT_PROP_USERNAME_PATTERN); +} + void osinfo_install_script_set_output_prefix(OsinfoInstallScript *script, const gchar *prefix) { diff --git a/osinfo/osinfo_install_script.h b/osinfo/osinfo_install_script.h index c494192..62c19bb 100644 --- a/osinfo/osinfo_install_script.h +++ b/osinfo/osinfo_install_script.h @@ -52,6 +52,7 @@ typedef struct _OsinfoInstallScriptPrivate OsinfoInstallScriptPrivate; #define OSINFO_INSTALL_SCRIPT_PROP_TEMPLATE_DATA "template-data" #define OSINFO_INSTALL_SCRIPT_PROP_PROFILE "profile" #define OSINFO_INSTALL_SCRIPT_PROP_PRODUCT_KEY_FORMAT "product-key-format" +#define OSINFO_INSTALL_SCRIPT_PROP_USERNAME_PATTERN "username-pattern" #define OSINFO_INSTALL_SCRIPT_PROP_EXPECTED_FILENAME "expected-filename" #define OSINFO_INSTALL_SCRIPT_PROP_PATH_FORMAT "path-format" #define OSINFO_INSTALL_SCRIPT_PROP_CAN_PRE_INSTALL_DRIVERS "can-pre-install-drivers" @@ -153,6 +154,7 @@ const gchar *osinfo_install_script_get_template_data(OsinfoInstallScript *script const gchar *osinfo_install_script_get_profile(OsinfoInstallScript *script); const gchar *osinfo_install_script_get_product_key_format(OsinfoInstallScript *script); +const gchar *osinfo_install_script_get_username_pattern(OsinfoInstallScript *script); void osinfo_install_script_set_output_prefix(OsinfoInstallScript *script, const gchar *prefix); diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c index 4e8f942..8eec254 100644 --- a/osinfo/osinfo_loader.c +++ b/osinfo/osinfo_loader.c @@ -819,6 +819,7 @@ static void osinfo_loader_install_script(OsinfoLoader *loader, gchar *id = (gchar *)xmlGetProp(root, BAD_CAST "id"); const OsinfoEntityKey keys[] = { { OSINFO_INSTALL_SCRIPT_PROP_PROFILE, G_TYPE_STRING }, + { OSINFO_INSTALL_SCRIPT_PROP_USERNAME_PATTERN, G_TYPE_STRING }, { OSINFO_INSTALL_SCRIPT_PROP_PRODUCT_KEY_FORMAT, G_TYPE_STRING }, { OSINFO_INSTALL_SCRIPT_PROP_PATH_FORMAT, G_TYPE_STRING }, { OSINFO_INSTALL_SCRIPT_PROP_EXPECTED_FILENAME, G_TYPE_STRING }, -- 2.4.3 From zeeshanak at gnome.org Mon Aug 17 18:14:29 2015 From: zeeshanak at gnome.org (Zeeshan Ali (Khattak)) Date: Mon, 17 Aug 2015 19:14:29 +0100 Subject: [Libosinfo] [PATCH 2/2] debian,script: Specify username pattern In-Reply-To: <1439835269-22596-1-git-send-email-zeeshanak@gnome.org> References: <1439835269-22596-1-git-send-email-zeeshanak@gnome.org> Message-ID: <1439835269-22596-2-git-send-email-zeeshanak@gnome.org> Debian installer is known to bail out on encountering invalid characters (e.g '-') in usernames[1], so let's ensure applications know not to pass such characters in username configuration parameter. [1] https://bugzilla.gnome.org/show_bug.cgi?id=734682 --- data/install-scripts/debian.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/install-scripts/debian.xml b/data/install-scripts/debian.xml index b164b01..f25e19f 100644 --- a/data/install-scripts/debian.xml +++ b/data/install-scripts/debian.xml @@ -4,6 +4,7 @@ jeos preseed.cfg true + ^[a-zA-Z][a-zA-Z0-9]*$ @@ -131,6 +132,7 @@ d-i preseed/late_command string in-target passwd -d root desktop preseed.cfg true + ^[a-zA-Z][a-zA-Z0-9]*$ -- 2.4.3 From zeeshanak at gnome.org Wed Aug 19 13:30:56 2015 From: zeeshanak at gnome.org (Zeeshan Ali (Khattak)) Date: Wed, 19 Aug 2015 14:30:56 +0100 Subject: [Libosinfo] [PATCH] Ditch udev rule In-Reply-To: <20130911112635.GA21962@teriyaki.cdg.redhat.com> References: <1361200943-3675-1-git-send-email-zeeshanak@gnome.org> <20130218162008.GM3658@redhat.com> <20130218164727.GN3658@redhat.com> <20130219101154.GB15847@redhat.com> <20130911112635.GA21962@teriyaki.cdg.redhat.com> Message-ID: On Wed, Sep 11, 2013 at 12:26 PM, Christophe Fergeau wrote: > On Tue, Sep 10, 2013 at 04:25:39PM +0300, Zeeshan Ali (Khattak) wrote: >> > Keep it for now, but update the RPM specfile so that if built for >> > Fedora 19, it is not installed. >> >> So is it now time to merge this patch before we forget about it completely? > > f18 is still a supported distro where it's nice to have the udev rule. On > the other hand, it hasn't been updated to 0.2.7. I'd tend to wait for at > least 6 more months, but no strong feelings. How about now? :) -- Regards, Zeeshan Ali (Khattak) ________________________________________ Befriend GNOME: http://www.gnome.org/friends/ From cfergeau at redhat.com Mon Aug 24 08:00:55 2015 From: cfergeau at redhat.com (Christophe Fergeau) Date: Mon, 24 Aug 2015 10:00:55 +0200 Subject: [Libosinfo] [PATCH] Ditch udev rule In-Reply-To: References: <1361200943-3675-1-git-send-email-zeeshanak@gnome.org> <20130218162008.GM3658@redhat.com> <20130218164727.GN3658@redhat.com> <20130219101154.GB15847@redhat.com> <20130911112635.GA21962@teriyaki.cdg.redhat.com> Message-ID: <20150824080055.GJ32577@edamame.cdg.redhat.com> On Wed, Aug 19, 2015 at 02:30:56PM +0100, Zeeshan Ali (Khattak) wrote: > On Wed, Sep 11, 2013 at 12:26 PM, Christophe Fergeau > wrote: > > On Tue, Sep 10, 2013 at 04:25:39PM +0300, Zeeshan Ali (Khattak) wrote: > >> > Keep it for now, but update the RPM specfile so that if built for > >> > Fedora 19, it is not installed. > >> > >> So is it now time to merge this patch before we forget about it completely? > > > > f18 is still a supported distro where it's nice to have the udev rule. On > > the other hand, it hasn't been updated to 0.2.7. I'd tend to wait for at > > least 6 more months, but no strong feelings. > > How about now? :) Given that the spec file has: %if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 %define with_udev 0 %endif ACK. I suspect the .spec.in bits in the initial patch needs to be updated though (to remove the bit I quoted above for example). Thanks for remembering about that patch! Christophe -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 819 bytes Desc: not available URL: From zeeshanak at gnome.org Mon Aug 24 17:34:03 2015 From: zeeshanak at gnome.org (Zeeshan Ali (Khattak)) Date: Mon, 24 Aug 2015 18:34:03 +0100 Subject: [Libosinfo] [PATCH] Ditch udev rule In-Reply-To: <20150824080055.GJ32577@edamame.cdg.redhat.com> References: <1361200943-3675-1-git-send-email-zeeshanak@gnome.org> <20130218162008.GM3658@redhat.com> <20130218164727.GN3658@redhat.com> <20130219101154.GB15847@redhat.com> <20130911112635.GA21962@teriyaki.cdg.redhat.com> <20150824080055.GJ32577@edamame.cdg.redhat.com> Message-ID: On Mon, Aug 24, 2015 at 9:00 AM, Christophe Fergeau wrote: > On Wed, Aug 19, 2015 at 02:30:56PM +0100, Zeeshan Ali (Khattak) wrote: >> On Wed, Sep 11, 2013 at 12:26 PM, Christophe Fergeau >> wrote: >> > On Tue, Sep 10, 2013 at 04:25:39PM +0300, Zeeshan Ali (Khattak) wrote: >> >> > Keep it for now, but update the RPM specfile so that if built for >> >> > Fedora 19, it is not installed. >> >> >> >> So is it now time to merge this patch before we forget about it completely? >> > >> > f18 is still a supported distro where it's nice to have the udev rule. On >> > the other hand, it hasn't been updated to 0.2.7. I'd tend to wait for at >> > least 6 more months, but no strong feelings. >> >> How about now? :) > > Given that the spec file has: > > %if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 > %define with_udev 0 > %endif > > ACK. I suspect the .spec.in bits in the initial patch needs to be > updated though (to remove the bit I quoted above for example). > > Thanks for remembering about that patch! It was git. :) I kept the branch around. -- Regards, Zeeshan Ali (Khattak) ________________________________________ Befriend GNOME: http://www.gnome.org/friends/ From zeeshanak at gnome.org Mon Aug 24 17:37:42 2015 From: zeeshanak at gnome.org (Zeeshan Ali (Khattak)) Date: Mon, 24 Aug 2015 18:37:42 +0100 Subject: [Libosinfo] [PATCH v2] Ditch udev rule Message-ID: <1440437862-18587-1-git-send-email-zeeshanak@gnome.org> New udev/blkid expose more ISO9660 properties that apps can grab and set on install media for detection to work. As a result our udev rule becomes redundant. This improves system bootup time conciderably if there is an ISO9660 media inserted during bootup as our udev rule needed to parse the XML etc and is therefore pretty slow (keeping in mind that a few seconds are a long time in the land of modern udev/systemd). --- configure.ac | 20 -------------------- data/95-osinfo.rules.in | 2 -- data/Makefile.am | 12 ------------ libosinfo.spec.in | 19 +------------------ 4 files changed, 1 insertion(+), 52 deletions(-) delete mode 100644 data/95-osinfo.rules.in diff --git a/configure.ac b/configure.ac index b618ee2..7e7e956 100644 --- a/configure.ac +++ b/configure.ac @@ -121,26 +121,6 @@ if test "x$enable_introspection" = "xyes" ; then fi AM_CONDITIONAL([WITH_VALA], [test "x$enable_vala" = "xyes"]) -AC_ARG_ENABLE([udev], - AS_HELP_STRING([--enable-udev], [enable Udev support]), - [], [enable_udev=no]) -AM_CONDITIONAL([WITH_UDEV], [test "x$enable_udev" = "xyes"]) - -AC_ARG_WITH([udev-rulesdir], - [AS_HELP_STRING([--with-udev-rulesdir],[UDev rules directory])], - [], []) - -if test "x$with_udev_rulesdir" = "x"; then - if test "x$prefix" = "x/usr" ; then - with_udev_rulesdir=/lib/udev/rules.d - else - with_udev_rulesdir=$prefix/lib/udev/rules.d - fi -fi - -UDEV_RULESDIR="$with_udev_rulesdir" -AC_SUBST(UDEV_RULESDIR) - AC_ARG_ENABLE([coverage], AS_HELP_STRING([--enable-coverage], [enable GCC code coverage]), [], [enable_coverage=no]) diff --git a/data/95-osinfo.rules.in b/data/95-osinfo.rules.in deleted file mode 100644 index e32811a..0000000 --- a/data/95-osinfo.rules.in +++ /dev/null @@ -1,2 +0,0 @@ -SUBSYSTEM=="block", ACTION=="add|change", ENV{ID_FS_TYPE}=="iso9660|udf", \ - IMPORT{program}="@bindir@/osinfo-detect -f env $tempnode" diff --git a/data/Makefile.am b/data/Makefile.am index 0d9e959..b252036 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -32,17 +32,5 @@ pci_ids_install: INSTALL_DATA_HOOK_DEPS += pci_ids_install endif -if WITH_UDEV -BUILT_SOURCES = 95-osinfo.rules - -95-osinfo.rules: 95-osinfo.rules.in - sed 's,\@bindir\@,$(exec_prefix)/bin,' $< > $@ - -95-osinfo.rules-install: 95-osinfo.rules - $(MKDIR_P) $(DESTDIR)$(UDEV_RULESDIR) - $(INSTALL) -m 0644 95-osinfo.rules $(DESTDIR)$(UDEV_RULESDIR) - -INSTALL_DATA_HOOK_DEPS += 95-osinfo.rules-install -endif install-data-hook: $(INSTALL_DATA_HOOK_DEPS) diff --git a/libosinfo.spec.in b/libosinfo.spec.in index fc2f2d1..68e1da4 100644 --- a/libosinfo.spec.in +++ b/libosinfo.spec.in @@ -10,11 +10,6 @@ %define with_gir 1 %endif -%define with_udev 1 -%if 0%{?fedora} >= 19 -%define with_udev 0 -%endif - Summary: A library for managing OS information for virtualization Name: libosinfo Version: @VERSION@ @@ -37,9 +32,6 @@ BuildRequires: /usr/bin/pod2man BuildRequires: gobject-introspection-devel %endif Requires: hwdata -%if %{with_udev} -Requires: udev -%endif %description libosinfo is a library that allows virtualization provisioning tools to @@ -82,13 +74,7 @@ This package provides the Vala bindings for libosinfo library. %define gir_arg --enable-introspection=no %endif -%if %{with_udev} -%define udev_arg --enable-udev=yes -%else -%define udev_arg --enable-udev=no -%endif - -%configure %{gir_arg} %{udev_arg} --enable-vala=yes --with-usb-ids-path=/usr/share/hwdata/usb.ids --with-pci-ids-path=/usr/share/hwdata/pci.ids +%configure %{gir_arg} --enable-vala=yes --with-usb-ids-path=/usr/share/hwdata/usb.ids --with-pci-ids-path=/usr/share/hwdata/pci.ids %__make %{?_smp_mflags} V=1 chmod a-x examples/*.js examples/*.py @@ -134,9 +120,6 @@ rm -fr %{buildroot} %{_mandir}/man1/osinfo-query.1* %{_mandir}/man1/osinfo-install-script.1* %{_libdir}/%{name}-1.0.so.* -%if %{with_udev} -/lib/udev/rules.d/95-osinfo.rules -%endif %if %{with_gir} %{_libdir}/girepository-1.0/Libosinfo-1.0.typelib %endif -- 2.4.3 From zeeshanak at gnome.org Mon Aug 24 17:39:38 2015 From: zeeshanak at gnome.org (Zeeshan Ali (Khattak)) Date: Mon, 24 Aug 2015 18:39:38 +0100 Subject: [Libosinfo] [PATCH 1/2] script: API to query username pattern In-Reply-To: <1439835269-22596-1-git-send-email-zeeshanak@gnome.org> References: <1439835269-22596-1-git-send-email-zeeshanak@gnome.org> Message-ID: Ping! Can anyone review these patches. On Mon, Aug 17, 2015 at 7:14 PM, Zeeshan Ali (Khattak) wrote: > Add API to allow applications to query the expected pattern of username > from install scripts. > --- > data/schemas/libosinfo.rng | 5 +++++ > osinfo/libosinfo.syms | 5 +++++ > osinfo/osinfo_install_script.c | 16 ++++++++++++++++ > osinfo/osinfo_install_script.h | 2 ++ > osinfo/osinfo_loader.c | 1 + > 5 files changed, 29 insertions(+) > > diff --git a/data/schemas/libosinfo.rng b/data/schemas/libosinfo.rng > index b23d210..a019894 100644 > --- a/data/schemas/libosinfo.rng > +++ b/data/schemas/libosinfo.rng > @@ -603,6 +603,11 @@ > > > > + > + > + > + > + > > > > diff --git a/osinfo/libosinfo.syms b/osinfo/libosinfo.syms > index 68d54ff..7e83f8b 100644 > --- a/osinfo/libosinfo.syms > +++ b/osinfo/libosinfo.syms > @@ -520,6 +520,11 @@ LIBOSINFO_0.2.12 { > osinfo_media_get_volume_size; > } LIBOSINFO_0.2.11; > > +LIBOSINFO_0.2.13 { > + global: > + osinfo_install_script_get_username_pattern; > +} LIBOSINFO_0.2.12; > + > /* Symbols in next release... > > LIBOSINFO_0.0.2 { > diff --git a/osinfo/osinfo_install_script.c b/osinfo/osinfo_install_script.c > index 9ded116..6842d3c 100644 > --- a/osinfo/osinfo_install_script.c > +++ b/osinfo/osinfo_install_script.c > @@ -441,6 +441,22 @@ const gchar *osinfo_install_script_get_product_key_format(OsinfoInstallScript *s > OSINFO_INSTALL_SCRIPT_PROP_PRODUCT_KEY_FORMAT); > } > > +/** > + * osinfo_install_script_get_username_pattern: > + * @script: the install script > + * > + * If this function returns a non-NULL string, it means that the @script > + * requires the username to match the returned regular expression string. > + * > + * Returns: (transfer none) (allow-nullable): Regular express string that > + * username must match, or %NULL. > + */ > +const gchar *osinfo_install_script_get_username_pattern(OsinfoInstallScript *script) > +{ > + return osinfo_entity_get_param_value(OSINFO_ENTITY(script), > + OSINFO_INSTALL_SCRIPT_PROP_USERNAME_PATTERN); > +} > + > void osinfo_install_script_set_output_prefix(OsinfoInstallScript *script, > const gchar *prefix) > { > diff --git a/osinfo/osinfo_install_script.h b/osinfo/osinfo_install_script.h > index c494192..62c19bb 100644 > --- a/osinfo/osinfo_install_script.h > +++ b/osinfo/osinfo_install_script.h > @@ -52,6 +52,7 @@ typedef struct _OsinfoInstallScriptPrivate OsinfoInstallScriptPrivate; > #define OSINFO_INSTALL_SCRIPT_PROP_TEMPLATE_DATA "template-data" > #define OSINFO_INSTALL_SCRIPT_PROP_PROFILE "profile" > #define OSINFO_INSTALL_SCRIPT_PROP_PRODUCT_KEY_FORMAT "product-key-format" > +#define OSINFO_INSTALL_SCRIPT_PROP_USERNAME_PATTERN "username-pattern" > #define OSINFO_INSTALL_SCRIPT_PROP_EXPECTED_FILENAME "expected-filename" > #define OSINFO_INSTALL_SCRIPT_PROP_PATH_FORMAT "path-format" > #define OSINFO_INSTALL_SCRIPT_PROP_CAN_PRE_INSTALL_DRIVERS "can-pre-install-drivers" > @@ -153,6 +154,7 @@ const gchar *osinfo_install_script_get_template_data(OsinfoInstallScript *script > const gchar *osinfo_install_script_get_profile(OsinfoInstallScript *script); > > const gchar *osinfo_install_script_get_product_key_format(OsinfoInstallScript *script); > +const gchar *osinfo_install_script_get_username_pattern(OsinfoInstallScript *script); > > void osinfo_install_script_set_output_prefix(OsinfoInstallScript *script, const gchar *prefix); > > diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c > index 4e8f942..8eec254 100644 > --- a/osinfo/osinfo_loader.c > +++ b/osinfo/osinfo_loader.c > @@ -819,6 +819,7 @@ static void osinfo_loader_install_script(OsinfoLoader *loader, > gchar *id = (gchar *)xmlGetProp(root, BAD_CAST "id"); > const OsinfoEntityKey keys[] = { > { OSINFO_INSTALL_SCRIPT_PROP_PROFILE, G_TYPE_STRING }, > + { OSINFO_INSTALL_SCRIPT_PROP_USERNAME_PATTERN, G_TYPE_STRING }, > { OSINFO_INSTALL_SCRIPT_PROP_PRODUCT_KEY_FORMAT, G_TYPE_STRING }, > { OSINFO_INSTALL_SCRIPT_PROP_PATH_FORMAT, G_TYPE_STRING }, > { OSINFO_INSTALL_SCRIPT_PROP_EXPECTED_FILENAME, G_TYPE_STRING }, > -- > 2.4.3 > -- Regards, Zeeshan Ali (Khattak) ________________________________________ Befriend GNOME: http://www.gnome.org/friends/ From fabiano at fidencio.org Wed Aug 26 06:53:34 2015 From: fabiano at fidencio.org (=?UTF-8?Q?Fabiano_Fid=C3=AAncio?=) Date: Wed, 26 Aug 2015 08:53:34 +0200 Subject: [Libosinfo] [PATCH 1/2] script: API to query username pattern In-Reply-To: <1439835269-22596-1-git-send-email-zeeshanak@gnome.org> References: <1439835269-22596-1-git-send-email-zeeshanak@gnome.org> Message-ID: On Mon, Aug 17, 2015 at 8:14 PM, Zeeshan Ali (Khattak) wrote: > Add API to allow applications to query the expected pattern of username > from install scripts. > --- > data/schemas/libosinfo.rng | 5 +++++ > osinfo/libosinfo.syms | 5 +++++ > osinfo/osinfo_install_script.c | 16 ++++++++++++++++ > osinfo/osinfo_install_script.h | 2 ++ > osinfo/osinfo_loader.c | 1 + > 5 files changed, 29 insertions(+) > > diff --git a/data/schemas/libosinfo.rng b/data/schemas/libosinfo.rng > index b23d210..a019894 100644 > --- a/data/schemas/libosinfo.rng > +++ b/data/schemas/libosinfo.rng > @@ -603,6 +603,11 @@ > > > > + > + > + > + > + > > > > diff --git a/osinfo/libosinfo.syms b/osinfo/libosinfo.syms > index 68d54ff..7e83f8b 100644 > --- a/osinfo/libosinfo.syms > +++ b/osinfo/libosinfo.syms > @@ -520,6 +520,11 @@ LIBOSINFO_0.2.12 { > osinfo_media_get_volume_size; > } LIBOSINFO_0.2.11; > > +LIBOSINFO_0.2.13 { > + global: > + osinfo_install_script_get_username_pattern; > +} LIBOSINFO_0.2.12; > + > /* Symbols in next release... > > LIBOSINFO_0.0.2 { > diff --git a/osinfo/osinfo_install_script.c b/osinfo/osinfo_install_script.c > index 9ded116..6842d3c 100644 > --- a/osinfo/osinfo_install_script.c > +++ b/osinfo/osinfo_install_script.c > @@ -441,6 +441,22 @@ const gchar *osinfo_install_script_get_product_key_format(OsinfoInstallScript *s > OSINFO_INSTALL_SCRIPT_PROP_PRODUCT_KEY_FORMAT); > } > > +/** > + * osinfo_install_script_get_username_pattern: > + * @script: the install script > + * > + * If this function returns a non-NULL string, it means that the @script > + * requires the username to match the returned regular expression string. > + * > + * Returns: (transfer none) (allow-nullable): Regular express string that > + * username must match, or %NULL. > + */ > +const gchar *osinfo_install_script_get_username_pattern(OsinfoInstallScript *script) > +{ > + return osinfo_entity_get_param_value(OSINFO_ENTITY(script), > + OSINFO_INSTALL_SCRIPT_PROP_USERNAME_PATTERN); > +} > + > void osinfo_install_script_set_output_prefix(OsinfoInstallScript *script, > const gchar *prefix) > { > diff --git a/osinfo/osinfo_install_script.h b/osinfo/osinfo_install_script.h > index c494192..62c19bb 100644 > --- a/osinfo/osinfo_install_script.h > +++ b/osinfo/osinfo_install_script.h > @@ -52,6 +52,7 @@ typedef struct _OsinfoInstallScriptPrivate OsinfoInstallScriptPrivate; > #define OSINFO_INSTALL_SCRIPT_PROP_TEMPLATE_DATA "template-data" > #define OSINFO_INSTALL_SCRIPT_PROP_PROFILE "profile" > #define OSINFO_INSTALL_SCRIPT_PROP_PRODUCT_KEY_FORMAT "product-key-format" > +#define OSINFO_INSTALL_SCRIPT_PROP_USERNAME_PATTERN "username-pattern" > #define OSINFO_INSTALL_SCRIPT_PROP_EXPECTED_FILENAME "expected-filename" > #define OSINFO_INSTALL_SCRIPT_PROP_PATH_FORMAT "path-format" > #define OSINFO_INSTALL_SCRIPT_PROP_CAN_PRE_INSTALL_DRIVERS "can-pre-install-drivers" > @@ -153,6 +154,7 @@ const gchar *osinfo_install_script_get_template_data(OsinfoInstallScript *script > const gchar *osinfo_install_script_get_profile(OsinfoInstallScript *script); > > const gchar *osinfo_install_script_get_product_key_format(OsinfoInstallScript *script); > +const gchar *osinfo_install_script_get_username_pattern(OsinfoInstallScript *script); > > void osinfo_install_script_set_output_prefix(OsinfoInstallScript *script, const gchar *prefix); > > diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c > index 4e8f942..8eec254 100644 > --- a/osinfo/osinfo_loader.c > +++ b/osinfo/osinfo_loader.c > @@ -819,6 +819,7 @@ static void osinfo_loader_install_script(OsinfoLoader *loader, > gchar *id = (gchar *)xmlGetProp(root, BAD_CAST "id"); > const OsinfoEntityKey keys[] = { > { OSINFO_INSTALL_SCRIPT_PROP_PROFILE, G_TYPE_STRING }, > + { OSINFO_INSTALL_SCRIPT_PROP_USERNAME_PATTERN, G_TYPE_STRING }, > { OSINFO_INSTALL_SCRIPT_PROP_PRODUCT_KEY_FORMAT, G_TYPE_STRING }, > { OSINFO_INSTALL_SCRIPT_PROP_PATH_FORMAT, G_TYPE_STRING }, > { OSINFO_INSTALL_SCRIPT_PROP_EXPECTED_FILENAME, G_TYPE_STRING }, > -- > 2.4.3 > > _______________________________________________ > Libosinfo mailing list > Libosinfo at redhat.com > https://www.redhat.com/mailman/listinfo/libosinfo Both patches look good, ACK from me. Best Regards, -- Fabiano Fid?ncio From cfergeau at redhat.com Wed Aug 26 09:26:48 2015 From: cfergeau at redhat.com (Christophe Fergeau) Date: Wed, 26 Aug 2015 11:26:48 +0200 Subject: [Libosinfo] [PATCH v2] Ditch udev rule In-Reply-To: <1440437862-18587-1-git-send-email-zeeshanak@gnome.org> References: <1440437862-18587-1-git-send-email-zeeshanak@gnome.org> Message-ID: <20150826092648.GA26798@edamame.cdg.redhat.com> ACK with this squashed in: diff --git a/data/Makefile.am b/data/Makefile.am index b252036..407cc28 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1,7 +1,7 @@ INSTALL_DATA_HOOK_DEPS = SUBDIRS = datamaps devices oses hypervisors install-scripts schemas -EXTRA_DIST = usb.ids pci.ids 95-osinfo.rules.in +EXTRA_DIST = usb.ids pci.ids CLEANFILES = usb.ids pci.ids if USE_INTERNAL_USB_IDS On Mon, Aug 24, 2015 at 06:37:42PM +0100, Zeeshan Ali (Khattak) wrote: > New udev/blkid expose more ISO9660 properties that apps can grab and > set on install media for detection to work. As a result our udev rule > becomes redundant. > > This improves system bootup time conciderably if there is an ISO9660 > media inserted during bootup as our udev rule needed to parse the XML > etc and is therefore pretty slow (keeping in mind that a few seconds are > a long time in the land of modern udev/systemd). > --- > configure.ac | 20 -------------------- > data/95-osinfo.rules.in | 2 -- > data/Makefile.am | 12 ------------ > libosinfo.spec.in | 19 +------------------ > 4 files changed, 1 insertion(+), 52 deletions(-) > delete mode 100644 data/95-osinfo.rules.in > > diff --git a/configure.ac b/configure.ac > index b618ee2..7e7e956 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -121,26 +121,6 @@ if test "x$enable_introspection" = "xyes" ; then > fi > AM_CONDITIONAL([WITH_VALA], [test "x$enable_vala" = "xyes"]) > > -AC_ARG_ENABLE([udev], > - AS_HELP_STRING([--enable-udev], [enable Udev support]), > - [], [enable_udev=no]) > -AM_CONDITIONAL([WITH_UDEV], [test "x$enable_udev" = "xyes"]) > - > -AC_ARG_WITH([udev-rulesdir], > - [AS_HELP_STRING([--with-udev-rulesdir],[UDev rules directory])], > - [], []) > - > -if test "x$with_udev_rulesdir" = "x"; then > - if test "x$prefix" = "x/usr" ; then > - with_udev_rulesdir=/lib/udev/rules.d > - else > - with_udev_rulesdir=$prefix/lib/udev/rules.d > - fi > -fi > - > -UDEV_RULESDIR="$with_udev_rulesdir" > -AC_SUBST(UDEV_RULESDIR) > - > AC_ARG_ENABLE([coverage], > AS_HELP_STRING([--enable-coverage], [enable GCC code coverage]), > [], [enable_coverage=no]) > diff --git a/data/95-osinfo.rules.in b/data/95-osinfo.rules.in > deleted file mode 100644 > index e32811a..0000000 > --- a/data/95-osinfo.rules.in > +++ /dev/null > @@ -1,2 +0,0 @@ > -SUBSYSTEM=="block", ACTION=="add|change", ENV{ID_FS_TYPE}=="iso9660|udf", \ > - IMPORT{program}="@bindir@/osinfo-detect -f env $tempnode" > diff --git a/data/Makefile.am b/data/Makefile.am > index 0d9e959..b252036 100644 > --- a/data/Makefile.am > +++ b/data/Makefile.am > @@ -32,17 +32,5 @@ pci_ids_install: > INSTALL_DATA_HOOK_DEPS += pci_ids_install > endif > > -if WITH_UDEV > -BUILT_SOURCES = 95-osinfo.rules > - > -95-osinfo.rules: 95-osinfo.rules.in > - sed 's,\@bindir\@,$(exec_prefix)/bin,' $< > $@ > - > -95-osinfo.rules-install: 95-osinfo.rules > - $(MKDIR_P) $(DESTDIR)$(UDEV_RULESDIR) > - $(INSTALL) -m 0644 95-osinfo.rules $(DESTDIR)$(UDEV_RULESDIR) > - > -INSTALL_DATA_HOOK_DEPS += 95-osinfo.rules-install > -endif > > install-data-hook: $(INSTALL_DATA_HOOK_DEPS) > diff --git a/libosinfo.spec.in b/libosinfo.spec.in > index fc2f2d1..68e1da4 100644 > --- a/libosinfo.spec.in > +++ b/libosinfo.spec.in > @@ -10,11 +10,6 @@ > %define with_gir 1 > %endif > > -%define with_udev 1 > -%if 0%{?fedora} >= 19 > -%define with_udev 0 > -%endif > - > Summary: A library for managing OS information for virtualization > Name: libosinfo > Version: @VERSION@ > @@ -37,9 +32,6 @@ BuildRequires: /usr/bin/pod2man > BuildRequires: gobject-introspection-devel > %endif > Requires: hwdata > -%if %{with_udev} > -Requires: udev > -%endif > > %description > libosinfo is a library that allows virtualization provisioning tools to > @@ -82,13 +74,7 @@ This package provides the Vala bindings for libosinfo library. > %define gir_arg --enable-introspection=no > %endif > > -%if %{with_udev} > -%define udev_arg --enable-udev=yes > -%else > -%define udev_arg --enable-udev=no > -%endif > - > -%configure %{gir_arg} %{udev_arg} --enable-vala=yes --with-usb-ids-path=/usr/share/hwdata/usb.ids --with-pci-ids-path=/usr/share/hwdata/pci.ids > +%configure %{gir_arg} --enable-vala=yes --with-usb-ids-path=/usr/share/hwdata/usb.ids --with-pci-ids-path=/usr/share/hwdata/pci.ids > %__make %{?_smp_mflags} V=1 > > chmod a-x examples/*.js examples/*.py > @@ -134,9 +120,6 @@ rm -fr %{buildroot} > %{_mandir}/man1/osinfo-query.1* > %{_mandir}/man1/osinfo-install-script.1* > %{_libdir}/%{name}-1.0.so.* > -%if %{with_udev} > -/lib/udev/rules.d/95-osinfo.rules > -%endif > %if %{with_gir} > %{_libdir}/girepository-1.0/Libosinfo-1.0.typelib > %endif > -- > 2.4.3 > > _______________________________________________ > Libosinfo mailing list > Libosinfo at redhat.com > https://www.redhat.com/mailman/listinfo/libosinfo -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 819 bytes Desc: not available URL: From cfergeau at redhat.com Wed Aug 26 09:32:31 2015 From: cfergeau at redhat.com (Christophe Fergeau) Date: Wed, 26 Aug 2015 11:32:31 +0200 Subject: [Libosinfo] [PATCH 2/2] debian, script: Specify username pattern In-Reply-To: <1439835269-22596-2-git-send-email-zeeshanak@gnome.org> References: <1439835269-22596-1-git-send-email-zeeshanak@gnome.org> <1439835269-22596-2-git-send-email-zeeshanak@gnome.org> Message-ID: <20150826093231.GB26798@edamame.cdg.redhat.com> On Mon, Aug 17, 2015 at 07:14:29PM +0100, Zeeshan Ali (Khattak) wrote: > Debian installer is known to bail out on encountering invalid characters > (e.g '-') in usernames[1], so let's ensure applications know not to pass > such characters in username configuration parameter. Having just a patch for debian feels incomplete, while I haven't tested unattended installation, Anaconda won't let me create a user named " @){}":?>\|" (without the quotes), so we probably need similar patches for each autoinstall scripts for completeness. Christophe -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 819 bytes Desc: not available URL: From cfergeau at redhat.com Wed Aug 26 09:37:50 2015 From: cfergeau at redhat.com (Christophe Fergeau) Date: Wed, 26 Aug 2015 11:37:50 +0200 Subject: [Libosinfo] [PATCH 1/2] script: API to query username pattern In-Reply-To: <1439835269-22596-1-git-send-email-zeeshanak@gnome.org> References: <1439835269-22596-1-git-send-email-zeeshanak@gnome.org> Message-ID: <20150826093750.GC26798@edamame.cdg.redhat.com> On Mon, Aug 17, 2015 at 07:14:28PM +0100, Zeeshan Ali (Khattak) wrote: > Add API to allow applications to query the expected pattern of username > from install scripts. > --- > data/schemas/libosinfo.rng | 5 +++++ > osinfo/libosinfo.syms | 5 +++++ > osinfo/osinfo_install_script.c | 16 ++++++++++++++++ > osinfo/osinfo_install_script.h | 2 ++ > osinfo/osinfo_loader.c | 1 + > 5 files changed, 29 insertions(+) > > diff --git a/data/schemas/libosinfo.rng b/data/schemas/libosinfo.rng > index b23d210..a019894 100644 > --- a/data/schemas/libosinfo.rng > +++ b/data/schemas/libosinfo.rng > @@ -603,6 +603,11 @@ > > > > + > + > + > + > + We already have 'product-key-format' which has a somehow similar purpose for product keys, there are known limitations on hostname format in Windows iirc, and we also have user-realname and potentially admin-password/user-password which could have length/character set limitations. Rather than adding a new element for each of these, maybe we'd be better off with ? (not sure how convenient it is to stuff a regexp in an XML attribute). Christophe -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 819 bytes Desc: not available URL: From zeeshanak at gnome.org Wed Aug 26 12:21:07 2015 From: zeeshanak at gnome.org (Zeeshan Ali (Khattak)) Date: Wed, 26 Aug 2015 13:21:07 +0100 Subject: [Libosinfo] [PATCH 1/2] script: API to query username pattern In-Reply-To: <20150826093750.GC26798@edamame.cdg.redhat.com> References: <1439835269-22596-1-git-send-email-zeeshanak@gnome.org> <20150826093750.GC26798@edamame.cdg.redhat.com> Message-ID: On Wed, Aug 26, 2015 at 10:37 AM, Christophe Fergeau wrote: > On Mon, Aug 17, 2015 at 07:14:28PM +0100, Zeeshan Ali (Khattak) wrote: >> Add API to allow applications to query the expected pattern of username >> from install scripts. >> --- >> data/schemas/libosinfo.rng | 5 +++++ >> osinfo/libosinfo.syms | 5 +++++ >> osinfo/osinfo_install_script.c | 16 ++++++++++++++++ >> osinfo/osinfo_install_script.h | 2 ++ >> osinfo/osinfo_loader.c | 1 + >> 5 files changed, 29 insertions(+) >> >> diff --git a/data/schemas/libosinfo.rng b/data/schemas/libosinfo.rng >> index b23d210..a019894 100644 >> --- a/data/schemas/libosinfo.rng >> +++ b/data/schemas/libosinfo.rng >> @@ -603,6 +603,11 @@ >> >> >> >> + >> + >> + >> + >> + > > We already have 'product-key-format' which has a somehow similar purpose > for product keys I actually first tried to have the same API as product-key-format but then realized it's not practical since username is variable characters. OTOH, a regex for product-key-format wouldn't have made it easy for implementing the nice UI we have in Boxes for it (entering '-' in right places automatically) that other UIs might also want. >, there are known limitations on hostname format in > Windows iirc, and we also have user-realname and potentially > admin-password/user-password which could have length/character set > limitations. Rather than adding a new element for each of these, maybe > we'd be better off with > ? > (not sure how convenient it is to stuff a regexp in an XML attribute). I'm not sure I follow your suggestion. Could you please provide an example or two? -- Regards, Zeeshan Ali (Khattak) ________________________________________ Befriend GNOME: http://www.gnome.org/friends/ From cfergeau at redhat.com Wed Aug 26 13:02:15 2015 From: cfergeau at redhat.com (Christophe Fergeau) Date: Wed, 26 Aug 2015 15:02:15 +0200 Subject: [Libosinfo] [PATCH 1/2] script: API to query username pattern In-Reply-To: References: <1439835269-22596-1-git-send-email-zeeshanak@gnome.org> <20150826093750.GC26798@edamame.cdg.redhat.com> Message-ID: <20150826130215.GI26798@edamame.cdg.redhat.com> On Wed, Aug 26, 2015 at 01:21:07PM +0100, Zeeshan Ali (Khattak) wrote: > >, there are known limitations on hostname format in > > Windows iirc, and we also have user-realname and potentially > > admin-password/user-password which could have length/character set > > limitations. Rather than adding a new element for each of these, maybe > > we'd be better off with > > ? > > (not sure how convenient it is to stuff a regexp in an XML attribute). > > I'm not sure I follow your suggestion. Could you please provide an > example or two? Something like diff --git a/data/install-scripts/debian.xml b/data/install-scripts/debian.xml index b164b01..acb8d01 100644 --- a/data/install-scripts/debian.xml +++ b/data/install-scripts/debian.xml @@ -10,6 +10,7 @@ + initrd