Jump to content


Photo

BitBake - how to rebuild only enigma2 binary at development time


  • Please log in to reply
18 replies to this topic

#1 samsamsam

  • Senior Member
  • 2,024 posts

+146
Excellent

Posted 27 December 2016 - 22:26

Hello,

 

I am not familiar with BitBake build system.
What command should I type to rebuild only enigma2 when I change something in cpp code and I builded full image before?
 
Thank you very much for any help.
 
Regards,
SSS


Re: BitBake - how to rebuild only enigma2 binary at development time #2 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 27 December 2016 - 22:33

Try those:
 
cd build
source env.source
MACHINE=xxx bitbake enigma2

Edited by athoik, 27 December 2016 - 22:33.

Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: BitBake - how to rebuild only enigma2 binary at development time #3 betacentauri

  • PLi® Core member
  • 7,185 posts

+323
Excellent

Posted 27 December 2016 - 22:34

If you use enigma2.bbappend and have added a new patch or you have added patch to enigma2.bb you can do this:
cd <build env>/build
MACHINE=vusolo2 or whatever you use
source env.source
bitbake enigma2
Enigma2 ipk is stored in the deploy/ipk folders.

If you have local enigma2 git copy then first 3 commands are the same. Then
bitbake -f -c compile -b <path to e2 git copy>/enigma2.bb
Then you can find enigma2 binary in the e2 git copy directory.

If you use 2 way to build the binary and also an OpenPli 5 environment, then make an backup of your changes before starting the build. Pli5 deletes the local e2 copy when you try to build it the first time.

Edited by betacentauri, 27 December 2016 - 22:36.

Xtrend ET-9200, ET-8000, ET-10000, OpenPliPC on Ubuntu 12.04

Re: BitBake - how to rebuild only enigma2 binary at development time #4 Taapat

  • PLi® Core member
  • 2,345 posts

+121
Excellent

Posted 27 December 2016 - 23:19

I personally have not found a way how to rebuild enigma after the changes in cpp code.
 
Therefore, I usually do that:
cd build
source env.source
MACHINE=vusolo2 bitbake -b ../meta-openpli/recipes-openpli/enigma2/enigma2.bb -c patch

Make the necessary changes.

MACHINE=vusolo2 bitbake enigma2 -c package_write_ipk

It creates a package but no delete enigma2 source codes.

This allows my test result and keep my changes before launch of a new enigma2 build.
For new build without git update I use the command:
MACHINE=vusolo2 bitbake -b ../meta-openpli/recipes-openpli/enigma2/enigma2.bb -c cleansstate && MACHINE=vusolo2 bitbake -b ../meta-openpli/recipes-openpli/enigma2/enigma2.bb -c patch

Edited by Taapat, 27 December 2016 - 23:20.


Re: BitBake - how to rebuild only enigma2 binary at development time #5 Taapat

  • PLi® Core member
  • 2,345 posts

+121
Excellent

Posted 27 December 2016 - 23:31

Enigma source codes you can find in: build/tmp/work/vusolo2-oe-linux/enigma2/2.7+gitAUTOINC+..../git
For another receiver, of course, it will be in a folder with another receiver's name.


Re: BitBake - how to rebuild only enigma2 binary at development time #6 samsamsam

  • Senior Member
  • 2,024 posts

+146
Excellent

Posted 27 December 2016 - 23:32

Thank you very much for all your helps.

I will try and let you know.

 

Thank you all again.



Re: BitBake - how to rebuild only enigma2 binary at development time #7 samsamsam

  • Senior Member
  • 2,024 posts

+146
Excellent

Posted 28 December 2016 - 12:54

To be honest, with BitBake  I feel like small child.

 

Where enigma2 binary is located after build?

 

Thank you very much.



Re: BitBake - how to rebuild only enigma2 binary at development time #8 joeuser

  • Member
  • 9 posts

+1
Neutral

Posted 28 December 2016 - 13:15

You can try:

find . -name enigma2 -type f -exec ls -al {} \;


Re: BitBake - how to rebuild only enigma2 binary at development time #9 samsamsam

  • Senior Member
  • 2,024 posts

+146
Excellent

Posted 28 December 2016 - 13:34

I search like this before but I do not find anything.
This is a reason why I am asking about such simple thing,
 
I need make only change in several cpp files and rebuilg to test if my hypothetical workaround will fix the problem with bad working remote controler in with MB Micro.
I do not know how many time I will spent on such simple thing.


Re: BitBake - how to rebuild only enigma2 binary at development time #10 betacentauri

  • PLi® Core member
  • 7,185 posts

+323
Excellent

Posted 28 December 2016 - 13:47

Which method did you use to build e2? I have posted 2.


Xtrend ET-9200, ET-8000, ET-10000, OpenPliPC on Ubuntu 12.04

Re: BitBake - how to rebuild only enigma2 binary at development time #11 joeuser

  • Member
  • 9 posts

+1
Neutral

Posted 28 December 2016 - 13:50

If you use Taapat's advice and build the ipk, it is in

build/tmp/deploy/ipk/MACHINE

try:

find . -name 'enigma2_*.ipk' -type f -exec ls -al {} \;


Re: BitBake - how to rebuild only enigma2 binary at development time #12 samsamsam

  • Senior Member
  • 2,024 posts

+146
Excellent

Posted 28 December 2016 - 13:59

At first I build new image without my changes.

 

I did this as follow:

git clone https://github.com/OpenPLi/openpli-oe-core.git
cd openpli-oe-core
MACHINE=mbmicro make
MACHINE=mbmicro make image

Edited by samsamsam, 28 December 2016 - 14:00.


Re: BitBake - how to rebuild only enigma2 binary at development time #13 Taapat

  • PLi® Core member
  • 2,345 posts

+121
Excellent

Posted 28 December 2016 - 14:17

As already joeuser writes, after this enigma ipk files without your changes, you can find in: <openpli-oe-core/>build/tmp/deploy/ipk/mbmicro.
 
What method do you use to apply your changes after image building?
If you use my, first you need to use cleansstate, to clean previous enigma building (as I've pointed for a new enigma2 build at the end of my post).


Re: BitBake - how to rebuild only enigma2 binary at development time #14 samsamsam

  • Senior Member
  • 2,024 posts

+146
Excellent

Posted 28 December 2016 - 14:22

So, I should use this command:

MACHINE=mbmicro bitbake -b ../meta-openpli/recipes-openpli/enigma2/enigma2.bb -c cleansstate && MACHINE=mbmicro bitbake -b ../meta-openpli/recipes-openpli/enigma2/enigma2.bb -c patch

?

 

I need to prepare patch file and put it somewhere or simple directly modify cpp files?


Edited by samsamsam, 28 December 2016 - 14:26.


Re: BitBake - how to rebuild only enigma2 binary at development time #15 Taapat

  • PLi® Core member
  • 2,345 posts

+121
Excellent

Posted 28 December 2016 - 14:45

If you use my method then yes, use:
cd build
source env.source
MACHINE=mbmicro bitbake -b ../meta-openpli/recipes-openpli/enigma2/enigma2.bb -c cleansstate && MACHINE=mbmicro bitbake -b ../meta-openpli/recipes-openpli/enigma2/enigma2.bb -c patch
After that go to enigma source codes in folder: <openpli-oe-core/>build/tmp/work/mbmicro-oe-linux/enigma2/2.7+gitAUTOINC+..../git
and make your changes (simple directly modify cpp files).
 
After that:
MACHINE=mbmicro bitbake enigma2 -c package_write_ipk
And in folder <openpli-oe-core/>build/tmp/deploy/ipk/mbmicro you will find enigma ipk files with your changes.

Edited by Taapat, 28 December 2016 - 14:53.


Re: BitBake - how to rebuild only enigma2 binary at development time #16 Taapat

  • PLi® Core member
  • 2,345 posts

+121
Excellent

Posted 28 December 2016 - 14:49

Sorry, I changed my previous post...


Edited by Taapat, 28 December 2016 - 14:51.


Re: BitBake - how to rebuild only enigma2 binary at development time #17 Taapat

  • PLi® Core member
  • 2,345 posts

+121
Excellent

Posted 28 December 2016 - 14:59

And I had not thought about it, but obviously the MACHINE=mbmicro can be set only once, as indicated by betacentauri.



Re: BitBake - how to rebuild only enigma2 binary at development time #18 Erik Slagter

  • PLi® Core member
  • 46,969 posts

+542
Excellent

Posted 28 December 2016 - 15:04

When developing enigma2, you'd actually want your own develop directory (= enigma git repo clone), have a makefile there and simply type make to build a new binary. It IS possible but it's difficult. I have a script to do that, but I need to make adjustments every now and then, when OE changes "something".


* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.


Re: BitBake - how to rebuild only enigma2 binary at development time #19 samsamsam

  • Senior Member
  • 2,024 posts

+146
Excellent

Posted 29 December 2016 - 01:47

In case of development bitbake is not good solution as I can see, but, anyway.

 

Thank you very much for your help.

 

With provied information I was able to test my workaround for remote control driver in MBMicro.

With this workaround remote control works much better (not perfect) but much more better.

 

Let me describe the issue about which I wrote.

 

When we press very fast, for example "OK" button three times, from driver we will get events as follow:

     * PRESSED
     * REPEAT
     * REPEAT
     * RELASED
 
The valid sequence of events for this sample should be:
     * PRESSED
     * RELEASED
     * PRESSED
     * RELEASED
     * PRESSED
     * RELEASED
 
If widget reacts same for both PRESSED and REPEAT events (for example channel list) it is not big problem, but if  widget reacts only on PRESSED event (for example Virtual Keyboard) it make it almost unusable.
 
My workaround is based on heuristics using input_event timestamp to replace some REPEAT event by pair RELEASED, PRESSED.
 
If you interested with source code changes (lib\driver\rcinput.h and rcinput.cpp):

void eRCDeviceInputDev::handleCode(long rccode)
{
struct input_event *ev = (struct input_event *)rccode;
 
...
 
#if 0 // @sss
switch (ev->value)
{
case 0:
input->keyPressed(eRCKey(this, ev->code, eRCKey::flagBreak)); /*emit*/
break;
case 1:
input->keyPressed(eRCKey(this, ev->code, 0)); /*emit*/
break;
case 2:
input->keyPressed(eRCKey(this, ev->code, eRCKey::flagRepeat)); /*emit*/
break;
}
#else // @sss start
    /* This is workaround for problem with MBMicro remote control driver 
     * When we press very fast, for example "OK" button three times, 
     * from driver we will get events as follow:
     * PRESSED
     * REPEAT
     * REPEAT
     * RELASED
     *
     * The valid sequence of events for this sample should be:
     * PRESSED
     * RELEASED
     * PRESSED
     * RELEASED
     * PRESSED
     * RELEASED
     *
     * This workaround try to correct event sequence based on timestamp heuristics.
     * This workaround can works as expected only when repeat repeat will be set to 100 and repeat delay to 10.
     * with such setting emulate repeat delay will be forced to ~500.
     */
    {
        uint64_t timestamp = (ev->time.tv_sec * (uint64_t)1000) + (ev->time.tv_usec / 1000);
        
        switch (ev->value)
        {
        case 0:
            /* release */
            input->keyPressed(eRCKey(this, ev->code, eRCKey::flagBreak)); /*emit*/
            prevTimestamp = 0;
            break;
        case 1:
            /* pressed */
            input->keyPressed(eRCKey(this, ev->code, 0)); /*emit*/
            
            lastPressedTimestamp = timestamp;
            prevTimestamp = timestamp;
            firsRepeatAfterKeyPressed = true;
            break;
        case 2:
            {
            /* repeat */
            uint64_t diff = timestamp - prevTimestamp;
            if ((firsRepeatAfterKeyPressed && diff <= 172) || (!firsRepeatAfterKeyPressed && diff <= 152))
            {
                if ((timestamp - lastPressedTimestamp) >= 500) // repeat delay 500
                {
                    /* real repeat */
                    input->keyPressed(eRCKey(this, ev->code, eRCKey::flagRepeat)); /*emit*/
                }
                /*
                else
                {
                    // skip, repeat too early
                }
                */
            }
            else
            {
                // we will take this repeat as key pressed
                
                /* fake release */
                input->keyPressed(eRCKey(this, ev->code, eRCKey::flagBreak)); /*emit*/
                
                /* fake pressed */
                input->keyPressed(eRCKey(this, ev->code, 0)); /*emit*/
                
                lastPressedTimestamp = timestamp;
            }
            firsRepeatAfterKeyPressed = false;
            
            }
            break;
        default:
            break;
        }
        
        prevTimestamp = timestamp;
    }
#endif // @sss end
}



15 user(s) are reading this topic

0 members, 15 guests, 0 anonymous users