#! /bin/sh
set -x

# Script for flash programming on Fastwel boards in QNX 6.4.
# Must be run on target platform!
#
# Sequence of operations:
# Run ETFS NAND flash driver with 3000K reserved for raw partition for QNX image.
# Program QNX image to raw partition.
# Re-run the driver.
# Format second partition to create QNX filesystem.
# Copy all necessary files to flash.

slay -f fs-etfs-samsung512
../install/x86/sbin/fs-etfs-samsung512 -e -r 3000
waitfor /dev/etfs1
../install/x86/usr/bin/etfsctl -d /dev/etfs1 -L ./ipl-ifs-cpc502.bin

slay -f fs-etfs-samsung512
../install/x86/sbin/fs-etfs-samsung512 -m /flash -r 3000
waitfor /dev/etfs2 5
../install/x86/usr/bin/etfsctl -d /dev/etfs2 -S -f -c

#cp -R ./flash_root/* /flash/
