#!/bin/sh

rm -f ./confhfmall

### Write to ./confhfmall
echo "# eg: output target-1.0.hfm" >> ./confhfmall
echo "#input /path/to/input_file filename version MTD_number flashstart flashend flashlength DRAMstartaddr" >> ./confhfmall

if [ "$OEM" -eq "0" ]; then
  echo "output FWR_"$PLATFORM"_V"$MAJOR"."$MINOR"_Build_"$BUILDTIME".hfm" >> ./confhfmall
else
  echo "output FWR_"$PLATFORM"_V"$MAJOR"."$MINOR"."$OEM"_Build_"$BUILDTIME".hfm" >> ./confhfmall
fi

echo "apid 0xE0000661" >> ./confhfmall
echo "apid 0xE0000662" >> ./confhfmall
echo "apid 0xE0000663" >> ./confhfmall
echo "modelname DA-66X-LX" >> ./confhfmall

#if [ "$BOEM" -eq "0" ]; then
#  echo "input /tftpboot/"$BOOTLOADER"_"$BMAJOR"."$BMINOR".bos redboot "$BMAJOR"."$BMINOR"."$BOEM"."$BTESTING" 0 0x50000000 0x50060000 0x00060000 0x00000000" >> ./confhfmall
#elif [ "$BTESTING" -eq "0" ]; then
#  echo "input /tftpboot/"$BOOTLOADER"_"$BMAJOR"."$BMINOR"."$BOEM".bos redboot "$BMAJOR"."$BMINOR"."$BOEM"."$BTESTING" 0 0x50000000 0x50060000 0x00060000 0x00000000" >> ./confhfmall
#else
#  echo "input /tftpboot/"$BOOTLOADER"_"$BMAJOR"."$BMINOR"."$BOEM"."$TESTING".bos redboot "$BMAJOR"."$BMINOR"."$BOEM"."$BTESTING" 0 0x50000000 0x50060000 0x00060000 0x00000000" >> ./confhfmall
#fi

echo "input /tftpboot/noaddversion/$KERNEL-$MAJOR.$MINOR.$OEM.$TESTING kernel $MAJOR.$MINOR.$OEM.$TESTING 1 0x50060000 0x50200000 0x001a0000 0x00000000" >> ./confhfmall

echo "input /tftpboot/noaddversion/$ROOTDISK-$MAJOR.$MINOR.$OEM.$TESTING root-file-system $MAJOR.$MINOR.$OEM.$TESTING 2 0x50200000 0x51000000 0x00e00000 0x00000000" >> ./confhfmall

echo "input ./erase erase $MAJOR.$MINOR.$OEM.$TESTING 3 0x51000000 0x51fc0000 0x00e00000 0x00000000" >> ./confhfmall

echo "# You must fix to use 'configuration' file name" >> ./confhfmall
echo "# input ../mkrom/rfis directory $MAJOR.$MINOR.$OEM.$TESTING 5 0x51fe0000 0x52000000 0x00020000 0x00000000" >> ./confhfmall
