Creating .scr file for update

      Creating .scr file for update

      We want to update efus boards in the field. Therefore we use the update.scr file the modified kernel and rootfs image an copy it on an USB stick. Everything is working fine with one issue. We also need to change the rootfs to rw and so we added a line with "run .mode_rw" to the update.scr file. At this moment the checksum of the update file is broken (in header) and the update doesn't work anymore.
      Is there a manual howto create a "signed" update.scr file?
      Mkimage is a tool of uboot to create a correct kernel-image, I guess?!?!
      The update.scr file is an ascii file with commands for u-boot to flash files or change uboot variables. The file itself has a kind of checksum in its header and is followed by the commands. Maybe there are different mkimage programs?
      Uboot only checks the update.scr file and not any other file like the kernel or filesys image.
      Yes, you're right, buy when I need to create update.scr or install.scr file I use mkimage ( not sure where I get it, it was in FNS toolchain files for QBliss board I think ) in way :

      ./mkimage -T script -C none -n 'Update script' -d update.txt update.scr

      This one creates compiled scr script file update.scr from update.txt which is simple text file containig all desired commands you want uboot to fullfil.

      Mine starts with

      # Load kernel image and store in partition Kernel
      load ${updatedev} . uImage-${ipaddr}
      nand erase.part Kerne
      l

      ending with

      saveenv
      # Done
      echo "Installation complete"


      Hope this is what you mean, we use QBliss boards and I think linux distros should be same.
      As mentioned mkimage is a tool that creates images for the U-Boot Bootloader. Beside commands the image can contain a kernel image, firmware images, rootfilesystem and many more.
      Additionally some metadata is contained like the architecture or whether the image is compressed and witch compression type is used.
      A checksum is build to ensure safety. It ensure that you can't update when the image has been modified unintendedly e.g. due to read or write issues with usb flash.

      So that means, the update.scr file you where looking at is not the ready to run image for U-Boot. Even if it may seem that way because of a huge amount of plain text it contains.
      It's a compiled image with a checksum. If it had been compressed the difference to original plain text would be obvious.

      Let's have a little example how to build an update script.
      The textfile of an update script can look like this:

      # Load kernel image and store in partition Kernel
      load ${updatedev} . uImage-${arch}
      nand erase.part Kernel
      nand write . Kernel ${filesize}
      # Create UBI with volume rootfs on partition TargetFS
      nand erase.part TargetFS
      ubi part TargetFS
      ubi create rootfs
      # Load root filesystem and store in UBI volume rootfs
      load ${updatedev} . rootfs-${arch}.ubifs
      ubi write . rootfs ${filesize}
      # Set default configuration: kernel from NAND, rootfs from ubifs
      run .kernel_nand
      run .rootfs_ubifs
      # Remove update variable and save environment
      setenv updatedev
      saveenv
      # Done
      echo "Installation complete"
      echo
      echo "Please set/verify ethernet address(es) now and call saveenv"

      To compile the file, let's call it script.txt use the mkimage tool. We ship the mkimage tool with our toolchain.

      mkimage -A arm -O u-boot -T script -C none -n "F&S update script" -d script.txt update.scr

      This will compile your text file and output the ready to use file 'update.scr'.
      And now it will have a correct checksum.

      Best regards,
      Your F&S Support Team
      F&S Elektronik Systeme GmbH
      As this is an international forum, please try to post in English.
      Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.