Now there is a new tool which can be used with Nexus which allows you to unlock the bootloader from within the Android environment. You can download the app directly on your Android device through the Google Play Store or by using the link which follows:
This allows you to make the modifications you need without having your entire data and system partitions getting wiped. By making a few changes to the /param partition, you can safely make the modifications on your device without the risk of damage.
In order to install the app your device must be a rooted Google Galaxy Nexus, Google Nexus 4 or Google Nexus 10. You will be able to unlock or relock your bootloader as many times as you want. Because this approach doesn’t open the miscellaneous partition or the allow code modifications your device will retain a certain measure of security against bootloader-level vulnerabilities.
Currently this app will not work with another popular Nexus device - the Google Nexus 7.