Skip to content

Instantly share code, notes, and snippets.

@Semant1ka
Last active December 19, 2017 08:56
Show Gist options
  • Save Semant1ka/14981818bc9e9968e27ec37684095ecf to your computer and use it in GitHub Desktop.
Save Semant1ka/14981818bc9e9968e27ec37684095ecf to your computer and use it in GitHub Desktop.
Run Debian Stretch on arm (NXP Freescale IMX6qpsabreai board).

Recently, I was looking for an operating system to install on IMX6qpsabreai board and first tried to build all components of the system with Yосto framework.

While the framework is well-documented and easy to use the file system that I have obtained with it had a primary drawback: it was difficult to customize the set of packages on the installed system and required to setup local http server for package management. Also, to effectively build a new package for custom Yocto image one need to get familiar with Bitbake build system syntax which migth take some time to master.

So I decided to use Debian file system which allowed me to use Debian servers for update along with u-boot and kernel image build with Yocto and fsl-community-bsp

Build kernel image

There are two important parameters which will enable UART support for the board, so if you are building the kernel, make shure you have included them into defconfig.

CONFIG_FHANDLE=y
CONFIG_IKCONFIG=y

In bitbake recepie for /meta-freescale/recipes-kernel/linux/linux-imx-4.1.15/imx/defconfig the first parameter is not included by default, so you should add it manually to defconfig and rebuild the kernel.

bitbake linux-imx

Without the parameters above you will receive tty error on load.

[ ***] A start job is running for dev-ttymxc3.device (1min 20s / 1min 30s)random: nonblocking pool is initialized
[ TIME ] Timed out waiting for device dev-ttymxc3.device.
[DEPEND] Dependency failed for Serial Getty on ttymxc3.

Check debootstrap version

At the moment of my experiments Jessie debootstrap had version (1.0.67+deb8u1), which was not able to configure systemd

dpkg: regarding .../systemd-sysv_208-7_armhf.deb containing systemd-sysv, pre-dependency problem:
 systemd-sysv pre-depends on systemd
  systemd is unpacked, but has never been configured

Without systemd tty on the board was not able to initialize properly, so the solution for that for Jessie was to update debootstrap from jessie-backports to version (1.0.89~bpo8+1)

sudo echo "deb http://ftp.debian.org/debian jessie-backports main contrib non-free" > /etc/apt/sources.list
sudo apt-get update
sudo apt-get -t jessie-backports install debootstrap

Debootstrap Debian Stretch

sudo mkfs.etx4 /dev/sdb2
sudo mount /dev/sdb2 /mnt
sudo debootstrap --arch=armhf --foreign stretch /mnt
sudo cp /usr/bin/qemu-arm-static /mnt/usr/bin/
sudo chroot /mnt
/debootstrap/debootstrap --second-stage
echo "deb http://ftp.us.debian.org/debian/ stretch main contrib" > /etc/apt/sources.list
echo "deb-src http://ftp.us.debian.org/debian/ stretch main contrib" >> /etc/apt/sources.list
echo "deb http://security.debian.org/ stretch/updates main" >> /etc/apt/sources.list
echo "deb-src http://security.debian.org/ stretch/updates main" >> /etc/apt/sources.list
# setup proxy setting for apt if you are using proxy 
apt-get update
export LANG=C
apt-get install openssh-client openssh-server can-utils bro broctl network-manager
echo "imx-debian" > /etc/hostname
passwd root
exit
sudo umont /dev/sdb2

References:

Debootsrap-related bugs:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment