repack: move sbin to /system ramdisk and update repacking
for android-10

This will support updating the ramdisk to a different
compression format and co-exist with magisk.

We are also cleaning up and removing non android-10
api makefile actions.

We are also moving twrp repacking to its own class. We
check the new ramdisk format and if it's different
we have magisk compress using the new ramdisk format.

Change-Id: I770030aae7797e75817178b2f0fccd9f39dc23af
diff --git a/partitions.hpp b/partitions.hpp
index 53d40ac..55a0ac1 100755
--- a/partitions.hpp
+++ b/partitions.hpp
@@ -76,19 +76,6 @@
 	char* fstab_line;
 };
 
-enum Repack_Type {
-	REPLACE_NONE = 0,
-	REPLACE_RAMDISK = 1,
-	REPLACE_KERNEL = 2,
-};
-
-struct Repack_Options_struct {
-	Repack_Type Type;
-	bool Backup_First;
-	bool Disable_Verity;
-	bool Disable_Force_Encrypt;
-};
-
 enum PartitionManager_Op {                                                    // PartitionManager Restore Mode for Raw_Read_Write()
 	PM_BACKUP = 0,
 	PM_RESTORE = 1,
@@ -160,13 +147,16 @@
 	int Decrypt_Adopted();
 	void Revert_Adopted();
 	void Partition_Post_Processing(bool Display_Error);                       // Apply partition specific settings after fstab processed
-	void Set_Backup_FileName(string fname);                                   // Set Backup_FileName for partition
+	void Set_Backup_FileName(string fname);                                   // Set backup filename for partition
+	std::string Get_Backup_FileName();                                        // Get the backup filename for the partition
 	string Get_Backup_Name();                                                 // Get Backup_Name for partition
 	bool Decrypt_FBE_DE();                                                    // If FBE is present, backup exclusions are set up and DE decrypt is attempted
 	string Get_Mount_Point();												  // Return Mount_Point or directory the current partition is mounted on
 	bool Get_Super_Status();												  // Returns true if partition is a super volume mounted partitions
 	void Set_Can_Be_Backed_Up(bool val);									  // Update whether the partition can be backed up or not
 	void Set_Can_Be_Wiped(bool val);										  // Update whether the partition can be wiped or not
+	std::string Get_Display_Name();                                           // Get the display name in the gui for the partition
+	bool Is_SlotSelect();                                                     // Return whether the partition is a slot partition or not
 
 public:
 	string Current_File_System;                                               // Current file system
@@ -384,9 +374,6 @@
 	void read_uevent();                                                       // Reads uevent data into a buffer
 	void close_uevent();                                                      // Closes the uevent netlink socket
 	void Add_Partition(TWPartition* Part);                                    // Adds a new partition to the Partitions vector
-	bool Prepare_Repack(TWPartition* Part, const std::string& Temp_Folder_Destination, const bool Create_Backup, const std::string& Backup_Name); // Prepares an image for repacking by unpacking it to the temp folder destination
-	bool Prepare_Repack(const std::string& Source_Path, const std::string& Temp_Folder_Destination, const bool Copy_Source, const bool Create_Destination = true); // Prepares an image for repacking by unpacking it to the temp folder destination
-	bool Repack_Images(const std::string& Target_Image, const struct Repack_Options_struct& Repack_Options); // Repacks the boot image with a new kernel or a new ramdisk
     bool Prepare_Super_Volume(TWPartition* twrpPart);					  	  // Prepare logical super partition volume for mounting
 	std::string Get_Super_Partition();										  // Get Super Partition block device path
 	void Setup_Super_Devices();												  // Setup logical dm devices on super partition
@@ -411,6 +398,8 @@
 	int mtp_write_fd;
 	pid_t tar_fork_pid;                                                       // PID of twrpTar fork
 	Backup_Method_enum Backup_Method;                                         // Method used for backup
+	std::string original_ramdisk_format;                                      // Ramdisk format of boot partition
+	std::string repacked_ramdisk_format;                                      // Ramdisk format of boot image to repack from
 
 private:
 	std::vector<TWPartition*> Partitions;                                     // Vector list of all partitions