Droidboot Provision Os

0 views
Skip to first unread message

Demeter Exekutor

unread,
Aug 4, 2024, 9:52:44 PM8/4/24
to giosoundxydo
Adevice running Windows 10 has several requirements for booting into the OS. After the device's firmware initializes all the hardware, the device needs to ensure that there's enough power to boot. Afterwards, the device needs to ensure that the device is booting into the appropriate OS depending on if the user wants to perform an update or a restore on the device, or if the user wants to boot the device into the main OS.

The firmware boot loaders boot the UEFI environment and hands over control to UEFI applications written by the SoC vendor, Microsoft, and OEMs. These applications can utilize UEFI drivers and services.


Full Flash Update (FFU) image flashing mode refers to a UEFI application that flashes an OS image to device storage. Microsoft provides a UEFI flashing application that can be used in non-manufacturing scenarios. OEMs can also implement their own UEFI flashing application. For more information, see Capture and apply Windows Full Flash Update (FFU) images.


The SoC firmware boot loaders initialize the minimal set of hardware required for the device to run. The SoC firmware boot loaders are designed to finish as fast as possible, and nothing is drawn to the screen while they're running. After the SoC firmware boot loaders finish, the device is booted into the UEFI environment.


The SoC firmware boot loaders also contain an emergency flashing capability that allows devices to be flashed when the boot environment isn't stable and Full Flash Update (FFU) image-based flashing using the Microsoft-provided flashing tool isn't possible. Emergency flashing requires tools specific to the SoC. For more information, contact the SoC vendor.


Windows 10 utilizes the Unified Extensible Firmware Interface (UEFI) to support the handoff of system control from the SoC firmware boot loader to the OS. The UEFI environment is a minimal boot OS upon which devices are booted and the Windows 10 OS runs. For more information, see UEFI in Windows.


The Windows Boot Manager is a Microsoft-provided UEFI application that sets up the boot environment. Inside the boot environment, individual boot applications started by the Boot Manager provide functionality for all customer-facing scenarios before the device boots.


After the UEFI environment launches the Boot Manager, the Boot Manager initializes boot libraries, reads the boot configuration database to determine which boot applications to run and in which order to run them. The Boot Manager launches boot applications sequentially, and each application exits back to the Boot Manager after finishing.


Boot libraries are libraries of functions that extend upon existing UEFI functionality, and are designed to be used within the boot environment. Only boot applications, which are launched by the Boot Manager, have access to the boot libraries.


In non-retail OS images, the Boot Manager next runs an offline crash dump boot application that allows the device to capture a snapshot of physical memory from the previous OS session. When the device resets abnormally, the previous OS session's memory is preserved across the reset. When this happens, the offline crash dump application saves that memory and turn it into an offline crash dump file, which can be transferred off the device and analyzed. If the device didn't reset abnormally in the previous OS session, the offline crash dump application exits immediately.


In all OS images, the Boot Manager next runs mobilestartup.efi. This application runs several boot libraries, some of which are only run on first boot (for example, to provision the secure boot policy) or only in non-retail images (for example, to enter USB mass storage mode). The following libraries are always run:


First, mobilestartup.efi runs the library that implements UEFI battery charging. This library allows the user to charge their device while the device is in the boot environment (or is perceived as being turned off). This library is run first to ensure that the device has enough power to fully boot. For more information about scenarios involving the battery charging application, see Battery charging in the boot environment.


Next, mobilestartup.efi runs the libraries that implement flashing, device reset, and updates. These libraries determine whether the device should boot to flashing or device reset mode, or if the device should continue to the Update OS or Main OS.


So flashrom can read the flash memory just fine, I haven't tried to write it yet, but I think I'll do it soon. Since it's an SPI flash there is a chance that it's reasonably easy to re-program it with an external programmer in case of a brick. I haven't taken the device apart yet to see what physical package the flash chip uses.


The last two logos are boot animations, fired up one after the other by the bootanim service invoked by the init.rc file that is on the boot partition; the animation data is taken from the system partition, it's in the media/bootanimation.zip file: just PNGs, one per frame.


So after some hours of looking I found that it'd be super easy to customize the root filesystem and even all the logos of the boot sequence; however what I really want to do is to load a custom kernel, but that's meat for another day.


My tablet is reboot in droidboot mode only when I tried to flash the official firmware using the tool to obtain root permissions (in toolbox the function Firmware Flash tablet using fastboot):

-toolbox-for-install-windows-and-r...

but it did not work, work only to obtain root permission


Can You give me some suggestions on how to install firwmare with Flash Tool Manufacturing or using another mode?

If I reboot into recovery mode I find written "apply update from AD"B can I use this mode to install the latest version of firmware?

Thanks and sorry for my bad English but I use google translator.


I haven't updated the firmware yet; and instead I broke it by setting some options in the firmware menu which now makes the device reset at boot and USB host is not working either, so I cannot enter the firmware menu anymore. I think I have to flash the firmware with an external programmer; for the records the chip is a W25Q64FW SPI flash, coming in a SOIC-8 package.


Did you manage to replace all the boot logos? Would like to switch all the logos, including the first one you get before selecting OS. Is this possible? If so, how do I do this, please explain how to replace the boot logos shown after selecting Android or Windows too!


Thanks for your post. I was trying to follow the same steps as above where I tried compiling flashrom on an x86 machine and then pushed it to my x86 tablet using adb push as shown above, but doesn't seem like that worked for me. I was under the impression that, one has to recompile it on android on x86 using NDK for flashrom to work(Because the libraries that flashrom would need on a Linux machine may or may not be available on android) Could you please throw some light on how you pushed it to android and made it work?


Verified boot is the process of assuring the end user of the integrity of the software running on a device. It typically starts with a read-only portion of the device firmware which loads code and executes it only after cryptographically verifying that the code is authentic and doesn't have any known security flaws. AVB is one implementation of verified boot.


The central data structure used in AVB is the VBMeta struct. This data structure contains a number of descriptors (and other metadata) and all of this data is cryptographically signed. Descriptors are used for image hashes, image hashtree metadata, and so-called chained partitions. A simple example is the following:


where the vbmeta partition holds the hash for the boot partition in a hash descriptor. For the system and vendor partitions a hashtree follows the filesystem data and the vbmeta partition holds the root hash, salt, and offset of the hashtree in hashtree descriptors. Because the VBMeta struct in the vbmeta partition is cryptographically signed, the boot loader can check the signature and verify it was made by the owner of key0 (by e.g. embedding the public part of key0) and thereby trust the hashes used for boot, system, and vendor.


A chained partition descriptor is used to delegate authority - it contains the name of the partition where authority is delegated as well as the public key that is trusted for signatures on this particular partition. As an example, consider the following setup:


In this setup the xyz partition has a hashtree for integrity-checking. Following the hashtree is a VBMeta struct which contains the hashtree descriptor with hashtree metadata (root hash, salt, offset, etc.) and this struct is signed with key1. Finally, at the end of the partition is a footer which has the offset of the VBMeta struct.


This setup allows the bootloader to use the chain partition descriptor to find the footer at the end of the partition (using the name in the chain partition descriptor) which in turns helps locate the VBMeta struct and verify that it was signed by key1 (using key1_pub stored in the chain partition descriptor). Crucially, because there's a footer with the offset, the xyz partition can be updated without the vbmeta partition needing any changes.


The VBMeta struct is flexible enough to allow hash descriptors and hashtree descriptors for any partition to live in the vbmeta partition, the partition that they are used to integrity check (via a chain partition descriptor), or any other partition (via a chain partition descriptor). This allows for a wide range of organizational and trust relationships.


Chained partitions need not use a footer - it is permissible to have a chained partition point to a partition where the VBMeta struct is at the beginning (e.g. just like the vbmeta partition). This is useful for use-cases where all hash- and hashtree-descriptors for the partitions owned by an entire organization are stored in a dedicated partition, for example vbmeta_google. In this example the hashtree descriptor for system is in the vbmeta_google partition meaning that the bootloader doesn't need to access the system partition at all which is helpful if the system partition is managed as a logical partition (via e.g. LVM techniques or similar).

3a8082e126
Reply all
Reply to author
Forward
0 new messages