phytec / phybian

phyBIAN - Debian images using Kas/Isar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

phyBIAN - PHYTEC Debian images using Isar and kas

This document describes building Isar Phytec images with kas.

Preparing the Build Environment

If running build in kas-docker the only prerequirement is installed docker.

If running native Isar build you should prepare build environment:

Install the required packages for Isar and for kas.

You should also have mtd-utils package installed for ubifs image reneration for imx6ul target.

For Debian 11:

# apt-get install binfmt-support debootstrap dosfstools dpkg-dev gettext-base \
    git mtools parted python3 python3-distutils quilt qemu qemu-user-static \
    reprepro sudo python3-distro python3-jsonschema python3-yaml mtd-utils

Configure sudo:

# visudo -f /etc/sudoers.d/10-users

Add the following line. Replace <user> with the actual username.

<user>	ALL=(ALL:ALL) NOPASSWD:ALL

Downloading the sources

Download the BSP source:

$ git clone https://github.com/phytec/phybian
$ cd phybian

Download kas:

$ git clone https://github.com/siemens/kas

Building the Image

To speed up fetching process set global DL_DIR location:

mkdir dl_dir
export DL_DIR=$(pwd)/dl_dir

Start ssh-agent and add your rsa key:

$ eval $(ssh-agent)
$ ssh-add ~/.ssh/id_rsa

Then you need to fetch the sources:

$ kas/run-kas checkout phytec_polis.yml
or
$ kas/kas-docker checkout phytec_polis.yml

Depend on target machine you can start building the image like:

$ kas/kas-docker --isar build phytec_polis.yml

Or just start native build without Docker:

$ kas/run-kas build phytec_polis.yml

The output files are located in build/tmp/deploy/images/$MACHINE.

To start a development shell without building, use:

$ kas/run-kas shell phytec_polis.yml

Testing output images via NFS

Prepare loading source

Install NFS server on the host and unpack build/tmp/deploy/images/$MACHINE/phytec-qt5demo-image-phybian-vendor-xwayland-bullseye-$MACHINE.tar.gz in its root.

For imx8mp (phyboard-pollux)

  1. Reboot the board and interrupt the bootloader.

  2. Set custom boot command (change BOARD_IP, SERVER_IP and NFS_PATH to yours):

> setenv bootcmd_custom "setenv ipaddr "_BOARD_IP_"; nfs ${loadaddr} _SERVER_IP_:_NFS_PATH_/boot/vmlinux-5.10.72-isar+; nfs ${fdt_addr} _SERVER_IP_:_NFS_PATH_/usr/lib/linux-image-5.10.72-isar+/freescale/imx8mp-phyboard-pollux-rdk.dtb; setenv bootargs console=${console} root=/dev/nfs ip=dhcp nfsroot=_SERVER_IP_:_NFS_PATH_,v3,tcp rw; booti ${loadaddr} - ${fdt_addr}"
  1. Boot the board:

> run bootcmd_custom

For imx6ul (phyboard-segin)

  1. Reboot the board and interrupt the bootloader.

  2. Enable DHCP and mount NFS partition (change SERVER_IP and NFS_PATH to yours):

> dhcp; mkdir -p /mnt/nfs; mount -t nfs _SERVER_IP_:_NFS_PATH_ /mnt/nfs
  1. Enter into default boot script:

> sedit /env/boot/nand

and append to the end (change SERVER_IP and NFS_PATH to yours):

global.bootm.image="/mnt/nfs/boot/vmlinuz-5.10.76-isar+"
global.bootm.oftree="/mnt/nfs/usr/lib/linux-image-5.10.76-isar+/imx6ull-phytec-segin-ff-rdk-nand.dtb"
global.linux.bootargs.dyn.root="root=/dev/nfs ip=dhcp nfsroot=_SERVER_IP_:_NFS_PATH_,v3,tcp"
  1. Boot the board:

> boot nand

Testing output SD images

  1. Unmount all SD card partitions (e.g. /dev/sde1):

$ sudo umount /dev/<your_device><number>
  1. Flash WIC image to SD card:

$ sudo dd if=phytec-qt5demo-image-phybian-vendor-xwayland-bullseye-$MACHINE.wic of=/dev/<your_device> bs=1MB conv=fsync
  1. Boot the board using prepared SD card.

About

phyBIAN - Debian images using Kas/Isar


Languages

Language:Shell 100.0%