UEFI_Init() private method

private UEFI_Init ( ) : bool
return bool
Exemplo n.º 1
0
        private Boolean CreateUEFIBootOption(String Drive)
        {
            String _Drive = String.Format(@"\\.\{0}", Drive);

            Log.write("-Add UEFI Entry");

            if (!UEFIWrapper.UEFI_Init())
            {
                Log.write("UEFI Init Fail");
                return(false);
            }

            if (Environment.Is64BitOperatingSystem)
            {
                if (!UEFIWrapper.UEFI_MakeMediaBootOption(config.BOOT_ENTRY_TEXT, _Drive, config.UEFI_DIR + config.UEFI_GRUB_BIN64))
                {
                    Log.write("UEFI 64-bit Entry Fail");
                    return(false);
                }
            }
            else
            {
                if (!UEFIWrapper.UEFI_MakeMediaBootOption(config.BOOT_ENTRY_TEXT, _Drive, config.UEFI_DIR + config.UEFI_GRUB_BIN32))
                {
                    Log.write("UEFI 32-bit Entry Fail");
                    return(false);
                }
            }
            return(true);
        }
Exemplo n.º 2
0
        protected override bool UnInstallBootObjects(Object extraData)
        {
            Log.write("===Removing Boot Objects===");
            MountFirmwarePartition();
            if (UEFIWrapper.UEFI_Init())
            {
                Log.write("-Remove Android UEFI Entry");
                int ret = UEFIWrapper.UEFI_DeleteBootOptionByDescription(config.BOOT_ENTRY_TEXT);
                Log.write("-UEFI: " + ret);
            }
            else
            {
                Log.write("-UEFI Init ... fail");
            }
            base.cleanup(config.UEFI_PARTITION_MOUNTPOINT + config.UEFI_DIR);
            UnMountFirmwarePartition();

            return(true);
        }