Root Filesystem (2018 March MDK Release)

SD Card based Root Filesystem

Installing the filesystem

The MDK comes packaged with a prebuilt root filesystem. This can be found in the MDK's install directory under deploy.

First, backup the filesystem currently on the SD card (you will need to modify the paths based on your specific Linux distribution):

sudo cd /path/to/media/rootfs/
sudo tar czvf ~/rootfs-backup.tar.gz .

Then, you can install the new root filesystem with

rm -rf /path/to/media/rootfs/*
tar xvf /opt/criticallink/mitysom-335x_2018-03-16/deploy/mitysom-335x-devkit-rootfs.tar.bz2 -C /path/to/media/rootfs/

NOTE: It's recommended that you flush any buffered data to the root filesystem media with sync to avoid corruption. This command will not print any status output and can take a long time to run depending on the write speed of the media.

Please note that when you update the root filesystem to the latest MDK, you will also want to replace your kernel image with the latest MDK's kernel image.

Installing U-Boot and Linux

cp <MDK path>/deploy/<SOM NAND size>/MLO /path/to/media/boot/
cp <MDK path>/deploy/<SOM NAND size>/u-boot.img /path/to/media/boot/
cp <MDK path>/deploy/zImage-zImage_devkit.bin /path/to/media/boot/zImage
cp <MDK path>/deploy/zImage--4.4.32-devkit+<git hash>-r1-am335x-mitysom-<SOM configuration>-<date>.dtb /path/to/media/boot/am335x-mitysom.dtb

When installing the device tree, the device tree must be selected based on the NAND (256M/512M/1G) and NOR (with or without) configuration of the SOM.

For example:
  • 256MB NAND with NOR, use am335x-mitysom-256M-NOR
  • 512MB without NOR, use am335x-mitysom-512M

Booting the Root Filesystem

U-Boot can boot using the SD card root filesystem with

U-Boot# mmcinfo; setenv fdtaddr 0x88000000; setenv fdt_high 0xFFFFFFFF; setenv kloadaddr 0x80007FC0;
U-Boot# fatload mmc 0 $kloadaddr zImage
U-Boot# fatload mmc 0 $fdtaddr am335x-mitysom.dtb
U-Boot# setenv console "ttyS0,115200n8" 
U-Boot# run mmc_args
U-Boot# bootz $kloadaddr - $fdtaddr

These commands can be saved as the default boot command

U-Boot# setenv console "ttyS0,115200n8" 
U-Boot# setenv bootcmd "mmcinfo; fatload mmc 0 0x80007FC0 zImage; fatload mmc 0 0x88000000 am335x-mitysom.dtb; run mmc_args; bootz 0x80007FC0 - 0x88000000" 
U-Boot# saveenv

NAND based Root Filesystem

See UBIFS Nand Boot.

Before building the UBIFS image, unpack the prebuilt root filesystem that ships with the MDK. This may be found in the MDK's install directory under deploy.

cd <your working directory>
mkdir filesystem
tar xf /opt/criticallink/mitysom-335x_2018-03-16/deploy/mitysom-335x-devkit-rootfs.tar.bz2 -C ./filesystem

Network Boot


U-Boot loads the zImage and device-tree over the network using TFTP.

Install the TFTP server

sudo apt-get install tftpd-hpa

Configure the server
Add/Update the following line in /etc/conf.d/tftpd:


Create the TFTP folder

mkdir -p /srv/tftp

Reload the TFTP server

sudo service tftpd-hpa restart

Add the kernel image and device tree from the MDK

mkdir /srv/tftp/mitysom/
cp /opt/criticallink/mitysom-335x_2018-03-23/deploy/zImage-zImage_devkit.bin /srv/tftp/mitysom/zImage
cp /opt/criticallink/mitysom-335x_2018-03-23/deploy/<device tree>.dtb /srv/tftp/mitysom/am335x-mitysom.dtb


After U-Boot loads the kernel, the kernel may use an NFS drive as it's root filesystem.

Install an NFS server

sudo apt-get install nfs-kernel-server

Make the NFS rootfs folder

mkdir -p /srv/nfs/mitysom

Export the rootfs folder
Add the following entry to /etc/exports:

/srv/nfs/mitysom *(rw,async,nohide,insecure,no_root_squash,no_subtree_check)

Update the NFS server's exports

sudo exportfs -arv

Make the NFS server serve over UDP
Add the following to /etc/nfs.conf


Restart the NFS server

systemctl restart nfs-server.service

Uncompress the MDK rootfs

tar xf /opt/criticallink/mitysom-335x_2018-03-23/deploy/mitysom-335x-devkit-rootfs.tar.bz2 -C /srv/nfs/mitysom

In order to sucessfully boot, DHCP needs to be disabled in systemd for the network adapter connecting to the NFS server.

mkdir -p /srv/nfs/mitysom/etc/connman
vi /srv/nfs/mitysom/etc/connman/main.conf

Then add the following lines to /srv/nfs/mitysom/etc/connman/main.conf:


Configure and boot U-Boot:

U-Boot# set kloadaddr 0x80007FC0
U-Boot# set fdtaddr 0x88000000
U-Boot# set serverip <host machine IP>
U-Boot# set rootpath "/srv/nfs/mitysom" 
U-Boot# set autoload no
U-Boot# set bootcmd "dhcp; tftp $kloadaddr /mitysom/zImage; tftp $fdtaddr /mitysom/am335x-mitysom.dtb; run net_args; bootz $kloadaddr - $fdtaddr;" 
U-Boot# saveenv
U-Boot# boot

Go to top
Add picture from clipboard (Maximum size: 600 MB)