Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ec3924d authored by Steve Kondik's avatar Steve Kondik Committed by Steve Kondik
Browse files

init: Don't wreck things if androidboot.bootdevice isn't set

 * Allow for the original behavior if the bootdevice isn't specified
   on the command line.

Change-Id: Id5549d3229f975747b35bb30a260a15df3b71cec
parent 1f01e5f8
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -585,7 +585,7 @@ static char **get_block_device_symlinks(struct uevent *uevent)
    int ret;
    char *p;
    unsigned int size;
    int is_bootdevice = 0;
    int is_bootdevice = -1;
    struct stat info;
    int mtd_fd = -1;
    int nr;
@@ -638,7 +638,9 @@ static char **get_block_device_symlinks(struct uevent *uevent)
        free(p);
    }

    if (bootdevice[0] != '\0' && !strncmp(device, bootdevice, sizeof(bootdevice))) {
    if (bootdevice[0] == '\0')
        is_bootdevice = 0;
    else if (!strncmp(device, bootdevice, sizeof(bootdevice))) {
        make_link(link_path, "/dev/block/bootdevice");
        is_bootdevice = 1;
    }
@@ -653,7 +655,7 @@ static char **get_block_device_symlinks(struct uevent *uevent)
        else
            links[link_num] = NULL;

        if (is_bootdevice) {
        if (is_bootdevice >= 0) {
            if (asprintf(&links[link_num], "/dev/block/bootdevice/by-name/%s", p) > 0)
                link_num++;
            else
@@ -668,7 +670,7 @@ static char **get_block_device_symlinks(struct uevent *uevent)
        else
            links[link_num] = NULL;

        if (is_bootdevice) {
        if (is_bootdevice >= 0) {
            if (asprintf(&links[link_num], "/dev/block/bootdevice/by-num/p%d", uevent->partition_num) > 0)
                link_num++;
            else