[Dev] Gumd usage in building images

Zaman, Imran imran.zaman at intel.com
Thu Oct 30 11:57:30 GMT 2014


Hi Roman!

gumd v1.0.1 is integrated to Tizen Common 
http://download.tizen.org/snapshots/tizen/common/tizen-common_20141029.1/repos/x86_64-wayland/packages/x86_64/gumd-1.0.1-21.2.x86_64.rpm

Please let me know if you are still facing any issues while using gumd with mic.

BR
imran
________________________________________
From: Zaman, Imran
Sent: 24 October 2014 17:41
To: Roman Kubiak; Rafał Krypa
Cc: dev at lists.tizen.org
Subject: RE: [Dev] Gumd usage in building images

Hi Roman!

Found and fixed the issue.. NOTE: forget about gum v1.0.0; you MUST use gum v1.0.1

Please find attached sample ks file, which I used to test creating user in offline mode using libgum/gum-utils.

1- sudo mic cr --local-pkgs-path=/var/tmp/local/BUILD-ROOTS/scratch.x86_64.0/home/abuild/rpmbuild/RPMS/x86_64/ loop iz-tizen-common_20141015.6_common-wayland-mbr-x86_64.ks
    1.a local-pkgs-path contains latest gumd packages v1.0.1.
    1.b you can clone gumd from https://review.tizen.org/git/?p=platform%2Fupstream%2Fgumd.git;a=shortlog;h=HEAD, and try using it in image creation.
2- sudo mic chroot mic-output/tizen-common.img
3- bash-4.3# id baby
uid=2003(baby) gid=100(users) groups=100(users)
bash-4.3#

Roman, please try it out and let me know if you still faces any issues.

BR
imran

________________________________________
From: Dev [dev-bounces at lists.tizen.org] on behalf of Zaman, Imran [imran.zaman at intel.com]
Sent: 24 October 2014 16:04
To: Roman Kubiak; Rafał Krypa
Cc: dev at lists.tizen.org
Subject: Re: [Dev] Gumd usage in building images

Okey I tried it..

1- sudo mic cr --local-pkgs-path=/var/tmp/local/BUILD-ROOTS/scratch.x86_64.0/home/abuild/rpmbuild/RPMS/x86_64/ loop iz-tizen-common_20141015.6_common-wayland-mbr-x86_64.ks
    ( --local-pkgs-path contains latest gumd packages v1.0.0)
2- sudo mic chroot mic-output/tizen-common.img
3- bash-4.3# gum-utils -o -a --username=user1 --usertype=4

and it works.. yuppy  :-)
see logs at the end of email.. Attached is the kickstart file, which I used.

Btw I can build gumd packages for you.. let me know the architecture, so that you can give it a try as well?

Next i will put "gum-utils -o -a --username=user1 --usertype=4" in ks file and see if it works or not.. fingers crossed :-)

BR
imran


gum-utils log
========

(gum-utils:14547): gum-WARNING **: 962276.865508 gumd-utils.c:265 _handle_user_add User added successfully

(gum-utils:14547): gum-WARNING **: 962276.865623 gumd-utils.c:171 _print_user_prop uid : 2003

(gum-utils:14547): gum-WARNING **: 962276.865644 gumd-utils.c:172 _print_user_prop gid : 100

(gum-utils:14547): gum-WARNING **: 962276.865661 gumd-utils.c:173 _print_user_prop username : user1

(gum-utils:14547): gum-WARNING **: 962276.865676 gumd-utils.c:174 _print_user_prop nickname : UNKNOWN

(gum-utils:14547): gum-WARNING **: 962276.865692 gumd-utils.c:175 _print_user_prop realname : user1

(gum-utils:14547): gum-WARNING **: 962276.865707 gumd-utils.c:176 _print_user_prop office :

(gum-utils:14547): gum-WARNING **: 962276.865722 gumd-utils.c:178 _print_user_prop officephone :

(gum-utils:14547): gum-WARNING **: 962276.865737 gumd-utils.c:179 _print_user_prop homephone :

(gum-utils:14547): gum-WARNING **: 962276.865751 gumd-utils.c:180 _print_user_prop homedir : /home/user1

(gum-utils:14547): gum-WARNING **: 962276.865766 gumd-utils.c:181 _print_user_prop shell : /bin/bash


________________________________________
From: Roman Kubiak [r.kubiak at samsung.com]
Sent: 24 October 2014 15:37
To: Zaman, Imran; Rafał Krypa
Cc: dev at lists.tizen.org
Subject: Re: [Dev] Gumd usage in building images

The best thing to do is to chroot to the image

# mic ch platform.img

after it's created and test in this environment (it's the image unpacked, and run through qemu)

if it works there it should later work in the kickstart file

you can do your tests and verify if the needed files modified etc.


On 10/24/2014 02:32 PM, Zaman, Imran wrote:

Hi Roman!

Thanks, I disabled gumd and image is created now :-)

How shall I try whether gum-utils offline mode works with the image or not?
Adding the following line to the kickstart should do the trick.. right?
how can I verify that it really did work or not? Do I need to flash and boot the image? no other faster way? :-)

gum-utils -o --username=user1 --usertype=4


BR
imran
________________________________________
From: Roman Kubiak [r.kubiak at samsung.com<mailto:r.kubiak at samsung.com>]
Sent: 23 October 2014 19:01
To: Zaman, Imran; Rafał Krypa
Cc: dev at lists.tizen.org<mailto:dev at lists.tizen.org>
Subject: Re: [Dev] Gumd usage in building images

If you have a call to gumd somewhere in the kickstart and it's not working (as you wrote) it's haning the "RUnning scripts" parts of the kickstart, and since it's buffered you won't see what is happening before unless you kill the qemu process that is emulating your gumd/gum-utils in mic

try ps axuw | grep qemu

and see if it's running gumd/gum-utils if so kill it, it should continue with other scripts in the kickstart

then  just remove it from the ks file.

On 10/23/2014 04:46 PM, Zaman, Imran wrote:

Hi Rafal!

Rafal, I have pushed the changes for libgum/gum-utils offline support.
Patrick, sysroot support is also added to 'offline' mode.

Both the changes should be available in the next image.

Roman, I have removed offline support from gumd daemon as it was not needed..
So either libgum can be used with offline param for synchronous APIs.. or use gum-utils with offline command line argument like:

gum-utils -o -a --username=user1 --usertype=4

Please let me know if you find any issues.

Roman, I will try to work on the bug on next thursday as I am off for 3 days (you can try gumd 1.0.0 and use gum-utils in mic; i guess the problem will be there still).
It may have to do with glib but lets see if we can figure it out..
Btw i m not able to create images any more so cant try out things on my own for mic :-( some how it get stuck at the following stage and does not proceed further. Any idea?

...

INFO: Installing: pciutils             ++++++++++++++++++++++++++++++     [154/170]
INFO: Installing: pam-locale           ++++++++++++++++++++++++++++++     [155/170]
INFO: Installing: sudo                 ++++++++++++++++++++++++++++++     [156/170]
INFO: Installing: glibc-locale         +++++++++++++++++++++++++++++++    [157/170]
INFO: Installing: tzdata               +++++++++++++++++++++++++++++++    [158/170]
INFO: Installing: rsync                +++++++++++++++++++++++++++++++    [159/170]
INFO: Installing: unzip                +++++++++++++++++++++++++++++++    [160/170]
INFO: Installing: zip                  +++++++++++++++++++++++++++++++    [161/170]
INFO: Installing: rfkill               ++++++++++++++++++++++++++++++++   [162/170]
INFO: Installing: diffutils            ++++++++++++++++++++++++++++++++   [163/170]
INFO: Installing: patch                ++++++++++++++++++++++++++++++++   [164/170]
INFO: Installing: tree                 ++++++++++++++++++++++++++++++++   [165/170]
INFO: Installing: tar                  ++++++++++++++++++++++++++++++++   [166/170]
INFO: Installing: tizen-release        +++++++++++++++++++++++++++++++++  [167/170]
INFO: Installing: linux-firmware       +++++++++++++++++++++++++++++++++  [168/170]
INFO: Installing: meta-generic-adaptat +++++++++++++++++++++++++++++++++  [169/170]
INFO: Installing: default-ac-domains   ++++++++++++++++++++++++++++++++++ [170/170]

INFO: Applying configurations ...
INFO: Running scripts ...

BR
imran
________________________________________
From: Dev [dev-bounces at lists.tizen.org<mailto:dev-bounces at lists.tizen.org><mailto:dev-bounces at lists.tizen.org><mailto:dev-bounces at lists.tizen.org>] on behalf of Zaman, Imran [imran.zaman at intel.com<mailto:imran.zaman at intel.com><mailto:imran.zaman at intel.com><mailto:imran.zaman at intel.com>]
Sent: 20 October 2014 18:54
To: Rafał Krypa
Cc: dev at lists.tizen.org<mailto:dev at lists.tizen.org><mailto:dev at lists.tizen.org><mailto:dev at lists.tizen.org>
Subject: Re: [Dev] Gumd usage in building images

Hi Rafal!

I have started working on making libgum work in offline mode. Its doable and I should come back to you within 2-3 days.
I will also add support for "offline" to gum-utils. One thing to keep in mind is that you guys should use libgum (with offline support) instead of gum-utils to avoid cases like error handling etc.

The way I will change libgum is that user should specify the offline mode when calling the APIs at object creation time.
e.g. GumUser * gum_user_get_sync (gboolean offline, uid_t uid);

Its better to let the 'user' of the 'libgum'/'gum-utils' to decide whether it wants offline mode or not rather than automagically switching to one or the other mode on the fly.

Btw how do you detect if a daemon is running or not? iterating through 'proc' may not be the best solution that can work out in environments like yocto or at image creation time.

BR
imran
________________________________________
From: Rafał Krypa [r.krypa at samsung.com<mailto:r.krypa at samsung.com><mailto:r.krypa at samsung.com><mailto:r.krypa at samsung.com>]
Sent: 17 October 2014 20:25
To: Zaman, Imran
Cc: Ohly, Patrick; dev at lists.tizen.org<mailto:dev at lists.tizen.org><mailto:dev at lists.tizen.org><mailto:dev at lists.tizen.org>; r.kubiak at samsung.com<mailto:r.kubiak at samsung.com><mailto:r.kubiak at samsung.com><mailto:r.kubiak at samsung.com>; dominig.arfoll at fridu.net<mailto:dominig.arfoll at fridu.net><mailto:dominig.arfoll at fridu.net><mailto:dominig.arfoll at fridu.net>
Subject: Re: [Dev] Gumd usage in building images

On 2014-10-17 16:14, Zaman, Imran wrote:


Hi Rafal/Roman!

I agree with patrick, and consequently:

In order to make life easier, I have added "offline" support in gumd, which means that gumd can be run as simple binary to add/del/update/get user/group.
No (p2p) dbus is needed.

offline mode:  user will be added and gumd will exit immediately
# gumd -o -a --username=user1 --usertype=4               (e.g.)



This is fine and solves the problem. But I'd like to suggest other approach, already mentioned by Patrick:



For gumd, a mode where the client tool embeds the daemon code directly
would be the best solution IMHO.



This is the same approach that we used in cynara and security-manager. It greatly simplifies usage of the client library, making the client work (to some extent) in the same way for both off-line and on-line modes.
The exact approach we used was to:
- move some parts of the deamon code to a separate library
- link daemon with it to keep it working as usual
- link client with it to enable offline mode
- inside client implementation, if daemon is not running, invoke the target routines directly instead of sending requests to daemon

What do you think about doing something similar for gumd? This would allow simple usage of "gum-utils" during both image-creation time and run-time.


Best regards,
Rafal Krypa




non-offline mode (it needs either p2p dbus or system bus):
# gumd

The changes have already been merged and pushed to tizen, and should show up in next Tizen common release (hopefully on monday).
Please make sure that you use gumd with version 0.0.6.

Roman, please test user creation at image level with gumd 0.0.6 and let me know if you face any issues.

BR
imran
________________________________________
From: Dev [dev-bounces at lists.tizen.org<mailto:dev-bounces at lists.tizen.org><mailto:dev-bounces at lists.tizen.org><mailto:dev-bounces at lists.tizen.org>] on behalf of Patrick Ohly [patrick.ohly at intel.com<mailto:patrick.ohly at intel.com><mailto:patrick.ohly at intel.com><mailto:patrick.ohly at intel.com>]
Sent: 17 October 2014 10:37
To: dev at lists.tizen.org<mailto:dev at lists.tizen.org><mailto:dev at lists.tizen.org><mailto:dev at lists.tizen.org>
Subject: Re: [Dev] Gumd usage in building images

On Fri, 2014-10-17 at 09:18 +0200, Dominig ar Foll (Intel OTC) wrote:


Hello;

when looking at off line mode (use during image creation) remember that
we have a fast growing community planing to use Yocto and so your
solution needs to work with Yocto as well.


For those not familiar with Yocto, some background:
      * Tools manipulating the root filesystem typically get compiled
        for the host system (for example, your Intel-based laptop
        running some Linux distro) and then get invoked to modify files
        used in the target (for example, ARM). Make sure that your files
        don't have architecture dependencies (LSB vs. MSB, 32 vs 64).
      * If that's not possible, tools are run under qemu.
      * chroot is not used (because it would require root privileges),
        so tools need to support manipulating files not at their final
        destination (for example, tmp/sysroot/usr/ instead of /usr).
      * The environment prepared for the tools only consists of env
        variables. There's no concept of spawning additional daemons
        (doesn't matter whether it's dbus-daemon or gumd).

For gumd, a mode where the client tool embeds the daemon code directly
would be the best solution IMHO. A --sysroot parameter similar to gcc
would probably be useful/needed, too.


---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki
Business Identity Code: 0357606 - 4
Domiciled in Helsinki

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
Dev mailing list
Dev at lists.tizen.org<mailto:Dev at lists.tizen.org><mailto:Dev at lists.tizen.org><mailto:Dev at lists.tizen.org>
https://lists.tizen.org/listinfo/dev
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki
Business Identity Code: 0357606 - 4
Domiciled in Helsinki

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.





--
--------------
 Roman Kubiak
--------------

---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki
Business Identity Code: 0357606 - 4
Domiciled in Helsinki

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.





--
--------------
 Roman Kubiak
--------------
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki
Business Identity Code: 0357606 - 4
Domiciled in Helsinki

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
Dev mailing list
Dev at lists.tizen.org
https://lists.tizen.org/listinfo/dev
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.



More information about the Dev mailing list