Pandora Simple Dev Pnd


Joined
May 17, 2010
Messages
2,198
Location
:|
Stuckie said:
Yea, we're armel... dependency tracking is hell... but, I've come up with something funky ;)

You might need to wait till I get back from work, unless it finishes in the next hour.. suffice to say, I think you'll like it!

Sounds tantalising!
 
Last edited by a moderator:

MistaGiggles

Still Fresh
Joined
May 12, 2009
Messages
38
Just got the 20thjune extend mounted, and I've written a quick hello world program. Which compiler do I use to compile it? (very new to command line compiling, only ever used IDEs) I tried "gcc main.cpp" but it's giving me 'undefined reference' errors.

Thanks
 

Stuckie

Member
Joined
Apr 7, 2004
Messages
492
Age
35
Location
Tired, and sleeping in the basement...
Website
www.stuckieworld.net
undefined reference to what?

it should work fine.. gcc and g++ is there ( for .cpp you probably should be using g++ anyway ) and headers for SDL and a bunch of other things.
so yea, tell us what the undefined reference is :) could be you forgot something silly like an include! or I've buggered something up viciously :D
 

Creature XL

Active Member
Joined
Jun 12, 2004
Messages
563
Age
44
Location
Hannover.de
Website
Visit site
Stuckie said:
Unfortunately not, as you're mounting to places which are generally being written to or used at that point in time ( you can check this by running "lsof /your/path" and you'll get a list of things accessing that path. )

You can sometimes get away with unmounting the /home bind, but you'd need to do it in a script that forces a sudo password, as if it's still in the cache, it tries to unmount too quick while the filesystem is writing the command that you've called the script to your bash_history! Fun, isn't it? ;)

What about "sudo -i" ?
Then you are root and your home (and the bash_history) should be in /root/.bash_history
 
Last edited by a moderator:

daniel3000

Still Fresh
Joined
Mar 20, 2009
Messages
89
hi Stuckie and others,

thanks for this great onboard developer toolchain package!
I am kind of a beginner (not with onboard development. Have done this on the Zaurus / pdaXrom and weeXpc for years. But on the Pandora and working the first time with those FS extend files...)

Question:
whenever I extend the root fs with dev.extend, all write operations to root go into the extend, not to NAND, right?
Is there a way to change this WHILE the extend is active?
Or have I misunderstood something about all this?

My problem:
When I have extended the root FS and compile something and find out that headers are missing, I want to install those headers using
sudo opkg install XYZ-dev
But opkg is disturbed by the extend and gives a lot of warnings, and it seems to install a lot of packages which it shouldn't install.
When I reboot, the installed packages are not in NAND.
So it seems to be necesssary, whenever I stumble across some headers missing, to reboot the Pandora, then install the headers / libs, then load the extend file again and retry the compilation. Quite clumsy process. Is there a way around this?

Thanks in advance,
Daniel
 

Stuckie

Member
Joined
Apr 7, 2004
Messages
492
Age
35
Location
Tired, and sleeping in the basement...
Website
www.stuckieworld.net
Yea, the extend acts as an Overlay so it "protects" your NAND from being written to, and all writes go to the extend file instead.
Not sure why opkg gives warnings and things.. it might be boost, as I remember hotfix 2 had something odd about opkg's boost.. it wasn't quite installed properly, so I reinstalled it within the extend and it was fine.

The purpose of these extends though, is to protect your NAND, really..

What's opkg complaining about anyway?
 

bompo

Still Fresh
Joined
Jul 19, 2010
Messages
10
Can't start a pnd file from sd card if I use the new extendUtilis (25 July) to mount a dev extend.
This worked before with the an older version of extendUtilis (pre GUI Version). Anyone knows why?
 

Stuckie

Member
Joined
Apr 7, 2004
Messages
492
Age
35
Location
Tired, and sleeping in the basement...
Website
www.stuckieworld.net
Post your premount script, as I may have been over zealous in binding directories and missed something.
Also, when you try to run a pnd and it fails, post the output of "dmesg | tail" please, so I can track it down and fix it :)
Finally, what version of Extend Utils? The "GUI" will tell you the version number in the window header ( 1.0a, 1.0b, 1.1 are out, if I remember correctly )
 

bompo

