1 2 Previous Next 21 Replies Latest reply on May 17, 2015 7:11 AM by ahochan

    flashall.sh changes to allow re-partitioning without xFSTK


      Hi all,

          I now have flashall.sh script working on Linux and Macs without the '-b' option , which eliminates the need for xFSTK, and allows use on Macs for flashing different partition schemes (as required by ubilinux (Debian)).

      There is a change necessary in the flashall.sh script that reboots the board after flashing u-boot. This has the effect of setting up the partitions, so that when the new rootfs partition is being flashed, it doesn't generate errors when it goes beyond the size of the old partitions.


      So , the change in the script was as follows.


          echo "Flashing U-Boot Environment Backup"
          flash-command --alt u-boot-env1 -D "${VARIANT_FILE}"


      and change to:


          echo "Flashing U-Boot Environment Backup and rebooting to apply partition changes"
          flash-command --alt u-boot-env1 -D "${VARIANT_FILE}" -R                    


      The important bits are the '-R' which causes a reboot, and the 'dfu-wait' causes the script to wait till the Edison comes back up so flashing can continue.


      There are a few advantages to this.


      1. On Linux, no need to install (or build) xFSTK tools when flashing images with different partition schemes.
      2. On Macs, it will now allow you to flash images with different partition schemes, which you could not before, you had to use 'flashall -b', which would not work on Macs.
      3. Now you just run 'flashall.sh' with no parameters, and the partitions will be resized and set up correctly.


      This change is ideal when you are flashing unilinux (Debian) which uses a 1.5G roots partition as opposed to the 500MB used by the Yocto image.


      Oh, and on a separate note, here's a check to make sure the script is running as root. It might be an idea to stick this in somewhere near the beginning of the flashall.sh script.


      if ! [ $(id -u) = 0 ];                                                         
          echo "This script must be run as root"                                     
          exit 1                                                                     




        1 2 Previous Next