Generate a "serial number" for Android, pass it via modified /proc/cmdline
Android expects a serial number to be passed to init via the kernel command
line. Android generates a unique system identifier, ANDROID_ID, based on the
machine's serial number. Without one, ANDROID_ID is always the same. Certain
market apps rely on a unique ANDROID_ID (outside of emulator) for accounting
purposes.
To provide such an ID, we now generate a random, fake serial number and store
it in /data. This will ensure it survives reboots. We then modify the kernel
command line by copying it to /tmp, editing it, and bind-mounting over the
original in /proc.