In a recent CyanogenMod 9 port I needed to set permissions on various device nodes at boot. I knew I needed to use ueventd, but I wasn’t sure which file Android’s ueventd daemon was looking in for device-specific rules.
As it turns out, Android’s init system decides which
ueventd.*.rc file to parse based on the kernel’s
androidboot.hardware command line parameter. Here’s the relevant snippet from
/* Respect hardware passed in through the kernel cmd line. Here we will look * for androidboot.hardware param in kernel cmdline, and save its value in * hardware. */ import_kernel_cmdline(0, import_kernel_nv); get_hardware_name(hardware, &revision); ueventd_parse_config_file("/ueventd.rc"); snprintf(tmp, sizeof(tmp), "/ueventd.%s.rc", hardware);
After I read that, it was trivial to set my kernel’s cmdline to
androidboot.hardware=u8185 and then start throwing rules into
Now you know. May the source be with you. 😉