REM # Do all S3000 and S5000 provisioning
REM #
REM set DeploymentStore=c:\results

call varset platform "queryProperty IntelBIOSID BoardFamilyID -"
echo platform %platform%

if "%platform%" == "S5000" goto doS5000
if "%platform%" == "S3000" goto doS3000
echo ERROR: platform %platform% is not recognized.
exit /B 1

:doS3000
set chassis=SR1530AH
    echo prepareResources %chassis%
    call prepareResources.cmd %chassis%

    echo "flashamt"
    call flashamt\flashamt.cmd

    echo "flashbios"
    call iflash\flashbios-s3.cmd

    echo "cfgamt"
    call amtcfg\cfgamt.cmd

    echo "cfgbios"
    call syscfg\cfgbios.cmd

    echo "cfgdisk"
    call hdparm\cfgdisk-ata.cmd

    echo "cfgnic.cmd"
    REM call nicSpeed.cmd
    call cfgnic\cfgnic.cmd

    echo "erase"
    call erase -v sda -s

goto done

:doS5000
REM # Do all S5000 provisioning

    call queryProperty FRU "Chassis OEM Field" - info="Mainboard FRU" |varset chassis  > nul
    call exportVarSet chassis

    echo prepareResources %chassis%
    call prepareResources.cmd %chassis%

    echo flash
    call iflash\flash-s5.cmd

    echo cfgbios
    call syscfg\cfgbios.cmd

    echo cfgbmc
    call ipmiutil\cfgbmc.cmd

    echo cfgdisk
    call scsirastools\cfgdisk-scsi.cmd

    echo cfgnic
    REM call nicSpeed.cmd
    call cfgnic\cfgnic.cmd

    echo skip erase
    REM call erase -s

goto done

:done
REM use persistVariable to set state here
echo ready to reboot
REM reboot\reboot.cmd

