Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added custom qemu options #5

Merged
merged 2 commits into from
Sep 16, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion qemuopts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#MACHINE,drive,bootcmd,net
#MACHINE,drive,bootcmd,nic,net,custom
VEXPRESS1,if=sd\,format=raw\,index=0,console=ttyAMA0 rw root=/dev/mmcblk0,nic
VEXPRESS2,if=sd\,format=raw,pty.legacy_count=16 console=ttyAMA0 rw root=/dev/mmcblk0 rootwait rootfstype=ext2,nic\,model=lan9118
REALVIEW-EB,if=sd\,format=raw,root=/dev/mmcblk0 rw console=ttyAMA0,nic
Expand Down
19 changes: 14 additions & 5 deletions run/parsedevices
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,29 @@
#
# Parses the devices file

declare -a ids qemus machines cpus dtbs mems kernels qemuopts drives bootargs nics descs
declare -A qmachine qdrives qbootargs qnics
declare -a ids qemus machines cpus dtbs mems kernels qemuopts drives bootargs nics nets customs descs
declare -A qmachine qdrives qbootargs qnics qnet qcustoms

DEVICES="/armx/devices"
QEMUOPTS="/armx/qemuopts"
DEFAULT_NET="tap,ifname=tap0,script=no,downscript=no"

while IFS=',' read QMACHINE QDRIVE QBOOTCMD QNIC
while IFS=',' read QMACHINE QDRIVE QBOOTCMD QNIC QNET QCUSTOM
do
if [ "$QMACHINE" != "" ]
then
qmachine[$QMACHINE]=$QMACHINE
qdrives[$QMACHINE]=$QDRIVE
qbootargs[$QMACHINE]=$QBOOTCMD
qnics[$QMACHINE]=$QNIC
if [ "$QNET" == "" ]
then
QNET=$DEFAULT_NET
fi
qnet[$QMACHINE]=$QNET
qcustoms[$QMACHINE]=$QCUSTOM
# Uncomment - for debugging purposes only
#echo "$QMACHINE|${qbootargs[$QMACHINE]}|${qdrives[$QMACHINE]}|${qbootargs[$QMACHINE]}|${qnics[$QMACHINE]}"
# echo "$QMACHINE|${qbootargs[$QMACHINE]}|${qdrives[$QMACHINE]}|${qbootargs[$QMACHINE]}|${qnics[$QMACHINE]}|${qnet[$QMACHINE]}|${qcustoms[$QMACHINE]}"
fi
done <<< "$(cat "${QEMUOPTS}" | sed -e 's/#.*//g')"

Expand All @@ -36,9 +43,11 @@ do
drives[$count]=${qdrives[$QOPTS]}
bootargs[$count]="${qbootargs[$QOPTS]} ARMX=$ID"
nics[$count]=${qnics[$QOPTS]}
nets[$count]=${qnet[$QOPTS]}
descs[$count]=$DESC
customs[$count]=${qcustoms[$QOPTS]}
# Uncomment - for debugging purposes only
#echo "${ids[$count]}|${qemus[$count]}|${machines[$count]}|${cpus[$count]}|${dtbs[$count]}|${mems[$count]}|${kernels[$count]}|${drives[$count]}|${bootargs[$count]}|${nics[$count]}|${descs[$count]}"
# echo "${ids[$count]}|${qemus[$count]}|${machines[$count]}|${cpus[$count]}|${dtbs[$count]}|${mems[$count]}|${kernels[$count]}|${drives[$count]}|${bootargs[$count]}|${nics[$count]}|${nets[$count]}|${descs[$count]}"
count=$((count + 1))
fi
done <<< "$(cat "${DEVICES}" | sed -e 's/#.*//g')"