Still Fresh
Joined
Jul 19, 2010
Messages
10
dev.premount created with v1.1:
Code:
# We're adding this because sometimes /usr/local doesn't exist... and stuff DOES end up in here, so we need to create it to protect it
gksudo "mkdir -p /usr/local"

mkdir /tmp/dev.extend
gksudo "mount -o loop /media/mmcblk0p1/dev/dev.extend /tmp/dev.extend"
gksudo "mkdir -p /tmp/dev.extend/bin /tmp/dev.extend/etc /tmp/dev.extend/lib /tmp/dev.extend/sbin /tmp/dev.extend/home /tmp/dev.extend/usr /tmp/dev.extend/var /tmp/dev.extend/usr/arm-angstrom-linux-gnueabi /tmp/dev.extend/usr/bin /tmp/dev.extend/usr/etc /tmp/dev.extend/usr/games /tmp/dev.extend/usr/include /tmp/dev.extend/usr/lib /tmp/dev.extend/usr/libexec /tmp/dev.extend/usr/local /tmp/dev.extend/usr/sbin /tmp/dev.extend/usr/share /tmp/dev.extend/usr/src /tmp/dev.extend/var/backups /tmp/dev.extend/var/lib /tmp/dev.extend/var/local /tmp/dev.extend/var/openldap-data /tmp/dev.extend/var/spool"
gksudo "mount -t aufs -o dirs=/tmp/dev.extend/bin=rw:/bin=ro aufs /bin"
gksudo "mount -t aufs -o dirs=/tmp/dev.extend/etc=rw:/etc=ro aufs /etc"
gksudo "mount -t aufs -o dirs=/tmp/dev.extend/lib=rw:/lib=ro aufs /lib"
gksudo "mount -t aufs -o dirs=/tmp/dev.extend/sbin=rw:/sbin=ro aufs /sbin"
gksudo "mount -t aufs -o dirs=/tmp/dev.extend/bin=rw:/bin=ro aufs /bin"
gksudo "mount -t aufs -o dirs=/tmp/dev.extend/usr/arm-angstrom-linux-gnueabi=rw:/usr/arm-angstrom-linux-gnueabi=ro aufs /usr/arm-angstrom-linux-gnueabi"
gksudo "mount -t aufs -o dirs=/tmp/dev.extend/usr/bin=rw:/usr/bin=ro aufs /usr/bin"
gksudo "mount -t aufs -o dirs=/tmp/dev.extend/usr/etc=rw:/usr/etc=ro aufs /usr/etc"
gksudo "mount -t aufs -o dirs=/tmp/dev.extend/usr/games=rw:/usr/games=ro aufs /usr/games"
gksudo "mount -t aufs -o dirs=/tmp/dev.extend/usr/include=rw:/usr/include=ro aufs /usr/include"
gksudo "mount -t aufs -o dirs=/tmp/dev.extend/usr/lib=rw:/usr/lib=ro aufs /usr/lib"
gksudo "mount -t aufs -o dirs=/tmp/dev.extend/usr/libexec=rw:/usr/libexec=ro aufs /usr/libexec"
gksudo "mount -t aufs -o dirs=/tmp/dev.extend/usr/local=rw:/usr/local=ro aufs /usr/local"
gksudo "mount -t aufs -o dirs=/tmp/dev.extend/usr/sbin=rw:/usr/sbin=ro aufs /usr/sbin"
gksudo "mount -t aufs -o dirs=/tmp/dev.extend/usr/share=rw:/usr/share=ro aufs /usr/share"
gksudo "mount -t aufs -o dirs=/tmp/dev.extend/usr/src=rw:/usr/src=ro aufs /usr/src"
gksudo "mount -t aufs -o dirs=/tmp/dev.extend/var/backups=rw:/var/backups=ro aufs /var/backups"
gksudo "mount -t aufs -o dirs=/tmp/dev.extend/var/lib=rw:/var/lib=ro aufs /var/lib"
gksudo "mount -t aufs -o dirs=/tmp/dev.extend/var/local=rw:/var/local=ro aufs /var/local"
gksudo "mount -t aufs -o dirs=/tmp/dev.extend/var/openldap-data=rw:/var/openldap-data=ro aufs /var/openldap-data"
gksudo "mount -t aufs -o dirs=/tmp/dev.extend/var/spool=rw:/var/spool=ro aufs /var/spool"

