git has started rejecting repositories owned by other users and refusing
to run the "git rev-parse HEAD" command in this type of cases. That
resulted in issues with the VM testing model where the VM is practically
running everything as root while the host is a normal development
environment and likely a non-root user owned files.
Fix this by fetching the commitid on the host and pass it to the VM so
that no git operations need to be run within the VM itself.
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
DB=""
else
DB="-S $DBFILE"
- COMMITID="$(git rev-parse HEAD)"
+ if [ -z "$COMMITID" ]; then
+ COMMITID="$(git rev-parse HEAD)"
+ fi
if [ -n "$COMMITID" ]; then
DB="$DB --commit $COMMITID"
fi
TELNET=$(sed 's/.*TELNET=\([^ ]*\) .*/\1/' /proc/cmdline)
ARGS=$(sed 's/.*ARGS=\([^ ]*\)\( \|$\).*/\1/' /proc/cmdline)
LOGDIR=$(sed 's/.*LOGDIR=\([^ ]*\)\( \|$\).*/\1/' /proc/cmdline)
+if grep -q "commitid=" /proc/cmdline; then
+ COMMITID=$(sed 's/.*commitid=\([^ ]*\)\( \|$\).*/\1/' /proc/cmdline)
+else
+ COMMITID=
+fi
mount --bind "$TESTDIR/vm/regdb/" /lib/firmware
export LOGDIR=/tmp/logs
export DBFILE=$LOGDIR/results.db
export PREFILL_DB=y
+ export COMMITID
# some tests need CRDA, install a simple uevent helper
# and preload the 00 domain it will have asked for already
A+="EPATH=$EPATH "
A+="ARGS=$argsfile "
A+="console=$KVMOUT "
+COMMITID="$(git rev-parse HEAD)"
+if [ -n "$COMMITID" ]; then
+ A+="commitid=$COMMITID "
+fi
A+="ro"
if [ -z $KVM ]; then