Home  >  Edison  >  Building

Building and 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 or USB disk. This has the advantage that you will alsways have a bootable system from which you can inspect or modify stuf preventing your experimental system from booting. And if not, you can pull the disk and fix from your PC.

Building the rootfs

Back track to Building the image.

Installing the rootfs on a sd card

You will find the image here:

    tmp/deploy/images/edison

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

    mount

And if necessary unmount:

    sudo umount /dev/sdX

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.

    bmaptool create -o edison-image-edison.bmap edison-image-edison.ext4
    sudo bmaptool copy edison-image-edison.ext4 /dev/sdc

You need to check, repair and resize the disk after this. You can use GParted for this. On the command line it is:

    sudo e2fsck -f -y -v -C 0 /dev/sdX

and

    sudo resize2fs -p /dev/sdX

Booting the rootfs from SDHC

During U-Boot press then type

    run edsboot

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

    restart sdhc

Booting the rootfs from external USB disk

Support for this has been removed. U-Boot currently does not support the USB, so can not load the kernel from a USB disk. Booting from external disk requires the kernel to be loaded from emmc or sdhc.

Further, booting from USB prevents you from using the USB in gadget mode to obtain network access, unless you have a fancy USB expander with built-in ethernet port (like SMSC LAN9514 Eval Board)

If your external rootfs is based on the current kernel on the boot partition (or if you updated the boot partition with your latest edison-image-edison.hddimg) you can use that kernel to boot your usb disk as you see fit. We leave it to your imagination to add a line to U-Boot’s edison.env to make this work.