Setup¶
- If you don't have the
repotool installed, please refer to Build Torizon OS From Source with Yocto Project. - Initialize and sync the repo manifest for x86:
We strongly recommend using the
$ mkdir common-torizon; cd common-torizon $ repo init -u https://git.toradex.com/toradex-manifest.git -b master -m common-torizon/x86/default.xml $ repo sync -j 10default.xmlmanifest. Theintegration.xmlandnext.xmlare development manifests used internally and they might be unstable.default.xmlis the manifest used for our releases, so they are reliable.[!IMPORTANT]
Common Torizon OS is only available on branchesscarthgap-7.x.yor newer!
Alternatively, you can manually clone all layers one by one. Refer to the section Manual Setup at the end of this document to learn how.
Build¶
-
Source
setup-environment:This will create a build folder named$ MACHINE=intel-corei7-64 . setup-environment build-corei7-64build-corei7-64, where all build artifacts will be stored. -
Inside the build directory, start the build e.g.:
$ bitbake torizon-docker
All artifacts should be inside build-corei7-64/deploy/images/intel-corei7-64, including the .wic file.
Test on Virtual Box¶
Setup a virtual machine to test the image built, using the generated .wic.vdi or .wic.vmdk.
Below is a script for setting up a virtual machine inside Virtual Box, called Common-Torizon:
# Setup new machine Common-Torizon
VBoxManage createvm --name Common-Torizon --ostype "Linux_64" --register --basefolder "$HOME/CommonTorizonVBoxVM"
VBoxManage modifyvm Common-Torizon --firmware efi64
# Attempt at serial connection (cant communicate but can inspect serial logs via 'tail -f /tmp/serial')
VBoxManage modifyvm Common-Torizon --cpus 2 --memory 2048 --vram 256 --graphicscontroller vmsvga --uart1 0x3F8 4 --uartmode1 file /tmp/serial
VBoxManage storagectl Common-Torizon --name "SATA Controller" --add sata --bootable on
VBoxManage storageattach Common-Torizon --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium "torizon-docker-intel-corei7-64.wic.vdi"
# Port forwarding for SSH on port 2222
VBoxManage modifyvm Common-Torizon --nat-pf1=ssh,tcp,,2222,,3791 --nat-pf2=ssh_tor,tcp,,2223,,22
VBoxManage startvm Common-Torizon
Test on QEMU¶
Run using QEMU:
$ qemu-system-x86_64 -drive if=virtio,file=torizon-docker-intel-corei7-64.wic,format=raw -no-reboot -cpu host -nic user,hostfwd=tcp::2222-:22 -machine pc -vga virtio -m 4096 -bios /usr/share/ovmf/OVMF.fd -enable-kvm -serial pty
Manual Setup¶
- Create your build folder structure. Something like:
$ mkdir common-torizon; cd common-torizon $ mkdir layers; cd layers - Clone the layers needed to build x86 Common Torizon:
- Download Poky
$ git clone git://git.yoctoproject.org/poky -b scarthgap - Download
meta-intel,meta-torizonandmeta-torizon-bsp:$ git clone git://git.yoctoproject.org/meta-intel -b scarthgap $ git clone https://github.com/torizon/meta-torizon.git -b scarthgap-7.x.y $ git clone https://github.com/torizon/meta-torizon-bsp.git -b master - Download the Torizon layer dependencies:
$ git clone https://github.com/uptane/meta-updater.git -b scarthgap $ git clone https://git.yoctoproject.org/meta-virtualization -b scarthgap - And finally, download
meta-updaterandmeta-virtualizationdependency:$ git clone https://github.com/openembedded/meta-openembedded -b scarthgap - Go back into our top folder
common-torizon - Create a symlink to our
setup-environment:$ ln -s layers/meta-torizon-bsp/scripts/setup-environment setup-environment