Skip to content

Commit

Permalink
Fix regression in sdcard partitioning menu.
Browse files Browse the repository at this point in the history
1606b8a

Change-Id: I110b7aee9274ddc58bc59a744d831f22e22e1336
  • Loading branch information
koush committed Nov 22, 2012
1 parent 1606b8a commit 038bd90
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions extendedcommands.c
Expand Up @@ -1294,13 +1294,13 @@ void show_advanced_menu()
};

if (!can_partition("/sdcard")) {
list[7] = NULL;
list[6] = NULL;
}
if (!can_partition("/external_sd")) {
list[8] = NULL;
list[7] = NULL;
}
if (!can_partition("/emmc")) {
list[9] = NULL;
list[8] = NULL;
}

for (;;)
Expand Down

13 comments on commit 038bd90

@PhilZ-cwm6
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jelly Bean needs this:
/preload support for the nandrodi backups or they get useless backups:

nandroid.c edits

For backup:

if (0 != (ret = nandroid_backup_partition(backup_path, "/system")))
    return ret;

if (0 != (ret = nandroid_backup_partition(backup_path, "/preload")))
    return ret;

For restore (linked to /system/app)

if (restore_system && 0 != (ret = nandroid_restore_partition(backup_path, "/system")))
    return ret;

if (restore_system && 0 != (ret = nandroid_restore_partition(backup_path, "/preload")))
    return ret;

@koush
Copy link
Author

@koush koush commented on 038bd90 Nov 22, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/preload is not aosp standard

@PhilZ-cwm6
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@boeaja
Copy link

@boeaja boeaja commented on 038bd90 Nov 23, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line :

int vol_len = strlen(vol->device);
    // do not allow partitioning of a device that isn't mmcblkX or mmcblkXp1
    if (vol->device[vol_len - 2] == 'p' && vol->device[vol_len - 2] != '1') {
        LOGI("Can't partition unsafe device: %s\n", vol->device);
        return 0;
    }

should be :

int vol_len = strlen(vol->device);
    // do not allow partitioning of a device that isn't mmcblkX or mmcblkXp1
    if (vol->device[vol_len - 2] == 'p' && vol->device[vol_len - 1] != '1') {
        LOGI("Can't partition unsafe device: %s\n", vol->device);
        return 0;
    }

so menu partition sdcard is available because it allways give me "Can't partition unsafe device: mmcblk1p1" on recovery_log

@koush
Copy link
Author

@koush koush commented on 038bd90 Nov 23, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@boeaja I am pretty sure that line is correct.

Can you paste your recovery.fstab?

@PhilZ-cwm6
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about his, but same issue with this one i9100/n7000

mount point fstype device

/boot emmc /dev/block/mmcblk0p5
/recovery emmc /dev/block/mmcblk0p6

/efs ext4 /dev/block/mmcblk0p1
/cache ext4 /dev/block/mmcblk0p7
/system ext4 /dev/block/mmcblk0p9
/data ext4 /dev/block/mmcblk0p10
/preload ext4 /dev/block/mmcblk0p12
/modem emmc /dev/block/mmcblk0p8 #added manually

/emmc vfat /dev/block/mmcblk0p11
/sdcard vfat /dev/block/mmcblk1p1

@koush
Copy link
Author

@koush koush commented on 038bd90 Nov 23, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm

/sdcard vfat /dev/block/mmcblk1p1

looks right.

[len - 2] == 'p' and [len - 1] == '1', so it shouldn't bail out with that error there.

@boeaja
Copy link

@boeaja boeaja commented on 038bd90 Nov 24, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my recovery.fstab

# mount point   fstype    device        [device2]

/boot       emmc        /dev/block/mmcblk0p8
/cache      ext4        /dev/block/mmcblk0p15
/data       ext4        /dev/block/mmcblk0p13
/misc       emmc        /dev/block/mmcblk0p17
/recovery   emmc        /dev/block/mmcblk0p16
/sdcard     vfat        /dev/block/mmcblk1p1        /dev/block/mmcblk1
/system     ext4        /dev/block/mmcblk0p12
/sd-ext     ext4        /dev/block/mmcblk1p2
/emmc       vfat        /dev/block/mmcblk0p18

// do not allow partitioning of a device that isn't mmcblkX or mmcblkXp1
so /sdcard is mmcblk1p1 ---> [len - 2] == 'p' and [len - 1] != '1', --->False ( no error generated , so i can partition my sdcard)

@koush
Copy link
Author

@koush koush commented on 038bd90 Nov 24, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@boeaja Right, isn't that correct behavior?

@boeaja
Copy link

@boeaja boeaja commented on 038bd90 Nov 24, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes..

The original code
(vol->device[vol_len - 2] == 'p' && vol->device[vol_len - 2] != '1') -->> true for mmcblk1p1 so error generated and menu Partition sdcard mising..

So will it be fix or i have to fix each time sync the repo...

@koush
Copy link
Author

@koush koush commented on 038bd90 Nov 24, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh I see.

@koush
Copy link
Author

@koush koush commented on 038bd90 Nov 24, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@PhilZ-cwm6
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, now you got it
Never bothered fixing it on repo sync for my builds as I hate partition sdcards from phone. But many do complain
Thumbs up for prompt support

Please sign in to comment.