Cleaned up genInitMem script to only generate necessary files and eliminate prompts

This commit is contained in:
David Harris 2023-11-22 05:25:09 -08:00
parent d509644fa6
commit e66adcca9d

View File

@ -10,17 +10,6 @@ rawUntrimmedBootmemFile="$tvDir/untrimmedBootmemFileGDB.bin"
untrimmedBootmemFile="$tvDir/untrimmedBootmemFile.bin"
DEVICE_TREE=${imageDir}/wally-virt.dtb
read -p "Warning: running this script will overwrite the contents of:
* $rawRamFile
* $ramFile
* $rawBootmemFile
* $bootmemFile
* $rawUntrimmedBootmemFile
* $untrimmedBootmemFile
Would you like to proceed? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
if [ ! -d "$tvDir" ]; then
echo "Error: linux testvector directory $tvDir not found!">&2
echo "Please create it. For example:">&2
@ -50,23 +39,25 @@ then
-ex "maintenance packet Qqemu.PhyMemMode:1" \
-ex "printf \"Creating $rawBootmemFile\n\"" \
-ex "dump binary memory $rawBootmemFile 0x1000 0x1fff" \
-ex "printf \"Creating $rawUntrimmedBootmemFile\n\"" \
-ex "printf \"Warning - please verify that the second half of $rawUntrimmedBootmemFile is all 0s\n\"" \
-ex "dump binary memory $rawUntrimmedBootmemFile 0x1000 0x2fff" \
-ex "printf \"Creating $rawRamFile\n\"" \
-ex "dump binary memory $rawRamFile 0x80000000 0x8fffffff" \
-ex "kill" \
-ex "q"
#-ex "printf \"Warning - please verify that the second half of $rawUntrimmedBootmemFile is all 0s\n\"" \
#-ex "printf \"Creating $rawUntrimmedBootmemFile\n\"" \
#-ex "dump binary memory $rawUntrimmedBootmemFile 0x1000 0x2fff" \
echo "Changing Endianness"
make fixBinMem
./fixBinMem "$rawRamFile" "$ramFile"
./fixBinMem "$rawBootmemFile" "$bootmemFile"
./fixBinMem "$rawUntrimmedBootmemFile" "$untrimmedBootmemFile"
#./fixBinMem "$rawUntrimmedBootmemFile" "$untrimmedBootmemFile" # doesn't seem to be used for anything
rm -f "$rawRamFile" "$rawBootmemFile" "$rawUntrimmedBootmemFile"
echo "genInitMem.sh completed!"
echo "You may want to restrict write access to $tvDir now and give cad ownership of it."
echo "Run the following:"
echo " sudo chown -R cad:cad $tvDir"
echo " sudo chmod -R go-w $tvDir"
fi