Home  >  Edison  >  Building

Building a Debian image

Debian

Currently Debian will only build correct for x86_64 builds. That means it will only build correctly if you checkout kirkstone and not master. The reason is the debian_1_create.sh script misses to pick up all needed kernel modules.

Prerequisites

sudo apt install debootstrap

Build and flash

Follow the usual steps to generate a yocto image.
Then type: make debian to generate the Debian image. The make requires sudo to run. So you may be asked for your password.
During the process, you will be also asked to create the root password for Edison root account. You will need this password to login on Edison Debian.

You can type make clean_debian to delete the Debian image. It is required before calling make debian again.

Installing

Use out/linux64/build/toFlash/flashall.sh to flash it or use Flash Tool Lite.

You can also choose to install the rootfs on the sd card or usb same as with the Yocto images.

Installing Debian as an alternate image

From the Debian image additionally we create a BTRFS snapshot. The snapshot is also located here out/linux64/build/tmp/deploy/images/edison/ with the name edison-image-edison.snapshot.7z. You can install it in excatly the same way as when installing an alternate Yocto image, see Automatically building and installing a btrfs snapshot.

Post install

Being a Debian system directly using the root account is not recommended. You can not ssh into the Edison as root, but you can login as root via the console using the password you gave during the build.

  • You might want to create a user account: adduser an_username
  • And the give that user sudo rights: usermod -aG sudo an_username

You might want to install applications from the Debian repositories manually. To make life easier:

  • sudo apt-get install aptitude

Optional optimizing of disk partitions for EMMC installations

You can increase root partition size and if you want, add swap partition:

Increase rootfs Swap partition on EMMC Swap and additonal storage on sdcard
Remove the OTA partition and grow the rootfs partition Transform update partition as a swap partition parted /dev/mmcblk1
parted /dev/mmcblk0 rm 9 mkswap /dev/mmcblk0p9 (parted) p
to print the partition available on your sdcard
growpart /dev/mmcblk0 8 resize2fs /dev/mmcblk0p8 (parted) rm x
where x is the number of a partition, repeat until you have removed all partitions
resize2fs /dev/mmcblk0p8 echo "/dev/mmcblk0p9 none swap sw 0 0" >> /etc/fstab
mount swap partition at next reboot
(parted) mkpart primary ext4 10 28000
create a main partition of 28GB
    (parted) mkpart primary linux-swap 28000 100%
create a swap partition from 28GB to the end (if you have a 32GB card, it will be 4GB)
    (parted) q
    mkfs.ext4 /dev/mmcblk1p1
format the main partition
    mkswap /dev/mmcblk1p2
format the swap partition
    echo "/dev/mmcblk1p1 /media auto defaults 1 1" >> /etc/fstab
mount main partition at startup at next reboot
    echo "/dev/mmcblk1p2 none swap sw 0 0" >> /etc/fstab
mount swap partition at next reboot

Connecting the network

Connect to wifi as usual with connmanctl

Recovery to Yocto

A recovery may be needed

Highlights

  • Enjoy sudo apt update and sudo apt install package without needing to build them
  • Growing/resizing rootfs partition is needed only once. So no need to redo it if you reflash the same board.
  • Your home folder for your user account is not deleted when reflashing.