To make a script that will run at startup, you will need to create an executable shell script, then get it to execute at startup by putting it in a startup script.
Start by writing your script in nano/pico or notepad and having it do all the things you need it to do. See the sample script below.
#install apt-get #chmod +x installaptget.sh sudo mount / -o remount,rw sudo mkdir -p /var/cache/apt/archives/partial sudo mkdir -p /var/log/apt sudo touch /etc/apt/sources.list sudo chmod a+w /etc/apt/sources.list echo deb http://ftp.iinet.net.au/pub/ubuntu karmic main restricted > /etc/apt/sources.list sudo apt-get update
You will then need to make the script executable by using the commented command in the script above: chmod +x yourScriptName.sh. You will then need to put a link to your script in the startup script in /etc/X11/chromeos-xsession by typing /pathToYourScript/yourScriptName.sh.
The only problem with this guide is the creation of the start up script. If the script can be created on another OS and copied into Chrome OS, or somebody can work out how to create it in Chrome OS, all will be good.
A good solution to writing scripts or editing files I have found is to install nano after configuring apt to work the first time.
sudo apt-get install nano
this is also good for editing /etc/apt/sources.list to add more repositories.
nano /etc/apt/sources.list