gnome-control-center/panels/thunderbolt/update-from-bolt.sh
Christian Kellner 47f241b10c thunderbolt: new panel for device management
Thunderbolt devices need to be approved before they can be used.
This is done via the boltd system daemon and gnome-shell. The new
panel enables the user to manage thunderbolt devices, i.e.:

 - forget devices that have previously been authorized
 - authorize currently unauthorize devices

Additionally authorization of devices an be temporarily disabled
to ensure no evil device will gain access to the computers
resources.

File starting with "bolt-" are copied from bolt's source tree
and currently correspond to the bolt upstream commit with the id
f22b1cd6104bdc2b33a95d9896b50f29a141b8d8
They can be updated from bolt via the update-from-bolt.sh script.
2018-04-13 15:08:16 +02:00

50 lines
781 B
Bash
Executable file

#!/bin/bash
if [ $# -ne 1 ]; then
echo "$0: usage: <BOLT-SOURCE>"
exit 1
fi
boltsrc="$1"
function die() {
echo $*
exit 1
}
function copyone() {
dst=$1
src="$boltsrc/$dst"
search=(common cli)
for base in ${search[*]}
do
path="$boltsrc/$base/$dst"
if [ -f $path ]; then
src=$path
break;
fi
done
if [ ! -f $src ]; then
echo -e "$dst \t[ skipped ] $src (ENOENT)"
elif cmp -s $src $dst; then
echo -e "$dst \t[ unchanged ]"
else
cp $src $dst || die "$dst [failed] source: $src"
echo -e "$dst \t[ updated ] $src"
git add $dst
fi
}
names=(client device enums error names proxy str time)
for fn in ${names[*]}
do
header="bolt-$fn.h"
source="bolt-$fn.c"
copyone $header
copyone $source
done