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

Commit 96af84a4 authored by Ethan Yonker's avatar Ethan Yonker Committed by Dees Troy
Browse files

Allow flashing of images via the GUI

- Use the Images... button in the lower right of the zip install
  page
- Unify image flashing functions between restore and image flash
- boot and recovery partitions are flashable by default
- use fstab flag flashimg=1 or 0 to override defaults
- file system partitions are currently not flashable

Change-Id: I822dc446030543c55d2153e219d67a1292374ffc
parent 7d3b54f3
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -201,6 +201,7 @@ GUIAction::GUIAction(xml_node<>* node)
		mf["decrypt_backup"] = &GUIAction::decrypt_backup;
		mf["repair"] = &GUIAction::repair;
		mf["changefilesystem"] = &GUIAction::changefilesystem;
		mf["flashimage"] = &GUIAction::flashimage;
	}

	// First, get the action
@@ -1651,6 +1652,24 @@ int GUIAction::stopmtp(std::string arg)
	return 0;
}

int GUIAction::flashimage(std::string arg)
{
	int op_status = 0;

	operation_start("Flash Image");
	string path, filename, full_filename;
	DataManager::GetValue("tw_zip_location", path);
	DataManager::GetValue("tw_file", filename);
	full_filename = path + "/" + filename;
	if (PartitionManager.Flash_Image(full_filename))
		op_status = 0; // success
	else
		op_status = 1; // fail

	operation_end(op_status);
	return 0;
}

int GUIAction::getKeyByName(std::string key)
{
	if (key == "home")			return KEY_HOME;
+1 −0
Original line number Diff line number Diff line
@@ -192,6 +192,7 @@
		<variable name="button_fill_half_height" value="50" />
		<variable name="button_fill_quarter_height" value="30" />
		<variable name="button_full_center_x" value="256" />
		<variable name="flash_list_height" value="200" />
		<variable name="backup_list_x" value="23" />
		<variable name="backup_list_y" value="105" />
		<variable name="backup_list_width" value="486" />
+1 −0
Original line number Diff line number Diff line
@@ -192,6 +192,7 @@
		<variable name="button_fill_half_height" value="50" />
		<variable name="button_fill_quarter_height" value="30" />
		<variable name="button_full_center_x" value="256" />
		<variable name="flash_list_height" value="200" />
		<variable name="backup_list_x" value="23" />
		<variable name="backup_list_y" value="105" />
		<variable name="backup_list_width" value="486" />
+1 −0
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@
		<variable name="row17_text_y" value="1455" />
		<variable name="row18_text_y" value="1530" />
		<variable name="zip_status_y" value="922" />
		<variable name="flash_list_height" value="500" />
		<variable name="tz_selected_y" value="240" />
		<variable name="tz_set_y" value="1500" />
		<variable name="tz_current_y" value="1425" />
+1 −0
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@
		<variable name="row17_text_y" value="1455" />
		<variable name="row18_text_y" value="1530" />
		<variable name="zip_status_y" value="922" />
		<variable name="flash_list_height" value="500" />
		<variable name="tz_selected_y" value="240" />
		<variable name="tz_set_y" value="1500" />
		<variable name="tz_current_y" value="1425" />
Loading