C/C++ Development tools v2


dimag0g

Very Active Member
Joined
Jan 12, 2011
Messages
608
Location
Strasbourg, France
Hello all,

 

This is a thread about the current developments in cdevtools package (aka cdevtools v2). The package is now distributed as an update to the origial cdevtools package released by freamon. The thread about the older versions of the package is here.

 

The killer feature of cdevtools is the ability to automatically download kernel sources and build a working kernel.

 

I started to work on this PND when I realized that the original cdevtools was not supported anymore. This was also an opportuniny to impose some strict guidelines which I intend to follow in the future versions:

 

- it is supposed to include dev packages for all* libraries included in the firmware. The versions of these dev packages should correspond to the up to date firmware versions of the libraries.

- it is supposed to include all* command-line development tools for C/C++. These tools should be updated to the recent versions, not necessarily corresponding to packages in openpandora feed.

- no extra libraries should be included in the PND, unless they are required by included development tools or otherwise absolutely necessary.

(by all* I mean all libs/tools which are actually useful to someone. I will be willing to add them on request in the future versions, unless they create problems. I also might remove some of the libs/tools if noone seems to use them, or if they break the toolchain).

 

Of course, you will need to include additionnal libraries for projects you will build with cdevtools. There are two choices as for how to proceed:

 

1. add library packages from the feeds


Code:
$ addipk libzizi-dev
libzizi-dev depends on libzizi2
$ addipk libzizi2

