debootstrap Debian Buster on imx8mminievk

Showing results for 
Search instead for 
Did you mean: 

debootstrap Debian Buster on imx8mminievk

Contributor III

This guide will show you how to debootstrap Debian Buster on imx8mminievk on a SD-card, but will very likely help you on other systems as well. First you need a Linux installation present on the imx8mminievk.

Follow the Getting Started guide to install a Linux System on the board. In short it is done in the following 5 steps:

  1.  Download
  2. Download uuu
  3. Put board in download mode (SDP) [1010xxxxxx] [xxxxxxxxx0]
  4. run uuu with as argument
  5. plug in and turn on the board

Now put the board back in eMMC boot mode [0110110001] [0001010100] and start up the supplied Linux system. All logins are done with root (no password).

Plug in a SD-card and copy the partition table:

sfdisk -d /dev/mmcblk2 | sfdisk /dev/mmcblk1

Copy data from the boot partition:

dd if=/dev/mmcblk2p1 of=/dev/mmcblk1p1 bs=1M

Resize data partition on the target (SD-card):

echo ",+" | sfdisk -N2 /dev/mmcblk1

Create file system and mount it:

mkfs.ext4 /dev/mmcblk1p2
mkdir /mnt/target
mount /dev/mmcblk1p2 /mnt/target

To be able to bootstrap the system we need debootstrap and binutils, (1), (2) available on the system. Use ar to extract the data.tar on another computer (or 7zip if you use Windows), copy the tar-files with scp/winscp onto the board and extract with tar -xf. (Because 7zip/windows cant handle symlinks).

Set up symbolic links for debootstrap, ar and libbfd:

ln -s /home/root/usr/sbin/debootstrap /usr/sbin/
ln -s /home/root/usr/share/debootstrap /usr/share/
ln -s /home/root/usr/bin/ar /usr/bin/
ln -s /home/root/usr/lib/aarch64-linux-gnu/ /usr/lib/

Start the debootstrap:

debootstrap --arch arm64 buster /mnt/target

Configuring the target:

#copy mtab (will be overwritten later at restart)
cp /etc/mtab /mnt/target/etc/mtab

#bind virtual file systems
mount -o bind /dev /mnt/target/dev
mount -o bind /proc /mnt/target/proc
mount -o bind /sys /mnt/target/sys

#enter target
chroot /mnt/target /bin/bash

#set up fstab
echo UUID=$(blkid /dev/mmcblk1p2 -o value|head -n1) / ext4 defaults,errors=remount-ro 0 1 > /etc/fstab

#put hostname in /etc/hosts
sed -i "1 a $(cat /etc/hostname)" /etc/hosts

#install sudo
apt install sudo

#remove root login
passwd -d root
passwd -l root
#add new user
adduser debian

Don't forget:

addgroup debian sudo

Install more packages (not necessary):

tasksel --new-install

Exit the chroot:


You're now ready to boot your new Debian installation. Put the card in MicroSD boot mode [0110110010] [0001101000]. And issue a reboot command:


If everything went smoothly you should now see your system start with Debian Buster. It's also possible to debootstrap Ubuntu or other Debian based systems.

Feel free to comment or ask questions.

I'll soon put up a guide how to build the linux kernel from source. 

With inspiration from: HOW-TO: Install Debian using debootstrap.

Labels (2)
7 Replies

Contributor I

Hi Andreas,

I followed your steps and after switching to SD boot, the board does not do anything. I see no output on the debug console either. If I switch back to the eMMC boot option the loaded linux image boots successfully. I tried twice to create the sd card without error (besides that I had to unmount some auto-mounted partitions to make sfdisk execute without complaint). But no success so far. Do I have to adjust something else?

0 Kudos

Contributor III

Are you sure that the partitions are created correctly on the sd-card?

0 Kudos

Contributor I

Hi Andreas,

thank you for the reply. Yes I am. A FAT boot partiation and a ext4

rootFs partition are definitly create. I have been playing with

RaspberryPI-like device which use the same sd card setup

My normal approach for those devices is to format the sd card (low

level) and use Win32 DiskImager to write preconfigured image onto this

card. This worked always so far.

The approach pointed out in your description was new to me (deboostrap)

but the guide was explained good enough for me to step through it.

Although I must admit, that I do not understand every command :smileyhappy:

Meanwhile I have loaded a binary image of another device which is based

on the iMX8 mini and used my standard approach but even with that sd

card the dev board does nothing but lighting the PWR-LED near the USB

power connector. I double checked the boot switches already. So for the

moment I have no idea what else I could do.

For my current research it would be sufficient to have a Debian running

from eMMC. So is it possible to load such an image into eMMC via the

uuu.exe? I would like to install some apt packages from the regular

debian repository online.

Kind regards


Am 08.11.2019 um 10:28 schrieb andreasgustafsson:


NXP Community



Re: debootstrap Debian Buster on imx8mminievk

reply from Andreas Gustafsson


in /i.MX Processors/ - View the full discussion



0 Kudos

Contributor II

Nice HowTo!

However, wireless is missing when booting in Debian.


Tasksel exits with an error:

tasksel: apt-get failed (100)

0 Kudos

Contributor II

Well, found out that /lib/firmware, /lib/modules and lib/modules/4.1xxxx/extra folders were not copied to chroot.

1. Copy missing folders containing qca9377 firmware and the kernel module

2. Fix modprobe dependencies: depmod -A

Then wlan0 appears.

Contributor III

I'm not using wlan so have not noticed this. Thank you for the fix!

0 Kudos

Contributor III

Moderator: Please put this up as a Blog post.

0 Kudos