Running Ubuntu Linux on i.MX 8M SOM Print

 

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

Note that the Fedora or Ubuntu 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.
  3. Remount the rootfs partition of the SD card that can be mounted with limited rights by default, then clear the rootfs partition:
  4. [[email protected] ~]$ sudo umount /dev/sdd2
    [[email protected] ~]$ mkdir -p /mnt/sdd2
    [[email protected] ~]$ sudo mount /dev/sdd2 /mnt/sdd2/
    [[email protected] ~]$ sudo rm -rf /mnt/sdd2/*

  5. Run the debootstrap tool to populate the Ubuntu rootfs:
  6. [[email protected] ~]$ sudo debootstrap --arch arm64 --foreign bionic /mnt/sdd2/

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

  9. Start the second bootstrap stage:
  10. I have no [email protected]:/# /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 [email protected]:/# apt-get install net-tools openssh-server
    I have no [email protected]:/# echo -ne "network:\n version: 2\n renderer: networkd\n ethernets:\n eth0:\n dhcp4: yes\n" > /etc/netplan/eth0.yaml
    I have no [email protected]:/# dpkg-reconfigure locales
    I have no [email protected]:/# dpkg-reconfigure tzdata
    I have no [email protected]:/# echo localhost.localdomain > /etc/hostname
    I have no [email protected]:/# passwd -d root
    I have no [email protected]:/# exit
    [[email protected] ~]$ 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. Ubuntu 18.04 LTS localhost.localdomain ttymxc0

    localhost login: root
    Last login: Wed Oct 17 06:03:23 PDT 2018 on ttymxc0
    Welcome to Ubuntu 18.04 LTS (GNU/Linux 4.9.88-imx8m-2.6.2 aarch64)

    * Documentation: https://help.ubuntu.com
    * Management: https://landscape.canonical.com
    * Support: https://ubuntu.com/advantage

    [email protected]:~# ping google.com -c 5
    PING google.com (173.194.222.139) 56(84) bytes of data.
    64 bytes from lo-in-f139.1e100.net (173.194.222.139): icmp_seq=1 ttl=43 time=18.3 ms
    From ocean.emcraft.com (172.17.0.1): icmp_seq=2 Redirect Host(New nexthop: quill.emcraft.com (172.17.0.137))
    64 bytes from lo-in-f139.1e100.net (173.194.222.139): icmp_seq=2 ttl=43 time=18.1 ms
    64 bytes from lo-in-f139.1e100.net (173.194.222.139): icmp_seq=3 ttl=43 time=20.8 ms
    64 bytes from lo-in-f139.1e100.net (173.194.222.139): icmp_seq=4 ttl=43 time=18.6 ms
    64 bytes from lo-in-f139.1e100.net (173.194.222.139): icmp_seq=5 ttl=43 time=20.7 ms

    --- google.com ping statistics ---
    5 packets transmitted, 5 received, 0% packet loss, time 4006ms
    rtt min/avg/max/mdev = 18.194/19.336/20.806/1.193 ms
    [email protected]:~#

  16. Note that additional packets can be installed on the live system using the apt-get install command:
  17. [email protected]:~# apt-get install vim