#!/bin/sh


# If an "overwrite" file exists, it updates the loaded rootfs file so that it can easily be upgraded.
if [ -e /mnt/rootfs/overwrite ]; then
  # Copy objects
  cp -a /mnt/hark /

  cp -a /mnt/rootfs/root/bt /root/

  cp -a /mnt/rootfs/root/drv/drv.ko /root/drv/
  cp -a /mnt/rootfs/root/top_module.bit /root/


fi


# USB Rec
echo 6 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio6/direction
  cp -a /mnt/rootfs/root/UsbRec /root/
  cp -a /mnt/rootfs/root/mount.conf /root/
  cp -a /mnt/rootfs/root/usb-rec.conf /root/
  cp -a /mnt/rootfs/root/mx-gpio /root/


#cp /mnt/uaputl.conf /root/wifi/config/

#cp /mnt/wifi_setting.txt /root/

  # Copy script
  cp /mnt/rootfs/root/step2.sh /root/
  cp /mnt/rootfs/root/step3.sh /root/

  # Copy test data
  cp /mnt/rootfs/root/aisatu8k.wav /root/
  cp /mnt/rootfs/root/sin_data.dat /root/
  cp /mnt/rootfs/root/whitenoise8k.wav /root/
  cp /mnt/rootfs/root/sin8k.wav /root/
  cp /mnt/rootfs/root/karaage8k.wav /root/
  cp /mnt/rootfs/root/karaage8k_wah.wav /root/
  cp /mnt/rootfs/tmp/hark_in.wav /tmp/
  cp /mnt/rootfs/tmp/input_trim_ng.wav /tmp/

# Wandboard
#ifconfig eth0 192.168.33.22

##################################################
## added following by takigahira
##

  # Copy hark manual start/stop scripts
  cp /mnt/rootfs/root/startvs.sh /root/
  cp /mnt/rootfs/root/starthark_old.sh /root/
  cp /mnt/rootfs/root/starthark.sh /root/
  cp /mnt/rootfs/root/starthark_sb.sh /root/
  cp /mnt/rootfs/root/starthark_sb_2016.sh /root/
  cp /mnt/rootfs/root/starthark_sb_2017_tsp.sh /root/
  cp /mnt/rootfs/root/starthark_sb_2017_mtsp.sh /root/
  cp /mnt/rootfs/root/stophark.sh /root/

  # Copy vsserver for car demo
  cp /mnt/rootfs/root/vsserver /root/
  cp /mnt/rootfs/root/thresh_table /root/
  cp /mnt/rootfs/root/thresh_table_evmode /root/

  # Copy recording scripts for car demo
  cp /mnt/rootfs/root/rec_speech.sh /root/
  cp /mnt/rootfs/root/rec_speech_sb.sh /root/
  cp /mnt/rootfs/root/scp_recdata.sh /root/
  cp /mnt/rootfs/root/ssh_keys.tar /root/
  cp /mnt/rootfs/root/del_tmp.sh /root/
  cp /mnt/rootfs/root/check_recdata.sh /root/

  # Copy time sync from http protocol script
  cp /mnt/rootfs/root/tsync.sh /root/

# EOF #

