Re: [systemd-devel] 220 tarball erroneously ships keyboard-keys-from-name.gperf

2015-05-27 Thread Marc-Antoine Perennou
On 27 May 2015 at 12:26, Lennart Poettering  wrote:
>
> I use "make distcheck" regularly during regular development, and
> that's how I generate the final tarball.


What about generating a preview tarball before tagging, and letting us
downstreams a couple of days to test it before you do the actual
tagging and put it in the official location?

Regards,
Marc-Antoine
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH 2/2] build-sys: don't dist generated files

2015-05-25 Thread Marc-Antoine Perennou
Works fine, thanks!

On 25 May 2015 at 17:04, Tom Gundersen  wrote:
> Applied, with minor fix. Please verify that it still works for you!
>
> Tom
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] build-sys: fix headers installation

2015-05-25 Thread Marc-Antoine Perennou
---
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 4933e6f..8e38010 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3128,7 +3128,7 @@ pkginclude_HEADERS += \
src/systemd/sd-bus.h \
src/systemd/sd-bus-protocol.h \
src/systemd/sd-bus-vtable.h \
-   src/systemd/sd-event.h
+   src/systemd/sd-event.h \
src/systemd/sd-login.h \
src/systemd/sd-id128.h \
src/systemd/sd-daemon.h
-- 
2.4.1

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 2/2] build-sys: don't dist generated files

2015-05-25 Thread Marc-Antoine Perennou
---
 Makefile.am | 15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 9420879..4933e6f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1259,8 +1259,7 @@ DISTCLEANFILES = \
 
 EXTRA_DIST += \
$(gperf_gperf_m4_sources) \
-   $(gperf_gperf_sources) \
-   $(gperf_txt_sources:-list.txt=-from-name.gperf)
+   $(gperf_gperf_sources)
 
 CLEANFILES += \
$(gperf_txt_sources)
@@ -4652,7 +4651,9 @@ libsystemd_journal_internal_la_SOURCES = \
src/journal/mmap-cache.h \
src/journal/compress.c \
src/journal/audit-type.h \
-   src/journal/audit-type.c \
+   src/journal/audit-type.c
+
+nodist_libsystemd_journal_internal_la_SOURCES = \
src/journal/audit_type-to-name.h
 
 gperf_txt_sources += \
@@ -5665,7 +5666,9 @@ systemd_resolved_SOURCES = \
src/resolve/resolved-dns-stream.h \
src/resolve/resolved-dns-stream.c \
src/resolve/dns-type.c \
-   src/resolve/dns-type.h \
+   src/resolve/dns-type.h
+
+nodist_systemd_resolved_SOURCES = \
src/resolve/dns_type-from-name.h \
src/resolve/dns_type-to-name.h
 
@@ -5766,7 +5769,9 @@ systemd_resolve_host_SOURCES = \
src/resolve/resolved-dns-domain.c \
src/resolve/resolved-dns-domain.h \
src/resolve/dns-type.c \
-   src/resolve/dns-type.h \
+   src/resolve/dns-type.h
+
+nodist_systemd_resolve_host_SOURCES = \
src/resolve/dns_type-from-name.h \
src/resolve/dns_type-to-name.h
 
-- 
2.4.1

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 1/2] build-sys: always include src/boot/efi in tarballs

2015-05-25 Thread Marc-Antoine Perennou
currently it would only be included if configure was ran with --enable-gnuefi
---
 Makefile.am | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 70d4dc0..9420879 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2601,6 +2601,8 @@ EFI_FORMAT = -O binary
 else
 EFI_FORMAT = --target=efi-app-$(EFI_ARCH)
 endif
+endif
+endif
 
 # 
--
 systemd_boot_headers = \
@@ -2616,13 +2618,16 @@ systemd_boot_sources = \
src/boot/efi/pefile.c \
src/boot/efi/boot.c
 
+EXTRA_DIST += $(systemd_boot_sources) $(systemd_boot_headers)
+
+if ENABLE_EFI
+if HAVE_GNUEFI
 systemd_boot_objects = $(addprefix 
$(top_builddir)/,$(systemd_boot_sources:.c=.o))
 systemd_boot_solib = $(top_builddir)/src/boot/efi/systemd_boot.so
 systemd_boot = systemd-boot$(EFI_MACHINE_TYPE_NAME).efi
 
 bootlib_DATA = $(systemd_boot)
 CLEANFILES += $(systemd_boot_objects) $(systemd_boot_solib) $(systemd_boot)
-EXTRA_DIST += $(systemd_boot_sources) $(systemd_boot_headers)
 
 $(top_builddir)/src/boot/efi/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix 
$(top_srcdir)/,$(systemd_boot_headers))
@$(MKDIR_P) $(top_builddir)/src/boot/efi/
@@ -2636,6 +2641,8 @@ $(systemd_boot_solib): $(systemd_boot_objects)
 $(systemd_boot): $(systemd_boot_solib)
$(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
  -j .dynsym -j .rel -j .rela -j .reloc $(EFI_FORMAT) $< $@
+endif
+endif
 
 # 
--
 stub_headers = \
@@ -2653,13 +2660,16 @@ stub_sources = \
src/boot/efi/linux.c \
src/boot/efi/stub.c
 
+EXTRA_DIST += $(stub_sources) $(stub_headers)
+
+if ENABLE_EFI
+if HAVE_GNUEFI
 stub_objects = $(addprefix $(top_builddir)/,$(stub_sources:.c=.o))
 stub_solib = $(top_builddir)/src/boot/efi/stub.so
 stub = linux$(EFI_MACHINE_TYPE_NAME).efi.stub
 
 bootlib_DATA += $(stub)
 CLEANFILES += $(stub_objects) $(stub_solib) $(stub)
-EXTRA_DIST += $(stub_sources) $(stub_headers)
 
 $(top_builddir)/src/boot/efi/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix 
$(top_srcdir)/,$(stub_headers))
@$(MKDIR_P) $(top_builddir)/src/boot/efi/
-- 
2.4.1

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] 220: --disable-audit broken?

2015-05-22 Thread Marc-Antoine Perennou
Hi,

On 22 May 2015 at 11:16,   wrote:
> hello,
>
> while building 220 I get:
>
> In file included from src/journal/audit-type.c:32:0:
> src/journal/audit_type-to-name.h: In function 'audit_type_to_string':
> src/journal/audit_type-to-name.h:23:14: error: 'AUDIT_USER_AUTH' 
> undeclared (first use in this function)
>  case AUDIT_USER_AUTH: return "USER_AUTH";
>   ^

I got the same here

rm src/journal/audit_type-to-name.h src/udev/keyboard-keys-from-name.gperf

Solved this one and another udev-related. These generated files are in
the tarball when they shouldn't.

Btw src/boot/efi is missing from the tarball, too.

Regards,
Marc-Antoine
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH v2 1/2] configure: allow setting EFI_CC

2015-04-08 Thread Marc-Antoine Perennou
---
 configure.ac | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1608c83..7e4a574 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1147,8 +1147,7 @@ fi
 AM_CONDITIONAL(ENABLE_EFI, [test "x$have_efi" = "xyes"])
 
 # 
--
-EFI_CC=gcc
-AC_SUBST([EFI_CC])
+AC_CHECK_TOOL(EFI_CC, gcc)
 
 EFI_ARCH=`echo $host | sed "s/\(-\).*$//"`
 
-- 
2.3.3

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH v2 2/2] build: allow setting OBJCOPY

2015-04-08 Thread Marc-Antoine Perennou
---
 Makefile.am  | 4 ++--
 configure.ac | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 9b769ee..397a71c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2596,7 +2596,7 @@ $(systemd_boot_solib): $(systemd_boot_objects)
nm -D -u $@ | grep ' U ' && exit 1 || :
 
 $(systemd_boot): $(systemd_boot_solib)
-   $(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
+   $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
  -j .dynsym -j .rel -j .rela -j .reloc \
  --target=efi-app-$(EFI_ARCH) $< $@
 
@@ -2634,7 +2634,7 @@ $(stub_solib): $(stub_objects)
nm -D -u $@ | grep ' U ' && exit 1 || :
 
 $(stub): $(stub_solib)
-   $(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
+   $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
  -j .dynsym -j .rel -j .rela -j .reloc \
  --target=efi-app-$(EFI_ARCH) $< $@
 
diff --git a/configure.ac b/configure.ac
index 7e4a574..6d7c2af 100644
--- a/configure.ac
+++ b/configure.ac
@@ -119,6 +119,7 @@ GOBJECT_INTROSPECTION_CHECK([1.31.1])
AM_CONDITIONAL([HAVE_INTROSPECTION], [false])
enable_introspection=no])
 
+AC_CHECK_TOOL(OBJCOPY, objcopy)
 AC_CHECK_TOOL(STRINGS, strings)
 AC_CHECK_TOOL(GPERF, gperf)
 if test -z "$GPERF" ; then
-- 
2.3.3

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH 2/2] build: allow setting OBJCOPY

