I am running Android 4.4 (using custom a custom rooted system image) in the android emulator (from the command line). When trying to set the time via Settings > Date & time ("Automatic date & time" and "Automatic time zone" are disabled) i can set the time (the dialog appears and works), but the system clock is not updated.

Logcat says:

D/        ( 1206): Setting time of day to sec=1515250620
W/        ( 1206): Unable to open alarm driver: No such file or directory

What could cause the alarm driver to be unavailable/missing and how can i fix this?

Update: I have verified that /dev/alarm is missing -- is there any way to add the missing driver without having to recompile android?

Thanks!

Yes, but some compiling is needed for the driver. Just not the whole custom image.

You need to set-up a cross compiler.

Go to your .config file and set the kernel driver you want to compile to

=m

using the menuconfig command

By selecting 'm' for the kernel driver. This means ``module,'' meaning that the system will compile it, but not directly into the kernel, but as a loadable module."

Now you are ready to compile your specific driver using this make command.

make <ARCH= Path to arm-eabi- directory >  <path to the .c file of module>

Once compiled go grab the created .ko file. Copy it to

/system/lib/modules/

within your custom rooted system image.

Lastly, from the terminal emulator use the insmod command to inject it in. So it would look like

su

mount -o rw,remount,rw /system

insmod /system/lib/modules/modulefile.ko

That should do it if you encounter any errors read them carefully incase the module is interdependent. Check the Dmesg logs for success or errors.

References:

https://source.android.com/devices/architecture/kernel/modular-kernels#loadable-kernel-modules

http://linuxdocs.org/HOWTOs/Kernel-HOWTO-4.html

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.