Home  >  Edison  >  Building

Installing the rootfs to SDHC

The following procedure is useful during development. Instead of flashing all to the Edison eMMC the rootfs goes on an external SDHC. This has the advantage that you can always have a bootable system on the EMMC from which you can inspect or modify files (likely /etc/fstab or broken systemd service files preventing your experimental system from booting. And if not, you can pull the disk and fix from your PC.

Installing the rootfs on a sd card

You will find the image here:

    tmp/deploy/images/edison

The rootfs is edison-image-edison.btrfs. This you can write to your sdcard.

    mount

And if necessary unmount:

    sudo umount /dev/sdX

Writing the sd card (slow)

Take care: the following command will erase everything on your sdcard:

    sudo sh -c 'cat edison-image-edison.ext4 >/dev/sdX' && sync
    sudo dd bs=1M if=edison-image-edison.ext4 of=/dev/sdX && sync

Make absolutely sure you know the device representing the sdcard, on my system it was /dev/sdb.

Writing the sd card (faster)

    bmaptool create -o edison-image-edison.bmap edison-image-edison.btrfs
    sudo bmaptool copy edison-image-edison.btrfs /dev/sdX

If your image is not sparse (for instance you downloaded the file) you can re-sparse it by “digging holes” using

    fallocate -d edison-image-edison.btrfs

before using the bmaptool.

Booting the rootfs from SDHC

During U-Boot press <ESC> then type

    run edsboot

or during running linux (f.i. on the emmc disk):

    restart sdhc