[RAUC] Antwort: Re: Antwort: D-Bus control Qt

2021-08-02 Thread Eugen . Wiens
Hi Michael,

"RAUC"  schrieb am 02.08.2021 15:20:25:

> Von: "Stahl, Michael" 
> An: "eugen.wi...@jumo.net" 
> Kopie: "RAUC@pengutronix.de" 
> Datum: 02.08.2021 15:20
> Betreff: Re: [RAUC] Antwort:  D-Bus control Qt
> Gesendet von: "RAUC" 
> 
> Hi Eugen,
> 
> I think I got it.
> 
> MyProgress.cpp:
> Q_DECLARE_METATYPE(MyProgress) 
> 
> QDBusArgument <<(QDBusArgument , const MyProgress& 
> parameterProgress)
> {
> argument.beginStructure();
> argument << parameterProgress.m_Progress;
> argument << parameterProgress.m_Message;
> argument << parameterProgress.m_Additional;
> argument.endStructure();
> return argument;
> }
> 
> const QDBusArgument >>(const QDBusArgument , 
MyProgress& 
> parameterProgress)
> {
> argument.beginStructure();
> argument >> parameterProgress.m_Progress;
> argument >> parameterProgress.m_Message;
> argument >> parameterProgress.m_Additional;
> argument.endStructure();
> return argument;
> }
> 
> MyProgress ::MyProgress(){
> qRegisterMetaType();
> qDBusRegisterMetaType();
> }
> 
> MyProgress.h:
> #ifndef MYPROGRESS_H

> #define MYPROGRESS_H
> 

> #include 
> #include 
> #include 
> #include 
> 
> class MyProgress
> {
> public:
> MyProgress();
> ~MyProgress();
> int m_Progress;
> QString m_Message;
> int m_Additional;
> public slots:
> friend QDBusArgument <<(QDBusArgument , const 
> RaucProgress );
> friend const QDBusArgument >>(const QDBusArgument 
, 
> RaucProgress );
> };
> #endif // MYPROGRESS_H
> 
> update.cpp:
> ...
> QDBusInterface interface( "de.pengutronix.rauc",

>   "/",
>   "de.pengutronix.rauc.Installer",
>   QDBusConnection::systemBus() );
> 
> if (interface.isValid() == true)
> {
> qDebug() << "interface is valid";
>   qDebug() << "Read property (Progress)";
>QVariant property = interface.property("Progress");
>   property.value() >> parameterProgress;
>qDebug() << parameterProgress.m_Progress;
>qDebug() << parameterProgress.m_Message;
>  }
> ...
> 
> parameterProgress is delcared in the update.h
> 
> I have a last question. Maybe you can answer it. Why have I add the 
> keyword "friend" in front of the QDBusArguments? I wount compile without 
it.
If you add the operators as a member, you Qt has problem to find them. We 
implement the operators outside of the class. As "normal" functions not as 
Member Methods. Qt is searching "operator >> ( Type, Type)" and not as 
Member of a class.

> 
> Many thanks.
> 
> Kind regards 
> Michael
> 
> Von: RAUC  im Auftrag von Stahl, 
> Michael 
> Gesendet: Montag, 2. August 2021 14:45
> An: eugen.wi...@jumo.net 
> Cc: RAUC@pengutronix.de 
> Betreff: Re: [RAUC] Antwort: D-Bus control Qt 
> 
> Hi Eugen,
> 
> thanks for the informations. They were very useful. Some lines are 
> familiar to me because I tested a lot.
> But I still need some support. 
> 
> This is the way I request the property:
> 
> MyProgress parameterProgress;
> QDBusInterface interface( "de.pengutronix.rauc", 
> "/",
> "de.pengutronix.rauc.Installer",
> QDBusConnection::systemBus() );
> QVariant property = interface.property("Progress"); 
> property.value() >> parameterProgress;
> 
> No I get a compiler error:
> no match for operator>>'(opernad types are 'QDBusArgument' and 
'MyProgress')
> 
> I think I do the registration an the installing of the oparators wrong.
> 
> The registration is done in the constructor of MyProgress:
> MyProgress ::MyProgress(){
> qRegisterMetaType();
> qDBusRegisterMetaType();
> }
> 
> The magic statement I place in top of my MyProcess.cpp
> // this is one of the magic statements
> Q_DECLARE_METATYPE(MyProgress)
> 
> But where exactly do you place the operators? Also in the MyProcess.cpp? 

> QDBusArgument <<(QDBusArgument , const MyProgress&
> parameterProgress);
> const QDBusArgument >>(const QDBusArgument , 
> MyProgress& parameterProgress);
> QDBusArgument <<(QDBusArgument , const MyProgress&
> parameterProgress)
> {
> argument.beginStructure();
> argument << parameterProgress.m_Progress;
> argument << parameterProgress.m_Message;
> argument << parameterProgress.m_Additional;
> argument.endStructure();
> return argument;
> }
> const QDBusArgument >>(const QDBusArgument , 
> MyProgress& parameterProgress)
> {
> argument.beginStructure();
> argument >> parameterProgress.m_Progress;
> argument >> parameterProgress.m_Message;
> argument >> parameterProgress.m_Additional;
> argument.endStructure();
> return argument;
> }
> 
> It seems like I am only a few millimeters away from my goal.
> 
> Thanks
> 
> Von: eugen.wi...@jumo.net 
> Gesendet: Montag, 2. August 2021 13:41
> An: Stahl, Michael 
> Cc: RAUC@pengutronix.de 
> Betreff: Antwort: [RAUC] D-Bus control Qt 
> 
> Hi Michael,
> 
> "RAUC"  

[RAUC] Antwort: Re: Antwort: Re: Antwort: D-Bus control Qt

2021-08-02 Thread Eugen . Wiens
Hi Michael,

"RAUC"  schrieb am 02.08.2021 16:29:18:

> Von: "Stahl, Michael" 
> An: "eugen.wi...@jumo.net" 
> Kopie: RAUC , "RAUC@pengutronix.de" 
> 
> Datum: 02.08.2021 16:29
> Betreff: Re: [RAUC] Antwort: Re:  Antwort:  D-Bus control Qt
> Gesendet von: "RAUC" 
> 
> Okay, thanks a lot.
> 
> A last question. Is it correct that I have to poll the "Progress" 
> property or is there any signal system where I can subcribe to get a
> notification at every change of progress status?

We are using a dbus signal. You can connect to it with Qt.

Best regards,
Eugen 
Diese E-Mail kann vertrauliche und/oder rechtlich geschützte Informationen 
beinhalten und ist ausschließlich für die im Verteiler genannten Personen 
bestimmt. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail 
sind nicht gestattet. Bitte benachrichtigen Sie uns gegebenenfalls telefonisch 
oder mit Antwort-Mail, falls Sie nicht der richtige Adressat dieser E-Mail 
sind. Bitte löschen Sie diese Nachricht und alle Anhänge dazu unverzüglich. 
Falls nicht ausdrücklich vermerkt, ist diese E-Mail keine rechtlich bindende 
Vereinbarung. 

Kommanditgesellschaft: JUMO GmbH & Co. KG, Sitz: 36039 Fulda, Amtsgericht Fulda 
HRA 302, Persönlich haftende Gesellschafterin: M. K. JUCHHEIM GmbH, Sitz: 36039 
Fulda, Amtsgericht Fulda HRB 17, Geschäftsführer: Dipl.-Ing. Bernhard Juchheim, 
Dipl.-Kfm. Michael Juchheim, Dipl.-Ing. Dimitrios Charisiadis 
Ust.-Id.-Nr.: DE 112411234 ___
RAUC mailing list


Re: [RAUC] Antwort: D-Bus control Qt

2021-08-02 Thread Stahl, Michael
Hi Eugen,

thanks for the informations. They were very useful. Some lines are familiar to 
me because I tested a lot.
But I still need some support.

This is the way I request the property:

MyProgress parameterProgress;
QDBusInterface interface( "de.pengutronix.rauc",

"/",

"de.pengutronix.rauc.Installer",

QDBusConnection::systemBus() );

QVariant property = interface.property("Progress");

property.value() >> parameterProgress;


No I get a compiler error:

no match for operator>>'(opernad types are 'QDBusArgument' and 'MyProgress')


I think I do the registration an the installing of the oparators wrong.


The registration is done in the constructor of MyProgress:

MyProgress ::MyProgress(){

qRegisterMetaType();

qDBusRegisterMetaType();

}


The magic statement I place in top of my MyProcess.cpp
// this is one of the magic statements
Q_DECLARE_METATYPE(MyProgress)

But where exactly do you place the operators? Also in the MyProcess.cpp?
QDBusArgument <<(QDBusArgument , const MyProgress& 
parameterProgress);
const QDBusArgument >>(const QDBusArgument , MyProgress& 
parameterProgress);
QDBusArgument <<(QDBusArgument , const MyProgress& 
parameterProgress)
{
argument.beginStructure();
argument << parameterProgress.m_Progress;
argument << parameterProgress.m_Message;
argument << parameterProgress.m_Additional;
argument.endStructure();
return argument;
}
const QDBusArgument >>(const QDBusArgument , MyProgress& 
parameterProgress)
{
argument.beginStructure();
argument >> parameterProgress.m_Progress;
argument >> parameterProgress.m_Message;
argument >> parameterProgress.m_Additional;
argument.endStructure();
return argument;
}

It seems like I am only a few millimeters away from my goal.

Thanks


Von: eugen.wi...@jumo.net 
Gesendet: Montag, 2. August 2021 13:41
An: Stahl, Michael 
Cc: RAUC@pengutronix.de 
Betreff: Antwort: [RAUC] D-Bus control Qt

Hi Michael,

"RAUC"  schrieb am 02.08.2021 08:15:26:

> Von: "Stahl, Michael" 
> An: "RAUC@pengutronix.de" 
> Datum: 02.08.2021 08:15
> Betreff: [RAUC] D-Bus control Qt
> Gesendet von: "RAUC" 
>
> Is there someone who implemented the DBus Property "Progress" into a
> Qt-Application? The problem seems the return value isi (Integer,
> String, Integer).
> For all other properties with a single return value like "Operation"
> or "LastError" the Qt DBus API works fine.
> I found an email from 28.Oct 2019 in the mailing list where Bastian
> Krause had the same issue. The answer was only that he had to
> cunsult the Qt DBus documentation on how a tuple is mapped to Qt types.
>
> Thats a good hint but after hours of searching the web I didn't find
> a solution. The return value for a property is QVariant in Qt.
>
> Trial 1 -> Read value by iface.property("Progress"):
> This is the error message I got when I try to read the progress property:
> Cannot construct placeholder type QDBusRawType
>
> Trial 2 -> Read value by iface.call("Get",...):
> Not able to get any information. The arguments of the returned
> QDBusMessages are always empty!
That is the way we implemented it:

On Qt there are some pitfalls and you has to marshaling the data.

1. Create a Data Class

#include 
#include 
#include 

class MyProgress
{
public:
[...]
int m_Progress;
QString m_Message;
int m_Additional;
};

// this is one of the magic statements
Q_DECLARE_METATYPE(MyProgress)
QDBusArgument <<(QDBusArgument , const MyProgress& 
parameterProgress);
const QDBusArgument >>(const QDBusArgument , MyProgress& 
parameterProgress);
};

You has to register the metatype and implement the operators. In the 
Constructor you has to add two register Methods

qRegisterMetaType();
qDBusRegisterMetaType();

After this tree registrations your Class MyProgress is known by Qt Metatype 
System. Now you has to implement operators

QDBusArgument <<(QDBusArgument , const MyProgress& 
parameterProgress)
{
argument.beginStructure();
argument << parameterProgress.m_Progress;
argument << parameterProgress.m_Message;
argument << parameterProgress.m_Additional;
argument.endStructure();
return argument;
}
const QDBusArgument >>(const QDBusArgument , MyProgress& 
parameterProgress)
{
argument.beginStructure();
argument >> parameterProgress.m_Progress;
argument >> parameterProgress.m_Message;
argument >> parameterProgress.m_Additional;
argument.endStructure();
return argument;
}

Now you are finished with preparing how to use it. In the Qt Slot of the D-Bus 
call your can pipe it in your class

MyProgress parameterProgress;
property.value() >> parameterProgress;


This URL help you to map our code to the Qt example 
https://doc.qt.io/qt-5/qdbusargument.html

I hope it helps


>
> ___
> RAUC mailing list

Diese E-Mail kann vertrauliche und/oder rechtlich gesch?tzte Informationen 

Re: [RAUC] Stumped, have a appfs partition that is encrypted, how to get RAUC to update it

2021-08-02 Thread Brian Hutchinson
On Fri, Jul 30, 2021 at 12:29 PM Jan Lübbe  wrote:

> Hi Brian,
>
> On Fri, 2021-07-30 at 10:20 -0400, Brian Hutchinson wrote:
> > > 100% Installing failed.
> > > LastError: Installation error: Failed updating slot appfs.1: failed to
> run
> > > mkfs.ext4: Child process exited with code 1
> > > Installing `/tmp/./update-myboard.raucb` failed
> > >
> > > But yet I can do mkfs.ext4 /dev/mapper/crypt_appfs2 and mount it and
> the
> > > filesystem is fine.
> > >
> > > Looks like I'm missing something still.
>
> Hmm, you should have more logs on the rauc service side, possible also
> with an
> error message from mkfs.ext4.
>
> >
> > So I think my issue was because I was nfs booted.  Slot A was activated
> but not
> > booted. But it looks like maybe it was using slot A /etc/rauc/system.conf
> > instead of the currently running nfs instance /etc/rauc/system.conf
> because what
> > I tried before worked once I mounted /dev/mmcblk2gp0p2 and changed that
> > /etc/rauc/system.conf to:
>
> It should use /etc/rauc/system.conf from the mounted rootfs, so NFS in your
> case.
>
> >  [slot.appfs.1]
> > device=/dev/mapper/crypt_appfs2
> > type=ext4
> > parent=rootfs.1
> >
> > So this brings up a question.  If I have boards out in the field and
> appfs goes
> > from plain ext4 to encrypted, I somehow need to update the currently
> running
> > /etc/rauc/system.conf file first before performing an update???  How to
> handle
> > system.conf changes?
>
> The system.conf contents should describe the details of the system than
> don't
> change during updates. Generally, partitioning changes are not possible in
> an
> atomic A/B way, so those are not really in scope for RAUC. :/
>
> Getting such a migration correct in the field is difficult. Something you
> could
> use, though.
>
> The device= properties will follow symlinks. So you could handle the switch
> between unencrypted and encrypted in a script before starting the rauc
> service
> and before mounting the current appfs.
>
> For both sides, you'd check if it already contains a luks header. If not,
> it's
> an old version which doesn't support encryption yet, so you link
> /dev/mmcblk...
> to /dev/appfs[12].
> If if already contains that header, attach the crypt device. The setup the
> /dev/appfs[12] link to /dev/mapper/crypt_appfs[12]).
>
> The system.conf would then point to device=/dev/appfs[12].
>
> Then add a pre-install handler:
>
> https://rauc.readthedocs.io/en/latest/using.html#system-based-customization-handlers
> It can check if the target slot link still points to the unencrypted
> device. In
> that case, it can setup the crypt device and change the link. RAUC
> should(*)
> then follow the updated link to the encrypted device when installing.
>
> Hope that helps... :)
>
>
Hi Jan,

Yes!  Thanks.

Now my problem is I have a very small 32M NOR flash and I have a 11M
SquashFS rootfs based off core-image-minimal.  I added packagegroup-luks
and it blew size up to 47M.  I then just tried to CORE_IMAGE_EXTRA_INSTALL
+= "cryptsetup" and that was still a 35M rootfs so now I'm stumped trying
to figure out if it's possible to get encryption support in my NOR flash
image we boot from :(

Regards,

Brian
___
RAUC mailing list


Re: [RAUC] Antwort: Re: Antwort: D-Bus control Qt

2021-08-02 Thread Stahl, Michael
Okay, thanks a lot.

A last question. Is it correct that I have to poll the "Progress" property or 
is there any signal system where I can subcribe to get a notification at every 
change of progress status?




Von: eugen.wi...@jumo.net 
Gesendet: Montag, 2. August 2021 15:36
An: Stahl, Michael 
Cc: RAUC@pengutronix.de ; RAUC 

Betreff: Antwort: Re: [RAUC] Antwort: D-Bus control Qt

Hi Michael,

"RAUC"  schrieb am 02.08.2021 15:20:25:

> Von: "Stahl, Michael" 
> An: "eugen.wi...@jumo.net" 
> Kopie: "RAUC@pengutronix.de" 
> Datum: 02.08.2021 15:20
> Betreff: Re: [RAUC] Antwort:  D-Bus control Qt
> Gesendet von: "RAUC" 
>
> Hi Eugen,
>
> I think I got it.
>
> MyProgress.cpp:
> Q_DECLARE_METATYPE(MyProgress)
>
> QDBusArgument <<(QDBusArgument , const MyProgress&
> parameterProgress)
> {
> argument.beginStructure();
> argument << parameterProgress.m_Progress;
> argument << parameterProgress.m_Message;
> argument << parameterProgress.m_Additional;
> argument.endStructure();
> return argument;
> }
>
> const QDBusArgument >>(const QDBusArgument , MyProgress&
> parameterProgress)
> {
> argument.beginStructure();
> argument >> parameterProgress.m_Progress;
> argument >> parameterProgress.m_Message;
> argument >> parameterProgress.m_Additional;
> argument.endStructure();
> return argument;
> }
>
> MyProgress ::MyProgress(){
> qRegisterMetaType();
> qDBusRegisterMetaType();
> }
>
> MyProgress.h:
> #ifndef MYPROGRESS_H

> #define MYPROGRESS_H
>

> #include 
> #include 
> #include 
> #include 
>
> class MyProgress
> {
> public:
> MyProgress();
> ~MyProgress();
> int m_Progress;
> QString m_Message;
> int m_Additional;
> public slots:
> friend QDBusArgument <<(QDBusArgument , const
> RaucProgress );
> friend const QDBusArgument >>(const QDBusArgument ,
> RaucProgress );
> };
> #endif // MYPROGRESS_H
>
> update.cpp:
> ...
> QDBusInterface interface( "de.pengutronix.rauc",

>   "/",
>   "de.pengutronix.rauc.Installer",
>   QDBusConnection::systemBus() );
>
> if (interface.isValid() == true)
> {
> qDebug() << "interface is valid";
>   qDebug() << "Read property (Progress)";
>QVariant property = interface.property("Progress");
>   property.value() >> parameterProgress;
>qDebug() << parameterProgress.m_Progress;
>qDebug() << parameterProgress.m_Message;
>  }
> ...
>
> parameterProgress is delcared in the update.h
>
> I have a last question. Maybe you can answer it. Why have I add the
> keyword "friend" in front of the QDBusArguments? I wount compile without it.
If you add the operators as a member, you Qt has problem to find them. We 
implement the operators outside of the class. As "normal" functions not as 
Member Methods. Qt is searching "operator >> ( Type, Type)" and not as Member 
of a class.

>
> Many thanks.
>
> Kind regards
> Michael
>
> Von: RAUC  im Auftrag von Stahl,
> Michael 
> Gesendet: Montag, 2. August 2021 14:45
> An: eugen.wi...@jumo.net 
> Cc: RAUC@pengutronix.de 
> Betreff: Re: [RAUC] Antwort: D-Bus control Qt
>
> Hi Eugen,
>
> thanks for the informations. They were very useful. Some lines are
> familiar to me because I tested a lot.
> But I still need some support.
>
> This is the way I request the property:
>
> MyProgress parameterProgress;
> QDBusInterface interface( "de.pengutronix.rauc",
> "/",
> "de.pengutronix.rauc.Installer",
> QDBusConnection::systemBus() );
> QVariant property = interface.property("Progress");
> property.value() >> parameterProgress;
>
> No I get a compiler error:
> no match for operator>>'(opernad types are 'QDBusArgument' and 'MyProgress')
>
> I think I do the registration an the installing of the oparators wrong.
>
> The registration is done in the constructor of MyProgress:
> MyProgress ::MyProgress(){
> qRegisterMetaType();
> qDBusRegisterMetaType();
> }
>
> The magic statement I place in top of my MyProcess.cpp
> // this is one of the magic statements
> Q_DECLARE_METATYPE(MyProgress)
>
> But where exactly do you place the operators? Also in the MyProcess.cpp?
> QDBusArgument <<(QDBusArgument , const MyProgress&
> parameterProgress);
> const QDBusArgument >>(const QDBusArgument ,
> MyProgress& parameterProgress);
> QDBusArgument <<(QDBusArgument , const MyProgress&
> parameterProgress)
> {
> argument.beginStructure();
> argument << parameterProgress.m_Progress;
> argument << parameterProgress.m_Message;
> argument << parameterProgress.m_Additional;
> argument.endStructure();
> return argument;
> }
> const QDBusArgument >>(const QDBusArgument ,
> MyProgress& parameterProgress)
> {
> argument.beginStructure();
> argument >> parameterProgress.m_Progress;
> argument >> parameterProgress.m_Message;
> 

Re: [RAUC] Antwort: D-Bus control Qt

2021-08-02 Thread Stahl, Michael
Hi Eugen,

I think I got it.

MyProgress.cpp:
Q_DECLARE_METATYPE(MyProgress)


QDBusArgument <<(QDBusArgument , const MyProgress& 
parameterProgress)

{

argument.beginStructure();

argument << parameterProgress.m_Progress;

argument << parameterProgress.m_Message;

argument << parameterProgress.m_Additional;

argument.endStructure();

return argument;

}


const QDBusArgument >>(const QDBusArgument , MyProgress& 
parameterProgress)

{

argument.beginStructure();

argument >> parameterProgress.m_Progress;

argument >> parameterProgress.m_Message;

argument >> parameterProgress.m_Additional;

argument.endStructure();

return argument;

}



MyProgress ::MyProgress(){

qRegisterMetaType();

qDBusRegisterMetaType();

}


MyProgress.h:

#ifndef MYPROGRESS_H


#define MYPROGRESS_H

#include 

#include 

#include 

#include 


class MyProgress

{

public:

MyProgress();

~MyProgress();

int m_Progress;

QString m_Message;

int m_Additional;

public slots:

friend QDBusArgument <<(QDBusArgument , const 
RaucProgress );

friend const QDBusArgument >>(const QDBusArgument , 
RaucProgress );

};

#endif // MYPROGRESS_H



update.cpp:

...

QDBusInterface interface( "de.pengutronix.rauc",


  "/",

  "de.pengutronix.rauc.Installer",

  QDBusConnection::systemBus() );


if (interface.isValid() == true)

{

qDebug() << "interface is valid";

  qDebug() << "Read property (Progress)";

   QVariant property = interface.property("Progress");

  property.value() >> parameterProgress;

   qDebug() << parameterProgress.m_Progress;

   qDebug() << parameterProgress.m_Message;

}

...



parameterProgress is delcared in the update.h


I have a last question. Maybe you can answer it. Why have I add the keyword 
"friend" in front of the QDBusArguments? I wount compile without it.


Many thanks.


Kind regards

Michael





Von: RAUC  im Auftrag von Stahl, Michael 

Gesendet: Montag, 2. August 2021 14:45
An: eugen.wi...@jumo.net 
Cc: RAUC@pengutronix.de 
Betreff: Re: [RAUC] Antwort: D-Bus control Qt

Hi Eugen,

thanks for the informations. They were very useful. Some lines are familiar to 
me because I tested a lot.
But I still need some support.

This is the way I request the property:

MyProgress parameterProgress;
QDBusInterface interface( "de.pengutronix.rauc",

"/",

"de.pengutronix.rauc.Installer",

QDBusConnection::systemBus() );

QVariant property = interface.property("Progress");

property.value() >> parameterProgress;


No I get a compiler error:

no match for operator>>'(opernad types are 'QDBusArgument' and 'MyProgress')


I think I do the registration an the installing of the oparators wrong.


The registration is done in the constructor of MyProgress:

MyProgress ::MyProgress(){

qRegisterMetaType();

qDBusRegisterMetaType();

}


The magic statement I place in top of my MyProcess.cpp
// this is one of the magic statements
Q_DECLARE_METATYPE(MyProgress)

But where exactly do you place the operators? Also in the MyProcess.cpp?
QDBusArgument <<(QDBusArgument , const MyProgress& 
parameterProgress);
const QDBusArgument >>(const QDBusArgument , MyProgress& 
parameterProgress);
QDBusArgument <<(QDBusArgument , const MyProgress& 
parameterProgress)
{
argument.beginStructure();
argument << parameterProgress.m_Progress;
argument << parameterProgress.m_Message;
argument << parameterProgress.m_Additional;
argument.endStructure();
return argument;
}
const QDBusArgument >>(const QDBusArgument , MyProgress& 
parameterProgress)
{
argument.beginStructure();
argument >> parameterProgress.m_Progress;
argument >> parameterProgress.m_Message;
argument >> parameterProgress.m_Additional;
argument.endStructure();
return argument;
}

It seems like I am only a few millimeters away from my goal.

Thanks


Von: eugen.wi...@jumo.net 
Gesendet: Montag, 2. August 2021 13:41
An: Stahl, Michael 
Cc: RAUC@pengutronix.de 
Betreff: Antwort: [RAUC] D-Bus control Qt

Hi Michael,

"RAUC"  schrieb am 02.08.2021 08:15:26:

> Von: "Stahl, Michael" 
> An: "RAUC@pengutronix.de" 
> Datum: 02.08.2021 08:15
> Betreff: [RAUC] D-Bus control Qt
> Gesendet von: "RAUC" 
>
> Is there someone who implemented the DBus Property "Progress" into a
> Qt-Application? The problem seems the return value isi (Integer,
> String, Integer).
> For all other properties with a single return value like "Operation"
> or "LastError" the Qt DBus API works fine.
> I found an email from 28.Oct 2019 in the mailing list where Bastian
> Krause had the same issue. The answer was only that he had to
> cunsult the Qt DBus documentation on how a tuple is mapped to Qt types.
>
> Thats a good hint but 

Re: [RAUC] Stumped, have a appfs partition that is encrypted, how to get RAUC to update it

2021-08-02 Thread Jan Lübbe
On Mon, 2021-08-02 at 11:22 -0400, Brian Hutchinson wrote:
> Hi Jan,
> 
> Yes!  Thanks.

Good. :)

> Now my problem is I have a very small 32M NOR flash and I have a 11M SquashFS
> rootfs based off core-image-minimal.  I added packagegroup-luks and it blew 
> size
> up to 47M.  I then just tried to CORE_IMAGE_EXTRA_INSTALL += "cryptsetup" and
> that was still a 35M rootfs so now I'm stumped trying to figure out if it's
> possible to get encryption support in my NOR flash image we boot from :(

This seems to relate more to OE/Yocto, than to rauc, so perhaps #oe/#yocto is a
better place to ask this. :)

I don't remember sizes for cryptsetup right now, but 35MB seems large. The
cryptsetup recipe has many PACKAGECONFIGs, so you might want to limit those to
the ones you actually need.

You can find much more ideas and analysis methods in the docs:
https://docs.yoctoproject.org/singleindex.html#building-a-tiny-system

Regards,
Jan
-- 
Pengutronix e.K.   | |
Steuerwalder Str. 21   | http://www.pengutronix.de/  |
31137 Hildesheim, Germany  | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |


___
RAUC mailing list


[RAUC] Antwort: D-Bus control Qt

2021-08-02 Thread Eugen . Wiens
Hi Michael,

"RAUC"  schrieb am 02.08.2021 08:15:26:

> Von: "Stahl, Michael" 
> An: "RAUC@pengutronix.de" 
> Datum: 02.08.2021 08:15
> Betreff: [RAUC] D-Bus control Qt
> Gesendet von: "RAUC" 
> 
> Is there someone who implemented the DBus Property "Progress" into a
> Qt-Application? The problem seems the return value isi (Integer, 
> String, Integer). 
> For all other properties with a single return value like "Operation"
> or "LastError" the Qt DBus API works fine. 
> I found an email from 28.Oct 2019 in the mailing list where Bastian 
> Krause had the same issue. The answer was only that he had to 
> cunsult the Qt DBus documentation on how a tuple is mapped to Qt types.
> 
> Thats a good hint but after hours of searching the web I didn't find
> a solution. The return value for a property is QVariant in Qt. 
> 
> Trial 1 -> Read value by iface.property("Progress"):
> This is the error message I got when I try to read the progress 
property:
> Cannot construct placeholder type QDBusRawType
> 
> Trial 2 -> Read value by iface.call("Get",...):
> Not able to get any information. The arguments of the returned 
> QDBusMessages are always empty!
That is the way we implemented it:

On Qt there are some pitfalls and you has to marshaling the data.

1. Create a Data Class

#include 
#include 
#include 

class MyProgress
{
public:
[...]
int m_Progress;
QString m_Message;
int m_Additional;
};

// this is one of the magic statements 
Q_DECLARE_METATYPE(MyProgress)
QDBusArgument <<(QDBusArgument , const MyProgress& 
parameterProgress);
const QDBusArgument >>(const QDBusArgument , MyProgress& 
parameterProgress);
};

You has to register the metatype and implement the operators. In the 
Constructor you has to add two register Methods 

qRegisterMetaType();
qDBusRegisterMetaType();

After this tree registrations your Class MyProgress is known by Qt 
Metatype System. Now you has to implement operators

QDBusArgument <<(QDBusArgument , const MyProgress& 
parameterProgress)
{
argument.beginStructure();
argument << parameterProgress.m_Progress;
argument << parameterProgress.m_Message;
argument << parameterProgress.m_Additional;
argument.endStructure();
return argument;
}
const QDBusArgument >>(const QDBusArgument , MyProgress& 
parameterProgress)
{
argument.beginStructure();
argument >> parameterProgress.m_Progress;
argument >> parameterProgress.m_Message;
argument >> parameterProgress.m_Additional;
argument.endStructure();
return argument;
}

Now you are finished with preparing how to use it. In the Qt Slot of the 
D-Bus call your can pipe it in your class

MyProgress parameterProgress;
property.value() >> parameterProgress;


This URL help you to map our code to the Qt example 
https://doc.qt.io/qt-5/qdbusargument.html

I hope it helps 


> 
> ___
> RAUC mailing list

Diese E-Mail kann vertrauliche und/oder rechtlich geschützte Informationen 
beinhalten und ist ausschließlich für die im Verteiler genannten Personen 
bestimmt. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail 
sind nicht gestattet. Bitte benachrichtigen Sie uns gegebenenfalls telefonisch 
oder mit Antwort-Mail, falls Sie nicht der richtige Adressat dieser E-Mail 
sind. Bitte löschen Sie diese Nachricht und alle Anhänge dazu unverzüglich. 
Falls nicht ausdrücklich vermerkt, ist diese E-Mail keine rechtlich bindende 
Vereinbarung. 

Kommanditgesellschaft: JUMO GmbH & Co. KG, Sitz: 36039 Fulda, Amtsgericht Fulda 
HRA 302, Persönlich haftende Gesellschafterin: M. K. JUCHHEIM GmbH, Sitz: 36039 
Fulda, Amtsgericht Fulda HRB 17, Geschäftsführer: Dipl.-Ing. Bernhard Juchheim, 
Dipl.-Kfm. Michael Juchheim, Dipl.-Ing. Dimitrios Charisiadis 
Ust.-Id.-Nr.: DE 112411234 ___
RAUC mailing list


Re: [RAUC] D-Bus control Qt

2021-08-02 Thread Bastian Krause


Hi,

On 8/2/21 8:15 AM, Stahl, Michael wrote:
> Is there someone who implemented the DBus Property "Progress" into a
> Qt-Application? The problem seems the return value isi (Integer, String,
> Integer). 
> For all other properties with a single return value like "Operation" or
> "LastError" the Qt DBus API works fine. 
> I found an email from 28.Oct 2019 in the mailing list where Bastian
> Krause had the same issue. The answer was only that he had to cunsult
> the Qt DBus documentation on how a tuple is mapped to Qt types.

I just answered the mail by Steffen Wolk back then.

> Thats a good hint but after hours of searching the web I didn't find a
> solution. The return value for a property is QVariant in Qt. 
> 
> Trial 1 -> Read value by iface.property("Progress"):
> This is the error message I got when I try to read the progress property:
> Cannot construct placeholder type QDBusRawType
> 
> Trial 2 -> Read value by iface.call("Get",...):
> Not able to get any information. The arguments of the returned
> QDBusMessages are always empty!

I don't have any experience here. Maybe Steffen Wolk (in cc) can share
how his solution looks like?

Regards,
Bastian

-- 
Pengutronix e.K.   | |
Steuerwalder Str. 21   | http://www.pengutronix.de/  |
31137 Hildesheim, Germany  | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
RAUC mailing list


[RAUC] D-Bus control Qt

2021-08-02 Thread Stahl, Michael
Is there someone who implemented the DBus Property "Progress" into a 
Qt-Application? The problem seems the return value isi (Integer, String, 
Integer).
For all other properties with a single return value like "Operation" or 
"LastError" the Qt DBus API works fine.
I found an email from 28.Oct 2019 in the mailing list where Bastian Krause had 
the same issue. The answer was only that he had to cunsult the Qt DBus 
documentation on how a tuple is mapped to Qt types.

Thats a good hint but after hours of searching the web I didn't find a 
solution. The return value for a property is QVariant in Qt.

Trial 1 -> Read value by iface.property("Progress"):
This is the error message I got when I try to read the progress property:
Cannot construct placeholder type QDBusRawType

Trial 2 -> Read value by iface.call("Get",...):
Not able to get any information. The arguments of the returned QDBusMessages 
are always empty!


___
RAUC mailing list