diff --git a/board/shredos/fsoverlay/usr/bin/archive_log.sh b/board/shredos/fsoverlay/usr/bin/archive_log.sh index d9d89e87a4..f711335f8d 100755 --- a/board/shredos/fsoverlay/usr/bin/archive_log.sh +++ b/board/shredos/fsoverlay/usr/bin/archive_log.sh @@ -43,9 +43,10 @@ if [ $status != 0 ] && [ $status != 32 ]; then else printf "archive_log.sh: FAT32 partition $drive is now mounted to $archive_drive_directory\n" - # Copy the dmesg.txt file over to the FAT32 partition + # Copy the dmesg.txt and PDF files over to the FAT32 partition dmesg > dmesg.txt cp /dmesg.txt "$archive_drive_directory/" + cp /nwipe_report_*pdf "$archive_drive_directory/" if [ $? != 0 ]; then printf "archive_log.sh: Unable to copy the dmesg.txt file to the root of $drive:/\n" else @@ -71,6 +72,7 @@ else if [ exit_code != 5 ]; then # Move the nwipe logs into the RAM disc sent directory mv /nwipe_log* "$sent_directory/" + mv /nwipe_report*pdf "$sent_directory/" if [ $? != 0 ]; then printf "archive_log.sh: Unable to move the nwipe logs into the $sent_directory on the RAM disc\n" exit_code=6 diff --git a/board/shredos/fsoverlay/usr/bin/nwipe_launcher b/board/shredos/fsoverlay/usr/bin/nwipe_launcher index 505bb56e2f..c4f5ce8fcf 100755 --- a/board/shredos/fsoverlay/usr/bin/nwipe_launcher +++ b/board/shredos/fsoverlay/usr/bin/nwipe_launcher @@ -4,6 +4,36 @@ # trap "echo" INT +# Check dmesg for USB activity, do not proceed until there has been no +# activity for 5 seconds or automatically proceed after 15 seconds. +# +previous_sha1="" +loop_count=0 + +printf "\nWaiting for all USB devices to be initialised, timeout 30s ." + +while [ 1 ]; do + sha1=$(dmesg | grep -i USB | sha1sum) + if [[ "$previous_sha1" == "$sha1" ]]; then + break + fi + previous_sha1=$sha1 + sleep 1 + printf "." + sleep 1 + printf "." + sleep 1 + printf "." + sleep 1 + printf "." + sleep 1 + printf "." + ((loop_count++)) + if [ $loop_count == 6 ]; then + break + fi +done +printf "\n" # archive dmesg.txt and nwipe logs prior to launching nwipe. This is done just # in case there are any display issues and we want to take a look at the dmesg data. /usr/bin/archive_log.sh