[Android Q&A, Help & Troubleshooting] moorkai:
load_bcmdriver as an init.d alternative

This, out of pure necessity, needed to be a separate post (and not an edit of #293). I believe many people will find this useful, well, if you play games on your Geek and have installed a few big titles, you have definitely stumbled upon this problem. You have probably tried to install that new awesome looking racing game on your Geek (Real Racing 3, someone?), but suddenly you have run out of space and hit the 2 GB glass ceiling. Dang!

Luckily, there is a remedy (root permissions necessary!) for that: make an ext4 partition on your microSD card, mount it (by working around the necessity of having init.d support - we'll come to it later), and move data from your internal memory to your microSD card using Titanium Backup's Data2SD implementation. Sounds simple, right? Well, as I have already said, we don't have init.d support yet, so we have to fiddle with our little device (read: it's not, but quite there), as the ext4 file system needs to be mounted before Android indexes the installed applications. Later mounting won't help much.

That's where load_bcmdriver comes to save us. It's executed early enough to do the trick. At this point it is highly desired (read: do it now if you didn't already) to have your microSD card partitioned so that it has x gigabytes of FAT32 space and then some ext4 space (using different order will require altering the Data2SD command lines). After you have done that, set ADB up (most Linux distros have adb available in their repositories, and for Windows there is Minimal ADB and Fastboot), connect to your phone using USB or network (anything will do) and execute the following commands (just in case you wonder, type the commands after and excluding the $ or # signs - $ indicates the ordinary user prompt, and # indicates root prompt):

connecting to your phone using ADB

[I]$[/I] adb shell

acquiring Superuser permissions

[I]$[/I] su

our phone won't really cooperate until we mount / as rw

[I]#[/I] mount -o remount,rw /

... as well as the /system partition

[I]#[/I] mount -o remount,rw /system

Okay, now, it's time to edit the load_bcmdriver shell file with whichever text editor you find applicable, as long as it can make use of superuser permissions (nano, vi, ES's file editor, etc.). It's located at /system/bin/load_bcmdriver. Originally, at least on B03, it looks like this:

#!/system/bin/sh

# Depending on Hardware (VV or PR board), NVRAM is different to follow the hardware.
NVRAM_REV="$(getprop ro.spid.wifi.nvram)"
if [ -z "${NVRAM_REV}" ]
then
NVRAM_REV='vv'
fi

# These hardcoded path for firmware and nvram are also defined in
# WifiBoardConfig.mk. Make sure to change at both places...
BCM4334_FLAGS="firmware_path=/system/etc/firmware/fw_bcmdhd_43341.bin nvram_path=/system/etc/wifi/bcmdhd_43341.cal"
BCM4335_FLAGS='firmware_path=/system/etc/firmware/fw_bcmdhd_4335.bin nvram_path=/system/etc/wifi/bcmdhd_4335.cal'

setprop wlan.bcm.chip 4334

# Here we trry to insmod the bcm4334 driver. Depending on how the driver has
# been compiled, it might fail directly here if the chip is bcm4335, in which
# case we then insmod the bcm4335 driver.
# If it's been compiled with ENABLE_INSMOD_NO_FW_LOAD, failure will happen when
# bringin the interface up which is handled in next code block.
/system/bin/insmod /lib/modules/bcmdhd.ko ${BCM4334_FLAGS}

setprop wlan.driver.status ok

Now add the following lines to the beginning of load_bcmdriver just below #!/system/bin/sh:

# D2SD mount
mount -o remount,rw "/"
mkdir "/sd-ext"
mount -t ext4 -o rw "/dev/block/mmcblk1p2" "/sd-ext"

Or, simply said, make it look this way:

#!/system/bin/sh

# D2SD mount
mount -o remount,rw "/"
mkdir "/sd-ext"
mount -t ext4 -o rw "/dev/block/mmcblk1p2" "/sd-ext"

# Depending on Hardware (VV or PR board), NVRAM is different to follow the hardware.
NVRAM_REV="$(getprop ro.spid.wifi.nvram)"
if [ -z "${NVRAM_REV}" ]
then
NVRAM_REV='vv'
fi

# These hardcoded path for firmware and nvram are also defined in
# WifiBoardConfig.mk. Make sure to change at both places...
BCM4334_FLAGS="firmware_path=/system/etc/firmware/fw_bcmdhd_43341.bin nvram_path=/system/etc/wifi/bcmdhd_43341.cal"
BCM4335_FLAGS='firmware_path=/system/etc/firmware/fw_bcmdhd_4335.bin nvram_path=/system/etc/wifi/bcmdhd_4335.cal'

setprop wlan.bcm.chip 4334

# Here we trry to insmod the bcm4334 driver. Depending on how the driver has
# been compiled, it might fail directly here if the chip is bcm4335, in which
# case we then insmod the bcm4335 driver.
# If it's been compiled with ENABLE_INSMOD_NO_FW_LOAD, failure will happen when
# bringin the interface up which is handled in next code block.
/system/bin/insmod /lib/modules/bcmdhd.ko ${BCM4334_FLAGS}

setprop wlan.driver.status ok

Now save and exit from the text editor of your choice and reboot! Once you fire up Titanium Backup, you should see one additional used/free space indicator there and be able to move application data to your microSD card.

P.S. load_bcmdriver could enable or mimic init.d functionality and make scripts like V8 SuperCharger run in early start, so go wild with your curiosity ;) ... though hacking boot.img and/or ramdisk might be a better option.