Creating chroot for arm on Ubuntu with rootstock
12 Aug 2010Some of you may or may not be familiar with chroot, for those who are familiar with chroot good job and for those that aren’t shame on you. Just kidding please read this for some more info about chroot.
Now that we all know what chroot is, maybe it could be fun to create an chroot environment, and to make it more exciting we are not creating an x86 but an arm processor environment :)
There are tons of ways of doing this but this is how I am doing it. You can use this method on any ubuntu from 9.04 and higher, but keep in mind I am using 10.04 so if you get error’s try to blame it on that instead off me. So first thing we need to do is prep our own ubuntu machine to be able to build a chroot environment. To do so we install rootstock, and we do it like this:
Now we can create a chroot with rootstock, this is an simple example of no nonsense chroot:
If you wish to know what this all means I recommend you to do:
To be able to access this chroot environment we need to mount it like this:
Now we can enter our chroot:
Or exit it and umount it like this:
So here you go small simple way of creating a chroot environment. Is that all you may ask your self, no it’s not, what we actually have created here above is a empty non fun chroot environment. So instead of that let’s try to make something more fun and exciting like have access to internet, have ssh server running, have an vncserver running. Here are the steps in how to do this.
Step 1, Create the image containing ssh tightvncserver lxde
Step 2, Start the chroot environment. You can use my script from here or do this:
To be able to use SSH or VNC you need to configure some things. I have created an script that can do this for you, you can download it from here.
Step 3, Configure:
Open an new terminal and then:
Go back to your chroot and then:
Step 4, If you want to use SSH or VNC you will need to start those every time you login to your chroot. You can do this by running these command’s
OPTIONAL: You can also add these commands to your bashrc script so that they will be executed for you. You can do this by running this, if you haven’t run step 3 yet you can also uncoment these two lines from my config.sh script.
Step 5, To quit the chroot just do the following or use my script from here:
You all are set now, you have an arm ubuntu image and you have configured it all that is left to do is use it.
As always there are people I would like to give credits to, and this time it’s Nexus One Hacks.
UPDATE For those who don’t like to do all this here is an img I created: Download