2015-04-08 Thread Marc-Antoine Perennou
On 8 April 2015 at 22:24, Mike Gilbert  wrote:
> On Wed, Apr 8, 2015 at 4:08 PM, Marc-Antoine Perennou
>  wrote:
>> Signed-off-by: Marc-Antoine Perennou 
>> ---
>>  Makefile.am  | 4 ++--
>>  configure.ac | 3 +++
>>  2 files changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/Makefile.am b/Makefile.am
>> index 9b769ee..397a71c 100644
>> --- a/Makefile.am
>> +++ b/Makefile.am
>> @@ -2596,7 +2596,7 @@ $(systemd_boot_solib): $(systemd_boot_objects)
>> nm -D -u $@ | grep ' U ' && exit 1 || :
>>
>>  $(systemd_boot): $(systemd_boot_solib)
>> -   $(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
>> +   $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
>>   -j .dynsym -j .rel -j .rela -j .reloc \
>>   --target=efi-app-$(EFI_ARCH) $< $@
>>
>> @@ -2634,7 +2634,7 @@ $(stub_solib): $(stub_objects)
>> nm -D -u $@ | grep ' U ' && exit 1 || :
>>
>>  $(stub): $(stub_solib)
>> -   $(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
>> +   $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
>>   -j .dynsym -j .rel -j .rela -j .reloc \
>>   --target=efi-app-$(EFI_ARCH) $< $@
>>
>> diff --git a/configure.ac b/configure.ac
>> index 0722841..faf1596 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -83,6 +83,9 @@ AC_PROG_AWK
>>
>>  AC_PROG_CC_C99
>>
>> +AC_ARG_VAR(OBJCOPY, [The objcopy binary])
>> +test -z "$ac_cv_env_OBJCOPY_value" && OBJCOPY=objcopy
>
> Why not use AC_CHECK_TOOL here?
>
> https://www.gnu.org/software/autoconf/manual/autoconf.html#Generic-Programs

Heh, indeed, forgot about this one. Thanks!
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 2/2] build: allow setting OBJCOPY

2015-04-08 Thread Marc-Antoine Perennou
Signed-off-by: Marc-Antoine Perennou 
---
 Makefile.am  | 4 ++--
 configure.ac | 3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 9b769ee..397a71c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2596,7 +2596,7 @@ $(systemd_boot_solib): $(systemd_boot_objects)
nm -D -u $@ | grep ' U ' && exit 1 || :
 
 $(systemd_boot): $(systemd_boot_solib)
-   $(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
+   $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
  -j .dynsym -j .rel -j .rela -j .reloc \
  --target=efi-app-$(EFI_ARCH) $< $@
 
@@ -2634,7 +2634,7 @@ $(stub_solib): $(stub_objects)
nm -D -u $@ | grep ' U ' && exit 1 || :
 
 $(stub): $(stub_solib)
-   $(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
+   $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
  -j .dynsym -j .rel -j .rela -j .reloc \
  --target=efi-app-$(EFI_ARCH) $< $@
 
diff --git a/configure.ac b/configure.ac
index 0722841..faf1596 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,6 +83,9 @@ AC_PROG_AWK
 
 AC_PROG_CC_C99
 
+AC_ARG_VAR(OBJCOPY, [The objcopy binary])
+test -z "$ac_cv_env_OBJCOPY_value" && OBJCOPY=objcopy
+
 AC_PATH_PROG([M4], [m4])
 AC_PATH_PROG([XSLTPROC], [xsltproc])
 
-- 
2.3.3

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 1/2] configure: allow setting EFI_CC

2015-04-08 Thread Marc-Antoine Perennou
and only fallback to gcc
---
 configure.ac | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1608c83..0722841 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1147,8 +1147,8 @@ fi
 AM_CONDITIONAL(ENABLE_EFI, [test "x$have_efi" = "xyes"])
 
 # 
--
-EFI_CC=gcc
-AC_SUBST([EFI_CC])
+AC_ARG_VAR(EFI_CC, [Compiler to be used for EFI stub])
+test -z "$ac_cv_env_EFI_CC_value" && EFI_CC=gcc
 
 EFI_ARCH=`echo $host | sed "s/\(-\).*$//"`
 
-- 
2.3.3

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH 2/5] udev.pc: install to pkgconfiglibdir

2015-04-08 Thread Marc-Antoine Perennou
On 8 April 2015 at 20:24, Kay Sievers  wrote:
> On Wed, Apr 8, 2015 at 8:10 PM, Marc-Antoine Perennou
>  wrote:
>> On 8 April 2015 at 20:02, Kay Sievers  wrote:
>>> On Wed, Apr 8, 2015 at 7:52 PM, Marc-Antoine Perennou
>>>  wrote:
>>>> On 8 April 2015 at 19:46, Kay Sievers  wrote:
>>>>> On Wed, Apr 8, 2015 at 7:34 PM, Marc-Antoine Perennou
>>>>>  wrote:
>>>>>> On 8 April 2015 at 18:47, Kay Sievers  wrote:
>>>>>>> On Tue, Apr 7, 2015 at 8:54 PM, Marc-Antoine Perennou
>>>>>>>  wrote:
>>>>>>>> ---
>>>>>>>>  Makefile.am | 3 +--
>>>>>>>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>>>>>>>
>>>>>>>> diff --git a/Makefile.am b/Makefile.am
>>>>>>>> index 9fa4223..9b769ee 100644
>>>>>>>> --- a/Makefile.am
>>>>>>>> +++ b/Makefile.am
>>>>>>>> @@ -3725,8 +3725,7 @@ udevconfdir = $(sysconfdir)/udev
>>>>>>>>  dist_udevconf_DATA = \
>>>>>>>> src/udev/udev.conf
>>>>>>>>
>>>>>>>> -sharepkgconfigdir = $(datadir)/pkgconfig
>>>>>>>> -sharepkgconfig_DATA = \
>>>>>>>> +pkgconfiglib_DATA += \
>>>>>>>> src/udev/udev.pc
>>>>>>>
>>>>>>> This is all backwards. The systemd.pc file is also in the wrong 
>>>>>>> location.
>>>>>>>
>>>>>>> These GENERIC files are supposed to be found by the primary AND the
>>>>>>> secondary arch at the same time, at the GENERIC location, not in a
>>>>>>> arch-specific libdir.
>>>>>>>
>>>>>>> How would the 32bit build find this file on a 64bit 
>>>>>>> compat-arch/multilib system?
>>>>>>>
>>>>>>> Kay
>>>>>>
>>>>>> Well, let's imagine a full cross-compilation toolchain, with
>>>>>> CHOST-prefixed tools.
>>>>>>
>>>>>> x86_64 stuff will get built with x86_64-pc-linux-gnu-gcc
>>>>>> i686 stuff will get built with i686-pc-linux-gnu-gcc
>>>>>> (and you could add a lot of non-native archs here like arm, mips & co)
>>>>>>
>>>>>> x86_64-pc-linux-gnu-pkg-config will look into /usr/lib64/pkgconfig and
>>>>>> /usr/share/pkgconfig
>>>>>> i686-pc-linux-gnu-pkg-config will look into /usr/lib32/pkgconfig and
>>>>>> /usr/share/pkgconfig
>>>>>>
>>>>>> You says that systemd is in the wrong location, so let's see what's
>>>>>> going on with its
>>>>>> current location, and then if we move it to /usr/share
>>>>>>
>>>>>> Current location, libdir/pkgconfig/systemd.pc
>>>>>>
>>>>>> x86_64-pc-linux-gnu-pkg-config finds /usr/lib64/pkgconfig/systemd.pc 
>>>>>> containing,
>>>>>> amongst other things, libdir which is arch specific, /usr/lib64 and
>>>>>> systemdutildir
>>>>>> which contains arch-specific binaries (yes, /usr/lib64/systemd/systemd 
>>>>>> *is* an
>>>>>> ELF64 binary using an x86_64 interpreter.
>>>>>>
>>>>>> i686-pc-linux-gnu-pkg-config finds /usr/lib32/pkgconfig/systemd.pc 
>>>>>> (since it has
>>>>>> been cross-compiled too) and is pretty happy with that.
>>>>>>
>>>>>> arm-whatever-pkg-config finds /usr/arm-whatever/lib/systemd.pc and is
>>>>>> happy with it.
>>>>>>
>>>>>> If you move it to /usr/share/pkgconfig
>>>>>>
>>>>>> x86_64-pc-linux-gnu-pkg-config finds /usr/share/pkgconfig/systemd.pc
>>>>>> and is happy with it
>>>>>>
>>>>>> i686-pc-linux-gnu-pkg-config finds /usr/share/pkgconfig/systemd.pc and
>>>>>> tries linking to
>>>>>> x86_64 libraries
>>>>>>
>>>>>> arm-whatever-pkg-config finds /usr/share/pkgconfig/systemd.pc and
>>>>>> tries linking to
>>>>>> x86_64 libraries + it gets the path towards binaries its target won't
>>>>>> even be able to execute.
>>>>>>
>&

Re: [systemd-devel] [PATCH 4/5] configure: allow setting EFI_CC

2015-04-08 Thread Marc-Antoine Perennou
On 7 April 2015 at 20:54, Marc-Antoine Perennou
 wrote:
> and only fallback to gcc
> ---
>  configure.ac | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/configure.ac b/configure.ac
> index 1608c83..56340a2 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1147,7 +1147,7 @@ fi
>  AM_CONDITIONAL(ENABLE_EFI, [test "x$have_efi" = "xyes"])
>
>  # 
> --
> -EFI_CC=gcc
> +EFI_CC="${EFI_CC:-gcc}"
>  AC_SUBST([EFI_CC])
>
>  EFI_ARCH=`echo $host | sed "s/\(-\).*$//"`
> --
> 2.3.3
>


Please ignore this patch, a better version is coming of this 4/5 and of 5/5.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH 2/5] udev.pc: install to pkgconfiglibdir

2015-04-08 Thread Marc-Antoine Perennou
On 8 April 2015 at 20:02, Kay Sievers  wrote:
> On Wed, Apr 8, 2015 at 7:52 PM, Marc-Antoine Perennou
>  wrote:
>> On 8 April 2015 at 19:46, Kay Sievers  wrote:
>>> On Wed, Apr 8, 2015 at 7:34 PM, Marc-Antoine Perennou
>>>  wrote:
>>>> On 8 April 2015 at 18:47, Kay Sievers  wrote:
>>>>> On Tue, Apr 7, 2015 at 8:54 PM, Marc-Antoine Perennou
>>>>>  wrote:
>>>>>> ---
>>>>>>  Makefile.am | 3 +--
>>>>>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>>>>>
>>>>>> diff --git a/Makefile.am b/Makefile.am
>>>>>> index 9fa4223..9b769ee 100644
>>>>>> --- a/Makefile.am
>>>>>> +++ b/Makefile.am
>>>>>> @@ -3725,8 +3725,7 @@ udevconfdir = $(sysconfdir)/udev
>>>>>>  dist_udevconf_DATA = \
>>>>>> src/udev/udev.conf
>>>>>>
>>>>>> -sharepkgconfigdir = $(datadir)/pkgconfig
>>>>>> -sharepkgconfig_DATA = \
>>>>>> +pkgconfiglib_DATA += \
>>>>>> src/udev/udev.pc
>>>>>
>>>>> This is all backwards. The systemd.pc file is also in the wrong location.
>>>>>
>>>>> These GENERIC files are supposed to be found by the primary AND the
>>>>> secondary arch at the same time, at the GENERIC location, not in a
>>>>> arch-specific libdir.
>>>>>
>>>>> How would the 32bit build find this file on a 64bit compat-arch/multilib 
>>>>> system?
>>>>>
>>>>> Kay
>>>>
>>>> Well, let's imagine a full cross-compilation toolchain, with
>>>> CHOST-prefixed tools.
>>>>
>>>> x86_64 stuff will get built with x86_64-pc-linux-gnu-gcc
>>>> i686 stuff will get built with i686-pc-linux-gnu-gcc
>>>> (and you could add a lot of non-native archs here like arm, mips & co)
>>>>
>>>> x86_64-pc-linux-gnu-pkg-config will look into /usr/lib64/pkgconfig and
>>>> /usr/share/pkgconfig
>>>> i686-pc-linux-gnu-pkg-config will look into /usr/lib32/pkgconfig and
>>>> /usr/share/pkgconfig
>>>>
>>>> You says that systemd is in the wrong location, so let's see what's
>>>> going on with its
>>>> current location, and then if we move it to /usr/share
>>>>
>>>> Current location, libdir/pkgconfig/systemd.pc
>>>>
>>>> x86_64-pc-linux-gnu-pkg-config finds /usr/lib64/pkgconfig/systemd.pc 
>>>> containing,
>>>> amongst other things, libdir which is arch specific, /usr/lib64 and
>>>> systemdutildir
>>>> which contains arch-specific binaries (yes, /usr/lib64/systemd/systemd 
>>>> *is* an
>>>> ELF64 binary using an x86_64 interpreter.
>>>>
>>>> i686-pc-linux-gnu-pkg-config finds /usr/lib32/pkgconfig/systemd.pc (since 
>>>> it has
>>>> been cross-compiled too) and is pretty happy with that.
>>>>
>>>> arm-whatever-pkg-config finds /usr/arm-whatever/lib/systemd.pc and is
>>>> happy with it.
>>>>
>>>> If you move it to /usr/share/pkgconfig
>>>>
>>>> x86_64-pc-linux-gnu-pkg-config finds /usr/share/pkgconfig/systemd.pc
>>>> and is happy with it
>>>>
>>>> i686-pc-linux-gnu-pkg-config finds /usr/share/pkgconfig/systemd.pc and
>>>> tries linking to
>>>> x86_64 libraries
>>>>
>>>> arm-whatever-pkg-config finds /usr/share/pkgconfig/systemd.pc and
>>>> tries linking to
>>>> x86_64 libraries + it gets the path towards binaries its target won't
>>>> even be able to execute.
>>>>
>>>>
>>>> Hope that helps understanding the rational of putting pkgconfig files
>>>> pointing to
>>>> arch-specific libs/bins into an arch-specific place.
>>>>
>>>>
>>>> A good example of a pkgconfig file that is ok to install into
>>>> /usr/share/pkgconfig is
>>>> xorg-macros.pc which only leads to arch-independants macros.
>>>
>>> The point is, the purpose of that file is not cross-compiling. It is
>>> meant to provide information for the i686 toolchain which is nativly
>>> compiled on a x86_64 primary host.
>>>
>>> How is the i686 tool supposed to find the primary values of the
>>> installed native x86_64 tools if things are

Re: [systemd-devel] [PATCH 2/5] udev.pc: install to pkgconfiglibdir

2015-04-08 Thread Marc-Antoine Perennou
On 8 April 2015 at 19:46, Kay Sievers  wrote:
> On Wed, Apr 8, 2015 at 7:34 PM, Marc-Antoine Perennou
>  wrote:
>> On 8 April 2015 at 18:47, Kay Sievers  wrote:
>>> On Tue, Apr 7, 2015 at 8:54 PM, Marc-Antoine Perennou
>>>  wrote:
>>>> ---
>>>>  Makefile.am | 3 +--
>>>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>>>
>>>> diff --git a/Makefile.am b/Makefile.am
>>>> index 9fa4223..9b769ee 100644
>>>> --- a/Makefile.am
>>>> +++ b/Makefile.am
>>>> @@ -3725,8 +3725,7 @@ udevconfdir = $(sysconfdir)/udev
>>>>  dist_udevconf_DATA = \
>>>> src/udev/udev.conf
>>>>
>>>> -sharepkgconfigdir = $(datadir)/pkgconfig
>>>> -sharepkgconfig_DATA = \
>>>> +pkgconfiglib_DATA += \
>>>> src/udev/udev.pc
>>>
>>> This is all backwards. The systemd.pc file is also in the wrong location.
>>>
>>> These GENERIC files are supposed to be found by the primary AND the
>>> secondary arch at the same time, at the GENERIC location, not in a
>>> arch-specific libdir.
>>>
>>> How would the 32bit build find this file on a 64bit compat-arch/multilib 
>>> system?
>>>
>>> Kay
>>
>> Well, let's imagine a full cross-compilation toolchain, with
>> CHOST-prefixed tools.
>>
>> x86_64 stuff will get built with x86_64-pc-linux-gnu-gcc
>> i686 stuff will get built with i686-pc-linux-gnu-gcc
>> (and you could add a lot of non-native archs here like arm, mips & co)
>>
>> x86_64-pc-linux-gnu-pkg-config will look into /usr/lib64/pkgconfig and
>> /usr/share/pkgconfig
>> i686-pc-linux-gnu-pkg-config will look into /usr/lib32/pkgconfig and
>> /usr/share/pkgconfig
>>
>> You says that systemd is in the wrong location, so let's see what's
>> going on with its
>> current location, and then if we move it to /usr/share
>>
>> Current location, libdir/pkgconfig/systemd.pc
>>
>> x86_64-pc-linux-gnu-pkg-config finds /usr/lib64/pkgconfig/systemd.pc 
>> containing,
>> amongst other things, libdir which is arch specific, /usr/lib64 and
>> systemdutildir
>> which contains arch-specific binaries (yes, /usr/lib64/systemd/systemd *is* 
>> an
>> ELF64 binary using an x86_64 interpreter.
>>
>> i686-pc-linux-gnu-pkg-config finds /usr/lib32/pkgconfig/systemd.pc (since it 
>> has
>> been cross-compiled too) and is pretty happy with that.
>>
>> arm-whatever-pkg-config finds /usr/arm-whatever/lib/systemd.pc and is
>> happy with it.
>>
>> If you move it to /usr/share/pkgconfig
>>
>> x86_64-pc-linux-gnu-pkg-config finds /usr/share/pkgconfig/systemd.pc
>> and is happy with it
>>
>> i686-pc-linux-gnu-pkg-config finds /usr/share/pkgconfig/systemd.pc and
>> tries linking to
>> x86_64 libraries
>>
>> arm-whatever-pkg-config finds /usr/share/pkgconfig/systemd.pc and
>> tries linking to
>> x86_64 libraries + it gets the path towards binaries its target won't
>> even be able to execute.
>>
>>
>> Hope that helps understanding the rational of putting pkgconfig files
>> pointing to
>> arch-specific libs/bins into an arch-specific place.
>>
>>
>> A good example of a pkgconfig file that is ok to install into
>> /usr/share/pkgconfig is
>> xorg-macros.pc which only leads to arch-independants macros.
>
> The point is, the purpose of that file is not cross-compiling. It is
> meant to provide information for the i686 toolchain which is nativly
> compiled on a x86_64 primary host.
>
> How is the i686 tool supposed to find the primary values of the
> installed native x86_64 tools if things are moved like you propose?
>

Why would it need to?

> The entire idea of adding $libdir to a file that is installed in
> $libdir to point to itself makes no sense at all, but that was the
> reason it was moved in the first place.
>
> Kay

Agreed about the redundancy, but what if the arm tool wants to find
installed arm tools, and not x86_64?
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH 5/5] build: use $(OBJCOPY)

2015-04-08 Thread Marc-Antoine Perennou
On 8 April 2015 at 19:03, Kay Sievers  wrote:
> On Tue, Apr 7, 2015 at 8:54 PM, Marc-Antoine Perennou
>  wrote:
>> ---
>>  Makefile.am | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/Makefile.am b/Makefile.am
>> index 9b769ee..397a71c 100644
>> --- a/Makefile.am
>> +++ b/Makefile.am
>> @@ -2596,7 +2596,7 @@ $(systemd_boot_solib): $(systemd_boot_objects)
>> nm -D -u $@ | grep ' U ' && exit 1 || :
>>
>>  $(systemd_boot): $(systemd_boot_solib)
>> -   $(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
>> +   $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
>
> This does not build here. I don't see who would define OBJCOPY.
>
> Kay

Someone with a full CHOST-prefixed compilation toolchain would.
I agree there should be a default value here, though, will send another
fixed patch for this.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH 2/5] udev.pc: install to pkgconfiglibdir

2015-04-08 Thread Marc-Antoine Perennou
On 8 April 2015 at 18:47, Kay Sievers  wrote:
> On Tue, Apr 7, 2015 at 8:54 PM, Marc-Antoine Perennou
>  wrote:
>> ---
>>  Makefile.am | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/Makefile.am b/Makefile.am
>> index 9fa4223..9b769ee 100644
>> --- a/Makefile.am
>> +++ b/Makefile.am
>> @@ -3725,8 +3725,7 @@ udevconfdir = $(sysconfdir)/udev
>>  dist_udevconf_DATA = \
>> src/udev/udev.conf
>>
>> -sharepkgconfigdir = $(datadir)/pkgconfig
>> -sharepkgconfig_DATA = \
>> +pkgconfiglib_DATA += \
>> src/udev/udev.pc
>
> This is all backwards. The systemd.pc file is also in the wrong location.
>
> These GENERIC files are supposed to be found by the primary AND the
> secondary arch at the same time, at the GENERIC location, not in a
> arch-specific libdir.
>
> How would the 32bit build find this file on a 64bit compat-arch/multilib 
> system?
>
> Kay

Well, let's imagine a full cross-compilation toolchain, with
CHOST-prefixed tools.

x86_64 stuff will get built with x86_64-pc-linux-gnu-gcc
i686 stuff will get built with i686-pc-linux-gnu-gcc
(and you could add a lot of non-native archs here like arm, mips & co)

x86_64-pc-linux-gnu-pkg-config will look into /usr/lib64/pkgconfig and
/usr/share/pkgconfig
i686-pc-linux-gnu-pkg-config will look into /usr/lib32/pkgconfig and
/usr/share/pkgconfig

You says that systemd is in the wrong location, so let's see what's
going on with its
current location, and then if we move it to /usr/share

Current location, libdir/pkgconfig/systemd.pc

x86_64-pc-linux-gnu-pkg-config finds /usr/lib64/pkgconfig/systemd.pc containing,
amongst other things, libdir which is arch specific, /usr/lib64 and
systemdutildir
which contains arch-specific binaries (yes, /usr/lib64/systemd/systemd *is* an
ELF64 binary using an x86_64 interpreter.

i686-pc-linux-gnu-pkg-config finds /usr/lib32/pkgconfig/systemd.pc (since it has
been cross-compiled too) and is pretty happy with that.

arm-whatever-pkg-config finds /usr/arm-whatever/lib/systemd.pc and is
happy with it.

If you move it to /usr/share/pkgconfig

x86_64-pc-linux-gnu-pkg-config finds /usr/share/pkgconfig/systemd.pc
and is happy with it

i686-pc-linux-gnu-pkg-config finds /usr/share/pkgconfig/systemd.pc and
tries linking to
x86_64 libraries

arm-whatever-pkg-config finds /usr/share/pkgconfig/systemd.pc and
tries linking to
x86_64 libraries + it gets the path towards binaries its target won't
even be able to execute.


Hope that helps understanding the rational of putting pkgconfig files
pointing to
arch-specific libs/bins into an arch-specific place.


A good example of a pkgconfig file that is ok to install into
/usr/share/pkgconfig is
xorg-macros.pc which only leads to arch-independants macros.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 0/5] Cross compilation adjustments

2015-04-07 Thread Marc-Antoine Perennou
Hi,

These are just a few trivial patches fixing cross-compilation build and 
installation.

1/5 follows what is done everywhere else in the Makefile
2/5 installs arch-specifc pkg-config file to the correct location
3/5 makes use of EFI_CC in the efi part of the configure too
4/5 actually allows to set EFI_CC
5/5 makes use of $(OBJCOPY) instead of harcoding objcopy

Marc-Antoine Perennou (5):
  factory: install to datadir
  udev.pc: install to pkgconfiglibdir
  efi: use EFI_CC
  configure: allow setting EFI_CC
  build: use $(OBJCOPY)

 Makefile.am  | 11 +--
 configure.ac |  4 ++--
 2 files changed, 7 insertions(+), 8 deletions(-)

-- 
2.3.3

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 5/5] build: use $(OBJCOPY)

2015-04-07 Thread Marc-Antoine Perennou
---
 Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 9b769ee..397a71c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2596,7 +2596,7 @@ $(systemd_boot_solib): $(systemd_boot_objects)
nm -D -u $@ | grep ' U ' && exit 1 || :
 
 $(systemd_boot): $(systemd_boot_solib)
-   $(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
+   $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
  -j .dynsym -j .rel -j .rela -j .reloc \
  --target=efi-app-$(EFI_ARCH) $< $@
 
@@ -2634,7 +2634,7 @@ $(stub_solib): $(stub_objects)
nm -D -u $@ | grep ' U ' && exit 1 || :
 
 $(stub): $(stub_solib)
-   $(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
+   $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
  -j .dynsym -j .rel -j .rela -j .reloc \
  --target=efi-app-$(EFI_ARCH) $< $@
 
-- 
2.3.3

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 4/5] configure: allow setting EFI_CC

2015-04-07 Thread Marc-Antoine Perennou
and only fallback to gcc
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 1608c83..56340a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1147,7 +1147,7 @@ fi
 AM_CONDITIONAL(ENABLE_EFI, [test "x$have_efi" = "xyes"])
 
 # 
--
-EFI_CC=gcc
+EFI_CC="${EFI_CC:-gcc}"
 AC_SUBST([EFI_CC])
 
 EFI_ARCH=`echo $host | sed "s/\(-\).*$//"`
-- 
2.3.3

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 2/5] udev.pc: install to pkgconfiglibdir

2015-04-07 Thread Marc-Antoine Perennou
---
 Makefile.am | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 9fa4223..9b769ee 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3725,8 +3725,7 @@ udevconfdir = $(sysconfdir)/udev
 dist_udevconf_DATA = \
src/udev/udev.conf
 
-sharepkgconfigdir = $(datadir)/pkgconfig
-sharepkgconfig_DATA = \
+pkgconfiglib_DATA += \
src/udev/udev.pc
 
 EXTRA_DIST += \
-- 
2.3.3

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 3/5] efi: use EFI_CC

2015-04-07 Thread Marc-Antoine Perennou
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 29111f5..1608c83 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1172,7 +1172,7 @@ AS_IF([test "x$enable_gnuefi" != "xno"], [
[AC_MSG_ERROR([*** gnuefi support requested but headers 
not found])])
 ])
 
-efiroot=$(echo $(cd /usr/lib/$(gcc -print-multi-os-directory); pwd))
+efiroot=$(echo $(cd /usr/lib/$(${EFI_CC} -print-multi-os-directory); 
pwd))
 
 EFI_LIB_DIR="$efiroot"
 AC_ARG_WITH(efi-libdir,
-- 
2.3.3

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 1/5] factory: install to datadir

2015-04-07 Thread Marc-Antoine Perennou
---
 Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index a575af6..9fa4223 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -109,8 +109,8 @@ udevrulesdir=$(udevlibexecdir)/rules.d
 udevhwdbdir=$(udevlibexecdir)/hwdb.d
 catalogdir=$(prefix)/lib/systemd/catalog
 kernelinstalldir = $(prefix)/lib/kernel/install.d
-factory_etcdir = $(prefix)/share/factory/etc
-factory_pamdir = $(prefix)/share/factory/etc/pam.d
+factory_etcdir = $(datadir)/factory/etc
+factory_pamdir = $(datadir)/factory/etc/pam.d
 bootlibdir = $(prefix)/lib/systemd/boot/efi
 
 # And these are the special ones for /
-- 
2.3.3

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] test-compress-benchmark: silence warnings

2014-07-15 Thread Marc-Antoine Perennou
On 16 July 2014 10:30, Zbigniew Jędrzejewski-Szmek  wrote:
> On Wed, Jul 16, 2014 at 03:29:15AM +0200, Zbigniew Jędrzejewski-Szmek wrote:
>> On Wed, Jul 16, 2014 at 10:13:06AM +0900, Marc-Antoine Perennou wrote:
>> > and btw make it pass for 32bits where size_t != uint64_t
>> Do they still make those? ;)
>>
>> Will apply.
> Actually please apply it yourself. Looks good.
>
> Zbyszek


Don't have push access, so I'll let you apply when you have time.

Marc-Antoine
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] test-compress-benchmark: silence warnings

2014-07-15 Thread Marc-Antoine Perennou
and btw make it pass for 32bits where size_t != uint64_t
---
 src/journal/test-compress-benchmark.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/journal/test-compress-benchmark.c 
b/src/journal/test-compress-benchmark.c
index 0a23bd1..a346447 100644
--- a/src/journal/test-compress-benchmark.c
+++ b/src/journal/test-compress-benchmark.c
@@ -42,12 +42,12 @@ static char* make_buf(size_t count) {
 
 static void test_compress_decompress(const char* label,
  compress_t compress, decompress_t 
decompress) {
-usec_t n, n2;
+usec_t n, n2 = 0;
 float dt;
 
 _cleanup_free_ char *text, *buf;
 _cleanup_free_ void *buf2 = NULL;
-size_t buf2_allocated = 0;
+uint64_t buf2_allocated = 0;
 size_t skipped = 0, compressed = 0, total = 0;
 
 text = make_buf(MAX_SIZE);
@@ -57,7 +57,7 @@ static void test_compress_decompress(const char* label,
 n = now(CLOCK_MONOTONIC);
 
 for (size_t i = 1; i <= MAX_SIZE; i += (i < 2048 ? 1 : 217)) {
-size_t j = 0, k = 0;
+uint64_t j = 0, k = 0;
 int r;
 
 r = compress(text, i, buf, &j);
@@ -72,7 +72,7 @@ static void test_compress_decompress(const char* label,
 
 assert(j > 0);
 if (j >= i)
-log_error("%s \"compressed\" %zu -> %zu", label, i, j);
+log_error("%s \"compressed\" %zu -> " PRIu64, label, 
i, j);
 
 r = decompress(buf, j, &buf2, &buf2_allocated, &k, 0);
 assert(r == 0);
-- 
2.0.1

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] fix in_addr_prefix_intersect for 32bits

2014-06-22 Thread Marc-Antoine Perennou
shifting from a non fixed number of bits >= to the size of the type
leads to weird results, handle the special case of << 32 to fix it.

This was causing a test failure from test-socket-util:
Assertion 'in_addr_prefix_intersect(f, &ua, apl, &ub, bpl) == result' failed at
/var/tmp/paludis/build/sys-apps-systemd-scm/work/systemd-scm/src/test/test-socket-util.c:147,
 function
test_in_addr_prefix_intersect_one(). Aborting.

Minimal reproducer:

paludisbuild@Lou /tmp $ cat test.c
static void test(unsigned m) {
unsigned nm = 0xUL << (32-m);
printf("%u: %x\n", m, nm);
}

int main (void) {
test(1);
test(0);
return 0;
}
paludisbuild@Lou /tmp $ gcc -m32 -std=gnu99 test.c -o test32
paludisbuild@Lou /tmp $ ./test32
1: 8000
0: 
paludisbuild@Lou /tmp $ gcc -std=gnu99 test.c -o test64
paludisbuild@Lou /tmp $ ./test64
1: 8000
0: 0
---
 src/shared/socket-util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/shared/socket-util.c b/src/shared/socket-util.c
index f8c6795..6f49798 100644
--- a/src/shared/socket-util.c
+++ b/src/shared/socket-util.c
@@ -695,7 +695,7 @@ int in_addr_prefix_intersect(
 uint32_t x, nm;
 
 x = be32toh(a->in.s_addr ^ b->in.s_addr);
-nm = 0xUL << (32 - m);
+nm = (m == 0) ? 0 : 0xUL << (32 - m);
 
 return (x & nm) == 0;
 }
-- 
2.0.0

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] Don't use "class" in public headers

2014-03-18 Thread Marc-Antoine Perennou
---
 src/systemd/sd-login.h   | 2 +-
 src/systemd/sd-resolve.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/systemd/sd-login.h b/src/systemd/sd-login.h
index 87ebafb..c539dd8 100644
--- a/src/systemd/sd-login.h
+++ b/src/systemd/sd-login.h
@@ -178,7 +178,7 @@ int sd_seat_can_tty(const char *seat);
 int sd_seat_can_graphical(const char *seat);
 
 /* Return the class of machine */
-int sd_machine_get_class(const char *machine, char **class);
+int sd_machine_get_class(const char *machine, char **clazz);
 
 /* Get all seats, store in *seats. Returns the number of seats. If
  * seats is NULL only returns number of seats. */
diff --git a/src/systemd/sd-resolve.h b/src/systemd/sd-resolve.h
index 3c1d482..a02be7d 100644
--- a/src/systemd/sd-resolve.h
+++ b/src/systemd/sd-resolve.h
@@ -103,13 +103,13 @@ int sd_resolve_getnameinfo_done(sd_resolve_query* q, char 
**ret_host, char **ret
  * compatible with the ones of libc's res_query(3). The function returns a new
  * query object. When the query is completed you may retrieve the results using
  * sd_resolve_res_done().  */
-int sd_resolve_res_query(sd_resolve *resolve, sd_resolve_query **q, const char 
*dname, int class, int type);
+int sd_resolve_res_query(sd_resolve *resolve, sd_resolve_query **q, const char 
*dname, int clazz, int type);
 
 /** Issue an resolver query on the specified session. The arguments are
  * compatible with the ones of libc's res_search(3). The function returns a new
  * query object. When the query is completed you may retrieve the results using
  * sd_resolve_res_done().  */
-int sd_resolve_res_search(sd_resolve *resolve, sd_resolve_query **q, const 
char *dname, int class, int type);
+int sd_resolve_res_search(sd_resolve *resolve, sd_resolve_query **q, const 
char *dname, int clazz, int type);
 
 /** Retrieve the results of a preceding sd_resolve_res_query() or
  * resolve_res_search call.  The query object q is destroyed by this
-- 
1.9.0

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH 3/4] bus: driverd: don't attempt to remove from empty list

2014-01-04 Thread Marc-Antoine Perennou
On 28 December 2013 13:54, Marc-Antoine Perennou
 wrote:
> ---
>  src/bus-driverd/bus-driverd.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/bus-driverd/bus-driverd.c b/src/bus-driverd/bus-driverd.c
> index b423420..1fdea7e 100644
> --- a/src/bus-driverd/bus-driverd.c
> +++ b/src/bus-driverd/bus-driverd.c
> @@ -90,10 +90,10 @@ static void match_free(Match *m) {
>  Match *first;
>
>  first = hashmap_get(m->client->matches, m->match);
> -LIST_REMOVE(matches, first, m);
> -if (first)
> +if (first) {
> +LIST_REMOVE(matches, first, m);
>  assert_se(hashmap_replace(m->client->matches, 
> m->match, first) >= 0);
> -else
> +} else
>  hashmap_remove(m->client->matches, m->match);
>
>  m->client->n_matches--;
> --
> 1.8.5.2
>

Any news on this one?
Without it, every startup I get

#0  0x7ffcebc5f339 in raise () from /usr/lib64/libc.so.6
No symbol table info available.
#1  0x7ffcebc60738 in abort () from /usr/lib64/libc.so.6
No symbol table info available.
#2  0x0042e743 in log_assert_failed (text=text@entry=0x4308af
"*_head == _item", file=file@entry=0x4303c0
"/var/tmp/paludis/build/sys-apps-systemd-scm/work/systemd-scm/src/bus-driverd/bus-driverd.c",
line=line@entry=93, func=func@entry=0x430bf4
<__PRETTY_FUNCTION__.10834> "match_free") at
/var/tmp/paludis/build/sys-apps-systemd-scm/work/systemd-scm/src/shared/log.c:725
No locals.
#3  0x004038cb in match_free (m=0x1a99ba0) at
/var/tmp/paludis/build/sys-apps-systemd-scm/work/systemd-scm/src/bus-driverd/bus-driverd.c:93
_head = 
_item = 0x1a99ba0
first = 
__PRETTY_FUNCTION__ = "match_free"
#4  0x004041c0 in client_free (c=0x1a54db0) at
/var/tmp/paludis/build/sys-apps-systemd-scm/work/systemd-scm/src/bus-driverd/bus-driverd.c:166
m = 
__PRETTY_FUNCTION__ = "client_free"
#5  0x004047bd in on_name_owner_changed (bus=,
m=, userdata=, error=) at
/var/tmp/paludis/build/sys-apps-systemd-scm/work/systemd-scm/src/bus-driverd/bus-driverd.c:180
c = 
__PRETTY_FUNCTION__ = "on_name_owner_changed"
#6  0x0041e328 in bus_match_run (bus=bus@entry=0x197b180,
node=0x1aa7e60, m=m@entry=0x1a3a8a0) at
/var/tmp/paludis/build/sys-apps-systemd-scm/work/systemd-scm/src/libsystemd-bus/bus-match.c:292
error_buffer = {name = 0x0, message = 0x0, _need_free = 0}
test_str = 0x0
test_u8 = 0 '\000'
r = 
__PRETTY_FUNCTION__ = "bus_match_run"
#7  0x0041e2bf in bus_match_run (bus=bus@entry=0x197b180,
node=0x1aa7e10, m=m@entry=0x1a3a8a0) at
/var/tmp/paludis/build/sys-apps-systemd-scm/work/systemd-scm/src/libsystemd-bus/bus-match.c:273
test_str = 0x0
test_u8 = 0 '\000'
r = 
__PRETTY_FUNCTION__ = "bus_match_run"
#8  0x0041e47d in bus_match_run (bus=bus@entry=0x197b180,
node=0x197f3e0, m=m@entry=0x1a3a8a0) at
/var/tmp/paludis/build/sys-apps-systemd-scm/work/systemd-scm/src/libsystemd-bus/bus-match.c:355
found = 
test_str = 0x7ffcec40f000 ":1.76"
test_u8 = 0 '\000'
r = 
__PRETTY_FUNCTION__ = "bus_match_run"
#9  0x0041e2bf in bus_match_run (bus=bus@entry=0x197b180,
node=0x197f370, m=m@entry=0x1a3a8a0) at
/var/tmp/paludis/build/sys-apps-systemd-scm/work/systemd-scm/src/libsystemd-bus/bus-match.c:273
test_str = 0x0
test_u8 = 0 '\000'
r = 
__PRETTY_FUNCTION__ = "bus_match_run"
#10 0x0041e47d in bus_match_run (bus=bus@entry=0x197b180,
node=0x197f320, m=m@entry=0x1a3a8a0) at
/var/tmp/paludis/build/sys-apps-systemd-scm/work/systemd-scm/src/libsystemd-bus/bus-match.c:355
found = 
test_str = 0x1a58e68 "/org/freedesktop/DBus"
test_u8 = 0 '\000'
r = 
__PRETTY_FUNCTION__ = "bus_match_run"
#11 0x0041e2bf in bus_match_run (bus=bus@entry=0x197b180,
node=0x197f2b0, m=m@entry=0x1a3a8a0) at
/var/tmp/paludis/build/sys-apps-systemd-scm/work/systemd-scm/src/libsystemd-bus/bus-match.c:273
test_str = 0x0
test_u8 = 0 '\000'
r = 
__PRETTY_FUNCTION__ = "bus_match_run"
#12 0x0041e47d in bus_match_run (bus=bus@entry=0x197b180,
node=0x197f260, m=m@entry=0x1a3a8a0) at
/var/tmp/paludis/build/sys-apps-systemd-scm/work/systemd-scm/src/libsystemd-bus/bus-match.c:355
found = 
test_str = 0x1a58ea8 "NameOwnerChanged"
test_u8 = 0 '\000'
r = 
__PRETTY_FUN

Re: [systemd-devel] [PATCH 2/4] bus: driverd: don't remove twice a match from the list

2013-12-28 Thread Marc-Antoine Perennou
On Sat, 2013-12-28 at 15:17 +0100, Lennart Poettering wrote:
> 
> Hmm, did you run into an actual problem with this?
> 
> match_free() only undoes the registration if m->client is actually
> set. Which it isn't in this case, since we actually set m->client after
> the hashmap_replace() succeeded. Actually, we use whether m->client is
> set or not as indication whether we have to remove the match from the
> hashmap and the list that is appended to each entry.
> 
> To me it appears the currently code is quite correct, or am I missing
> anything?
> 
> Lennart
> 

I might have gotten this one wrong, I actually found it while looking
for another one (3/4) which caused me a coredump because of the last
assert in LIST_REMOVE

Marc-Antoine



___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 1/4] bus: driverd; add missing format string parameter

2013-12-27 Thread Marc-Antoine Perennou
This was causing a nasty coredump
---
 src/bus-driverd/bus-driverd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bus-driverd/bus-driverd.c b/src/bus-driverd/bus-driverd.c
index 57023ec..44172c4 100644
--- a/src/bus-driverd/bus-driverd.c
+++ b/src/bus-driverd/bus-driverd.c
@@ -346,7 +346,7 @@ static int driver_remove_match(sd_bus *bus, sd_bus_message 
*message, void *userd
 
 m = hashmap_get(c->matches, normalized);
 if (!m) {
-r = sd_bus_error_setf(error, 
SD_BUS_ERROR_MATCH_RULE_NOT_FOUND, "Match rule \"%s\" not found.");
+r = sd_bus_error_setf(error, 
SD_BUS_ERROR_MATCH_RULE_NOT_FOUND, "Match rule \"%s\" not found.", normalized);
 goto finish;
 }
 
-- 
1.8.5.2

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 3/4] bus: driverd: don't attempt to remove from empty list

2013-12-27 Thread Marc-Antoine Perennou
---
 src/bus-driverd/bus-driverd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/bus-driverd/bus-driverd.c b/src/bus-driverd/bus-driverd.c
index b423420..1fdea7e 100644
--- a/src/bus-driverd/bus-driverd.c
+++ b/src/bus-driverd/bus-driverd.c
@@ -90,10 +90,10 @@ static void match_free(Match *m) {
 Match *first;
 
 first = hashmap_get(m->client->matches, m->match);
-LIST_REMOVE(matches, first, m);
-if (first)
+if (first) {
+LIST_REMOVE(matches, first, m);
 assert_se(hashmap_replace(m->client->matches, 
m->match, first) >= 0);
-else
+} else
 hashmap_remove(m->client->matches, m->match);
 
 m->client->n_matches--;
-- 
1.8.5.2

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 2/4] bus: driverd: don't remove twice a match from the list

2013-12-27 Thread Marc-Antoine Perennou
match_free already does it
---
 src/bus-driverd/bus-driverd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/bus-driverd/bus-driverd.c b/src/bus-driverd/bus-driverd.c
index 44172c4..b423420 100644
--- a/src/bus-driverd/bus-driverd.c
+++ b/src/bus-driverd/bus-driverd.c
@@ -129,10 +129,8 @@ static int match_new(Client *c, struct bus_match_component 
*components, unsigned
 first = hashmap_get(c->matches, m->match);
 LIST_PREPEND(matches, first, m);
 r = hashmap_replace(c->matches, m->match, first);
-if (r < 0) {
-LIST_REMOVE(matches, first, m);
+if (r < 0)
 goto fail;
-}
 
 m->client = c;
 c->n_matches++;
-- 
1.8.5.2

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 4/4] gitignore: add back user@.service

2013-12-27 Thread Marc-Antoine Perennou
---
 units/.gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/units/.gitignore b/units/.gitignore
index 6de2aad..cb9fa1c 100644
--- a/units/.gitignore
+++ b/units/.gitignore
@@ -66,3 +66,4 @@
 /systemd-user-sessions.service
 /systemd-vconsole-setup.service
 /user@.service.m4
+/user@.service
-- 
1.8.5.2

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] rtnl: fix for 32bits

2013-12-16 Thread Marc-Antoine Perennou
Commit 0a0dc69b655cfb10cab39133f5d521e7b35ce3d5 broke tests for 32 bits
---
 src/libsystemd-rtnl/rtnl-message.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libsystemd-rtnl/rtnl-message.c 
b/src/libsystemd-rtnl/rtnl-message.c
index 264cca0..c62eca9 100644
--- a/src/libsystemd-rtnl/rtnl-message.c
+++ b/src/libsystemd-rtnl/rtnl-message.c
@@ -601,7 +601,7 @@ int sd_rtnl_message_append_ether_addr(sd_rtnl_message *m, 
unsigned short type, c
 return -ENOTSUP;
 }
 
-r = add_rtattr(m, type, data, sizeof(data));
+r = add_rtattr(m, type, data, ETH_ALEN);
 if (r < 0)
 return r;
 
-- 
1.8.5.1

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] shared: add missing include

2013-12-11 Thread Marc-Antoine Perennou
Needed for socketpair, recv
---
 src/shared/logs-show.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c
index c99fc75..0e3fd3d 100644
--- a/src/shared/logs-show.c
+++ b/src/shared/logs-show.c
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
-- 
1.8.5.1

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH V2 2/2] systemctl: port to libsystemd-bus

2013-11-08 Thread Marc-Antoine Perennou
On Friday, November 8, 2013, Lennart Poettering wrote:

> On Fri, 08.11.13 10:34, Marc-Antoine Perennou (marc-anto...@perennou.com)
> wrote:
>
> Heya!
>
> I already rebased the previous version you posted, and then applied with
> some changes. Is this reposting of yours more than just a rebase?
>
> I merged both commits into one, and made a couple of changes:
>
> I didn't like the log_method_call_failed() thing, because I'd much
> prefer having good explanatory error messages which usually require
> format strings and stuff. I did like log_message_creation_failed()
> though and moved it to bus-util.c as bus_log_create_error().
>
> sd-bus.h is a public API, where we try to avoid everything that is not
> C89. "bool" is C99. The message parser/append calls hence assume that
> booleans are "int"s, as in traditional C, in glib or even the old
> libdbus1. However, "bool" and "int" have different sizes, which means
> taking a pointer of a bool and passing that to sd_bus_message_read() or
> so for parsing a bool will explode. C can be ugly like hell
> sometimes. Anyway, fixed those.
>
> The bus transport generalization doesn't do direct PID1 connections
> anymore, I will add this in a alter commit.
>
> Thanks a lot for the patch!
>
> We are now down to only PID 1 left in libdus-1 land!
>
> Lennart
>
> --
> Lennart Poettering, Red Hat
>

Was mostly a rebase + trivial cleanups, nothing important.
Thanks for the hints and fixes!

Marc-Antoine
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH v2 1/2] analyze: split out bus util functions

2013-11-07 Thread Marc-Antoine Perennou
They will soon be used in systemctl
---
 src/analyze/analyze.c | 68 +++
 src/libsystemd-bus/bus-util.c | 49 +++
 src/libsystemd-bus/bus-util.h | 17 +++
 3 files changed, 70 insertions(+), 64 deletions(-)

diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c
index e149b15..19e6508 100644
--- a/src/analyze/analyze.c
+++ b/src/analyze/analyze.c
@@ -89,19 +89,6 @@ struct boot_times {
 usec_t unitsload_finish_time;
 };
 
-struct unit_info {
-const char *id;
-const char *description;
-const char *load_state;
-const char *active_state;
-const char *sub_state;
-const char *following;
-const char *unit_path;
-uint32_t job_id;
-const char *job_type;
-const char *job_path;
-};
-
 struct unit_times {
 char *name;
 usec_t activating;
@@ -146,31 +133,6 @@ static int bus_get_uint64_property(sd_bus *bus, const char 
*path, const char *in
 return 0;
 }
 
-static int bus_get_unit_property_strv(sd_bus *bus, const char *path, const 
char *property, char ***strv) {
-_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
-int r;
-
-assert(bus);
-assert(path);
-assert(property);
-assert(strv);
-
-r = sd_bus_get_property_strv(
-bus,
-"org.freedesktop.systemd1",
-path,
-"org.freedesktop.systemd1.Unit",
-property,
-&error,
-strv);
-if (r < 0) {
-log_error("Failed to get unit property %s: %s", property, 
bus_error_message(&error, -r));
-return r;
-}
-
-return 0;
-}
-
 static int compare_unit_time(const void *a, const void *b) {
 return compare(((struct unit_times *)b)->time,
((struct unit_times *)a)->time);
@@ -205,34 +167,12 @@ static void free_unit_times(struct unit_times *t, 
unsigned n) {
 free(t);
 }
 
-static int bus_parse_unit_info(sd_bus_message *message, struct unit_info *u) {
-int r = 0;
-
-assert(message);
-assert(u);
-
-r = sd_bus_message_read(message, "(ssouso)", &u->id,
- &u->description,
- &u->load_state,
- &u->active_state,
- &u->sub_state,
- &u->following,
- &u->unit_path,
- &u->job_id,
- &u->job_type,
- &u->job_path);
-if (r < 0)
-return bus_log_parse_error(r);
-
-return r;
-}
-
 static int acquire_time_data(sd_bus *bus, struct unit_times **out) {
 _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
 _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
 int r, c = 0, n_units = 0;
 struct unit_times *unit_times = NULL;
-struct unit_info u;
+struct unit_info u = {};
 
 r = sd_bus_call_method(
 bus,
@@ -253,7 +193,7 @@ static int acquire_time_data(sd_bus *bus, struct unit_times 
**out) {
 goto fail;
 }
 
-while ((r = bus_parse_unit_info(reply, &u)) > 0) {
+while ((r = bus_message_read_unit_info(reply, &u)) > 0) {
 struct unit_times *t;
 
 if (r < 0)
@@ -1027,8 +967,8 @@ static int graph_one(sd_bus *bus, const struct unit_info 
*u, char *patterns[]) {
 static int dot(sd_bus *bus, char* patterns[]) {
 _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
 _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
+struct unit_info u = {};
 int r;
-struct unit_info u;
 
 r = sd_bus_call_method(
 bus,
@@ -1050,7 +990,7 @@ static int dot(sd_bus *bus, char* patterns[]) {
 
 printf("digraph systemd {\n");
 
-while ((r = bus_parse_unit_info(reply, &u)) > 0) {
+while ((r = bus_message_read_unit_info(reply, &u)) > 0) {
 r = graph_one(bus, &u, patterns);
 if (r < 0)
 return r;
diff --git a/src/libsystemd-bus/bus-util.c b/src/libsystemd-bus/bus-util.c
index ae9733d..3959972 100644
--- a/src/libsystemd-bus/bus-util.c
+++ b/src/libsystemd-bus/bus-util.c
@@ -958,3 +958,52 @@ int bus_log_parse_error(int r) {
 log_error("Failed to parse message: %s", strerror(-r));
 return r;
 }
+
+int bus_get_unit_property_str

Re: [systemd-devel] [PATCH 0/7] systemctl: port to libsystemd-bus

2013-11-06 Thread Marc-Antoine Perennou
On 7 November 2013 13:48, Marc-Antoine Perennou
 wrote:
> This serie of patches ports systemctl to libsystemd-bus and fixes
> a couple of issues encountered while porting it.
>
> Note that curerently systemctl --user doesn't work.
> Actually, systemd-analyze --user doesn't work either, so there seem
> to be an issue regarding this in libsystemd-bus.
>
> The error message is:
> Failed to parse reply: Process org.freedesktop.systemd1 exited with status 1
>
> Marc-Antoine Perennou (7):
>   bus: allow reading empty arrays
>   bus: fix bus_message_read_strv
>   bus: fix bus_print_property with strv
>   bus: rename sd_bus_get_property_{trivial,basic}
>   bus: mark sd_bus_message_at_end public
>   analyze: split out bus util functions
>   systemctl: port to libsystemd-bus
>
>  Makefile.am   |6 +-
>  src/analyze/analyze.c |   82 +-
>  src/libsystemd-bus/bus-convenience.c  |4 +-
>  src/libsystemd-bus/bus-message.c  |   25 +-
>  src/libsystemd-bus/bus-util.c |   75 +-
>  src/libsystemd-bus/bus-util.h |   17 +
>  src/libsystemd-bus/libsystemd-bus.sym |2 +-
>  src/systemctl/systemctl.c | 2301 
> -
>  src/systemd/sd-bus.h  |2 +-
>  9 files changed, 961 insertions(+), 1553 deletions(-)
>
> --
> 1.8.4.2
>

Note that a regularly rebased version of these patches is available
here: https://github.com/Keruspe/systemd
In case the patches don't apply anymore.

Marc-Antoine
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 4/7] bus: rename sd_bus_get_property_{trivial, basic}

2013-11-06 Thread Marc-Antoine Perennou
---
 src/analyze/analyze.c | 2 +-
 src/libsystemd-bus/bus-convenience.c  | 4 ++--
 src/libsystemd-bus/libsystemd-bus.sym | 2 +-
 src/systemd/sd-bus.h  | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c
index 22bf076..522e618 100644
--- a/src/analyze/analyze.c
+++ b/src/analyze/analyze.c
@@ -123,7 +123,7 @@ static int bus_get_uint64_property(sd_bus *bus, const char 
*path, const char *in
 _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
 int r;
 
-r = sd_bus_get_property_trivial(
+r = sd_bus_get_property_basic(
 bus,
 "org.freedesktop.systemd1",
 path,
diff --git a/src/libsystemd-bus/bus-convenience.c 
b/src/libsystemd-bus/bus-convenience.c
index 0ccc259..db15fdd 100644
--- a/src/libsystemd-bus/bus-convenience.c
+++ b/src/libsystemd-bus/bus-convenience.c
@@ -270,7 +270,7 @@ _public_ int sd_bus_get_property(
 return 0;
 }
 
-_public_ int sd_bus_get_property_trivial(
+_public_ int sd_bus_get_property_basic(
 sd_bus *bus,
 const char *destination,
 const char *path,
@@ -285,7 +285,7 @@ _public_ int sd_bus_get_property_trivial(
 assert_return(bus, -EINVAL);
 assert_return(isempty(interface) || 
interface_name_is_valid(interface), -EINVAL);
 assert_return(member_name_is_valid(member), -EINVAL);
-assert_return(bus_type_is_trivial(type), -EINVAL);
+assert_return(bus_type_is_basic(type), -EINVAL);
 assert_return(ptr, -EINVAL);
 assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
 assert_return(!bus_pid_changed(bus), -ECHILD);
diff --git a/src/libsystemd-bus/libsystemd-bus.sym 
b/src/libsystemd-bus/libsystemd-bus.sym
index 5eecfa1..01a0c8a 100644
--- a/src/libsystemd-bus/libsystemd-bus.sym
+++ b/src/libsystemd-bus/libsystemd-bus.sym
@@ -141,7 +141,7 @@ global:
 /* Convenience calls */
 sd_bus_call_method;
 sd_bus_get_property;
-sd_bus_get_property_trivial;
+sd_bus_get_property_basic;
 sd_bus_set_property;
 sd_bus_reply_method_return;
 sd_bus_reply_method_error;
diff --git a/src/systemd/sd-bus.h b/src/systemd/sd-bus.h
index 48edc59..e38f4a4 100644
--- a/src/systemd/sd-bus.h
+++ b/src/systemd/sd-bus.h
@@ -212,7 +212,7 @@ int sd_bus_message_rewind(sd_bus_message *m, int complete);
 
 int sd_bus_call_method(sd_bus *bus, const char *destination, const char *path, 
const char *interface, const char *member, sd_bus_error *error, sd_bus_message 
**reply, const char *types, ...);
 int sd_bus_get_property(sd_bus *bus, const char *destination, const char 
*path, const char *interface, const char *member, sd_bus_error *error, 
sd_bus_message **reply, const char *type);
-int sd_bus_get_property_trivial(sd_bus *bus, const char *destination, const 
char *path, const char *interface, const char *member, sd_bus_error *error, 
char type, void *ptr);
+int sd_bus_get_property_basic(sd_bus *bus, const char *destination, const char 
*path, const char *interface, const char *member, sd_bus_error *error, char 
type, void *ptr);
 int sd_bus_set_property(sd_bus *bus, const char *destination, const char 
*path, const char *interface, const char *member, sd_bus_error *error, const 
char *type, ...);
 int sd_bus_reply_method_return(sd_bus *bus, sd_bus_message *call, const char 
*types, ...);
 int sd_bus_reply_method_error(sd_bus *bus, sd_bus_message *call, const 
sd_bus_error *e);
-- 
1.8.4.2

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 2/7] bus: fix bus_message_read_strv

2013-11-06 Thread Marc-Antoine Perennou
message_read_strv_extend returns 0 on success
---
 src/libsystemd-bus/bus-message.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c
index 0fd9aa1..16b2201 100644
--- a/src/libsystemd-bus/bus-message.c
+++ b/src/libsystemd-bus/bus-message.c
@@ -4438,7 +4438,7 @@ _public_ int sd_bus_message_read_strv(sd_bus_message *m, 
char ***l) {
 assert_return(l, -EINVAL);
 
 r = bus_message_read_strv_extend(m, &strv);
-if (r <= 0) {
+if (r < 0) {
 strv_free(strv);
 return r;
 }
-- 
1.8.4.2

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 0/7] systemctl: port to libsystemd-bus

2013-11-06 Thread Marc-Antoine Perennou
This serie of patches ports systemctl to libsystemd-bus and fixes
a couple of issues encountered while porting it.

Note that curerently systemctl --user doesn't work.
Actually, systemd-analyze --user doesn't work either, so there seem
to be an issue regarding this in libsystemd-bus.

The error message is:
Failed to parse reply: Process org.freedesktop.systemd1 exited with status 1

Marc-Antoine Perennou (7):
  bus: allow reading empty arrays
  bus: fix bus_message_read_strv
  bus: fix bus_print_property with strv
  bus: rename sd_bus_get_property_{trivial,basic}
  bus: mark sd_bus_message_at_end public
  analyze: split out bus util functions
  systemctl: port to libsystemd-bus

 Makefile.am   |6 +-
 src/analyze/analyze.c |   82 +-
 src/libsystemd-bus/bus-convenience.c  |4 +-
 src/libsystemd-bus/bus-message.c  |   25 +-
 src/libsystemd-bus/bus-util.c |   75 +-
 src/libsystemd-bus/bus-util.h |   17 +
 src/libsystemd-bus/libsystemd-bus.sym |2 +-
 src/systemctl/systemctl.c | 2301 -
 src/systemd/sd-bus.h  |2 +-
 9 files changed, 961 insertions(+), 1553 deletions(-)

-- 
1.8.4.2

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 6/7] analyze: split out bus util functions

2013-11-06 Thread Marc-Antoine Perennou
They will soon be used in systemctl
---
 src/analyze/analyze.c | 80 +++
 src/libsystemd-bus/bus-util.c | 46 +
 src/libsystemd-bus/bus-util.h | 17 +
 3 files changed, 67 insertions(+), 76 deletions(-)

diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c
index 522e618..34fea28 100644
--- a/src/analyze/analyze.c
+++ b/src/analyze/analyze.c
@@ -89,19 +89,6 @@ struct boot_times {
 usec_t unitsload_finish_time;
 };
 
-struct unit_info {
-const char *id;
-const char *description;
-const char *load_state;
-const char *active_state;
-const char *sub_state;
-const char *following;
-const char *unit_path;
-uint32_t job_id;
-const char *job_type;
-const char *job_path;
-};
-
 struct unit_times {
 char *name;
 usec_t activating;
@@ -174,71 +161,12 @@ static void free_unit_times(struct unit_times *t, 
unsigned n) {
 free(t);
 }
 
-static int bus_parse_unit_info(sd_bus_message *message, struct unit_info *u) {
-int r = 0;
-
-assert(message);
-assert(u);
-
-r = sd_bus_message_read(message, "(ssouso)", &u->id,
- &u->description,
- &u->load_state,
- &u->active_state,
- &u->sub_state,
- &u->following,
- &u->unit_path,
- &u->job_id,
- &u->job_type,
- &u->job_path);
-if (r < 0) {
-log_error("Failed to parse message as unit_info.");
-return -EIO;
-}
-
-return r;
-}
-
-static int bus_get_unit_property_strv(sd_bus *bus, const char *unit_path, 
const char *prop, char ***strv) {
-_cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
-_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
-int r;
-const char *s;
-
-r = sd_bus_get_property(
-bus,
-"org.freedesktop.systemd1",
-unit_path,
-"org.freedesktop.systemd1.Unit",
-prop,
-&error,
-&reply,
-"as");
-if (r < 0) {
-log_error("Failed to get unit property: %s %s", prop, 
bus_error_message(&error, -r));
-return r;
-}
-
-r = sd_bus_message_enter_container(reply, SD_BUS_TYPE_ARRAY, "s");
-if (r < 0)
-return r;
-
-while ((r = sd_bus_message_read(reply, "s", &s)) > 0) {
-r = strv_extend(strv, s);
-if (r < 0) {
-log_oom();
-return r;
-}
-}
-
-return r;
-}
-
 static int acquire_time_data(sd_bus *bus, struct unit_times **out) {
 _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
 _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
 int r, c = 0, n_units = 0;
 struct unit_times *unit_times = NULL;
-struct unit_info u;
+struct unit_info u = {};
 
 r = sd_bus_call_method(
 bus,
@@ -258,7 +186,7 @@ static int acquire_time_data(sd_bus *bus, struct unit_times 
**out) {
 if (r < 0)
 goto fail;
 
-while ((r = bus_parse_unit_info(reply, &u)) > 0) {
+while ((r = bus_message_read_unit_info(reply, &u)) > 0) {
 struct unit_times *t;
 
 if (r < 0)
@@ -1042,8 +970,8 @@ static int graph_one(sd_bus *bus, const struct unit_info 
*u, char *patterns[]) {
 static int dot(sd_bus *bus, char* patterns[]) {
 _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
 _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
+struct unit_info u = {};
 int r;
-struct unit_info u;
 
 r = sd_bus_call_method(
 bus,
@@ -1065,7 +993,7 @@ static int dot(sd_bus *bus, char* patterns[]) {
 
 printf("digraph systemd {\n");
 
-while ((r = bus_parse_unit_info(reply, &u)) > 0) {
+while ((r = bus_message_read_unit_info(reply, &u)) > 0) {
 r = graph_one(bus, &u, patterns);
 if (r < 0)
 return r;
diff --git a/src/libsystemd-bus/bus-util.c b/src/libsystemd-bus/bus-util.c
index 2a9cd4f..d026487 100644
--- a/src/libsystemd-bus/bus-util.c
+++ b/src/libsystemd-bus/bus-util.c
@@ -947,3 +947,49 @@ int

[systemd-devel] [PATCH 3/7] bus: fix bus_print_property with strv

2013-11-06 Thread Marc-Antoine Perennou
---
 src/libsystemd-bus/bus-util.c | 29 -
 1 file changed, 12 insertions(+), 17 deletions(-)

diff --git a/src/libsystemd-bus/bus-util.c b/src/libsystemd-bus/bus-util.c
index 13ad444..2a9cd4f 100644
--- a/src/libsystemd-bus/bus-util.c
+++ b/src/libsystemd-bus/bus-util.c
@@ -545,33 +545,28 @@ int bus_print_property(const char *name, sd_bus_message 
*property, bool all) {
 
 case SD_BUS_TYPE_ARRAY:
 if (streq(contents, "s")) {
-bool space = false;
-char tp;
-const char *cnt;
+bool first = true;
+const char *str;
 
 r = sd_bus_message_enter_container(property, 
SD_BUS_TYPE_ARRAY, contents);
 if (r < 0)
 return r;
 
-r = sd_bus_message_peek_type(property, &tp, &cnt);
+while((r = sd_bus_message_read_basic(property, 
SD_BUS_TYPE_STRING, &str)) > 0) {
+if (first)
+printf("%s=", name);
+
+printf("%s%s", first ? "" : " ", str);
+
+first = false;
+}
 if (r < 0)
 return r;
 
-if (all || cnt) {
-const char *str;
-
+if (first && all)
 printf("%s=", name);
-
-while((r = sd_bus_message_read_basic(property, 
SD_BUS_TYPE_STRING, &str)) >= 0) {
-printf("%s%s", space ? " " : "", str);
-
-space = true;
-}
-if (r < 0)
-return r;
-
+if (!first || all)
 puts("");
-}
 
 r = sd_bus_message_exit_container(property);
 if (r < 0)
-- 
1.8.4.2

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 5/7] bus: mark sd_bus_message_at_end public

2013-11-06 Thread Marc-Antoine Perennou
---
 src/libsystemd-bus/bus-message.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c
index 16b2201..cc62050 100644
--- a/src/libsystemd-bus/bus-message.c
+++ b/src/libsystemd-bus/bus-message.c
@@ -2415,7 +2415,7 @@ static bool message_end_of_array(sd_bus_message *m, 
size_t index) {
 return index >= c->begin + BUS_MESSAGE_BSWAP32(m, *c->array_size);
 }
 
-int sd_bus_message_at_end(sd_bus_message *m, int complete) {
+_public_ int sd_bus_message_at_end(sd_bus_message *m, int complete) {
 assert_return(m, -EINVAL);
 assert_return(m->sealed, -EPERM);
 
-- 
1.8.4.2

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 1/7] bus: allow reading empty arrays

2013-11-06 Thread Marc-Antoine Perennou
---
 src/libsystemd-bus/bus-message.c | 21 +
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c
index 9543ae3..0fd9aa1 100644
--- a/src/libsystemd-bus/bus-message.c
+++ b/src/libsystemd-bus/bus-message.c
@@ -3567,15 +3567,20 @@ _public_ int sd_bus_message_read_array(sd_bus_message 
*m,
 if (r <= 0)
 return r;
 
-c = message_get_container(m);
-sz = BUS_MESSAGE_BSWAP32(m, *c->array_size);
+if (message_end_of_array(m, m->rindex)) {
+p = NULL;
+sz = 0;
+} else {
+c = message_get_container(m);
+sz = BUS_MESSAGE_BSWAP32(m, *c->array_size);
 
-r = message_peek_body(m, &m->rindex, align, sz, &p);
-if (r < 0)
-goto fail;
-if (r == 0) {
-r = -EBADMSG;
-goto fail;
+r = message_peek_body(m, &m->rindex, align, sz, &p);
+if (r < 0)
+goto fail;
+if (r == 0) {
+r = -EBADMSG;
+goto fail;
+}
 }
 
 r = sd_bus_message_exit_container(m);
-- 
1.8.4.2

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH 1/3] bus: allow reading empty arrays

2013-11-06 Thread Marc-Antoine Perennou
You can disregard these three patches, they will be part of the
systemctl porting.

Marc-Antoine
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 2/3] bus: fix bus_message_read_strv

2013-11-06 Thread Marc-Antoine Perennou
message_read_strv_extend returns 0 on success
---
 src/libsystemd-bus/bus-message.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c
index 698c7c4..f228b44 100644
--- a/src/libsystemd-bus/bus-message.c
+++ b/src/libsystemd-bus/bus-message.c
@@ -4420,7 +4420,7 @@ int sd_bus_message_read_strv(sd_bus_message *m, char 
***l) {
 assert_return(l, -EINVAL);
 
 r = bus_message_read_strv_extend(m, &strv);
-if (r <= 0) {
+if (r < 0) {
 strv_free(strv);
 return r;
 }
-- 
1.8.4.2

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 1/3] bus: allow reading empty arrays

2013-11-06 Thread Marc-Antoine Perennou
---
 src/libsystemd-bus/bus-message.c | 21 +
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c
index 437f6df..698c7c4 100644
--- a/src/libsystemd-bus/bus-message.c
+++ b/src/libsystemd-bus/bus-message.c
@@ -3549,15 +3549,20 @@ int sd_bus_message_read_array(sd_bus_message *m, char 
type, const void **ptr, si
 if (r <= 0)
 return r;
 
-c = message_get_container(m);
-sz = BUS_MESSAGE_BSWAP32(m, *c->array_size);
+if (message_end_of_array(m, m->rindex)) {
+p = NULL;
+sz = 0;
+} else {
+c = message_get_container(m);
+sz = BUS_MESSAGE_BSWAP32(m, *c->array_size);
 
-r = message_peek_body(m, &m->rindex, align, sz, &p);
-if (r < 0)
-goto fail;
-if (r == 0) {
-r = -EBADMSG;
-goto fail;
+r = message_peek_body(m, &m->rindex, align, sz, &p);
+if (r < 0)
+goto fail;
+if (r == 0) {
+r = -EBADMSG;
+goto fail;
+}
 }
 
 r = sd_bus_message_exit_container(m);
-- 
1.8.4.2

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 3/3] bus: fix bus_print_property with strv

2013-11-06 Thread Marc-Antoine Perennou
---
 src/libsystemd-bus/bus-util.c | 29 -
 1 file changed, 12 insertions(+), 17 deletions(-)

diff --git a/src/libsystemd-bus/bus-util.c b/src/libsystemd-bus/bus-util.c
index 3bb1fb7..93e79e9 100644
--- a/src/libsystemd-bus/bus-util.c
+++ b/src/libsystemd-bus/bus-util.c
@@ -545,33 +545,28 @@ int bus_print_property(const char *name, sd_bus_message 
*property, bool all) {
 
 case SD_BUS_TYPE_ARRAY:
 if (streq(contents, "s")) {
-bool space = false;
-char tp;
-const char *cnt;
+bool first = true;
+const char *str;
 
 r = sd_bus_message_enter_container(property, 
SD_BUS_TYPE_ARRAY, contents);
 if (r < 0)
 return r;
 
-r = sd_bus_message_peek_type(property, &tp, &cnt);
+while((r = sd_bus_message_read_basic(property, 
SD_BUS_TYPE_STRING, &str)) > 0) {
+if (first)
+printf("%s=", name);
+
+printf("%s%s", first ? "" : " ", str);
+
+first = false;
+}
 if (r < 0)
 return r;
 
-if (all || cnt) {
-const char *str;
-
+if (first && all)
 printf("%s=", name);
-
-while((r = sd_bus_message_read_basic(property, 
SD_BUS_TYPE_STRING, &str)) >= 0) {
-printf("%s%s", space ? " " : "", str);
-
-space = true;
-}
-if (r < 0)
-return r;
-
+if (!first || all)
 puts("");
-}
 
 r = sd_bus_message_exit_container(property);
 if (r < 0)
-- 
1.8.4.2

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 1/3] bus: add sd_bus_message_read_strv

2013-11-05 Thread Marc-Antoine Perennou
It will be useful to have that in the public API

Signed-off-by: Marc-Antoine Perennou 
---
 src/libsystemd-bus/bus-message.c | 15 +++
 src/systemd/sd-bus.h |  1 +
 2 files changed, 16 insertions(+)

diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c
index 7a4c65d..1050151 100644
--- a/src/libsystemd-bus/bus-message.c
+++ b/src/libsystemd-bus/bus-message.c
@@ -4510,6 +4510,21 @@ int bus_message_read_strv_extend(sd_bus_message *m, char 
***l) {
 return 0;
 }
 
+int sd_bus_message_read_strv(sd_bus_message *m, char ***l) {
+char **strv = NULL;
+int r;
+
+assert(m);
+assert(l);
+
+r = bus_message_read_strv_extend(m, &strv);
+if (r < 0)
+return r;
+
+*l = strv;
+return 0;
+}
+
 const char* bus_message_get_arg(sd_bus_message *m, unsigned i) {
 int r;
 const char *t = NULL;
diff --git a/src/systemd/sd-bus.h b/src/systemd/sd-bus.h
index e0a6041..1a1cce9 100644
--- a/src/systemd/sd-bus.h
+++ b/src/systemd/sd-bus.h
@@ -197,6 +197,7 @@ int sd_bus_message_copy(sd_bus_message *m, sd_bus_message 
*source, int all);
 int sd_bus_message_read(sd_bus_message *m, const char *types, ...);
 int sd_bus_message_read_basic(sd_bus_message *m, char type, void *p);
 int sd_bus_message_read_array(sd_bus_message *m, char type, const void **ptr, 
size_t *size);
+int sd_bus_message_read_strv(sd_bus_message *m, char ***ptr);
 int sd_bus_message_skip(sd_bus_message *m, const char *types);
 int sd_bus_message_enter_container(sd_bus_message *m, char type, const char 
*contents);
 int sd_bus_message_exit_container(sd_bus_message *m);
-- 
1.8.4.2

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 2/3] bus: add sd_bus_message_end_of_container

2013-11-05 Thread Marc-Antoine Perennou
Useful to check whether there are still things to read or not,
in order to be able not to allocate when not needed, when reading
arrays or such.
Will soon be used in systemctl

Signed-off-by: Marc-Antoine Perennou 
---
 src/libsystemd-bus/bus-message.c | 22 +++---
 src/systemd/sd-bus.h |  1 +
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c
index 1050151..d683d70 100644
--- a/src/libsystemd-bus/bus-message.c
+++ b/src/libsystemd-bus/bus-message.c
@@ -1906,6 +1906,14 @@ int sd_bus_message_open_container(
 return 0;
 }
 
+int sd_bus_message_end_of_container(sd_bus_message *m) {
+struct bus_container *c;
+
+c = message_get_container(m);
+
+return !c->signature || c->signature[c->index] == 0;
+}
+
 int sd_bus_message_close_container(sd_bus_message *m) {
 struct bus_container *c;
 
@@ -2654,7 +2662,7 @@ int sd_bus_message_read_basic(sd_bus_message *m, char 
type, void *p) {
 
 c = message_get_container(m);
 
-if (!c->signature || c->signature[c->index] == 0)
+if (sd_bus_message_end_of_container(m))
 return -ENXIO;
 
 if (message_end_of_array(m, m->rindex))
@@ -2817,7 +2825,7 @@ static int bus_message_enter_array(
 if (alignment < 0)
 return alignment;
 
-if (!c->signature || c->signature[c->index] == 0)
+if (sd_bus_message_end_of_container(m))
 return 0;
 
 if (c->signature[c->index] != SD_BUS_TYPE_ARRAY)
@@ -2870,7 +2878,7 @@ static int bus_message_enter_variant(
 if (*contents == SD_BUS_TYPE_DICT_ENTRY_BEGIN)
 return -EINVAL;
 
-if (!c->signature || c->signature[c->index] == 0)
+if (sd_bus_message_end_of_container(m))
 return 0;
 
 if (c->signature[c->index] != SD_BUS_TYPE_VARIANT)
@@ -2917,7 +2925,7 @@ static int bus_message_enter_struct(
 if (!signature_is_valid(contents, false))
 return -EINVAL;
 
-if (!c->signature || c->signature[c->index] == 0)
+if (sd_bus_message_end_of_container(m))
 return 0;
 
 l = strlen(contents);
@@ -2955,7 +2963,7 @@ static int bus_message_enter_dict_entry(
 if (c->enclosing != SD_BUS_TYPE_ARRAY)
 return -ENXIO;
 
-if (!c->signature || c->signature[c->index] == 0)
+if (sd_bus_message_end_of_container(m))
 return 0;
 
 l = strlen(contents);
@@ -3031,7 +3039,7 @@ int sd_bus_message_enter_container(sd_bus_message *m, 
char type, const char *con
 
 c = message_get_container(m);
 
-if (!c->signature || c->signature[c->index] == 0)
+if (sd_bus_message_end_of_container(m))
 return -ENXIO;
 
 if (message_end_of_array(m, m->rindex))
@@ -3132,7 +3140,7 @@ int sd_bus_message_peek_type(sd_bus_message *m, char 
*type, const char **content
 
 c = message_get_container(m);
 
-if (!c->signature || c->signature[c->index] == 0)
+if (sd_bus_message_end_of_container(m))
 goto eof;
 
 if (message_end_of_array(m, m->rindex))
diff --git a/src/systemd/sd-bus.h b/src/systemd/sd-bus.h
index 1a1cce9..34bd663 100644
--- a/src/systemd/sd-bus.h
+++ b/src/systemd/sd-bus.h
@@ -200,6 +200,7 @@ int sd_bus_message_read_array(sd_bus_message *m, char type, 
const void **ptr, si
 int sd_bus_message_read_strv(sd_bus_message *m, char ***ptr);
 int sd_bus_message_skip(sd_bus_message *m, const char *types);
 int sd_bus_message_enter_container(sd_bus_message *m, char type, const char 
*contents);
+int sd_bus_message_end_of_container(sd_bus_message *m);
 int sd_bus_message_exit_container(sd_bus_message *m);
 int sd_bus_message_peek_type(sd_bus_message *m, char *type, const char 
**contents);
 int sd_bus_message_verify_type(sd_bus_message *m, char type, const char 
*contents);
-- 
1.8.4.2

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 3/3] analyze: split out bus util functions

2013-11-05 Thread Marc-Antoine Perennou
They will soon be used in systemctl

Signed-off-by: Marc-Antoine Perennou 
---
 src/analyze/analyze.c | 80 +++
 src/libsystemd-bus/bus-util.c | 46 +
 src/libsystemd-bus/bus-util.h | 17 +
 3 files changed, 67 insertions(+), 76 deletions(-)

diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c
index e278a64..ecbba95 100644
--- a/src/analyze/analyze.c
+++ b/src/analyze/analyze.c
@@ -87,19 +87,6 @@ struct boot_times {
 usec_t unitsload_finish_time;
 };
 
-struct unit_info {
-const char *id;
-const char *description;
-const char *load_state;
-const char *active_state;
-const char *sub_state;
-const char *following;
-const char *unit_path;
-uint32_t job_id;
-const char *job_type;
-const char *job_path;
-};
-
 struct unit_times {
 char *name;
 usec_t activating;
@@ -172,71 +159,12 @@ static void free_unit_times(struct unit_times *t, 
unsigned n) {
 free(t);
 }
 
-static int bus_parse_unit_info(sd_bus_message *message, struct unit_info *u) {
-int r = 0;
-
-assert(message);
-assert(u);
-
-r = sd_bus_message_read(message, "(ssouso)", &u->id,
- &u->description,
- &u->load_state,
- &u->active_state,
- &u->sub_state,
- &u->following,
- &u->unit_path,
- &u->job_id,
- &u->job_type,
- &u->job_path);
-if (r < 0) {
-log_error("Failed to parse message as unit_info.");
-return -EIO;
-}
-
-return r;
-}
-
-static int bus_get_unit_property_strv(sd_bus *bus, const char *unit_path, 
const char *prop, char ***strv) {
-_cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
-_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
-int r;
-const char *s;
-
-r = sd_bus_get_property(
-bus,
-"org.freedesktop.systemd1",
-unit_path,
-"org.freedesktop.systemd1.Unit",
-prop,
-&error,
-&reply,
-"as");
-if (r < 0) {
-log_error("Failed to get unit property: %s %s", prop, 
bus_error_message(&error, -r));
-return r;
-}
-
-r = sd_bus_message_enter_container(reply, SD_BUS_TYPE_ARRAY, "s");
-if (r < 0)
-return r;
-
-while ((r = sd_bus_message_read(reply, "s", &s)) > 0) {
-r = strv_extend(strv, s);
-if (r < 0) {
-log_oom();
-return r;
-}
-}
-
-return r;
-}
-
 static int acquire_time_data(sd_bus *bus, struct unit_times **out) {
 _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
 _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
 int r, c = 0, n_units = 0;
 struct unit_times *unit_times = NULL;
-struct unit_info u;
+struct unit_info u = {};
 
 r = sd_bus_call_method(
 bus,
@@ -256,7 +184,7 @@ static int acquire_time_data(sd_bus *bus, struct unit_times 
**out) {
 if (r < 0)
 goto fail;
 
-while ((r = bus_parse_unit_info(reply, &u)) > 0) {
+while ((r = bus_message_read_unit_info(reply, &u)) > 0) {
 struct unit_times *t;
 
 if (r < 0)
@@ -1041,8 +969,8 @@ static int graph_one(sd_bus *bus, const struct unit_info 
*u, char *patterns[]) {
 static int dot(sd_bus *bus, char* patterns[]) {
 _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
 _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
+struct unit_info u = {};
 int r;
-struct unit_info u;
 
 r = sd_bus_call_method(
 bus,
@@ -1064,7 +992,7 @@ static int dot(sd_bus *bus, char* patterns[]) {
 
 printf("digraph systemd {\n");
 
-while ((r = bus_parse_unit_info(reply, &u)) > 0) {
+while ((r = bus_message_read_unit_info(reply, &u)) > 0) {
 r = graph_one(bus, &u, patterns);
   

Re: [systemd-devel] tree-wide conversion from libdbus to libsystemd-bus

2013-11-03 Thread Marc-Antoine Perennou
On Sunday, November 3, 2013, Daniel Mack wrote:

> On 10/30/2013 03:48 AM, Kay Sievers wrote:
> > On Wed, Oct 23, 2013 at 1:22 AM, Kay Sievers >
> wrote:
> >
> > [update]
> >
> >> To avoid any duplication of work, here are the tools which still need
> >> conversion. Please reply to this mail, in case you decide to work on
> >> anything in that area.
> >
> > - timedatectl
> >
> > - systemd-logind
> >
> > - loginctl
> > Peeters Simon: "I'll take ... (probably loginctl afterwards)"
> >
> > - localectl
> > Kay will do that next
> >
> > - hostnamectl
> >
> > - pam_systemd
> >Zbigniew: "I'll do pam_systemd"
> >
> > - systemctl
>
> I'll have a look at systemctl. Seems like a good way to get familiar
> with the new API. Might take me some days to finish it though.
>
>
> Daniel
>

Yep, I've goy it nearly half finished by now, should be done by next week
end.

Marc-Antoine
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] tree-wide conversion from libdbus to libsystemd-bus

2013-10-30 Thread Marc-Antoine Perennou
On 31 October 2013 07:10, Kay Sievers  wrote:
> On Wed, Oct 30, 2013 at 5:36 AM, Marc-Antoine Perennou
>  wrote:
>> On 30 October 2013 11:48, Kay Sievers  wrote:
>>> On Wed, Oct 23, 2013 at 1:22 AM, Kay Sievers  wrote:
>>>
>>> [update]
>>>
>>>> To avoid any duplication of work, here are the tools which still need
>>>> conversion. Please reply to this mail, in case you decide to work on
>>>> anything in that area.
>
>> I have some work in progress for hostnamectl
>
> Simon Peeters sent this to the list, but you probably noticed that already.
>
> Thanks,
> Kay


Yep, saw that.

I'll do systemctl if noone else wants to.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] tree-wide conversion from libdbus to libsystemd-bus

2013-10-29 Thread Marc-Antoine Perennou
On 30 October 2013 11:48, Kay Sievers  wrote:
> On Wed, Oct 23, 2013 at 1:22 AM, Kay Sievers  wrote:
>
> [update]
>
>> To avoid any duplication of work, here are the tools which still need
>> conversion. Please reply to this mail, in case you decide to work on
>> anything in that area.
>
> - timedatectl
>
> - systemd-logind
>
> - loginctl
> Peeters Simon: "I'll take ... (probably loginctl afterwards)"
>
> - localectl
> Kay will do that next
>
> - hostnamectl
>
> - pam_systemd
>Zbigniew: "I'll do pam_systemd"
>
> - systemctl
>
> - systemd
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel

I have some work in progress for hostnamectl
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] kernel-install questions

2013-09-25 Thread Marc-Antoine Perennou
On 26 September 2013 00:20, Tom Gundersen  wrote:
> On Wed, Sep 25, 2013 at 4:37 PM, Kay Sievers  wrote:
>> On Wed, Sep 25, 2013 at 3:35 PM, Tom Gundersen  wrote:
>>> *) With /boot on fat, 'add' fails for me due to not being able to use
>>> "cp --preserve". How is this meant to work (or was it just not tested
>>> on fat)? Dropping "--preserve" makes it work for me.
>>
>> Hmm, no problems here:
>> # cp --preserve /etc/hostname /boot; echo $?
>> 0
>>
>> # rpm -q coreutils
>> coreutils-8.21-11.fc19.x86_64
>
> Hm, interesting. I'll figure out what's going wrong here.
>


FYI, here it fails with my kernel compiled as standards user and
kernel-install ran as root.
If I first copy the ekrnel as root and then kernel-install my
root-owned copy, it works.

>>> With the below kernel patch make
>>> install "just works".
>>
>> It's on our TODO list for long, but we haven't done it so far.
>
> Ok. Good to know.
>
>>> Was there a reason for the different interface,
>>> or would you be open to adding compatibility with the kernel script?
>>
>> What would compat mean? A symlink to kernel-install from installkernel
>> and checking argv[0]?
>
> Precisely.
>
>>> (I could of course just ship a shim script, but I'd rather not).
>>
>> We thought of letting the kernel Makefile look for kernel-install
>> first and fall back to installkernel, but we haven't look into details
>> so far.
>
> That would be fine for the future, but it would still be useful to
> make stuff just work with old kernel builds for doing bisects and
> stuff like that.
>
> -t
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] build: allow specifying a custom pam session name

2013-07-25 Thread Marc-Antoine Perennou
On 26 July 2013 01:10, Tom Gundersen  wrote:

> On Fri, Jul 26, 2013 at 12:28 AM, Marc-Antoine Perennou
>  wrote:
> > for distribution now wanting to use "systemd-shared"
>
> Could you explain a bit more why this needs to be configurable? What's
> the usecase?
>
> Cheers,
>
> Tom
>

Oh, there is obviously a typo, it should be "not" and not "now".
It will allow distribution to use their already available pam session, like
"login-local" or such, for example.
+ I don't think "systemd-shared" is really an explicit name for a pam
session
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] build: allow specifying a custom pam session name

2013-07-25 Thread Marc-Antoine Perennou
for distribution now wanting to use "systemd-shared"

Signed-off-by: Marc-Antoine Perennou 
---
 Makefile.am|  1 +
 configure.ac   | 10 ++
 units/u...@.service.in |  2 +-
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index d013dfd..8030c5f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4072,6 +4072,7 @@ substitutions = \
'|udevlibexecdir=$(udevlibexecdir)|' \
'|SUSHELL=$(SUSHELL)|' \
'|DEBUGTTY=$(DEBUGTTY)|' \
+   '|PAM_NAME=$(PAM_NAME)|' \
'|KILL=$(KILL)|' \
'|KMOD=$(KMOD)|' \
'|MKDIR_P=$(MKDIR_P)|' \
diff --git a/configure.ac b/configure.ac
index 759073a..c1d2dac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -404,6 +404,15 @@ AC_SUBST(PAM_LIBS)
 AM_CONDITIONAL([HAVE_PAM], [test "x$have_pam" != xno])
 
 # 
--
+AC_ARG_WITH([pam-name],
+AS_HELP_STRING([--with-pam-name=NAME],
+[Specify the PAM session name to set up a session as]),
+[PAM_NAME="$withval"],
+[PAM_NAME=systemd-shared])
+
+AC_SUBST(PAM_NAME)
+
+# 
--
 AC_ARG_ENABLE([acl],
 AS_HELP_STRING([--disable-acl],[Disable optional ACL support]),
 [case "${enableval}" in
@@ -1027,6 +1036,7 @@ AC_MSG_RESULT([
 Installation Python: ${PYTHON_BINARY}
 firmware path:   ${FIRMWARE_PATH}
 PAM modules dir: ${with_pamlibdir}
+PAM session name:${with_pam_name}
 D-Bus policy dir:${with_dbuspolicydir}
 D-Bus session dir:   ${with_dbussessionservicedir}
 D-Bus system dir:${with_dbussystemservicedir}
diff --git a/units/u...@.service.in b/units/u...@.service.in
index 8f9a3b3..ce53d31 100644
--- a/units/u...@.service.in
+++ b/units/u...@.service.in
@@ -11,7 +11,7 @@ After=systemd-user-sessions.service
 
 [Service]
 User=%I
-PAMName=systemd-shared
+PAMName=@PAM_NAME@
 Type=notify
 ExecStart=-@rootlibexecdir@/systemd --user
 
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%I/dbus/user_bus_socket
-- 
1.8.3.3

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd[725]: Failed at step PAM spawning /usr/lib/systemd/systemd: Operation not permitted

2013-07-06 Thread Marc-Antoine Perennou
The patch I mailed a few hours ago about chowning cgroups solved this issue
here.


On 6 July 2013 05:57, Kok, Auke-jan H  wrote:

> On Thu, Jul 4, 2013 at 6:30 PM, Kay Sievers  wrote:
> > On Fri, Jul 5, 2013 at 2:35 AM, Cristian Rodríguez
> >  wrote:
> >> Since systemd 205, Im getting this scary warning
> >>
> >> Jul 04 19:55:36 xps9000.cristianrodriguez.net systemd[1]: Starting
> >> user-1000.slice.
> >>
> >> Jul 04 19:55:36 xps9000.cristianrodriguez.net systemd[1]: Created slice
> >> user-1000.slice.
> >>
> >> Jul 04 19:55:36 xps9000.cristianrodriguez.net systemd[1]: Starting User
> >> Manager for 1000...
> >>
> >> Jul 04 19:55:36 xps9000.cristianrodriguez.net systemd[1]: Starting
> Session 1
> >> of user crrodriguez.
> >>
> >> Jul 04 19:55:36 xps9000.cristianrodriguez.net systemd-logind[423]: New
> >> session 1 of user crrodriguez.
> >>
> >> Jul 04 19:55:36 xps9000.cristianrodriguez.net systemd-logind[423]:
> Linked
> >> /tmp/.X11-unix/X0 to /run/user/1000/X11-display.
> >>
> >> Jul 04 19:55:36 xps9000.cristianrodriguez.net systemd[1]: Started
> Session 1
> >> of user crrodriguez.
> >>
> >> Jul 04 19:55:36 xps9000.cristianrodriguez.net systemd[725]: Failed at
> step
> >> PAM spawning /usr/lib/systemd/systemd: Operation not permitted
> >
> > We are just not there, systemd --user is not started at the moment,
> > the cgroup sub-tree for the user's session is not accessible for the
> > systemd --user process running under the user's uid.
> >
> > Nothing really to worry about, the message should be ignored for now,
> > we will get there soon ...
>
> does the old method of manually starting user@.service at least still
> work? I haven't had any time to track the latest release yet...
>
> Auke
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] cgroups: chown user slices

2013-07-05 Thread Marc-Antoine Perennou
When creating the cgroup hierarchy for a user slice,
chown this slice to the user uid.

Signed-off-by: Marc-Antoine Perennou 
---
 src/shared/cgroup-label.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/src/shared/cgroup-label.c b/src/shared/cgroup-label.c
index 574a7be..1891c9a 100644
--- a/src/shared/cgroup-label.c
+++ b/src/shared/cgroup-label.c
@@ -41,6 +41,7 @@
 
 int cg_create(const char *controller, const char *path) {
 _cleanup_free_ char *fs = NULL;
+uid_t uid = (uid_t) -1;
 int r;
 
 r = cg_get_path_and_check(controller, path, NULL, &fs);
@@ -59,6 +60,13 @@ int cg_create(const char *controller, const char *path) {
 return -errno;
 }
 
+r = cg_path_get_owner_uid(path, &uid);
+if (r < 0 && r != -ENOENT)
+return r;
+
+if (uid != (uid_t) -1)
+chown(fs, uid, (gid_t) -1);
+
 return 1;
 }
 
-- 
1.8.3.2

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] kernel-install: don't make unused parameter mandatory

2013-03-26 Thread Marc-Antoine Perennou
We only use the image name in the case we're adding a kernel

Signed-off-by: Marc-Antoine Perennou 
---
 src/kernel-install/kernel-install | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/kernel-install/kernel-install 
b/src/kernel-install/kernel-install
index 16c06e0..9f3a523 100644
--- a/src/kernel-install/kernel-install
+++ b/src/kernel-install/kernel-install
@@ -62,7 +62,7 @@ usage()
 } >&2
 }
 
-if ! ( [[ $COMMAND ]] && [[ $KERNEL_VERSION ]] && [[ $KERNEL_IMAGE ]] ); then
+if ! ( [[ $COMMAND ]] && [[ $KERNEL_VERSION ]] ); then
 usage
 exit 1
 fi
@@ -101,6 +101,10 @@ readarray -t PLUGINS < <(
 
 case "$COMMAND" in
 add)
+if [[ -z $KERNEL_IMAGE ]]; then
+usage
+exit 1
+fi
 mkdir -p "$BOOT_DIR_ABS" || exit 1
 
 for f in "${PLUGINS[@]}"; do
-- 
1.8.1.5

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH 5/6] Add hexstr function

2013-02-11 Thread Marc-Antoine Perennou
On 12 February 2013 00:14, Oleksii Shevchuk  wrote:

> Function that converts byte array to hex string
> ---
>  src/shared/util.c | 23 +++
>  src/shared/util.h |  1 +
>  2 files changed, 24 insertions(+)
>
> diff --git a/src/shared/util.c b/src/shared/util.c
> index 24f9e7e..6dbfe29 100644
> --- a/src/shared/util.c
> +++ b/src/shared/util.c
> @@ -1368,6 +1368,29 @@ char hexchar(int x) {
>  return table[x & 15];
>  }
>
> +char * hexstr (const uint8_t *in, size_t count)
> +{
> +char *r, *i = NULL;
> +
> +if (!in || !count)
> +goto finish;
> +
> +r = i = new(char, count * 2 + 1);
> +if (! r)
> +goto finish;
> +
> +while (count--) {
> +*i++ = hexchar(*in >> 4);
> +*i++ = hexchar(*in);
> +++in;
> +}
> +
> +*i = '\0';
> +
> + finish:
> +return r;
> +}
> +
>  int unhexchar(char c) {
>
>  if (c >= '0' && c <= '9')
> diff --git a/src/shared/util.h b/src/shared/util.h
> index cd13457..fe85fa8 100644
> --- a/src/shared/util.h
> +++ b/src/shared/util.h
> @@ -211,6 +211,7 @@ int get_process_uid(pid_t pid, uid_t *uid);
>  int get_process_gid(pid_t pid, gid_t *gid);
>
>  char hexchar(int x);
> +char * hexstr (const uint8_t *in, size_t count);
>  int unhexchar(char c);
>  char octchar(int x);
>  int unoctchar(char c);
> --
> 1.8.1.2
>
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>

Hi,

I think you may be returning an unitialized "r" with your first "goto
finish", you should set it to NULL like you do for i
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH][V3] systemd-analyze: rewrite in C.

2013-02-04 Thread Marc-Antoine Perennou
On 4 February 2013 22:33, Peeters Simon  wrote:

> 2013/2/4 Lennart Poettering :
> > On Mon, 04.02.13 21:32, Simon Peeters (peeters.si...@gmail.com) wrote:
> >
> >> Written by Peeters Simon . Makefile stuff
> >> and cleaned up a bit by Auke Kok .
> >> ---
> >
> > Hmm, how does this relate to this work:
> >
> > https://bugzilla.freedesktop.org/show_bug.cgi?id=60112
>
> hmm, did not yet see this.
>
> > Can we merge both approaches?
>
> I will look at it further but my current toughts:
>  - the bus_parse_unit_info functions seems a good idea.
>  - his bus_get_uint64_property is slightly nicer than mine.
>  - it still uses cairo to write the plot which i think is not so nice.
> (since it is overkill for writing svg)
>  - it seems like a more literal translation in some places.
>  - repeats some bugs that were in the original python version but
> fixed in my version.
>  - it does not print bars for firmware and loader into the svg output.
>  - it prints more informational text on the svg.
>  - quiet unfortunate that these patches did not end up on the mailing list.
> (and apparently the poster did not see my patches on the list either)
>
> so I propose I try to merge the best of both patch-sets.
>
> any other comments with regards to this?
>


I indeed did not see your patches, unfortunately. I did not think about the
mailing list for that, my mistake.

It is indeed a quite literal translation for the most of it. I like better
your svg approach getting rid of cairo.

Feel free to merge both patch-sets and to yell at me if you need some help
to do so.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Compiling in a sandbox

2010-07-08 Thread Marc-Antoine Perennou
> On Thu, 08.07.10 13:42, Steve Herber (her...@thing.com) wrote:
> 
> > In gentoo, the only way I know to install packages is to run the
> > emerge command as root.   The point of gentoo is to automate the
> > download, untar, configure, compile, and install process.   I don't
> > know of a way to do this
> > without being root.   Does anyone know how to configure gentoo to split
> > the install phase, which must be run as root, from the other phases
> > that don't really need to be run as root?   Otherwise, the suggestion
> > from Lennart is not useful for gentoo.
> 
> If Gentoo is broken then please fix Gentoo.
> 
> I really can't believe that building things as root is how things are
> supposed to be done on Gentoo...
> 
> Lennart
> 
> -- 
> Lennart Poettering - Red Hat, Inc.
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel

FEATURES="userpriv usersandbox" or anything like that allow you to build as a 
non root user with portage/emerge, or you can use paludis which does not build 
as root by default, on Gentoo___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] sbin vs bin

2010-06-02 Thread Marc-Antoine Perennou
Systemd can also be used as a session manager, which is run as a simple
user.

On 2 June 2010 09:13, Steve Herber  wrote:

> I just noticed this change:
>
> 8 hours build-sys: move systemd from /sbin to /bin since it should be used
> by normal ...Lennart Poettering  1   -5/+2
>
> When would a non-root user even invoke the systemd executable?
> For testing an expert might run systemd as a non-root user but
> then they can just add /sbin to their path, an action they should
> be capable of if they are playing with systemd.  Init is in /sbin
> and anyone that knows that would expect systemd to be there also.
>
> Thanks,
>
> --
> Steve Herberher...@thing.comwork: 206-221-7262
> Software Engineer, UW Medicine, IT Services home: 425-454-2399
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Gentoo service files

2010-05-21 Thread Marc-Antoine Perennou
So, if it's hald, here is the good one

On 21 May 2010 18:17, Fabian Henze  wrote:

> Am Freitag, 21. Mai 2010, 00:02:26 schrieb Marc-Antoine Perennou:
> > Hi again,
> >
> > You're right gor the dbus service name, I just missed it. Hal service
> seems
> > to be haldaemon too, but I'm not 100% sure 'cause I haven't it on my
> > system. I fixed it and also added a symlink to the xdm service in the
> > graphical.target.wants in the joined patch.
>
> On gentoo it is "hald".
>
> -- Fabian Henze
>
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
>
From dd7105dfc72e63ad352dc496f269c39b660730c3 Mon Sep 17 00:00:00 2001
From: Marc-Antoine Perennou 
Date: Thu, 20 May 2010 23:54:59 +0200
Subject: [PATCH] units: fix Gentoo services

---
 Makefile.am |6 ++
 units/gentoo/reboot.service |1 -
 units/gentoo/xdm.service|3 ++-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 8313e57..f491585 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -493,5 +493,11 @@ if TARGET_FEDORA
 		$(LN_S) halt reboot > /dev/null 2>&1 || true )
 endif
 
+if TARGET_GENTOO
+	( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
+		rm -f xdm.service && \
+		$(LN_S) $(systemunitdir)/xdm.service xdm.service )
+endif
+
 DISTCHECK_CONFIGURE_FLAGS = \
 	--with-udevrulesdir=$$dc_install_base/$(udevrulesdir)
diff --git a/units/gentoo/reboot.service b/units/gentoo/reboot.service
index 92c4962..080a084 100644
--- a/units/gentoo/reboot.service
+++ b/units/gentoo/reboot.service
@@ -14,5 +14,4 @@ Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.a
 [Service]
 Type=finish
 ValidNoProcess=yes
-Environment=RUNLEVEL=6
 ExecStart=/etc/init.d/reboot.sh
diff --git a/units/gentoo/xdm.service b/units/gentoo/xdm.service
index 8394991..244bd48 100644
--- a/units/gentoo/xdm.service
+++ b/units/gentoo/xdm.service
@@ -8,7 +8,8 @@
 [Unit]
 Description=Display Manager
 Before=graphical.target
-After=basic.target syslog.target messagebus.service haldaemon.service
+Requires=basic.target
+After=basic.target syslog.target dbus.service hald.service
 Conflicts=shutdown.target
 
 [Service]
-- 
1.7.1

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Gentoo service files

2010-05-20 Thread Marc-Antoine Perennou
Hi again,

You're right gor the dbus service name, I just missed it. Hal service seems
to be haldaemon too, but I'm not 100% sure 'cause I haven't it on my system.
I fixed it and also added a symlink to the xdm service in the
graphical.target.wants in the joined patch.

On 20 May 2010 18:20, Lennart Poettering  wrote:

> On Thu, 20.05.10 10:37, Marc-Antoine Perennou (marc-anto...@perennou.com)
> wrote:
>
> Heya,
>
> > From 862fbcaa59b022d25b50c7793205daf40bb5817b Mon Sep 17 00:00:00 2001
> > From: Marc-Antoine Perennou 
> > Date: Thu, 20 May 2010 10:31:04 +0200
> > Subject: [PATCH] units: add services for Gentoo
>
> Merged this now. One thing I'd like to point out though:
>
> > +++ b/units/gentoo/xdm.service
> > @@ -0,0 +1,16 @@
> > +#  This file is part of systemd.
> > +#
> > +#  systemd is free software; you can redistribute it and/or modify it
> > +#  under the terms of the GNU General Public License as published by
> > +#  the Free Software Foundation; either version 2 of the License, or
> > +#  (at your option) any later version.
> > +
> > +[Unit]
> > +Description=Display Manager
> > +Before=graphical.target
> > +After=basic.target syslog.target messagebus.service haldaemon.service
>
> This seems not right. According to the configur.ac data your dbus
> service is called dbus.service, not messagebus.service (which is a
> fedoraism). Also, are you sure your hal service is called
> haldaemon.service?
>
> Lennart
>
> --
> Lennart PoetteringRed Hat, Inc.
> lennart [at] poettering [dot] net
> http://0pointer.net/lennart/   GnuPG 0x1A015CC4
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
From dd7105dfc72e63ad352dc496f269c39b660730c3 Mon Sep 17 00:00:00 2001
From: Marc-Antoine Perennou 
Date: Thu, 20 May 2010 23:54:59 +0200
Subject: [PATCH] units: fix Gentoo services

---
 Makefile.am |6 ++
 units/gentoo/reboot.service |1 -
 units/gentoo/xdm.service|3 ++-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 8313e57..f491585 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -493,5 +493,11 @@ if TARGET_FEDORA
 		$(LN_S) halt reboot > /dev/null 2>&1 || true )
 endif
 
+if TARGET_GENTOO
+	( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
+		rm -f xdm.service && \
+		$(LN_S) $(systemunitdir)/xdm.service xdm.service )
+endif
+
 DISTCHECK_CONFIGURE_FLAGS = \
 	--with-udevrulesdir=$$dc_install_base/$(udevrulesdir)
diff --git a/units/gentoo/reboot.service b/units/gentoo/reboot.service
index 92c4962..080a084 100644
--- a/units/gentoo/reboot.service
+++ b/units/gentoo/reboot.service
@@ -14,5 +14,4 @@ Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.a
 [Service]
 Type=finish
 ValidNoProcess=yes
-Environment=RUNLEVEL=6
 ExecStart=/etc/init.d/reboot.sh
diff --git a/units/gentoo/xdm.service b/units/gentoo/xdm.service
index 8394991..244bd48 100644
--- a/units/gentoo/xdm.service
+++ b/units/gentoo/xdm.service
@@ -8,7 +8,8 @@
 [Unit]
 Description=Display Manager
 Before=graphical.target
-After=basic.target syslog.target messagebus.service haldaemon.service
+Requires=basic.target
+After=basic.target syslog.target dbus.service haldaemon.service
 Conflicts=shutdown.target
 
 [Service]
-- 
1.7.1

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Gentoo service files

2010-05-20 Thread Marc-Antoine Perennou
Hi,

Just wrote some Gentoo service files based upon Fedora's ones.
Probably not perfect but I think it's a good start.
Did not pick up the sysinit thing, 'cause (at least on my system) the only
things in sysiniy are dmesg, devfs and udev, the only needed one would be
udev, and I guess it should have its own service.
From 862fbcaa59b022d25b50c7793205daf40bb5817b Mon Sep 17 00:00:00 2001
From: Marc-Antoine Perennou 
Date: Thu, 20 May 2010 10:31:04 +0200
Subject: [PATCH] units: add services for Gentoo

---
 Makefile.am   |9 +
 units/gentoo/halt.service |   19 +++
 units/gentoo/killall.service  |   15 +++
 units/gentoo/poweroff.service |   18 ++
 units/gentoo/reboot.service   |   18 ++
 units/gentoo/xdm.service  |   16 
 6 files changed, 95 insertions(+), 0 deletions(-)
 create mode 100644 units/gentoo/halt.service
 create mode 100644 units/gentoo/killall.service
 create mode 100644 units/gentoo/poweroff.service
 create mode 100644 units/gentoo/reboot.service
 create mode 100644 units/gentoo/xdm.service

diff --git a/Makefile.am b/Makefile.am
index 6d860ec..8313e57 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -132,6 +132,15 @@ dist_systemunit_DATA += \
 	units/fedora/sysinit.service
 endif
 
+if TARGET_GENTOO
+dist_systemunit_DATA += \
+	units/gentoo/halt.service \
+	units/gentoo/killall.service \
+	units/gentoo/poweroff.service \
+	units/gentoo/reboot.service \
+	units/gentoo/xdm.service
+endif
+
 # This is needed because automake is buggy in how it generates the
 # rules for C programs, but not Vala programs.  We therefore can't
 # list the .h files as dependencies if we want make dist to work.
diff --git a/units/gentoo/halt.service b/units/gentoo/halt.service
new file mode 100644
index 000..8762a78
--- /dev/null
+++ b/units/gentoo/halt.service
@@ -0,0 +1,19 @@
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+
+[Unit]
+Description=Halt
+Requires=shutdown.target killall.service
+After=shutdown.target killall.service
+Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount
+
+[Service]
+Type=finish
+ValidNoProcess=yes
+Environment=INIT_HALT=HALT
+Environment=RC_DOWN_HARDDISK=yes
+ExecStart=/etc/init.d/shutdown.sh
diff --git a/units/gentoo/killall.service b/units/gentoo/killall.service
new file mode 100644
index 000..a02062f
--- /dev/null
+++ b/units/gentoo/killall.service
@@ -0,0 +1,15 @@
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+
+[Unit]
+Description=Kill All Processes
+After=shutdown.target
+
+[Service]
+Type=finish
+ValidNoProcess=yes
+ExecStart=/etc/init.d/killprocs start
diff --git a/units/gentoo/poweroff.service b/units/gentoo/poweroff.service
new file mode 100644
index 000..1a0a6a4
--- /dev/null
+++ b/units/gentoo/poweroff.service
@@ -0,0 +1,18 @@
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+
+[Unit]
+Description=Power-Off
+Requires=shutdown.target killall.service
+After=shutdown.target killall.service
+Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount
+
+[Service]
+Type=finish
+ValidNoProcess=yes
+Environment=RC_DOWN_HARDDISK=yes
+ExecStart=/etc/init.d/shutdown.sh
diff --git a/units/gentoo/reboot.service b/units/gentoo/reboot.service
new file mode 100644
index 000..92c4962
--- /dev/null
+++ b/units/gentoo/reboot.service
@@ -0,0 +1,18 @@
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+
+[Unit]
+Description=Reboot
+Requires=shutdown.target killall.service
+After=shutdown.target killall.service
+Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount
+
+[Service]
+Type=finish
+ValidNoProcess=yes
+Environment=RUNLEVEL=6
+ExecStart=/etc/init.d/reboot.sh
diff --git a/units/gentoo/xdm.service b/units/gentoo/xdm.service
new file mode 100644
index 000..8394991
--- /dev/null
+++ b/units/gentoo/xdm.service
@@ -0,0 +1,16 @@
+

[systemd-devel] Gentoo getty support

2010-05-17 Thread Marc-Antoine Perennou
Hi,

Here are attached two patches, the first one gives Gentoo's getty support,
but it doesn't work without the second one for Makefile.am (it didn't with
--with-distro=debian neither when I tested so I assumed I should add all
distros listed in the configure.ac)
I'm not very familiar with autotools so the second one probably needs
reworking.
From 4b4738fa5fdce031feb5c5dc34a08059191067c1 Mon Sep 17 00:00:00 2001
From: Marc-Antoine Perennou 
Date: Mon, 17 May 2010 12:43:15 +0200
Subject: [PATCH 2/2] expose all distros in Makefile.am

---
 Makefile.am |   20 
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 3b54699..c0af5b9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -323,6 +323,26 @@ M4_FLAGS =
 
 if TARGET_FEDORA
 M4_FLAGS += -DTARGET_FEDORA=1
+else
+if TARGET_SUSE
+M4_FLAGS += -DTARGET_SUSE=1
+else
+if TARGET_DEBIAN
+M4_FLAGS += -DTARGET_DEBIAN=1
+else
+if TARGET_ARCH
+M4_FLAGS += -DTARGET_ARCH=1
+else
+if TARGET_GENTOO
+M4_FLAGS += -DTARGET_GENTOO=1
+else
+if TARGET_SLACKWARE
+M4_FLAGS += -DTARGET_SLACKWARE=1
+endif
+endif
+endif
+endif
+endif
 endif
 
 M4_PROCESS_SYSTEM = \
-- 
1.7.1

From 89431c3211f9927553057362c66a490c75f84208 Mon Sep 17 00:00:00 2001
From: Marc-Antoine Perennou 
Date: Mon, 17 May 2010 11:49:58 +0200
Subject: [PATCH 1/2] units: add ge...@.service define for Gentoo

---
 units/ge...@.service.m4 |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/units/ge...@.service.m4 b/units/ge...@.service.m4
index b951248..9787638 100644
--- a/units/ge...@.service.m4
+++ b/units/ge...@.service.m4
@@ -17,6 +17,7 @@
 
 m4_ifdef(`TARGET_FEDORA', `m4_define(`GETTY', `/sbin/mingetty')')m4_dnl
 m4_ifdef(`TARGET_DEBIAN', `m4_define(`GETTY', `/sbin/getty 38400')')m4_dnl
+m4_ifdef(`TARGET_GENTOO', `m4_define(`GETTY', `/sbin/agetty 38400')')m4_dnl
 m4_dnl
 [Unit]
 Description=Getty on %I
-- 
1.7.1

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel