Tips for all developers using the CVS - UkCvs.org
 

Go Back   UkCvs.org > Digital Tv Box Section > Dbox Section > Dbox Tuts

Dbox Tuts If your Stuck Unregistered TRY here first!

Reply
 
LinkBack Thread Tools Display Modes
Old 04-01-2009, 12:00 AM   #1 (permalink)
Developer
UkCvs Senior Member
 
Speedy2206's Avatar
 
Join Date: Nov 2008
1 Highscore

Location: Leatherhead
Posts: 188
iTrader: (0)
Casino cash: $64049
Thanks: 80
Thanked 257 Times in 112 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Groans: 1
Groaned at 0 Times in 0 Posts
Default Tips for all developers using the CVS

I just wanted to make sure everyone knew about a few tips and tricks with the CVS, in regards to making changes and compiling.

Some people are under the impression that to make changes once a compile has failed you have to start again, which can take several hours. Why do this to yourself, when the build was only 10 minutes away from completion??

A few shortcuts that I know of:

ONCE YOU HAVE COMPILED AN IMAGE, YOU CAN STILL MAKE CHANGES AND COMPILE THOSE WITHOUT HAVING TO START FROM SCRATCH

SIMPLY ADD --enable-maintainer-mode TO THE END OF YOUR CONFIGURE COMMAND



Examples:
If you want to add code (maybe for testing, or as a last minute extra feature that you forgot to include) to the:

Linux Kernel
Code:
rm .deps/linuxkernel or rm .deps/linuxdir
make linuxkernel
make flash-neutrino-jffs2-all
Neutrino Binary
Code:
rm .deps/neutrino
rm ../apps/tuxbox/neutrino/src/.libs/neutrino
at this point if you want to add a new menu for example, modify MAKEFILE.AM to include the new .cpp file, and write the code.
make neutrino
make flash-neutrino-jffs2-all
Zapit Binary
Code:
rm .deps/zapit
rm ../apps/dvb/zapit/src/.libs/zapit
make any changes to ZAPIT at this point
make zapit
make flash-neutrino-jffs2-all
You can also do this for Enigma or any other plugin, etc. Each folder usually contains a .libs subdirectory which houses the main binary file for that component. Simply deleting it will force the environment to compile it again, including any changes you've made.

-----------------------------------------------------------------------------------------------

My personal way of making quick changes to neutrino without having to start from scratch or flash a new image.

For this technique you will need a Neutrino image already on your DBOX. Also you will need to add the path to your compiler.

Lets say you downloaded the CVS to /home/me/myimage. If your configure line was ./configure --prefix=/home/me/myimage/output --with-cvsdir=/home/me/myimage then I would write the following

Code:
export PATH="$PATH:/home/me/myimage/output/cdk/bin"
(this only has to be done once per session).
Basically you take the path from the --prefix part of the configure line, and add /cdk/bin to the end of it.

This basically just gives us quick access to the compiler and strip functions.

OK, moving on from that.

Lets say I built neutrino once, and that image is flashed on my DBOX already. But I want to add something else to the neutrino binary without starting again.

I would do:
Code:
cd ../apps/tuxbox/neutrino/src
... at this point I would make any changes to the source code, including Makefile.am (you should never adjust Makefile itself, Makefile.am will rebuild Makefile correctly if it detects changes)
rm .libs/neutrino
make
cd .libs
powerpc-tuxbox-linux-gnu-strip neutrino
cp neutrino /home/me
Afterwards I will find a neutrino file in my home directory, which I can FTP onto my DBOX. On the DBOX itself, I can telnet to quickly see the changes:

Code:
killall -9 start_neutrino
killall -9 neutrino
chmod 755 /tmp/neutrino
/tmp/neutrino &
...keep the telnet window open... closing it will kill /tmp/neutrino!...
To sum up...

If the original image I made was great, but was missing the (for example) Zapit Config menu that renwich has just completed. I could add that by modifying /home/me/myimage/apps/tuxbox/neutrino/src/gui/Makefile.am to include my zapitconf.cpp file. I could then copy the zapitconf.cpp and zapitconf.h files into the gui directory, and add a link to that menu within neutrino_menu.cpp.

I then run the make command again, which detects and compiles my changes, and gives me a neutrino binary file (in src/.libs) which I can FTP to my DBOX2 to see my new changes. I move the neutrino file to /home/me because any folder with a . before it is hidden by default, and putting it in my home directory also gives me quick and easy access to it.


Voila!
Hope that helps somebody

Any other tips to speed things up to prevent you having to do a whole re-compile from scratch just ask me and I'll probably have the answer. For each image I do I probably only download the CVS once, patch and modify as much as I like, then flash to box to test. If it all works I take the raw neutrino-jffs2.img2x and upload it here.

But lets just say that my image would have probably been flashed only once on my DBOX and then individual binary files FTP'd to it later for testing


- Speedy
Speedy2206 is offline   Reply With Quote
The Following 5 Users Say Thank You to Speedy2206 For This Useful Post:
Derekwd (05-01-2009), FreddyFr0g (06-01-2009), PaphosAL (04-01-2009), renwich (04-01-2009), Tyke (06-03-2009)
Old 04-01-2009, 12:03 AM   #2 (permalink)
Developer
UkCvs Senior Member
 
Speedy2206's Avatar
 
Join Date: Nov 2008
1 Highscore

Location: Leatherhead
Posts: 188
iTrader: (0)
Casino cash: $64049
Thanks: 80
Thanked 257 Times in 112 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Groans: 1
Groaned at 0 Times in 0 Posts
Default
Also if you make alot of command-line programs like I do (makefta for example), by doing the following trick.....

Code:
export PATH="$PATH:/home/me/myimage/output/cdk/bin"
.....you can also quickly compile your program from anywhere, even outside of the cvs tree.

Simply type (for example):

Code:
powerpc-tuxbox-linux-gnu-g++ makefta.c -o makefta
powerpc-tuxbox-linux-gnu-strip makefta
And your binary file is ready to be used on the DBOX2 - all you need to do is FTP it and CHMOD 755. Done.
Speedy2206 is offline   Reply With Quote
The Following User Says Thank You to Speedy2206 For This Useful Post:
renwich (04-01-2009)
Old 04-01-2009, 12:07 AM   #3 (permalink)
Developer
UkCvs Senior Member
 
Speedy2206's Avatar
 
Join Date: Nov 2008
1 Highscore

Location: Leatherhead
Posts: 188
iTrader: (0)
Casino cash: $64049
Thanks: 80
Thanked 257 Times in 112 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Groans: 1
Groaned at 0 Times in 0 Posts
Default
Similarly I talked about shrinking files (see here: http://www.ukcvs.org/Forums/showthread.php?t=12379)

To achieve those results I done the following.
Anyone can do this if they have a linux box and have previously compiled a whole image. Even if the image is old and you have made new directories containing more up-to-date CVS trees, you can still use this trick.

Simply grab a file out of an existing image that you want to shrink (I would suggest trying /lib/modules/2.4.36.6/fs/cifs/cifs.o as a starting point), copy it to your linux machine (I chose a folder called /home/me/shrink), and type:

Code:
export PATH="$PATH:/home/me/myimage/output/cdk/bin"
cd /home/me/shrink
powerpc-tuxbox-linux-gnu-strip cifs.o
Afterwards look at the file size. Shrink, if it has any effect on the file you are trying it with, will usually halve the size of a file with no memory impact.
Speedy2206 is offline   Reply With Quote
The Following User Says Thank You to Speedy2206 For This Useful Post:
renwich (04-01-2009)
Old 04-01-2009, 12:09 AM   #4 (permalink)
Developer
UkCvs Senior Member
 
Speedy2206's Avatar
 
Join Date: Nov 2008
1 Highscore

Location: Leatherhead
Posts: 188
iTrader: (0)
Casino cash: $64049
Thanks: 80
Thanked 257 Times in 112 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Groans: 1
Groaned at 0 Times in 0 Posts
Default
And finally, if you find that you're using this trick alot (like me), it might be worth copying the files to a seperate directory, for example:

Code:
mkdir /home/me/dbox2compile
cd /home/me/myimage/output/cdk/bin
cp -r * /home/me/dbox2compile
Your export line will then look like this:

Code:
export PATH="$PATH:/home/me/myimage/dbox2compile"
After that you can delete ALL CVS trees from your computer and still have the compiler and strip functions ready for use.

Remember, the EXPORT line only needs to be typed once per session. So unless you shut down or reboot your machine, you should only type it once.
Speedy2206 is offline   Reply With Quote
The Following User Says Thank You to Speedy2206 For This Useful Post:
renwich (04-01-2009)
Old 04-01-2009, 08:07 AM   #5 (permalink)
Moderator
UkCvs Senior Member
 
pt-1's Avatar
 
Join Date: Sep 2008

Posts: 350
iTrader: (0)
Casino cash: $146980
Thanks: 105
Thanked 379 Times in 171 Posts
Nominated 10 Times in 3 Posts
Nominated TOTW/F/M Award(s): 2
Groans: 0
Groaned at 0 Times in 0 Posts
Default
Quote:
Originally Posted by Speedy2206 View Post
Similarly I talked about shrinking files (see here: http://www.ukcvs.org/Forums/showthread.php?t=12379)

To achieve those results I done the following.
Anyone can do this if they have a linux box and have previously compiled a whole image. Even if the image is old and you have made new directories containing more up-to-date CVS trees, you can still use this trick.

Simply grab a file out of an existing image that you want to shrink (I would suggest trying /lib/modules/2.4.36.6/fs/cifs/cifs.o as a starting point), copy it to your linux machine (I chose a folder called /home/me/shrink), and type:

Code:
export PATH="$PATH:/home/me/myimage/output/cdk/bin"
cd /home/me/shrink
powerpc-tuxbox-linux-gnu-strip cifs.o
Afterwards look at the file size. Shrink, if it has any effect on the file you are trying it with, will usually halve the size of a file with no memory impact.
Sorry to highjack this but a user has reported problems with scanning/epg after he used shrink on the sectionsd so not every binary can be shrinked !
pt-1 is offline   Reply With Quote
Old 04-01-2009, 10:52 AM   #6 (permalink)
Nagging Old Git
Team-UkCvs Senior Member
 
PaphosAL's Avatar
 
Join Date: Aug 2008

Location: A park bench, near you
Age: 75
Posts: 3,108
iTrader: (0)
Casino cash: $848260
Thanks: 2,645
Thanked 1,586 Times in 876 Posts
Nominated 2 Times in 2 Posts
Nominated TOTW/F/M Award(s): 2
Groans: 1
Groaned at 0 Times in 0 Posts
Default
Quote:
Originally Posted by pt-1 View Post
Sorry to highjack this but a user has reported problems with scanning/epg after he used shrink on the sectionsd so not every binary can be shrinked !
T-C have got FreddyFrog's sectionsd down to 115kb now, pt-1, working 100% fine and no useage of /tmp whatsoever, m8!

Cheers- AL

Should have added- this was not with shrink!

Last edited by PaphosAL; 04-01-2009 at 04:24 PM.. Reason: forgot something
PaphosAL is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 12:58 AM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Any information provided on this site is not guaranteed in any way. Some articles may discuss topics that are illegal, so this information is provided for educational purposes only, use at your own risk !! Ukcvs.org cannot be held responsible for the content of any post on this forum.