Running Debian on i.MX 8M SOM Print


The procedure documented below describes how to create a bootable Debian Stretch Linux SD Card and to boot the i.MX 8M SOM from this card.

Note that the Fedora or Debian Linux should be installed on the development host PC.

Here is the procedure.

  1. Prepare a bootable SD Card following the instructions provided in Booting Linux from SD Card.
  2. Install the debootstrap tool on the host PC.
    • Fedora:
    • [user@localhost ~]$ sudo dnf install debootstrap
      [user@localhost ~]$ sudo dnf install qemu-user-static

    • Debian:
    • [user@localhost ~]$ sudo apt-get install debootstrap
      [user@localhost ~]$ sudo apt-get install qemu-user-static

  3. Remount the rootfs partition of the SD Card that can be mounted with limited rights by default, then clear the rootfs partition:
  4. [user@localhost ~]$ sudo umount /dev/sdd2
    [user@localhost ~]$ mkdir -p /mnt/sdd2
    [user@localhost ~]$ sudo mount /dev/sdd2 /mnt/sdd2/
    [user@localhost ~]$ sudo rm -rf /mnt/sdd2/*

  5. Run the debootstrap tool to populate the Debian rootfs:
  6. [user@localhost ~]$ sudo debootstrap --arch arm64 --foreign stable /mnt/sdd2/

  7. Prepare the chroot environment for the second stage of the rootfs population procedure:
  8. [user@localhost ~]$ sudo cp /usr/bin/qemu-aarch64-static /mnt/sdd2/usr/bin/
    [user@localhost ~]$ sudo LANG=C.UTF-8 chroot /mnt/sdd2/ qemu-aarch64-static /bin/bash
    I have no name!@user:/#

  9. Start the second bootstrap stage:
  10. I have no name!@user:/# /debootstrap/debootstrap --second-stage
    I: Installing core packages...
    I: Unpacking required packages...
    I: Unpacking libacl1:arm64...
    I: Unpacking libattr1:arm64...
    I: Unpacking libaudit-common...
    I: Configuring tasksel-data...
    I: Configuring libc-bin...
    I: Configuring systemd...
    I: Base system installed successfully.

  11. Perform additional changes to complete installation:
  12. I have no name!@user:/# apt-get install locales net-tools openssh-server isc-dhcp-client
    I have no name!@user:/# echo -ne "auto eth0\niface eth0 inet dhcp\n" > /etc/network/interfaces.d/eth0
    I have no name!@user:/# dpkg-reconfigure locales
    I have no name!@user:/# dpkg-reconfigure tzdata
    I have no name!@user:/# echo localhost.localdomain > /etc/hostname
    I have no name!@user:/# passwd -d root
    I have no name!@user:/# exit
    [user@localhost ~]$ sync

  13. Unmount the SD Card, then insert this card into the i.MX 8M BSB carrier board and reboot the board.
  14. At the Linux login prompt, enter root as the user name with an empty password:
  15. Debian GNU/Linux 9 localhost.localdomain ttymxc0

    localhost login: root
    Last login: Tue Aug 14 09:42:32 PDT 2018 on ttymxc0
    Linux localhost.localdomain 4.9.88-imx8m-2.6.2 #2 SMP PREEMPT Wed Jun 20 23:54:47 PDT 2018 aarch64

    The programs included with the Debian GNU/Linux system are free software;
    the exact distribution terms for each program are described in the
    individual files in /usr/share/doc/*/copyright.

    Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
    permitted by applicable law.
    root@localhost:~# ping -c 5
    PING ( 56(84) bytes of data.
    64 bytes from ( icmp_seq=1 ttl=43 time=24.0 ms
    From ( icmp_seq=2 Redirect Host(New nexthop:
    64 bytes from ( icmp_seq=2 ttl=43 time=19.7 ms
    64 bytes from ( icmp_seq=3 ttl=43 time=18.8 ms
    64 bytes from ( icmp_seq=4 ttl=43 time=21.6 ms
    64 bytes from ( icmp_seq=5 ttl=43 time=22.2 ms

    --- ping statistics ---
    5 packets transmitted, 5 received, 0% packet loss, time 4006ms
    rtt min/avg/max/mdev = 18.825/21.309/24.063/1.859 ms

  16. Note that additional packets can be installed on the live system using the apt-get install command:
  17. root@localhost:~# apt-get install vim