OLD | NEW |
(Empty) | |
| 1 This directory contains examples of the new-style BIOS bitmaps, and a simple |
| 2 (and ugly) tool to view the configuration file that describes how each |
| 3 screen is displayed. |
| 4 |
| 5 Old-style bitmaps: |
| 6 |
| 7 In the Cr-48 BIOS there are four BIOS screens that may be presented to the |
| 8 user. Each contains a graphic, a URL, and some informative text. The screens |
| 9 are single bitmap images, hardcoded in read-only BIOS (because they have to |
| 10 display even when the R/W BIOS and SSD are both completely erased). They can |
| 11 be replaced at manufacturing time, but creating the screens is difficult. |
| 12 The format is a compressed EFI firmware volume that is generated when the |
| 13 BIOS is compiled. The result is an opaque blob that cannot be viewed or |
| 14 edited with linux-based tools. |
| 15 |
| 16 |
| 17 New-style bitmaps: |
| 18 |
| 19 Future BIOSes will continue to display the same basic screens, but using a |
| 20 different format. Each screen will have separate bitmaps for the basic |
| 21 graphic, the URL, and the informative text, and will be displayed by |
| 22 rendering each component in order. This will allow us to modify and replace |
| 23 any bitmap (most frequently the HWID), using standard command-line tools |
| 24 such as imagemagick. Compositing each screen in this way also means that we |
| 25 can easily provide localized BIOS screens or custom messages. |
| 26 |
| 27 |
| 28 Note: |
| 29 |
| 30 Because the bitmap images and display code is part of the Read-Only BIOS, |
| 31 back-porting the new-style bitmaps to older devices is not possible. |
| 32 |
| 33 |
| 34 Instructions: |
| 35 |
| 36 The bmpblk_utility reads a config file and produces a binary bmpblock. The |
| 37 config file lists the individual bitmaps and describes where to place each |
| 38 one when displaying each screen. The bmpblock is then written into the BIOS |
| 39 image with the gbb_utility. The bitmap_viewer program lets you view the |
| 40 composited screens as described by the config file. |
| 41 |
| 42 * First, get the bitmap_viewer working. This is best used OUTSIDE of the |
| 43 chroot. Test it by changing to the scripts/newbitmaps/images/1280x800 |
| 44 directory and running "../../bitmap_viewer unknown.yaml". You may need to |
| 45 install some additional packages. For example, on Ubuntu you'll probably |
| 46 need to install the "python-yaml" and "python-wxgtk2.8" packages. |
| 47 |
| 48 * Now make changes to the unknown.yaml config file, and use the |
| 49 bitmap_viewer to see how the layout looks. Hit Ctrl-R in the small window |
| 50 to reload the config file without restarting. |
| 51 |
| 52 * The bitmap_viewer can display images in several different formats, but the |
| 53 BIOS is very limited (and may differ between x86 and ARM). For x86, ensure |
| 54 that you're using the proper format by converting any new bitmaps with a |
| 55 command like this: |
| 56 |
| 57 convert IN.bmp -colors 256 -compress none -alpha off OUT.bmp |
| 58 |
| 59 * When you have the screens tweaked to your satisfaction, generate the |
| 60 binary bmpblock to embed into the BIOS. |
| 61 |
| 62 bmpblk_utility -c unknown.yaml bmpblock.bin |
| 63 |
| 64 * Use the gbb_utility to modify the BIOS to contain our new set of bitmaps. |
| 65 We will need to pad our replacement bmpblock to match the size of the |
| 66 original. |
| 67 |
| 68 NOTE: These commands are run (as root) on the device under test! |
| 69 |
| 70 NOTE: This will only work if the BIOS write-protection is disabled! |
| 71 |
| 72 Copy our new bmpblock over. |
| 73 |
| 74 cd /mnt/stateful_partition |
| 75 scp USER@SOMEHOST:/SOMEPATH/bmpblock.bin . |
| 76 |
| 77 Get a copy of the current BIOS. |
| 78 |
| 79 flashrom -r bios.bin |
| 80 |
| 81 Extract the current bmpblock from the BIOS, and see how big it is. |
| 82 |
| 83 gbb_utility -g -b oldblob bios.bin |
| 84 ls -l oldblob |
| 85 |
| 86 Pad our bmpblock to the same size (for example, 253568 bytes) |
| 87 |
| 88 dd if=bmpblock.bin bs=253568 count=1 of=newblob |
| 89 |
| 90 Put our bmpblock in our copy of the BIOS |
| 91 |
| 92 gbb_utility -s newblob bios.bin |
| 93 |
| 94 Reflash the BIOS with the new content |
| 95 |
| 96 flashrom -w bios.bin |
| 97 |
| 98 * Reboot. You should see your new bitmaps appear whenever the BIOS screens |
| 99 are displayed. If you have more than one localization, you should be able |
| 100 to cycle among them with the arrow keys. |
| 101 |
| 102 * If you want to examine a binary bmpblock that you've pulled from a BIOS |
| 103 image, the bmpblk_utility has options to display or unpack the binary. |
| 104 |
| 105 bmpblk_utility bmpblock.bin |
| 106 |
| 107 bmpblk_utility -y bmpblock.bin |
| 108 |
| 109 cd /SOME/SCRATCH/DIR |
| 110 bmpblk_utility -x bmpblock.bin |
OLD | NEW |