(addipk will not install dependencies automatically, but will inform you about any missing dependencies, which you should in turn install with addipk. By default, openpandora base feed and angstrom base feed are used, you can add more feeds via appdata/cdevtools/etc/opkg/*.conf files)

 

2. build the library from soucrces



Code:
$ wget http://zizihost.org/releases/libzizi-src-2.0.tar.gz
$ tar zxf libzizi-src-2.0.tar.gz
$ cd libzizi-src-2.0
$ ./configure --prefix=$CDEVROOT/usr
$ make && make install


(at this point, you should have all the files in the right places, and the library should be available to the toolchain without any further tweaks)

If make install fails with error "Cannot chmod directory: operation not permitted", you can try to install directly in the appdata folder:


Code:
$ cd libzizi-src-2.0
$ ./configure --prefix=$APPDATADIR/usr
$ make && make install

(at this point you must close and reopen the PND so that new files become visible at PND mountpoint)

 

Running


Code:
$ cd $CDEVROOT/setup
$ ./get-docs.sh
$ ./index-docs.sh

will install documentation in form of man and texinfo pages, so you will have something to read when you need a break from coding. You should be able to find information on a topic with "man topic", or by typing "info" pressing "m" and typing the topic name. Searching by keyword would be "man -k keyword" or "info -k keyword". More sophisticated natures could try "apropos keyword", while straightforward types would just ask "whatis keyword".

 

The PND contains all the scripts which I used to produce this package. In case you want to build your own toolchain, you might want to extract the setup folder in an empty root folder and run get-libs.sh, get-tools.sh and pack-pnd.sh. This should produce a more or less working PND in the setup. The toolchain will still need some intervention (mostly installing missing or newer tools like automake or man) to work correctly, but at least you start with something.

 

By carefully selecting the dev packages you need, you could actually be able to make a small enough PND to fit into the firmware (in the /pandora directory), the advantage over the root install being the compression and reduced chances to screw up with dependencies to the point when you will need a reflash.

 

Comments, suggestions and bug reports are welcome. Download link is at the top in case you overlooked it.
 
Last edited by a moderator:
Thans! I like the included documentation. But there seem to be some packaging problems. I tried some tools at random and man is missing libmandb, svn is missing libsvnclient and wish is version 8.5 while only libtk8.4 is included (whic is also in the firmware).
 
Thanks for checking that out! I have paid attention to keep the firmware intact, however, some programs seem to somehow use libraries outside the PND (probably via rpath).

Tcl/Tk is not really a development tool, maybe I'll drop it for the time being...
 
I like to use 'git gui' and gitk, so it would make me happy if Tcl/Tk were working, but you are right, it's not essential:)
 
Hi, I didn't test it yet, but thanks for your work!

Do you know, whether git pull does work now?
 
Do you know, whether git pull does work now?
I don't know, actually. Could you check it? I plan to package latest svn and git versions (built from sources) in the PND if this is necessary.
 
Last edited by a moderator:
I have updated the PND:

- tcl and tk are back to version 8.4

- apropos and whatis should work now

Please report if you still have troubles with man, as I'm unable to reproduce them
 
I have added boost to the PND. I know it's one hell of a load, but we have boost packages in the firmware, so it has every right to be in the PND.
 
All right, I have updated the packages in the PND, which comes in two flavors this time: lite (without boost and man/info pages) and full. Download links are on top of the page.

Hopefully there are not too many quirks, and by next weekend I plan to push one of the PNDs on the repo. I plan to put the light version in, and provide a link to full PND in the description. If you feel the full version belongs to the repo, I'm open to suggestions.

PS. Compiling kernel with it.
 
Last edited by a moderator:
Getting the documentation (requires Internet connection):


cd $CDEVROOT/setup
./isnt-docs.sh
./index-docs.sh

Getting the boost library files (requires Internet connection):


$CDEVROOT/setup/get-boost.sh
# or
addipk boost-dev

Upgrading to the latest packages (useful after upgrading Pandora OS, requires Internet connection):


$CDEVROOT/setup/upgrade-ipk.sh

Getting a working kernel requires several hours of time, a stable and fast Internet connection, about 3 GB of free space on your SD card, about 30 MB of free NAND and root permissions to install. Think about plugging your pandora to a power source as well, even if a fully charged battery seems sufficient to complete the task.


cd $CDEVROOT/setup
./get-kernel.sh && ./build-kernel.sh
#at this point it is wise go to bed, and the next day if you're lucky:
sudo ./inst-kernel.sh

A few notes regarding kernel scripts:

  • get-kernel.sh has a limited capability to recover from disconnects while cloning the git repo. It will pause for 90 seconds and retry if git fails to complete the current operation. However, on a second failure it will stop, and you will have to rerun it again. If that doesn't help and you you can't figure out what to do in order to recover, you will have to remove appdata/cdevtools/pandora-* directories and retry from the start.
  • the installation will require free space on /boot partition and you probably don't have any. So the old 2.6 kernel will be removed by inst-kernel.sh during the installation.
  • once you're running your custom kernel, you can build and load custom modules for it. The usual make command for these modules will be:
Code:
make ARCH=arm KERN_DIR=$APPDATADIR/pandora-kernel
insmod ./driver.ko
  • the kernel is built with support for SGX drivers v. 4.03.xx only. AFAIK those are the drivers installed in the firmware by default. Installing any other drivers, including the default 4.00.xx, will break all 3D applications. You can use SGX driver installer to get the right drivers installed.
  • you can customize your kernel before the build, but I strongly suggest to build the default kernel (with build-kernel.sh) and try it (with inst-kernel.sh) first. To change kernel config, you should use menuconfig:
Code:
cd $APPDATADIR/pandora-kernel
make menuconfig
# Make your changes and save.
$CDEVROOT/setup/build-kernel.sh
sudo $CDEVROOT/setup/inst-kernel.sh
  • menuconfig requres the terminal to have at least 80 characters per line. You may have to resize your terminal or set a smaller font size before you can run it.
  • to boot into the new kernel, use the boot menu (i.e. hold pandora key + right shoulder button during a restart)
 
Last edited by a moderator:
- no extra libraries should be included in the PND, unless they are required by included development tools or otherwise absolutely necessary.
(by all* I mean all libs/tools which are actually useful to someone. I will be willing to add them on request in the future versions, unless they create problems. I also might remove some of the libs/tools if noone seems to use them, or if they break the toolchain).
Great! The Code::Blocks PND includes way too much ballast by now and is getting increasingly unwieldy...
 
Because I want a "yes, it works" before I release. One of the older versions of inst-kernel.sh completely wrecked the /lib/modules on my system. I didn't have to reflash because I have a firmware tarball on my SD card, but how many users do?
 
PS. Just tried to download the file myself, and I must admit I didn't realize how crappy joinfile has become. I'm going to put my PND to the repo today.

EDIT: Done.
 
Last edited by a moderator:
I didn't try to actually do anything with your PND yet... But just from downloading the package - when both the old cdevtools and cdevtools2 are installed, it's not easily possible to find out which one I'm going to run, as your menu entry doesn't contain anything about "v2". Personally, I'd also prefer if cdevtools2 would use an own appdata directory - I don't think there's any rules about that, but using the same name for a PND file and it's appdata directory make things a lot less confusing when cleaning up files... Same thing with the squashfs mountpoint (though I have no idea why the old cdevtools used /mnt/utmp/cdevtools1000)...

[edit] ah, ok, I see the cdevtools appdata path is hardcoded into quite a few of the scripts, so there's some additional work required to change that...
 
Last edited by a moderator:
Well, my intention was to replace the original cdevtools PND. Unfortunately, I haven't been added to the maintainers (yet?), so I cannot release a proper update. Cdevtools v2 is also designed to take over the original cdevtools appdata.

What is the reason for you to keep the original cdevtools? I would be happy to add the missing functionality, if the effort required is reasonable.
 
I just had it still around on the devtools SD card (don't think I used it since the one time I failed at trying to port Mulberry...).

Didn't understand that you are trying to actually update/replace the original cdevtools package in-place - in that case everything is fine as is :)
 
I wanted to contribute to the glory of cdevtools :) but as the original autor seemed to be gone, I decided to call it cdevtools v2 and release as new.
 
Last edited by a moderator:
I finally did find time to test this.

I tried to recompile sylpheed for the new firmware, but ./configure failed with the error:

Code:
checking for GTK+ - version >= 2.8.0... no
*** Could not run GTK+ test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means GTK+ is incorrectly installed.
configure: error: Test for Gtk failed. See the 'INSTALL' for help.

Furthermore git pull still doesn't work.

Thanks for your work!

Greetings,
Ziz
 
Back
Top