dmesg | tail:
Code:
[  382.959106] mmci-omap mmci-omap.0: MMC IRQ 0x108000 : ERRI DTO
[  382.959167] mmcblk0: error -110 transferring data
[  401.667297] mmci-omap mmci-omap.0: MMC IRQ 0x108000 : ERRI DTO
[  401.667327] mmcblk0: error -110 transferring data
[  402.090576] mmci-omap mmci-omap.0: MMC IRQ 0x108000 : ERRI DTO
[  402.090637] mmcblk0: error -110 transferring data
[  402.614196] mmci-omap mmci-omap.0: MMC IRQ 0x108000 : ERRI DTO
[  402.614227] mmcblk0: error -110 transferring data
[  403.091247] mmci-omap mmci-omap.0: MMC IRQ 0x108000 : ERRI DTO
[  403.091308] mmcblk0: error -110 transferring data
 

Stuckie

Member
Joined
Apr 7, 2004
Messages
492
Age
35
Location
Tired, and sleeping in the basement...
Website
www.stuckieworld.net
Odd, I wonder why /bin is mounted a couple of times.. I'll need to look at that when I get back from work, but that's nothing to do with what's going on for you.

I don't see any issue with that mount script, however, the worrying thing is more the dmesg, as that looks like the Pandora is having issues with the SD card more than anything to do with the AUFS binds :\ I was expecting perhaps permission errors, or mount throwing something up; whereas those are hardware related errors.

Try putting the extend on another card and see if that works ( you may need to redo the mount script, depending on if you name your SD cards, and you're post-HotFix3, ) as there's nothing really wrong with that mount script, and I'm doing pretty standard things with the Extend stuff.
 

bompo

Still Fresh
Joined
Jul 19, 2010
Messages
10
strange, it worked with the old extendUtilis (the one without the gui stuff, probably the first version)
 

Stuckie

Member
Joined
Apr 7, 2004
Messages
492
Age
35
Location
Tired, and sleeping in the basement...
Website
www.stuckieworld.net
The only difference between the new and old, is that the premount scripts are editable.. the old extend utils basically had that exact premount script.

However, what dmesg is saying, are hardware errors, so you may want to check the card for corruption or something first.. if need be, I can upload the older version for you to test, but there really is no difference - and certainly nothing that would cause something like that to be triggered.

--edit--
I've uploaded the old version anyway, if you still want to try it: http://www.stuckiegamez.co.uk/apps/pandora/SimpleDev/OldExtendUtils.pnd

However, it's rootExtend script is pretty much exactly what you have above:
Code:
export MOUNT=/tmp/rootExtend
if (zenity --question --text="Do you want to expand as much of your / as we can to an extend file? ( apart from Home. )")
then
	zenity --info --text="Please select an extend file to use as an extension to your filesystem."
	newRootExtension=$(zenity --file-selection --file-filter=*.extend);
	if [ -f $newRootExtension ]
	then
		zenity --info --text="Now going to ask for your password to mount this file and bind your filesystem to it!"
		mkdir $MOUNT
		gksudo "mount -o loop $newRootExtension $MOUNT"
		cd $MOUNT
		gksudo "mkdir -p /usr/local"
		gksudo "mkdir -p bin etc lib sbin home usr var"
		gksudo "mkdir -p usr/arm-angstrom-linux-gnueabi usr/bin usr/etc usr/games usr/include usr/lib usr/libexec usr/local usr/sbin usr/share usr/src"
		gksudo "mkdir -p var/backups var/lib var/local var/openldap-data var/spool"
		gksudo "mount -t aufs -o dirs=$MOUNT/bin=rw:/bin=ro aufs /bin"
		gksudo "mount -t aufs -o dirs=$MOUNT/etc=rw:/etc=ro aufs /etc"
		gksudo "mount -t aufs -o dirs=$MOUNT/lib=rw:/lib=ro aufs /lib"
		gksudo "mount -t aufs -o dirs=$MOUNT/sbin=rw:/sbin=ro aufs /sbin"
		gksudo "mount -t aufs -o dirs=$MOUNT/usr/arm-angstrom-linux-gnueabi=rw:/usr/arm-angstrom-linux-gnueabi=ro aufs /usr/arm-angstrom-linux-gnueabi"
		gksudo "mount -t aufs -o dirs=$MOUNT/usr/bin=rw:/usr/bin=ro aufs /usr/bin"
		gksudo "mount -t aufs -o dirs=$MOUNT/usr/etc=rw:/usr/etc=ro aufs /usr/etc"
		gksudo "mount -t aufs -o dirs=$MOUNT/usr/games=rw:/usr/games=ro aufs /usr/games"
		gksudo "mount -t aufs -o dirs=$MOUNT/usr/include=rw:/usr/include=ro aufs /usr/include"
		gksudo "mount -t aufs -o dirs=$MOUNT/usr/lib=rw:/usr/lib=ro aufs /usr/lib"
		gksudo "mount -t aufs -o dirs=$MOUNT/usr/libexec=rw:/usr/libexec=ro aufs /usr/libexec"
		gksudo "mount -t aufs -o dirs=$MOUNT/usr/local=rw:/usr/local=ro aufs /usr/local"
		gksudo "mount -t aufs -o dirs=$MOUNT/usr/sbin=rw:/usr/sbin=ro aufs /usr/sbin"
		gksudo "mount -t aufs -o dirs=$MOUNT/usr/share=rw:/usr/share=ro aufs /usr/share"
		gksudo "mount -t aufs -o dirs=$MOUNT/usr/src=rw:/usr/src=ro aufs /usr/src"
		gksudo "mount -t aufs -o dirs=$MOUNT/var/backups=rw:/var/backups=ro aufs /var/backups"
		gksudo "mount -t aufs -o dirs=$MOUNT/var/lib=rw:/var/lib=ro aufs /var/lib"
		gksudo "mount -t aufs -o dirs=$MOUNT/var/local=rw:/var/local=ro aufs /var/local"
		gksudo "mount -t aufs -o dirs=$MOUNT/var/openldap-data=rw:/var/openldap-data=ro aufs /var/openldap-data"
		gksudo "mount -t aufs -o dirs=$MOUNT/var/spool=rw:/var/spool=ro aufs /var/spool"
		zenity --info --text="All done! Remember that this SD card is now LOCKED, you must reboot before removing it! Going to spawn a Terminal now..."
		terminal -T "Root Extended"
	fi
fi

Which is why I'm thinking that your SD card may be corrupt here.
 

bompo

Still Fresh
Joined
Jul 19, 2010
Messages
10
thanks stuckie, you were right.
I reformatted my sd card and now it works. :)
 

Stuckie

Member
Joined
Apr 7, 2004
Messages
492
Age
35
Location
Tired, and sleeping in the basement...
Website
www.stuckieworld.net
Staggering out the basement once more for another mad hack.

This time, a substantial update to the SimpleDev Environment.

Being of somewhat insane mind, I wondered if there was a way to get the dev tools packaged into a PND properly, without these rather dodgy AUFS hacks that can cause all manner of badness if you're not paying attention.
Add to that, that sometimes the AUFS binds don't take, and you end up writing all over your NAND anyway, I thought about doing something else.
I attempted to just package the Angstrom install of gcc into a PND.. but it spreads itself all over the place... no, what I needed was the classic cross-compiler setup, as that can be installed into any directory we want, and holds itself in there completely.

So yes, I've just built a Pandora cross-compiler on my Pandora. It took it's time to build too!
The process is pretty standard enough that you could get away with cross-compilers for other systems... how about a little Wiz devving on the go? Dingoo? GP32? or for true madness, build mingw32 and do some Windows apps!

This is a first release, but with just the compiler suite - no extra libraries like SDL or the like - as generally devs in these parts are pretty quick to build their own anyway, I've noticed.
I'll put up a library release soon, just wanted to get the compiler out there, to show that it works :)

The compiler was built in a mental way.
I hooked up an external USB Hard Drive to the Pandora ( as I wasn't entirely sure how much space this would eat up. )
I then used an Overlay to install the Angstrom dev tools on the Pandora, and grabbed crosstools-ng : http://ymorin.is-a-geek.org/projects/crosstool
I then compiled and installed that, while satisfying any dependencies it had.
Finally, I setup an arm cross compiler, using glibc, gcc 4.3.4 and what it marks as long-term stable Linux Headers - 2.6.27-48. Majority of the settings I left as default apart from install directory ( I set it to the path the PND mounts on ) and I added in the debug tools as well ( minus DUMA.. I had that in originally and left it running ALL DAY and it never finished.. so the second attempt didn't have DUMA and it finished in a few hours instead )
Once it finished, I wrapped it in a PND and reset to test.

The startup script is hugely simple in that all it does is set the PATH, and launch a Terminal. That Terminal is the only thing with that PATH, so once you close it, everything is cleanly pulled off. Just as it should be :)

I've compiled GCC with G++ support in, and their prefix is: arm-unknown-linux-gnueabi-* .. so arm-unknown-linux-gnueabi-gcc, for example.
I'm hoping this replaces the old Dev Extend ( which I'll probably phase out at the end of the month.. it was a nasty hack and didn't really work as well as I expected. )

I'll post up a Library pack later, with SDL and GLES and so on.. so it mirrors Torpor's Bollocks ( steady on! ) in terms of Library support if nothing else.

[edit]
Due to a fair few bugs and things, I'm taking the download down temporarily while I figure out why compiling anything more complicated than a simple SDL app causes major headaches... sorry.
[/edit]
 

torpor

hack hack hack, the little machines fight back
Joined
Oct 21, 2005
Messages
2,475
Location
vienna, austria
Website
w1xer.at
I'm just paranoid of filling up the NAND ;)

Code:
Filesystem     Size      Used     Available   Use%
ubi0:rootfs    454.7M    400.4M   53.4M       88%

^^ Has everything onboard to compile, and room to spare.


Vanilla Pandora? Thats why I bought two. :p
 

Stuckie

Member
Joined
Apr 7, 2004
Messages
492
Age
35
Location
Tired, and sleeping in the basement...
Website
www.stuckieworld.net
Alright for some :p

At any rate, I was _slightly_ too quick putting this up, as you do need to put libc_nonshared.a if you're linking multiple libraries into /usr/lib .. as ld won't pick it up anywhere else.. bleh.. though I'm sure one file copied over isn't too big a deal ;)

