diff options
author | David Ng <dave@codeaurora.org> | 2013-09-30 12:15:26 -0700 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:22:35 -0600 |
commit | 22abdc3934cc255a136ba7050c0aa49cb0a0f9ba (patch) | |
tree | 1ffc2e231c567078e021786638489293af91d4ca /init | |
parent | b198304a56bad86a08b5dd647113c61489dcb564 (diff) | |
download | system_core-22abdc3934cc255a136ba7050c0aa49cb0a0f9ba.zip system_core-22abdc3934cc255a136ba7050c0aa49cb0a0f9ba.tar.gz system_core-22abdc3934cc255a136ba7050c0aa49cb0a0f9ba.tar.bz2 |
ueventd: Add bootdevice symlink for boot storage device
Create /dev/block/bootdevice symlink for the boot storage
device based on ro.boot.bootdevice property. The property
value can be passed in via bootloader. This abstracts
references to the boot device (including partition nodes
in the boot device) from the actual device nodes (e.g. eMMC,
UFS).
Change-Id: I9c921fc9e31855759435fac27bd384645eee0236
Diffstat (limited to 'init')
-rw-r--r-- | init/devices.cpp | 8 | ||||
-rw-r--r-- | init/ueventd.cpp | 4 |
2 files changed, 12 insertions, 0 deletions
diff --git a/init/devices.cpp b/init/devices.cpp index 4944cec..9151f06 100644 --- a/init/devices.cpp +++ b/init/devices.cpp @@ -47,6 +47,7 @@ #include "ueventd_parser.h" #include "util.h" #include "log.h" +#include "property_service.h" #define SYSFS_PREFIX "/sys" static const char *firmware_dirs[] = { "/etc/firmware", @@ -55,6 +56,8 @@ static const char *firmware_dirs[] = { "/etc/firmware", extern struct selabel_handle *sehandle; +extern char boot_device[PROP_VALUE_MAX]; + static int device_fd = -1; struct uevent { @@ -518,6 +521,11 @@ static char **get_block_device_symlinks(struct uevent *uevent) else links[link_num] = NULL; + if (pdev && boot_device[0] != '\0' && strstr(device, boot_device)) { + /* Create bootdevice symlink for platform boot stroage device */ + make_link_init(link_path, "/dev/block/bootdevice"); + } + return links; } diff --git a/init/ueventd.cpp b/init/ueventd.cpp index c63fdaa..2dd8b01 100644 --- a/init/ueventd.cpp +++ b/init/ueventd.cpp @@ -33,6 +33,8 @@ #include "ueventd_parser.h" #include "property_service.h" +char boot_device[PROP_VALUE_MAX]; + int ueventd_main(int argc, char **argv) { /* @@ -65,6 +67,8 @@ int ueventd_main(int argc, char **argv) ueventd_parse_config_file("/ueventd.rc"); ueventd_parse_config_file(android::base::StringPrintf("/ueventd.%s.rc", hardware).c_str()); + property_get("ro.boot.bootdevice", boot_device); + device_init(); pollfd ufd; |