Pandora Simple Dev Pnd


Stuckie

Member
Joined
Apr 7, 2004
Messages
492
Age
38
Location
Tired, and sleeping in the basement...
Website
www.stuckieworld.net
Hey,

Currently, the Dev Extends are causing issues with people who have been using their Pandora a bit.
Essentially, this is because its binding whatever configuration files are present in the extend over your Pandora.
The best way to solve this would be to create your own root overlay, and install the dev tools in there.. or of course, install the dev tools direct to NAND.

I have been testing out various other methods around this, such as compiler GCC in the standard cross-compiler manner, so it can be launched from a PND. However, simple tests worked fine, but complex tests caused it to fail spectacularly.. so that needs figured out a bit. I also don't seem to have the greatest amount of time these days to do fiddling, and seem to be far more tired than usual :(

I'd therefore advise you not to use the Dev Extends unless you know what you're doing and have backups.. however, I have never marked these things as being terribly stable, and always labeled them as the "dodgy hacks" they are. It's an interesting hack, but its becoming increasingly like something that has to be done uniquely for each Pandora, rather than a generic Dev Extend that works on all - due to the nature of the AUFS binds ( which don't always take.. grrr )

Original post hidden in the spoiler tags.
** DEV EXTEND QUICK START **
You'll require the ExtendUtils suite: http://www.stuckiegamez.co.uk/apps/pandora/SimpleDev/extendutils.pnd this gets updated fairly regularly, so always check the Wiki documentation: http://pandorawiki.org/Extend_Utils
You'll also need a Dev Extend Package: http://www.stuckiegamez.co.uk/apps/pandora/SimpleDev/Dev.Extend.20thJune2010.zip - was the latest extend of Dev tools.

Extract the extends to the root of an SD card, and plonk the PND in your /pandora/menu.
Follow the instructions for a "Classic/Dev Extend" configuration on the Extend Utils Wiki: http://pandorawiki.org/Extend_Utils#Creating_a_Dev_Extend_Pre-Mount
Optionally, create your Home overlay as well and mount that too, check the documentation for details.
** DEV EXTEND QUICK START **

The "environment" includes pretty much what Torpor's thread recommends you install ( minus the omap demos.. I forgot them this time as once you see them once, they're a bit meh. )
SDL_Mixer was a funny one, however, as the -dev package in Angstrom seems to be of an older version that what's installed. So I somewhat cheated with that and forced an install, so there may be some issues there.
Editor wise, there's vim, nano and geany installed at least.
Source Control wise, there's CVS, SVN and GIT.
I can't remember if I installed anything else, but there's 358M left of the dev.extend file to add to, if needed.

Now, a little warning.
** WARNING ** WARNING ** WARNING ** WARNING ** WARNING ** WARNING **
This uses AUFS to mount directories from the SD Card to your NAND.
This means that it effectively locks that SD Card and you SHOULD NOT REMOVE IT before a reboot or shutdown, or you may very well cause your system to become unstable!
I have had no issues using this setup ( I've developed the PNDs I've put up with it, ) but I don't want people complaining they've hosed their system because they accidentally removed the card or something.
If you're at all paranoid, do not use this and setup a tool chain another way ( there's plenty - be it create a custom SD Card to boot from, the "standard" cross-compiler way, or just install direct on NAND )
** WARNING ** WARNING ** WARNING ** WARNING ** WARNING ** WARNING **

With that out of the way, this is what you get in your Zip file:
The "extendUtils" PND which does all the donkey work.
This is a slightly edited version of the one I previous put up in the AUFS Hackery thread, as I've found out that unmounting /home is not always possible ( makes sense really, your bash history sits in home, so you're trying to unmount it while it writes the command that you're unmounting it ;) )
There's also the dev.extend file. This is an ext2 formatted loop-back file which contains the dev environment, and extends / over to it, so you're free to install extra things if need be. This is 512M.
Finally, there are a bunch of zip files of pre-made extend files, in 256M, 512M, 1G, 2G and 4G flavours. These will expand to what they say, so make sure you've enough space for them! ( NOTE: I've just realised I haven't formatted these... you can do this from your Pandora though: mke2fs /path/to/your.extend before mounting it.. or whatever other file system you wish to use! I'll fix this when I get back from work. )
You probably want to use one of these to extend your /home so you can keep your source code and things with you, separate from NAND and separate from the dev environment. This is actually very handy as you can reboot, mount your /home bind, and test your code on a "vanilla" Pandora to ensure it works before going through the packaging phase :)
It also protects your NAND from accidental /home writes from software you haven't quite tied up yet ;)

I hope it's useful to someone.
It's certainly been useful to me, and it is effectively how I develop things on the Pandora for the moment.

[edit]
I've changed the structure of this a bit...
First you'll want the actual extend utilities. This includes a very experimental /home unbind which doesn't always behave itself.

You'll also possibly want one of the pre-formatted extend files. They come in 256Mb, 512Mb, 1Gb, 2Gb and 4Gb flavours. These are useful for a /home mount, or if you want to do a fresh root bind.
Finally, there's the original dev extend file release dated 18th June 2010.
This includes the following:
+ alsa-lib
+ alsa-lib-dev
+ bigreqsproto
+ bigreqsproto-dev
+ binutils-dev
+ cpp
+ cpp-symlinks
+ cvs
+ devmem2-dev
+ fbset-dev
+ fontcacheproto
+ fontcacheproto-dev
+ g++
+ g++-symlinks
+ gcc
+ gcc-doc
+ gcc-symlinks
+ geany
+ gettext
+ gettext-dev
+ git
+ glibc-extra-nss
+ inputproto
+ inputproto-dev
+ kbproto
+ kbproto-dev
+ libapr-1-0
+ libaprutil-1-0
+ libc6-dev
+ libexpat-dev
+ libfontenc-dev
+ libfreetype-dev
+ libgettextlib
+ libgettextsrc
+ libgles-omap3-dev
+ libgmp-dev
+ libgmp3
+ libjpeg-dev
+ liblzo-dev
+ liblzo1
+ libmpfr-dev
+ libmpfr1
+ libpixman-1-dev
+ libpng-dev
+ libsdl-1.2-dev
+ libsdl-gfx-dev
+ libsdl-image-1.2-dev
+ libsdl-net-1.2-dev
+ libsdl-ttf-2.0-dev
+ libsdl-mixer ( forcibly hacked on.. Angstrom's version is older than what's on the Pandora for some reason. )
+ libstdc++-dev
+ libtiff-dev
+ libts-1.0-dev
+ libx11-dev
+ libxau-dev
+ libxdmcp-dev
+ libxext-dev
+ libxfont-dev
+ libz-dev
+ linux-libc-headers-dev
+ make
+ make-dev
+ ncurses-dev
+ subversion
+ update-rc.d-dev
+ util-macros
+ util-macros-dev
+ xcmiscproto
+ xcmiscproto-dev
+ xextproto
+ xextproto-dev
+ xf86bigfontproto
+ xf86bigfontproto-dev
+ xproto
+ xproto-dev
+ xtrans-dev

You can grab all this from here: http://www.stuckiegamez.co.uk/apps/pandora/SimpleDev

And I shall be keeping that folder up to date with the latest bits and pieces.
I'll be posting whether I've updated the PND or not, so don't worry about missing out those changes :)
[/edit]

Comments and suggestions for further amendments are welcome :)
And hopefully I haven't missed anything in my rush out the door!

[edit - 17th August]
I'm about to update this for a whole new style of Dev PND which matches closer to a standard cross-compiler install...
[/edit]
 
Thanks Stuckie, will be giving it a look (although I've personally tailored torpor's stuff and added some libs that I needed)
 
Just wanted to pitch in and say this looks really great Stuckie.. although I'm no fan of having dev tools in a PND personally (I'm not sure I see the need for me, personally - I've got no problems having all these tools on the NAND), it will definitely be useful to other coders coming new to the scene who want an easy way to get started, and don't want to use the standard Angstrom techniques for setting up a development environment.

I'd be very interested in your additional libs Hooka .. I talked with DJWillis last night about the whole repo issue, and any details about what other people are installing from the Angstrom repo is very interesting to this discussion ..
 
Just updated the zip with pre-formatted .extend files. It's grown a bit to about 35mb but it's probably a bit easier to get started with.

Now go forth and code! ;)

If any more help is needed, let me know :)
Same for if there could be additional libraries to what's there ( what additional ones do you have Hooka, for example? )
 
Thank you very much!

I'm not much of a programmer, but I'm very interested in learning about all this stuff. I've got it running on my pandora. The extended home is very useful.

Thanks again.
 
I've a couple of other things to add to it, but as I've mounted the "root" image as Read-Write, you can just do "sudo opkg install <blah>" to get whatever you need :)

That first release was just the basic toolchain that was described in Torpor's thread.
The problem will be if I update this, then you'll lose whatever changes you may have had ( though I'm working on sneaky ways of getting around this ;) even if it just ends up a blind copy from A to B script ) - but ensuring that the base image has enough to get someone started is probably the best approach!

I'll also list any changes between each revision should you want to keep your own copy up to date :)

libpng should be there.. I install libpng-dev in the original image.
It doesn't look like I added vorbis though, so I'll get that installed now for the next release.

ChangeLogs:

Version: 18th June 2010
-----------------------
+ alsa-lib
+ alsa-lib-dev
+ bigreqsproto
+ bigreqsproto-dev
+ binutils-dev
+ cpp
+ cpp-symlinks
+ cvs
+ devmem2-dev
+ fbset-dev
+ fontcacheproto
+ fontcacheproto-dev
+ g++
+ g++-symlinks
+ gcc
+ gcc-doc
+ gcc-symlinks
+ geany
+ gettext
+ gettext-dev
+ git
+ glibc-extra-nss
+ inputproto
+ inputproto-dev
+ kbproto
+ kbproto-dev
+ libapr-1-0
+ libaprutil-1-0
+ libc6-dev
+ libexpat-dev
+ libfontenc-dev
+ libfreetype-dev
+ libgettextlib
+ libgettextsrc
+ libgles-omap3-dev
+ libgmp-dev
+ libgmp3
+ libjpeg-dev
+ liblzo-dev
+ liblzo1
+ libmpfr-dev
+ libmpfr1
+ libpixman-1-dev
+ libpng-dev
+ libsdl-1.2-dev
+ libsdl-gfx-dev
+ libsdl-image-1.2-dev
+ libsdl-net-1.2-dev
+ libsdl-ttf-2.0-dev
+ libsdl-mixer ( forcibly hacked on.. Angstrom's version is older than what's on the Pandora for some reason. )
+ libstdc++-dev
+ libtiff-dev
+ libts-1.0-dev
+ libx11-dev
+ libxau-dev
+ libxdmcp-dev
+ libxext-dev
+ libxfont-dev
+ libz-dev
+ linux-libc-headers-dev
+ make
+ make-dev
+ ncurses-dev
+ subversion
+ update-rc.d-dev
+ util-macros
+ util-macros-dev
+ xcmiscproto
+ xcmiscproto-dev
+ xextproto
+ xextproto-dev
+ xf86bigfontproto
+ xf86bigfontproto-dev
+ xproto
+ xproto-dev
+ xtrans-dev

Version: 19th June 2010 ( so far )
-----------------------
+ alsa-dev
+ autoconf
+ automake
+ gftp
+ gnu-config
+ m4
+ mercurial ( source install )
+ python-bzip2
+ python-compile
+ python-devel
+ python-distutils
+ python-fcntl
+ python-subprocess
+ python-zlib
 
It doesn't work. I opened the dev extend file, went through all the zenity prompts etc. I then tested it by installing Firefox. It installed to the nand.
 
hmm, could you do it again and when the terminal appears give me the output of "mount" please?
As it sounds like it didn't mount properly for whatever reason... you should see a whole heap of aufs mounts.

Sorry, I hit reply a bit quick there.
You should see a heap of aufs mounts and a /dev/loop mount ( or two, depending on if you just did the root mount or the home mount as well. )
This /dev/loop mount should be pointing at /mnt/utmp/rootextend/mounts and it should have bin etc home lib lost+found sbin usr var. If you've done home, it should be at /mnt/utmp/rootextend/mounts/home.

I suspect one of the mounts failed somewhere along the lines.
 
Code:
rootfs on / type rootfs (rw)
ubi0:rootfs on / type ubifs (rw,bulk_read)
proc on /proc type proc (rw)
tmpfs on /mnt/.splash type tmpfs (rw,size=40k)
sysfs on /sys type sysfs (rw)
none on /dev type tmpfs (rw,mode=755)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
tmpfs on /var/volatile type tmpfs (rw)
tmpfs on /dev/shm type tmpfs (rw,mode=777)
tmpfs on /media/ram type tmpfs (rw)
ubi1:boot on /boot type ubifs (rw)
/dev/mmcblk1 on /media/disk type vfat (rw,sync,nosuid,nodev,uid=1000,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=winnt)
/dev/loop0 on /mnt/pnd/rootextend type iso9660 (ro)
none on /mnt/utmp/rootextend type aufs (rw,si=603d1dd7,noplink)
/dev/loop1 on /mnt/utmp/rootextend/mounts type ext2 (rw,errors=continue)
aufs on /bin type aufs (rw,si=635bb857)
aufs on /etc type aufs (rw,si=635bb657)
aufs on /lib type aufs (rw,si=635bb757)
aufs on /sbin type aufs (rw,si=635bb457)
aufs on /usr/arm-angstrom-linux-gnueabi type aufs (rw,si=635bb957)
aufs on /usr/bin type aufs (rw,si=635bb357)
aufs on /usr/etc type aufs (rw,si=635bb057)
aufs on /usr/games type aufs (rw,si=63577777)
aufs on /usr/include type aufs (rw,si=63577477)
aufs on /usr/lib type aufs (rw,si=63577577)
aufs on /usr/libexec type aufs (rw,si=63577277)
aufs on /usr/sbin type aufs (rw,si=600d7dd7)
aufs on /usr/share type aufs (rw,si=610bc477)
aufs on /usr/src type aufs (rw,si=610b9837)
aufs on /var/backups type aufs (rw,si=659812d7)
aufs on /var/lib type aufs (rw,si=610bc777)
aufs on /var/local type aufs (rw,si=603cd557)
aufs on /var/openldap-data type aufs (rw,si=603cdd57)
aufs on /var/spool type aufs (rw,si=603cd957)

Wait, it seems to be working this time. I have Geany on my menu.

Sorry :)
 
That's working fine then... I don't see how it could have installed direct to NAND as it's re-routing everything to the loop back image.

Can you talk me through how you tested this, please.. so I can try track down what went wrong.
Was it essentially:
Bind the dev.extend.
Install Firefox.
Try Firefox to see if it works.
Reboot.
Try Firefox before binding and it was there?
 
Stuckie said:
That's working fine then... I don't see how it could have installed direct to NAND as it's re-routing everything to the loop back image.

Can you talk me through how you tested this, please.. so I can try track down what went wrong.
Was it essentially:
Bind the dev.extend.
Install Firefox.
Try Firefox to see if it works.
Reboot.
Try Firefox before binding and it was there?

Yes. I just removed Firefox and repeated the whole thing again, and this time it it all works. I did nothing differently!

I could tell something was wrong when the SD light wasn't flashing when installing the first time. Anyway, thanks for this! Loading up the PND and going through all the menus is kind of a pain, but it's a nice and safe way to do it. Thanks for the loopback files (I followed your original guide and sacrificed a card in etx2 format) too.

Now I'm off to go mad with the Angstrom repo. Wish me luck! Then it's Adventure in Recompilation Land.
 
Last edited by a moderator:
hmm... glad it's not up on one of the archives yet, so as long as people have to come here to grab it, I can track things like this :)
So, if anyone manages to get this to not work like SomeGuy99, let me know exactly what you did, and give me as much information as you can!
I have a feeling it silently failed to mount, but made the mount points for next time without telling you, so I shall be having another look at my script to be sure.

Good Luck with the Angstrom Repo.. it's a bit mad itself ;) been using this to find stuff: http://www.angstrom-distribution.org/repo/
I do prefer this setup to having a separate install on SD though.. if only that I can have a bunch of "default" applications installed and shared amongst my dev environments, rather than having to re-create the environments for every SD card. But, the SD card is possibly safer, as this can still fail it seems.. needs more testing!
 
Yeah, that's what I've been using (the repo page). I've held back on installing big stuff because space was running low.

This way I can back up the loopback files to a standard fat32 or ntfs drive!

Is there any way to increase their size later? I'm guessing not. At some point I'd quite like the contents of the extension pnd - as it's quite small, I plan to install in on my nand. Is it a shell script? Does it accept arguments? I can mod it if not. My ideal would be to make a Thunar action to right-click 'mount extension' on extension files and forego all the password stuff (add to the sudoers file I guess), then add a little notify popup to say 'extension mounted' or somesuch. I'll probably post it up in Software Hacking (I'm behind on writing guides atm).
 
Not easily no, but you should be able to get away with using an empty extend file to mount as root as it will create the folders for you, so you could use the 4gig one on fat32.. or create a giant one for your NTFS drive, if you prefer!
The pre-made dev one is just for convenience of people wanting to get started quickly :)

It is just a simple script that does it, here it is in it's entirety:
if (zenity --question --text="This will bind everything on / apart from /home to your .extend file.")
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!"
gksudo "mount -o loop $newRootExtension mounts/"
if [ ! -d mounts/bin ]
then
cd mounts
gksudo "mkdir bin etc lib sbin home usr var"
gksudo "mkdir usr/arm-angstrom-linux-gnueabi usr/bin usr/etc usr/games usr/include usr/lib usr/libexec usr/sbin usr/share usr/src"
gksudo "mkdir var/backups var/lib var/local var/openldap-data var/spool"
cd ..
fi
gksudo "mount -t aufs -o dirs=./mounts/bin=rw:/bin=ro aufs /bin"
gksudo "mount -t aufs -o dirs=./mounts/etc=rw:/etc=ro aufs /etc"
gksudo "mount -t aufs -o dirs=./mounts/lib=rw:/lib=ro aufs /lib"
gksudo "mount -t aufs -o dirs=./mounts/sbin=rw:/sbin=ro aufs /sbin"
gksudo "mount -t aufs -o dirs=./mounts/usr/arm-angstrom-linux-gnueabi=rw:/usr/arm-angstrom-linux-gnueabi=ro aufs /usr/arm-angstrom-linux-gnueabi"
gksudo "mount -t aufs -o dirs=./mounts/usr/bin=rw:/usr/bin=ro aufs /usr/bin"
gksudo "mount -t aufs -o dirs=./mounts/usr/etc=rw:/usr/etc=ro aufs /usr/etc"
gksudo "mount -t aufs -o dirs=./mounts/usr/games=rw:/usr/games=ro aufs /usr/games"
gksudo "mount -t aufs -o dirs=./mounts/usr/include=rw:/usr/include=ro aufs /usr/include"
gksudo "mount -t aufs -o dirs=./mounts/usr/lib=rw:/usr/lib=ro aufs /usr/lib"
gksudo "mount -t aufs -o dirs=./mounts/usr/libexec=rw:/usr/libexec=ro aufs /usr/libexec"
gksudo "mount -t aufs -o dirs=./mounts/usr/sbin=rw:/usr/sbin=ro aufs /usr/sbin"
gksudo "mount -t aufs -o dirs=./mounts/usr/share=rw:/usr/share=ro aufs /usr/share"
gksudo "mount -t aufs -o dirs=./mounts/usr/src=rw:/usr/src=ro aufs /usr/src"
gksudo "mount -t aufs -o dirs=./mounts/var/backups=rw:/var/backups=ro aufs /var/backups"
gksudo "mount -t aufs -o dirs=./mounts/var/lib=rw:/var/lib=ro aufs /var/lib"
gksudo "mount -t aufs -o dirs=./mounts/var/local=rw:/var/local=ro aufs /var/local"
gksudo "mount -t aufs -o dirs=./mounts/var/openldap-data=rw:/var/openldap-data=ro aufs /var/openldap-data"
gksudo "mount -t aufs -o dirs=./mounts/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

And the home mount is essentially the same:
if (zenity --question --text="Do you want to expand your /home to an extend file?.")
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 home to it!"
gksudo "mount -o loop $newRootExtension mounts/home"
gksudo "mount -t aufs -o dirs=./mounts/home=rw:/home=ro aufs /home"
zenity --info --text="All done! Going to spawn a Terminal now..."
terminal -T "Home Extended"
fi
fi

So you probably could get away with some Thunar scripts to do the same thing.
 
Can I mount more than one?

I'm using the dev one, but I can see myself filling that one up. Then I have to trash it and move to another. I do this with Wubi installs of Linux, I think 'Yeah sure, 4gb sounds like enough' but I soon forget how quickly crap accumulates!
 
You can, but you'd need to modify the mount command to something like: sudo mount -t aufs -o dirs=DIR_1=rw:DIR_2=rw:/home=ro aufs /home ... and so on, adding DIR_# as you see fit.. and AUFS will essentially pick one to write to, so you may end up with some files in one mount and not in another, so you'd need to mount the whole set to be sure you have everything.

Of course, if you do end up filling something, you could modify the command, and set your NAND point to read only, your filled point to read only, and your new point to read-write to ensure it only fills up that instead and leaves your other one alone.

You can't nest them and add mounts after the mount though ( as far as I'm aware.. seemed to fail for me, anyway )
 
Stuckie said:
Of course, if you do end up filling something, you could modify the command, and set your NAND point to read only, your filled point to read only, and your new point to read-write to ensure it only fills up that instead and leaves your other one alone.

Cool. I was wondering if that would work. So I can just start a collection of say, 500mb extensions, and mark the older ones as read only? Rocking.
 
Last edited by a moderator:
I'm really looking forward to trying this. Would it be possible to add an unmount option? (So you can unmount it, pop out your SD to add stuff, pop it back in and remount)

-God Ginrai
 
Back
Top