summaryrefslogtreecommitdiff
path: root/partition_installer.cpp
AgeCommit message (Collapse)Author
2021-11-03gsid: Increase image allocation size limitYi-Yo Chiang
Reserve /data size as large as |super|, so VAB can function properly. Bug: 204963821 Test: on a coral-userdebug (|super| ~ 9GB, |userdata| ~ 50GB) $ adb shell gsi_tool create-partition --readwrite --partition \ userdata --size $((45 << 30)) => fail $ adb shell gsi_tool create-partition --readwrite --partition \ userdata --size $((35 << 30)) => success Change-Id: I0bfbfe58471ba2d12231d8aa58510d61abd9b2a7
2021-02-17Explicitly cast to 64bit integer when calculating filesystem sizeYi-Yo Chiang
Else the result may overflow on platforms that have 32bit long. Bug: 179980369 Test: Install DSU on 32bit cuttlefish and observe logcat. Test: Try installing with different userdata size and verify the calculated filesystem size. Change-Id: I50b140590972e733e0e45047b2ce8a6735d205f7
2021-02-17gsid: suggestScratchSize() respect kMinimumFreeSpaceThresholdYi-Yo Chiang
gsid should take kMinimumFreeSpaceThreshold into account when calculating the suggested scratch partition size. Also use uint64_t to store any calculated intermediate result, so we can stay confortable from overflowing, and downcast the result to int64_t in the end, after we clamped the value within int64_t range. Bug: 165925766 Bug: 179980369 Test: Install DSU and verify adb remount works Change-Id: I919c723369d7d788c5c83a19e6b87f077fb2521b
2020-08-24Refactor ~PartitionInstaller() and add FinishInstall()Yo Chiang
Distill the error checking and resource management logic in ~PartitionInstaller() and PostInstallCleanup() into a public method FinishInstall(). FinishInstall() does the opposite of StartInstall(). It checks the installation result, release device handles and cleans up any failed installation files. Then it returns an error code indicating the installation status. Bug: 165471299 Test: Observe logcat when DSU installation fails Change-Id: Iee004bc29dc875c8cf656e11fe8fd259e3003992
2020-08-24Refactor and rename Finish() to CheckInstallState()Yo Chiang
CheckInstallState() returns IGsiService::INSTALL_OK if installation completes successfully, else an error code. Remove the PartitionInstaller::succeeded_ field as checking the value of CheckInstallState() is enough. Bug: 165471299 Test: Observe logcat when DSU installation fails Change-Id: Ie4d798c963c0d537ed5ab35713e1f8faacb89af2
2020-08-24Check install status in ~PartitionInstaller()Yo Chiang
~PartitionInstaller() should check the error code returned by Finish() and clean up the installed images if any error occured. Bug: 165471299 Test: Observe logcat when DSU installation fails Change-Id: If977b4da0f37a0706494259838c84bcd2752ed94
2020-03-03Fix gsi_tool wipe-dataHoward Chen
Bug: 149962466 Test: gsi_tool wipe-data Change-Id: I3265805c95ebad4ed37c4f0f0df2840214e232d4
2020-02-05Add getAvbPublicKey to IGsiService and IImageServiceYo Chiang
Retrieves AVB public key from an image's VBMeta block. Bug: 146418878 Test: adb shell am start-activity \ -n com.android.dynsystem/com.android.dynsystem.VerificationActivity \ -a android.os.image.action.START_INSTALL \ --el KEY_USERDATA_SIZE 8589934592 \ -d file:///storage/emulated/0/Download/aosp_arm64-dsu_test.zip Test: adb shell gsi_tool status \ // command should show sha1 of public key for each partition Change-Id: Ic529275a2678e6c1ce341910e4dbbe9af66742a7
2020-01-14Support multiple DSU installationsHoward Chen
Bug: 144247097 Test: adb shell gsi_tool install --gsi-size $(du -b system.raw|cut -f1) < system.raw Change-Id: I17f4292fc3038040cc5848ce00081e96c79ae769
2019-12-17gsid: Fixes for 32-bitPaul Trautrim
Bug: 146386624 Test: DSUEndtoEndTest Change-Id: I376f253c740575d8350b14faed1d04743d038f81
2019-11-12RefactoringHoward Chen
* Remove GsiInstallParams.aidl * GsiInstaller -> PartitionInstaller * beginGsiInstall -> open, close, createPartition * wipeUserdata -> zeroPartition * GetInstallation returns current installation * SaveInstallation save current installation Test: gsi_tool install & reboot adb shell am start-activity \ -n com.android.dynsystem/com.android.dynsystem.VerificationActivity \ -a android.os.image.action.START_INSTALL \ -d file:///storage/emulated/0/Download/system.raw.gz \ --el KEY_SYSTEM_SIZE $(du -b system.raw|cut -f1) \ --el KEY_USERDATA_SIZE 8589934592 Change-Id: I2be8b12130bd0a5f768a496c3a0ca8a3b2682c45