Skip to content

Flash Debian Images from Network

Flashing a Complete Debian System from Network Using TFTP and NFS

Notes:

  1. Make sure your host system is ready to use TFTP/NFS. Use Debian Setup TFTP/NFS if required.
  2. This is a concept guide. Adapt paths and network settings to your system.

Build a Minimal File System

Set up the build environment as described in Build Debian from source code.

Build the image:

var_build_image imx7-var-som debian:desktop "uboot linux"

Create the root filesystem directory and copy the files:

mkdir ~/flash_rootfs
sudo tar xf [...]/flexbuild/build_lsdk2412/images/rootfs_lsdk2412_debian_desktop_arm32.tar.zst -C ~/flash_rootfs
sudo cp -a ~/flash_rootfs/boot/*.dtb* /tftpboot
sudo cp ~/flash_rootfs/boot/zImage /tftpboot

Edit /etc/exports, for example:

sudo gedit /etc/exports

Add the following line, replacing <uname> with the actual username:

/home/<uname>/flash_rootfs *(rw,sync,no_root_squash,no_all_squash,no_subtree_check)

Restart the NFS server:

sudo /etc/init.d/nfs-kernel-server restart

Boot the board, stop the autoboot to get to the U-Boot command line, and set the following environment variables:

setenv serverip <your host ip address>
setenv nfsroot /home/<your username>/flash_rootfs

To set the device tree manually instead of using automatic detection:

setenv fdt_file <relevant device tree>

Boot from the network:

setenv bootcmd 'run netboot'
saveenv
boot

On the target, flash Debian to the SOM internal storage:

install_debian.sh

Once the file system is built, you can reuse it to flash additional VAR-SOM-MX7 devices. You can also update the images or customize install_debian.sh for your requirements.