How to set up an UCLIBC development environment

From ArticleWorld


You will need to set up a special environment for uclibc development just about any time you use it. Either because you are trying it out, or because you need it for a project, you cannot usually just throw the uclibc in your root directory and expect it to still work. Here is the correct way to set up the uclibc environment.

Steps

1. Download the prebuilt root filesystem from www.uclibc.org. Be warned that it is rather large (over 100M unpacked) so make sure you have the space.

2. Extract the bz2 archive (tar jxf root_fs_i385.ext2.bz2) to a folder of your choice.

3. Create a new mount point (say, /mnt/uclfs) and, as root, run the following commands:

mount -o loop root_fs_i386.ext2 /mnt/uclfs
cp -a   /mnt/uclfs* ucroot
rm -r ucroot/lost+found
umount /mnt/uclfs
rm root_fs_i386.ext2

You may also want to run:

chmod 777 ucroot/home

4. Once this is done, you will have a new root directory for uclibc in ucroot. If you do not like the idea of having it in the local directory, you can obviously replace it with /mnt/ucroot (for example) in the above sequence of commands.

Notes

The uclibc is somewhat behind updating the prebuilt root filesystem. If you need a bleeding-edge version of it, you should use buildroot, although that needs more time to compile and install.