Commit 682b8420 authored by Joanne Hugé's avatar Joanne Hugé

Update scripts

Fix directory name
Add configure-all-boards script
parent 2d15c9bb
#!/bin/bash
./configure-board emerald;
./configure-board onyx;
./configure-board slate;
#!/bin/bash #!/bin/bash
usage() { usage() {
echo "Usage: $0 [-h] [-p PARTITION_NUMBER] (emerald | onyx | slate) DEVICE" echo "Usage: $0 [-h] (emerald | onyx | slate)"
exit 1; exit 1;
} }
...@@ -12,9 +12,6 @@ while getopts "hp:" opt; do ...@@ -12,9 +12,6 @@ while getopts "hp:" opt; do
h ) h )
usage usage
;; ;;
p )
partition_number=${OPTARG}
;;
* ) * )
usage usage
;; ;;
...@@ -23,28 +20,26 @@ done ...@@ -23,28 +20,26 @@ done
shift $((OPTIND-1)) shift $((OPTIND-1))
if [ -z "$2" ]; then if [ -z "$1" ]; then
usage usage
fi fi
board_name=$1 board_name=$1
device=$2
cfg_dir=../config cfg_dir=../config
if [ $board_name != "emerald" ] && [ $board_name != "onyx" ] && [ $board_name != "slate" ]; then if [ $board_name != "emerald" ] && [ $board_name != "onyx" ] && [ $board_name != "slate" ]; then
usage usage
fi fi
rm -rf mnt_sd; scp -r $cfg_dir/common $board_name:;
mkdir -p mnt_sd; scp -r $cfg_dir/$board_name $board_name:;
echo "mount ${device}${partition_number} mnt_sd"; heredoc=$(cat << ENDSSH
mount ${device}${partition_number} mnt_sd; sudo cp -r common/* /;
echo "cp -r $cfg_dir/common/* mnt_sd"; sudo cp -r $board_name/* /;
cp -r $cfg_dir/common/* mnt_sd; rm -rf common;
echo "cp -r $cfg_dir/$board_name/* mnt_sd"; rm -rf $board_name;
cp -r $cfg_dir/$board_name/* mnt_sd; ENDSSH
echo "umount ${device}${partition_number}"; )
umount ${device}${partition_number};
rm -rf mnt_sd; ssh -t $board_name "$heredoc";
#!/bin/bash
usage() {
echo "Usage: $0 [-h] [-p PARTITION_NUMBER] (emerald | onyx | slate) DEVICE"
exit 1;
}
partition_number=2
while getopts "hp:" opt; do
case "${opt}" in
h )
usage
;;
p )
partition_number=${OPTARG}
;;
* )
usage
;;
esac
done
shift $((OPTIND-1))
if [ -z "$2" ]; then
usage
fi
board_name=$1
device=$2
cfg_dir=../config
if [ $board_name != "emerald" ] && [ $board_name != "onyx" ] && [ $board_name != "slate" ]; then
usage
fi
rm -rf mnt_sd;
mkdir -p mnt_sd;
echo "mount ${device}${partition_number} mnt_sd";
mount ${device}${partition_number} mnt_sd;
echo "cp -r $cfg_dir/common/* mnt_sd";
cp -r $cfg_dir/common/* mnt_sd;
echo "cp -r $cfg_dir/$board_name/* mnt_sd";
cp -r $cfg_dir/$board_name/* mnt_sd;
echo "umount ${device}${partition_number}";
umount ${device}${partition_number};
rm -rf mnt_sd;
...@@ -126,7 +126,7 @@ fi ...@@ -126,7 +126,7 @@ fi
# Compression # Compression
kernel_version=$(git branch | sed -n -e 's/^\* (HEAD detached at \(.*\))/\1/p') kernel_version=$(git describe --tags)
output_name=${kernel_version}_kernel${output_str} output_name=${kernel_version}_kernel${output_str}
echo "Creating output folder"; echo "Creating output folder";
...@@ -162,5 +162,5 @@ echo "Archive saved to $output_name.tar.gz" ...@@ -162,5 +162,5 @@ echo "Archive saved to $output_name.tar.gz"
if [ -n "$copy_to_sepia" ]; then if [ -n "$copy_to_sepia" ]; then
echo "Copying to sepia..."; echo "Copying to sepia...";
scp $output_name.tar.gz sepia:/home/vlaya/Documents/tsn-internship/img-kernel-utils/scripts/kernels/; scp $output_name.tar.gz sepia:Documents/tsn-internship/img-kernel-utils/custom-kernels;
fi fi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment