Using subversion on the SBC
From HotDec
Contents |
Introduction
Since we are often making changes the filesystem on the SBC we needed a method of keeping track of those changes. Subversion seemed like the perfect way to keep track of changes and keep versions up to date. The problem with subversion is that it doesn't handle file permissions and special file type (softlinks, fifos, device files) the way we would like it to. So Buck Golemon wrote a python script (emsvn) that would store permissions and special file information in a normal files that subversion could use. The script can be run from the SBC which makes it that much more useful.
Preparing
There are a couple of things you need to have done if these examples are going to work:
- Setup /root/.ssh/authorized_keys for your user and the remote computer (in our example : elegy) that your using. Take a look at SSH keys. To test this try ssh'ing into the SBC from the remote computer you are going to use. If it asks you for a password then the ssh key for your user and computer hasn't been added to the authorized_keys file of the SBC.
ssh root@sbc1
- Have python and the emsvn script on the SBC filesystem you are currently using.
- Have the ethernet/wireless setup so you can access the internet. You may also need to added the MAC address of the ethernet or wireless to the router so it can access the internet. Try ping'ing the remote computer. If it responds with something like 'Host name lookup failure' you need to fix this.
ping elegy.mie.uiuc.edu
Checking out an SBC image
Checking out an SBC image to the SBC is really done in two steps ( both steps are handled by the emsvn python script):
- SVN is run on a remote machine ( for example, elegy ) where the SBC image is checked out from the repository ( currently svn://legend.mechse.uiuc.edu/truck/Trunk/sbc )
- The files are copied from the remote machine to the SBC using scp
Here is an example where I am checking out the SBC image from the repository onto the DOC which is mounted as /mnt on the SBC. I am not runnning off the same filesystem I am updating, but I may be possible to update the filesytem while running off of it. I am going to host the SBC image on my NFS home drive on elegy in a folder that will created by the script ( /home2/dbking/sbc/truck_sbc_img1 ).
Here are the parameters to the emsvn script for a checkout.
emsvn checkout <repo> <remote> <localpath>
For this example <repo> will be svn://legend.mechse.uiuc.edu/truck/Trunk/sbc, <remote> will be dbking@elegy.mie.uiuc.edu/home2/dbking/sbc/truck_sbc_img1, and <localpath> will be /mnt.
emsvn checkout svn://legend.mechse.uiuc.edu/truck/Trunk/sbc dbking@elegy.mie.uiuc.edu/home2/dbking/sbc/truck_sbc_img1 /tmp
Evsvn will print out a list of the files it is moving, once the program is finished you should have the complete up-to-data SBC filesystem. Now that you have the filesystem checked out, you can make changes and COMMIT them to the repository, or if changes are made to the repository you can UPDATE your SBC.
Commiting changes to the repository
TODO : Write me
Updating the SBC from the repository
TODO : Write me