I'll fix that in a minute, once I've finished testing all those lovely libraries in a package.
( Yes, testing.. that'd be good, this time *cough* )

[edit] Oh yea, and Make's not there either.. curse me and my lack of testing... I'll fix that too.. [/edit]
[more important edit]

Actually, this doesn't seem to work that well at all.. seems to have a lot of issues in building anything complex.
I've tried a simple SDL app and it works fine, though I had to additionally link to libts.
Trying to compile the WakeBreaker source however, is a total nightmare.. it's like the linker isn't automatically pulling in symbolic dependencies, and it's become order dependent.

I must've messed something up somewhere, as this is essentially the same as any standard cross compiler.. hmm.. I'm taking the PND down for a bit while I figure it out.
[/more important edit]
 

Hitnrun

Member
Joined
Mar 1, 2008
Messages
427
Hmm I loaded the dev extends following the wiki, it seems to install, but I can't find a compiler command, neither "gcc" nor "g++" seem to be available.

Also it borked by sshd, when trying to ssh to the pandora with the extend active (via putty) I get the message: "Server refused to open a direct-tcpip channel".

Hmm... I rebooted, and am still getting this problem! What could have happened?
 

Stuckie

Member
Joined
Apr 7, 2004
Messages
492
Age
35
Location
Tired, and sleeping in the basement...
Website
www.stuckieworld.net
Sounds like the binds didn't fully work.. this is why I'm trying to figure out a better way of doing it.
Best way is to check "mount" that everything goes on properly, and if "dmesg | less" says anything about things not binding correctly.

As for sshd not working while having the extend installed, that could be because some of the binds did take, and the sshd config files were being read from the extend, rather than the NAND. It should've been fine when you rebooted though, that's an odd one.
Try setting up sshd again, as it may just be the config files got mangled. I haven't used sshd on the Pandora, so I can't really help much more than that, I'm afraid.. sorry.

I'm not particularly happy with the dev extend stuff at the moment, as with the aufs binds, you'll essentially get my configuration files ( or at least, whatever configuration files I had at the time I generated the extend. )
A better idea would be to setup a root overlay and install the dev tools into there, so then it's at least unique to your Pandora, and has any of your configuration files on it.

I am however, really quite knackered with things just now, so not sure when I'll have time to take another look at what I was up to with the cross-compiler idea, I'm afraid.
 
Top