取得系統中所有的package:
pm list packages
取得package的path
pm path PACKAGE_NAME
ex:
$ pm path com.android.example
$ /system/app/Example/Example.apk
取得所有package with path
pm list packages -f
2017年12月21日 星期四
2017年12月13日 星期三
[工作] Access PMIC from fastboot command (UEFI)
之前有個需求是希望能透過fastboot command來讓device進shipmode.
找了一下之後發現xbl裡面已經有提供進shipmode的function,
所以我們只需要把這個function加進protocol,
讓bootloader能access這個protocol.
xbl的部份:
Include/Protocol/EFIPmicSchg.h
增加新的定義:
+typedef
+EFI_STATUS(EFIAPI *EFI_PMIC_SCHG_ENABLE_SHIP_MODE)
+(
+ IN UINT32 PmicDeviceIndex
+);
struct _EFI_PMIC_SCHG_PROTOCOL {
...
+EFI_PMIC_SCHG_ENABLE_SHIP_MODE EnableShipMode;
...
};
Drivers/PmicDxe/PmicSchgProtocol.c
增加新的function:
+EFI_STATUS
+EFIAPI
+EFI_PmicSchgEnableShipMode
+(
+ IN UINT32 PmicDeviceIndex
+)
+{
+ pm_err_flag_type errFlag = PM_ERR_FLAG__SUCCESS;
+
+ errFlag = pm_schg_batif_enable_shipmode(PmicDeviceIndex);
+ if (PM_ERR_FLAG__SUCCESS != errFlag)
+ {
+ return EFI_DEVICE_ERROR;
+ }
+
+ return EFI_SUCCESS;
+}
EFI_QCOM_PMIC_SCHG_PROTOCOL PmicSchgProtocolImplementation =
{
...
+EFI_PmicSchgEnableShipMode,
...
};
bootloader的部份:
把xbl裡面protocol的header檔copy過來,
Include/Protocol/EFIPmicSchg.h
Library/BootLib/BootLib.inf
加入protocol的guid:
[Protocols]
...
gPmicSchgProtocolGuid
XXXModulePkg.dec
更改description, 加入protocol的uuid
gPmicSchgProtocolGuid = { 0xxxxxxxxx } }
使用protocol function的方式:
EFI_STATUS Status = EFI_SUCCESS;
EFI_PMIC_SCHG_PROTOCOL *PmicSchgProtocol = NULL;
Status = gBS->LocateProtocol(&gPmicSchgProtocolGuid, NULL, (VOID **) &PmicSchgProtocol);
PmicSchgProtocol->EnableShipMode(PM_DEVICE_1);
找了一下之後發現xbl裡面已經有提供進shipmode的function,
所以我們只需要把這個function加進protocol,
讓bootloader能access這個protocol.
xbl的部份:
Include/Protocol/EFIPmicSchg.h
增加新的定義:
+typedef
+EFI_STATUS(EFIAPI *EFI_PMIC_SCHG_ENABLE_SHIP_MODE)
+(
+ IN UINT32 PmicDeviceIndex
+);
struct _EFI_PMIC_SCHG_PROTOCOL {
...
+EFI_PMIC_SCHG_ENABLE_SHIP_MODE EnableShipMode;
...
};
Drivers/PmicDxe/PmicSchgProtocol.c
增加新的function:
+EFI_STATUS
+EFIAPI
+EFI_PmicSchgEnableShipMode
+(
+ IN UINT32 PmicDeviceIndex
+)
+{
+ pm_err_flag_type errFlag = PM_ERR_FLAG__SUCCESS;
+
+ errFlag = pm_schg_batif_enable_shipmode(PmicDeviceIndex);
+ if (PM_ERR_FLAG__SUCCESS != errFlag)
+ {
+ return EFI_DEVICE_ERROR;
+ }
+
+ return EFI_SUCCESS;
+}
EFI_QCOM_PMIC_SCHG_PROTOCOL PmicSchgProtocolImplementation =
{
...
+EFI_PmicSchgEnableShipMode,
...
};
bootloader的部份:
把xbl裡面protocol的header檔copy過來,
Include/Protocol/EFIPmicSchg.h
Library/BootLib/BootLib.inf
加入protocol的guid:
[Protocols]
...
gPmicSchgProtocolGuid
XXXModulePkg.dec
更改description, 加入protocol的uuid
gPmicSchgProtocolGuid = { 0xxxxxxxxx } }
使用protocol function的方式:
EFI_STATUS Status = EFI_SUCCESS;
EFI_PMIC_SCHG_PROTOCOL *PmicSchgProtocol = NULL;
Status = gBS->LocateProtocol(&gPmicSchgProtocolGuid, NULL, (VOID **) &PmicSchgProtocol);
PmicSchgProtocol->EnableShipMode(PM_DEVICE_1);
訂閱:
文章 (Atom)