github.com/jlmucb/cloudproxy@v0.0.0-20170830161738-b5aa0b619bc4/go/run/scripts/build_linux_host.sh (about)

     1  #!/bin/bash
     2  
     3  # This script assumes that the binary for linux_host has been built and
     4  # installed into a bin path in $GOPATH. For the purposes of KVM/CoreOS, this
     5  # binary must be executable on the virtual machine. One way to make this easier
     6  # is to build the binary statically. E.g., see run/scripts/build_standalone.sh.
     7  
     8  if [ "$#" != "1" ]; then
     9  	echo "Must supply the path to an initialized domain."
    10  	exit 1
    11  fi
    12  
    13  WHICH=$(which which)
    14  APP_BIN="$(PATH="${GOPATH//://bin:}/bin" $WHICH linux_host)"
    15  TEMP_DIR=$(mktemp -d)
    16  cp "$APP_BIN" ${TEMP_DIR}/linux_host
    17  mkdir ${TEMP_DIR}/policy_keys
    18  mkdir ${TEMP_DIR}/linux_tao_host
    19  chmod 755 ${TEMP_DIR}/linux_tao_host
    20  cp "$1/policy_keys/cert" ${TEMP_DIR}/policy_keys/cert
    21  cp "$1/tao.config" ${TEMP_DIR}/tao.config
    22  
    23  
    24  tar -C ${TEMP_DIR} -czf "$APP_BIN".img.tgz $(ls ${TEMP_DIR})
    25  rm -fr ${TEMP_DIR}