diff options
Diffstat (limited to 'documentation/building_and_booting.md')
| -rw-r--r-- | documentation/building_and_booting.md | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/documentation/building_and_booting.md b/documentation/building_and_booting.md new file mode 100644 index 00000000..478a4fb0 --- /dev/null +++ b/documentation/building_and_booting.md | |||
| @@ -0,0 +1,134 @@ | |||
| 1 | ### Building the Intel BSP layers | ||
| 2 | |||
| 3 | The intel-common BSP provide a few carefully selected tune options and | ||
| 4 | generic hardware support to cover the majority of current Intel CPUs and | ||
| 5 | devices. The naming follows the convention of intel-<TUNE>-<BITS>, where | ||
| 6 | TUNE is the gcc cpu-type (used with mtune and march typically) and BITS | ||
| 7 | is either 32 bit or 64 bit. | ||
| 8 | |||
| 9 | In order to build an image with BSP support for a given release, you | ||
| 10 | need to clone the meta-intel layer from git repository: | ||
| 11 | ``` | ||
| 12 | git clone https://git.yoctoproject.org/meta-intel | ||
| 13 | ``` | ||
| 14 | |||
| 15 | Check out the appropriate branch or release tags. The branch name and tags | ||
| 16 | would align with Yocto Project | ||
| 17 | [Release Codenames](https://wiki.yoctoproject.org/wiki/Releases). | ||
| 18 | Assuming meta-intel repository is cloned at the top-level of | ||
| 19 | OE-Core build tree, you can build a BSP image by adding the location of | ||
| 20 | the meta-intel layer to bblayers.conf: | ||
| 21 | ``` | ||
| 22 | BBLAYERS = " \ | ||
| 23 | /openembedded-core/meta \ | ||
| 24 | /openembedded-core/meta-intel " | ||
| 25 | ``` | ||
| 26 | |||
| 27 | To enable a particular machine, add a MACHINE line naming the BSP | ||
| 28 | to the local.conf file: | ||
| 29 | ``` | ||
| 30 | MACHINE ?= "intel-corei7-64" | ||
| 31 | ``` | ||
| 32 | |||
| 33 | where this can be replaced by other MACHINE types available: | ||
| 34 | |||
| 35 | - intel-core2-32 | ||
| 36 | |||
| 37 | This BSP is optimized for the Core2 family of CPUs as well as all | ||
| 38 | Atom CPUs prior to the Silvermont core. | ||
| 39 | |||
| 40 | - intel-corei7-64 | ||
| 41 | |||
| 42 | This BSP is optimized for Nehalem and later Core and Xeon CPUs as | ||
| 43 | well as Silvermont and later Atom CPUs, such as the Baytrail SoCs. | ||
| 44 | |||
| 45 | - intel-skylake-64 | ||
| 46 | |||
| 47 | This BSP uses [x86-64-v3 tuning](https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html). | ||
| 48 | |||
| 49 | You should then be able to build an image as such: | ||
| 50 | ``` | ||
| 51 | $ source oe-init-build-env | ||
| 52 | $ bitbake core-image-sato | ||
| 53 | ``` | ||
| 54 | |||
| 55 | At the end of a successful build, you should have an image that | ||
| 56 | you can boot from a USB flash drive. | ||
| 57 | |||
| 58 | |||
| 59 | ## Booting the intel-common BSP images | ||
| 60 | |||
| 61 | If you've built your own image, you'll find the bootable | ||
| 62 | image in the build/tmp/deploy/images/{MACHINE} directory, where | ||
| 63 | 'MACHINE' refers to the machine name used in the build. | ||
| 64 | |||
| 65 | Under Linux, insert a USB flash drive. Assuming the USB flash drive | ||
| 66 | takes device /dev/sdf, use dd to copy the image to it. Before the image | ||
| 67 | can be burned onto a USB drive, it should be un-mounted. Some Linux distros | ||
| 68 | may automatically mount a USB drive when it is plugged in. Using USB device | ||
| 69 | /dev/sdf as an example, find all mounted partitions: | ||
| 70 | ``` | ||
| 71 | $ mount | grep sdf | ||
| 72 | ``` | ||
| 73 | |||
| 74 | and un-mount those that are mounted, for example: | ||
| 75 | ``` | ||
| 76 | $ umount /dev/sdf1 | ||
| 77 | $ umount /dev/sdf2 | ||
| 78 | ``` | ||
| 79 | |||
| 80 | Now burn the image onto the USB drive: | ||
| 81 | ``` | ||
| 82 | $ sudo dd if=core-image-sato-intel-corei7-64.wic of=/dev/sdf status=progress | ||
| 83 | $ sync | ||
| 84 | $ eject /dev/sdf | ||
| 85 | ``` | ||
| 86 | |||
| 87 | This should give you a bootable USB flash device. Insert the device | ||
| 88 | into a bootable USB socket on the target, and power on. This should | ||
| 89 | result in a system booted to the Sato graphical desktop. | ||
| 90 | |||
| 91 | If you want a terminal, use the arrows at the top of the UI to move to | ||
| 92 | different pages of available applications, one of which is named | ||
| 93 | 'Terminal'. Clicking that should give you a root terminal. | ||
| 94 | |||
| 95 | If you want to ssh into the system, you can use the root terminal to | ||
| 96 | ifconfig the IP address and use that to ssh in. The root password is | ||
| 97 | empty, so to log in type 'root' for the user name and hit 'Enter' at | ||
| 98 | the Password prompt: and you should be in. | ||
| 99 | |||
| 100 | If you find you're getting corrupt images on the USB (it doesn't show | ||
| 101 | the syslinux boot: prompt, or the boot: prompt contains strange | ||
| 102 | characters), try doing this first: | ||
| 103 | ``` | ||
| 104 | $ dd if=/dev/zero of=/dev/sdf bs=1M count=512 | ||
| 105 | ``` | ||
| 106 | |||
| 107 | ## Building the installer image | ||
| 108 | |||
| 109 | If you plan to install your image to your target machine, you can build a wic | ||
| 110 | based installer image instead of default wic image. To build it, you need to | ||
| 111 | add below configuration to local.conf : | ||
| 112 | |||
| 113 | ``` | ||
| 114 | WKS_FILE = "image-installer.wks.in" | ||
| 115 | IMAGE_FSTYPES:append = " ext4" | ||
| 116 | IMAGE_TYPEDEP:wic = "ext4" | ||
| 117 | INITRD_IMAGE_LIVE="core-image-minimal-initramfs" | ||
| 118 | do_image_wic[depends] += "${INITRD_IMAGE_LIVE}:do_image_complete" | ||
| 119 | do_rootfs[depends] += "virtual/kernel:do_deploy" | ||
| 120 | IMAGE_BOOT_FILES:append = "\ | ||
| 121 | ${KERNEL_IMAGETYPE} \ | ||
| 122 | microcode.cpio \ | ||
| 123 | ${IMGDEPLOYDIR}/${IMAGE_BASENAME}-${MACHINE}.rootfs.ext4;rootfs.img \ | ||
| 124 | ${@bb.utils.contains('EFI_PROVIDER', 'grub-efi', 'grub-efi-bootx64.efi;EFI/BOOT/bootx64.efi', '', d)} \ | ||
| 125 | ${@bb.utils.contains('EFI_PROVIDER', 'grub-efi', '${IMAGE_ROOTFS}/boot/EFI/BOOT/grub.cfg;EFI/BOOT/grub.cfg', '', d)} \ | ||
| 126 | ${@bb.utils.contains('EFI_PROVIDER', 'systemd-boot', 'systemd-bootx64.efi;EFI/BOOT/bootx64.efi', '', d)} \ | ||
| 127 | ${@bb.utils.contains('EFI_PROVIDER', 'systemd-boot', '${IMAGE_ROOTFS}/boot/loader/loader.conf;loader/loader.conf ', '', d)} \ | ||
| 128 | ${@bb.utils.contains('EFI_PROVIDER', 'systemd-boot', '${IMAGE_ROOTFS}/boot/loader/entries/boot.conf;loader/entries/boot.conf', '', d)} " | ||
| 129 | ``` | ||
| 130 | |||
| 131 | Burn the wic image onto USB flash device, insert the device to target machine | ||
| 132 | and power on. This should start the installation process. | ||
| 133 | |||
| 134 | |||
