These are really just notes to remind me of how I did it but it may be useful to someone. I apologise in advance for the vague bits. Also too this recipe only works for people who run Ubuntu :D.
I am looking for a way to run an openframeworks project on a machine in an easy non final way which will allow me to borrow PCs from people and give them back without changing anything. Since my dev environment is ubuntu I chose lubuntu a lightweight ubuntu with a smaller memory map. Using the lubuntu live disk iso, I modified the iso to have everything I need to run my project. The result a flashdisk which will autorun my project when the pc boots from the disk. In my case my projects need the kinect so the installation is as simple as plug usb stick and kinect into pc and boot.
In recipe style here is what it took to get the disk:
- 1 Flash disk 1Gig is enough
- lbuntu iso file
- your compiled openframeworks project, the bin directory and the lib directory no source needed
- if you openframeworks project needs other libraries make a list of those that can be installed and make a tarball of those you need to install by hand. This is usually not necessary if you use openframeworks extension which include the libraries.
- A list of other package your project needs.
- a start.desktop file (see further down the post for an example)
- a start.sh script (see further down the post for an example)
- Ubuntu Customisation Kit or UCK you can get it by searching for uck in the software centre or typing sudo apt-get install uck
Remastering of the iso:
- start uck
- choose only the language packs you need
- when asked if you want to customise more say yes
- follow the prompts and at some point you'll get three options. choose option 1: start package manager
- At this point you are root on the filesystem that will be squashed in the iso. see chroot for more info if you need to know how this works. So adding packages and removing packages with the package manager started by uck will not change your computer but only the packages in your iso.
- Remove Ubiquity (ubiquity provides install icon on desktop and more)
- Add whatever packages you need e.g. build-essential if you are planning on building anything.
- Close the package manager when you are finished.
- At the three options prompt choose 2: open a terminal
- Now a terminal opens and you are again dropped into the file system in the iso as root. You can see this by typing whoami it should say root. Now you can do any modifications you need.
- Get the files you need by typing sftp username@localhost You need to use your username. If it asks security questions say yes and type in your password.
- Navigate to the place where the tarball is in you ingredients using pwd, cd and ls
- get the file by typing get filename.tar.gz
- exit to leave sftp
- Do whatever else you need. I moved the tarball to /tmp extracted it using tar -xvf filename.tar.gz then I moved my openframeworks project folder into /usr/share e.g. /usr/share/myapp
- Make a start.sh file in the /usr/shar/myapp which contains the following two lines: cd /usr/share/myapp/bin and ./myapp
- make the start.sh executable chmod 755 /usr/share/myapp/start.sh
- Make a .desktop file in /etc/xdg/autostart see this example where it says /root/test.sh replace /usr/share/myapp/start.sh
- remove all unsused files you copied in or unpacked with sftp to make the final image smaller
- clean up the unused packages by typing : apt-get autoremove
- leave the terminal by typing: exit
- Again you see the 3 options choose option 3: continue
- uck will now make a new .iso file for you.
You can test the iso in virtual box or make a usb disk using the usb creator which comes with ubuntu
- Once you have the usb disk plug it in and look for the syslinux.cfg file in syslinux on the disk.
- Edit it and change the timeout to say 10 which means 10 1/10ths of a second which makes it jump over the menu quickly.
- remove disk and plug into unsuspecting pc and boot up.
- After the first run remember to switch the screensaver off, I still have to figure out how to do this in the default settings.
- Some PCs have problems with live disk booting of 11.04 notably Acers which have a backlighting issue.
- It would be good to figure out how to do the screensaver changes as default.
- Works better if you make your project run fullscreen.
- I can run the uck process multiple times on the built iso in this way incrementally changing things.
- I still need to figure out how to remove other unneeded things such as bluetooth detecion and wifi detection which slows down the startup.
- When removing packages make sure it isn't going to remove lubuntu-desktop.