Replicant Android: How to get WiFi and Bluetooth working

Replicant is a version of Android that is fully free-as-in-freedom.  It is currently available for several devices, but does not (as of Jan 7, 2014) include software to make WiFi and Bluetooth work. That software is included in the CyanogenMod version of Android, but is not included in the Replicant version because it is not free .  If you would like to use the freest available version of Android, but you need WiFi and/or Bluetooth to work, it is possible to add back in the non-free WiFi and Bluetooth firmware from CyanogenMod.

Here’s an outline of how to do it, based on my experience getting WiFi and Bluetooth working on my Samsung Galaxy Tab 2 7.0. You might need to make adjustments, but this should make it much easier for you than it was for me.

Part I: Get the non-free firmware files

  1. Install CyanogenMod on your device, using instructions on the CyanogenMod site.
  2. In your computer’s web browser, view the Replicant Status page; then follow the link to your device’s dedicated status page (example); then follow the link (in the technical info section) to a page about firmwares for your device  (example).
  3. On your device, use the Android file manager app included in CyanogenMod to search for each of the firmware files listed on the page about firmwares for my device.  Write down the full path to each one. (You may need to set options to allow the file manager to have superuser or root privileges.)
  4. On your computer, install ADB (Android Debug Bridge, part of the Android SDK).
  5. On your device, enable Android debug mode (ADB).  This setting may be at Settings / Applications / Development or somewhere else in your Android settings, depending on the version of CyanogenMod you installed.
  6. Connect your device to your computer via USB, then open a command prompt window.  Use the ADB “adb pull” command (part of the Android SDK) to copy each of the firmware files you need onto your computer.

Part II: Install Replicant on your device

  1. In your computer’s web browser, view the Replicant Status page; then follow the link to your device’s dedicated status page (example); then follow the link to the installation guide for your device (example); follow those instructions.

Part III: Install the firmware files on your device

  1. Download the Google Apps update package for the version of CyanogenMod you installed in Part I.  (The purpose of this step is NOT to install Google Apps – which is non-free software that you probably don’t want on your device – but to use this package as a template for creating an update package for your firmware files.)
  2. Rename it to update-unsigned.zip.
  3. Read these instructions to help you understand what you’re doing.
  4. Using your favorite .zip file utility, remove everything in update-unsigned.zip except the “META-INF/com/google/android/” folder. In that folder, keep updater-script and update.binary.  You can remove update-script since it is only needed for Android versions before 1.6.
  5. Add the firmware files for your device to update-unsigned.zip, putting them in the folder locations shown on the firmware page that you found earlier (example).
  6. Edit updater-script in update-unsigned.zip so it will install and set permissions for the firmware files your device needs. As an example, here’s what worked for my Samsung Galaxy Tab 2 7.0:
    ui_print("***********************************************");
    ui_print("     WiFi and Bluetooth non-free firmware      ");
    ui_print("***********************************************");
    
    show_progress(1.000000, 0);
    
    ui_print("  Mounting /system");
    mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
    set_progress(0.100000);
    
    ui_print("  Extracting files to /system");
    package_extract_dir("system", "/system");
    set_progress(0.400000);
    
    ui_print("  Setting permissions...");
    set_perm_recursive(0,0,0755,0755,"/system/vendor/firmware");
    set_perm(0,0,0644,"/system/vendor/firmware/nvram_net.txt");
    set_perm_recursive(0,0,0755,0755,"/system/etc/wifi");
    set_perm(0,0,0644,"/system/etc/wifi/nvram_net.txt");
    set_perm(0,0,0644,"/system/etc/wifi/nvram_mfg.txt");
    set_perm(0,0,0644,"/system/etc/wifi/wpa_supplicant.conf");
    set_perm_recursive(0,0,0755,0644,"/system/etc/bluetooth");
    
    set_progress(0.500000);
    
    ui_print("  Unmounting /system");
    unmount("/system");
    set_progress(0.900000);
    
    ui_print("Update complete.");
    set_progress(1.000000);
  7. Follow these instructions to generate keys and use them to sign your update package.  Name the signed version update.zip.  (These other instructions might also be helpful.)
  8. Copy the signed update.zip in the root folder of your device’s SD card.
  9. Reboot the device into recovery mode and use the clockworkmod option to install update.zip from the SD card.
  10. Reboot your device and try turning on WiFi and Bluetooth.

6 thoughts on “Replicant Android: How to get WiFi and Bluetooth working”

  1. Hey thanks, this seems to be the only info available, but grant me one question: why isn’t it possible to extract the firmwares directly from the cyanogenmod distribution zip ? Is there something i’m missing?

    thanks
    Giuseppe

  2. Hi !It is an excellent thing you are doing here. What I caonnt find is a comment on versions of supported devices. For example, the Galaxy S. There is a Galaxy S II and III as well, and probably different versions of these for different markets. My question is which ones are covered by Replicant ? I think it would be helpful if you wrote a small comment on this type of thing in the articles of each device you support. A simple comment like we have not tested this against version xxx but we think it should work is better than nothing.

  3. Hello Replicant team,I’m a MSc student in free soatrfwe doing a report about Replicant. I would like to do a little interview to one or two members of the project. Is somebody of your team interested in doing this interview? In that case please, may you contact me by email? It just consists in some general questions answered by email, it does not take more than 15 minutes.Thanks a lot

Comments are closed.