summaryrefslogtreecommitdiffstats
path: root/fastboot
diff options
context:
space:
mode:
authorBadhri Jagan Sridharan <Badhri@google.com>2015-05-15 16:43:47 -0700
committerVineeta Srivastava <vsrivastava@google.com>2015-05-28 19:15:27 +0000
commita873e1dc0280f5d21384ec03ba812f4336c5dec5 (patch)
treecb819d342fda7bd1502d19f3b2f2543172970aed /fastboot
parent9fc834377297cb2dcc418e4ce7e38e89dd09812b (diff)
downloadsystem_core-a873e1dc0280f5d21384ec03ba812f4336c5dec5.zip
system_core-a873e1dc0280f5d21384ec03ba812f4336c5dec5.tar.gz
system_core-a873e1dc0280f5d21384ec03ba812f4336c5dec5.tar.bz2
fastboot: Add support for fastboot flashing commands
Commands added: fastboot flashing lock - Prevents flashing partitions fastboot flashing unlock - Enable user to flashing partitions fastboot flashing lock_critical - Prevents flashing bootloader related paritions fastboot flashing unlock_critical - Enables user to flash bootloader related partitions fastboot flashing get_unlock_ability - Query bootloader to check if device is locked. (cherry picked from commit bf11095f92c9278cb794a5336e1cce264f9b734d) Change-Id: Id6db16ba32f7a2b1c3f041a76bd3bdf2d3ab471e
Diffstat (limited to 'fastboot')
-rw-r--r--fastboot/fastboot.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index c599fc2..51985af 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -280,6 +280,17 @@ void usage(void)
" flashall flash boot, system, vendor and if found,\n"
" recovery\n"
" flash <partition> [ <filename> ] write a file to a flash partition\n"
+ " flashing lock locks the device. Prevents flashing"
+ " partitions\n"
+ " flashing unlock unlocks the device. Allows user to"
+ " flash any partition except the ones"
+ " that are related to bootloader\n"
+ " flashing lock_critical Prevents flashing bootloader related"
+ " partitions\n"
+ " flashing unlock_critical Enables flashing bootloader related"
+ " partitions\n"
+ " flashing get_unlock_ability Queries bootloader to see if the"
+ " device is unlocked\n"
" erase <partition> erase a flash partition\n"
" format[:[<fs type>][:[<size>]] <partition> format a flash partition.\n"
" Can override the fs type and/or\n"
@@ -1185,6 +1196,16 @@ int main(int argc, char **argv)
wants_reboot = 1;
} else if(!strcmp(*argv, "oem")) {
argc = do_oem_command(argc, argv);
+ } else if(!strcmp(*argv, "flashing") && argc == 2) {
+ if(!strcmp(*(argv+1), "unlock") || !strcmp(*(argv+1), "lock")
+ || !strcmp(*(argv+1), "unlock_critical")
+ || !strcmp(*(argv+1), "lock_critical")
+ || !strcmp(*(argv+1), "get_unlock_ability")) {
+ argc = do_oem_command(argc, argv);
+ } else {
+ usage();
+ return 1;
+ }
} else {
usage();
return 1;