diff --git a/Makefile b/Makefile index 3ae18f3f..724d4e22 100755 --- a/Makefile +++ b/Makefile @@ -3,18 +3,19 @@ # BUILDTYPE ?= debug INSTALLPREFIX ?= exe -FSWBUILDDIR ?= $(CURDIR)/fsw/build -GSWBUILDDIR ?= $(CURDIR)/gsw/build -SIMBUILDDIR ?= $(CURDIR)/sims/build +NOS3BUILDDIR ?= /tmp/nos3 +FSWBUILDDIR ?= $(NOS3BUILDDIR)/fsw +GSWBUILDDIR ?= $(NOS3BUILDDIR)/gsw +SIMBUILDDIR ?= $(NOS3BUILDDIR)/sims export CFS_APP_PATH = ../components -export MISSION_DEFS = ../cfg/build/ -export MISSIONCONFIG = ../cfg/build/nos3 +export MISSION_DEFS = /tmp/nos3/cfg/nos3_defs +export MISSIONCONFIG = nos3 # The "prep" step requires extra options that are specified via enviroment variables. # Certain special ones should be passed via cache (-D) options to CMake. # These are only needed for the "prep" target but they are computed globally anyway. -PREP_OPTS := +PREP_OPTS := -DMISSION_DEFS=$(MISSION_DEFS) ifneq ($(INSTALLPREFIX),) PREP_OPTS += -DCMAKE_INSTALL_PREFIX=$(INSTALLPREFIX) @@ -48,7 +49,7 @@ all: build-cryptolib: mkdir -p $(GSWBUILDDIR) - cd $(GSWBUILDDIR) && cmake $(PREP_OPTS) -DSUPPORT=1 ../../components/cryptolib + cd $(GSWBUILDDIR) && cmake -DSUPPORT=1 $(CURDIR)/components/cryptolib $(MAKE) --no-print-directory -C $(GSWBUILDDIR) build-fsw: @@ -56,13 +57,13 @@ ifeq ($(FLIGHT_SOFTWARE), fprime) cd fsw/fprime/fprime-nos3 && fprime-util generate && fprime-util build else mkdir -p $(FSWBUILDDIR) - cd $(FSWBUILDDIR) && cmake $(PREP_OPTS) ../cfe + cd $(FSWBUILDDIR) && cmake $(PREP_OPTS) $(CURDIR)/fsw/cfe $(MAKE) --no-print-directory -C $(FSWBUILDDIR) mission-install endif build-sim: mkdir -p $(SIMBUILDDIR) - cd $(SIMBUILDDIR) && cmake -DCMAKE_INSTALL_PREFIX=$(SIMBUILDDIR) .. + cd $(SIMBUILDDIR) && cmake -DCMAKE_INSTALL_PREFIX=$(SIMBUILDDIR) $(CURDIR)/sims $(MAKE) --no-print-directory -C $(SIMBUILDDIR) install checkout: @@ -72,7 +73,8 @@ clean: $(MAKE) clean-fsw $(MAKE) clean-sim $(MAKE) clean-gsw - rm -rf cfg/build + ./scripts/clean.sh + rm -rf $(NOS3BUILDDIR) clean-fsw: rm -rf cfg/build/nos3_defs @@ -80,14 +82,16 @@ clean-fsw: rm -rf fsw/fprime/fprime-nos3/build-artifacts rm -rf fsw/fprime/fprime-nos3/build-fprime-automatic-native rm -rf fsw/fprime/fprime-nos3/fprime-venv + rm -rf $(FSWBUILDDIR) clean-sim: - rm -rf sims/build + rm -rf $(SIMBUILDDIR) clean-gsw: rm -rf gsw/build rm -rf gsw/cosmos/build rm -rf /tmp/nos3 + rm -rf $(GSWBUILDDIR) config: ./scripts/cfg/config.sh @@ -96,17 +100,17 @@ debug: ./scripts/debug.sh fsw: - ./cfg/build/fsw_build.sh + $(NOS3BUILDDIR)/cfg/fsw_build.sh $(CURDIR) gsw: ./scripts/gsw/build_cryptolib.sh - ./cfg/build/gsw_build.sh + $(NOS3BUILDDIR)/cfg/gsw_build.sh $(CURDIR) igniter: ./scripts/igniter_launch.sh launch: - ./cfg/build/launch.sh + $(NOS3BUILDDIR)/cfg/launch.sh $(CURDIR) log: ./scripts/log.sh diff --git a/cfg/nos3_defs/targets.cmake b/cfg/nos3_defs/targets.cmake index c5c220ee..7d13c421 100644 --- a/cfg/nos3_defs/targets.cmake +++ b/cfg/nos3_defs/targets.cmake @@ -97,7 +97,7 @@ list(APPEND MISSION_GLOBAL_APPLIST fm lc sbn - sbn_tcp + sbn/modules/protocol/sbn_tcp sbn_client sc sch diff --git a/scripts/build_sim.sh b/scripts/build_sim.sh index 92a33145..ee887f9d 100755 --- a/scripts/build_sim.sh +++ b/scripts/build_sim.sh @@ -17,7 +17,7 @@ if [ ! -d $USER_NOS3_DIR ]; then fi # Check that configure build directory exists -if [ ! -d $BASE_DIR/cfg/build ]; then +if [ ! -d $USER_NOS3_BUILD_DIR/cfg ]; then echo "" echo " Need to run make config first!" echo "" @@ -26,4 +26,4 @@ fi chmod g+s $BASE_DIR/sims mkdir -p $BASE_DIR/sims/build -$DFLAGS_CPUS -v $BASE_DIR:$BASE_DIR --name "nos_build_sim" -w $BASE_DIR $DBOX make -j$NUM_CPUS build-sim +$DFLAGS_CPUS -v $BASE_DIR:$BASE_DIR -v $USER_NOS3_BUILD_DIR:$USER_NOS3_BUILD_DIR --name "nos_build_sim" -w $BASE_DIR $DBOX make -j$NUM_CPUS build-sim diff --git a/scripts/cfg/config.sh b/scripts/cfg/config.sh index 5718fef6..202eba07 100755 --- a/scripts/cfg/config.sh +++ b/scripts/cfg/config.sh @@ -7,12 +7,12 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source $SCRIPT_DIR/../env.sh # Make flight software configuration directory -mkdir -p $BASE_DIR/cfg/build +mkdir -p $USER_NOS3_BUILD_DIR/cfg # Copy baseline configurations into build directory -cp -r $BASE_DIR/cfg/InOut $BASE_DIR/cfg/build/ -cp -r $BASE_DIR/cfg/nos3_defs $BASE_DIR/cfg/build/ -cp -r $BASE_DIR/cfg/sims $BASE_DIR/cfg/build/ +cp -r $BASE_DIR/cfg/InOut $USER_NOS3_BUILD_DIR/cfg/ +cp -r $BASE_DIR/cfg/nos3_defs $USER_NOS3_BUILD_DIR/cfg/ +cp -r $BASE_DIR/cfg/sims $USER_NOS3_BUILD_DIR/cfg/ # Configure flight software python3 $SCRIPT_DIR/cfg/configure.py diff --git a/scripts/cfg/configure.py b/scripts/cfg/configure.py index ccc27aee..49941c05 100644 --- a/scripts/cfg/configure.py +++ b/scripts/cfg/configure.py @@ -24,12 +24,12 @@ if (fsw_cfg == 'fprime'): fsw_identified = 1 - os.system('cp ./scripts/fsw/fsw_fprime_build.sh ./cfg/build/fsw_build.sh') - os.system('cp ./scripts/fsw/fsw_fprime_launch.sh ./cfg/build/launch.sh') + os.system('cp ./scripts/fsw/fsw_fprime_build.sh /tmp/nos3/cfg/fsw_build.sh') + os.system('cp ./scripts/fsw/fsw_fprime_launch.sh /tmp/nos3/cfg/launch.sh') if (fsw_cfg == 'cfs'): fsw_identified = 1 - os.system('cp ./scripts/fsw/fsw_cfs_build.sh ./cfg/build/fsw_build.sh') - os.system('cp ./scripts/fsw/fsw_cfs_launch.sh ./cfg/build/launch.sh') + os.system('cp ./scripts/fsw/fsw_cfs_build.sh /tmp/nos3/cfg/fsw_build.sh') + os.system('cp ./scripts/fsw/fsw_cfs_launch.sh /tmp/nos3/cfg/launch.sh') if (fsw_identified == 0): print('Invalid FSW in configuration file!') print('Exiting due to error...') @@ -41,25 +41,25 @@ gsw_identified = 0 if (gsw_cfg == 'openc3'): - # Copy openc3 scripts into ./cfg/build + # Copy openc3 scripts into /tmp/nos3 gsw_identified = 1 - os.system('cp ./scripts/gsw/gsw_openc3_build.sh ./cfg/build/gsw_build.sh') - os.system('cp ./scripts/gsw/gsw_openc3_launch.sh ./cfg/build/gsw_launch.sh') + os.system('cp ./scripts/gsw/gsw_openc3_build.sh /tmp/nos3/cfg/gsw_build.sh') + os.system('cp ./scripts/gsw/gsw_openc3_launch.sh /tmp/nos3/cfg/gsw_launch.sh') if (gsw_cfg == 'cosmos'): - # Copy cosmos scripts into ./cfg/build + # Copy cosmos scripts into /tmp/nos3 gsw_identified = 1 - os.system('cp ./scripts/gsw/gsw_cosmos_build.sh ./cfg/build/gsw_build.sh') - os.system('cp ./scripts/gsw/gsw_cosmos_launch.sh ./cfg/build/gsw_launch.sh') + os.system('cp ./scripts/gsw/gsw_cosmos_build.sh /tmp/nos3/cfg/gsw_build.sh') + os.system('cp ./scripts/gsw/gsw_cosmos_launch.sh /tmp/nos3/cfg/gsw_launch.sh') if (gsw_cfg == 'fprime'): - # Copy fprime scripts into ./cfg/build + # Copy fprime scripts into /tmp/nos3 gsw_identified = 1 - os.system('cp ./scripts/gsw/gsw_fprime_build.sh ./cfg/build/gsw_build.sh') - os.system('cp ./scripts/gsw/gsw_fprime_launch.sh ./cfg/build/gsw_launch.sh') + os.system('cp ./scripts/gsw/gsw_fprime_build.sh /tmp/nos3/cfg/gsw_build.sh') + os.system('cp ./scripts/gsw/gsw_fprime_launch.sh /tmp/nos3/cfg/gsw_launch.sh') if (gsw_cfg == 'ait'): - # Copy ait scripts into ./cfg/build + # Copy ait scripts into /tmp/nos3 gsw_identified = 1 - os.system('cp ./scripts/gsw/gsw_ait_build.sh ./cfg/build/gsw_build.sh') - os.system('cp ./scripts/gsw/gsw_ait_launch.sh ./cfg/build/gsw_launch.sh') + os.system('cp ./scripts/gsw/gsw_ait_build.sh /tmp/nos3/cfg/gsw_build.sh') + os.system('cp ./scripts/gsw/gsw_ait_launch.sh /tmp/nos3/cfg/gsw_launch.sh') if (gsw_identified == 0): print('Invalid GSW in configuration file!') print('Exiting due to error...') @@ -242,7 +242,7 @@ lines.insert(sc_startup_eof, cf_line) # Write startup script file - with open('./cfg/build/nos3_defs/cpu1_cfe_es_startup.scr', 'w') as fp: + with open('/tmp/nos3/cfg/nos3_defs/cpu1_cfe_es_startup.scr', 'w') as fp: lines = "".join(lines) fp.write(lines) @@ -273,7 +273,7 @@ lines[date_index] = mission_start_time_utc.strftime('%m %d %Y') + ' ! Date (UTC) (Month, Day, Year)\n' lines[time_index] = mission_start_time_utc.strftime('%H %M %S') + ' ! Time (UTC) (Hr,Min,Sec)\n' - with open('./cfg/build/InOut/Inp_Sim.txt', 'w') as fp: + with open('/tmp/nos3/cfg/InOut/Inp_Sim.txt', 'w') as fp: lines = "".join(lines) fp.write(lines) @@ -288,7 +288,7 @@ lines[tipoff_index] = sc_orbit_tipoff_x + ' ' + sc_orbit_tipoff_y + ' ' + sc_orbit_tipoff_z + ' ! Ang Vel (deg/sec)\n' - with open('./cfg/build/InOut/SC_NOS3.txt', 'w') as fp: + with open('/tmp/nos3/cfg/InOut/SC_NOS3.txt', 'w') as fp: lines = "".join(lines) fp.write(lines) @@ -385,7 +385,7 @@ if (sc_thruster_en != 'true'): lines[thruster_index] = ipc_off - with open('./cfg/build/InOut/Inp_IPC.txt', 'w') as fp: + with open('/tmp/nos3/cfg/InOut/Inp_IPC.txt', 'w') as fp: lines = "".join(lines) fp.write(lines) @@ -408,7 +408,7 @@ torquer_index = 999 thruster_index = 999 - with open('./cfg/build/sims/nos3-simulator.xml', 'r') as fp: + with open('/tmp/nos3/cfg/sims/nos3-simulator.xml', 'r') as fp: lines = fp.readlines() for line in lines: if line.find('camsim') != -1: @@ -487,6 +487,6 @@ if (sc_thruster_en != 'true'): lines[thruster_index] = sim_disabled - with open('./cfg/build/sims/nos3-simulator.xml', 'w') as fp: + with open('/tmp/nos3/cfg/sims/nos3-simulator.xml', 'w') as fp: lines = "".join(lines) fp.write(lines) diff --git a/scripts/clean.sh b/scripts/clean.sh new file mode 100644 index 00000000..8b7db181 --- /dev/null +++ b/scripts/clean.sh @@ -0,0 +1,11 @@ +#!/bin/bash -i +# +# Convenience script for NOS3 development +# Use with the Dockerfile in the deployment repository +# https://github.com/nasa-itc/deployment +# + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +source $SCRIPT_DIR/env.sh + +$DFLAGS_CPUS -v $BASE_DIR:$BASE_DIR -v $USER_NOS3_BUILD_DIR:$USER_NOS3_BUILD_DIR --name "nos_clean" -w $BASE_DIR $DBOX rm -rf $USER_NOS3_BUILD_DIR/* diff --git a/scripts/debug.sh b/scripts/debug.sh index 05f479db..d5e18a79 100755 --- a/scripts/debug.sh +++ b/scripts/debug.sh @@ -9,4 +9,4 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source $SCRIPT_DIR/env.sh mkdir -p $BASE_DIR/fsw/build -$DFLAGS_CPUS -v $BASE_DIR:$BASE_DIR -v $USER_NOS3_DIR:$USER_NOS3_DIR -w $BASE_DIR --sysctl fs.mqueue.msg_max=10000 --ulimit rtprio=99 --cap-add=sys_nice --name "nos3_debug" $DBOX bash +$DFLAGS_CPUS -v $BASE_DIR:$BASE_DIR -v $USER_NOS3_DIR:$USER_NOS3_DIR -v $USER_NOS3_BUILD_DIR:$USER_NOS3_BUILD_DIR -w $BASE_DIR --sysctl fs.mqueue.msg_max=10000 --ulimit rtprio=99 --cap-add=sys_nice --name "nos3_debug" $DBOX bash diff --git a/scripts/env.sh b/scripts/env.sh index 546eaa34..91f1e95f 100755 --- a/scripts/env.sh +++ b/scripts/env.sh @@ -5,21 +5,24 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) BASE_DIR=$(cd `dirname $SCRIPT_DIR` && pwd) -FSW_DIR=$BASE_DIR/fsw/build/exe/cpu1 + +USERDIR=$(cd ~/ && pwd) +USER_NOS3_DIR=$USERDIR/.nos3 +USER_NOS3_BUILD_DIR=/tmp/nos3 + +FSW_DIR=$USER_NOS3_BUILD_DIR/fsw/exe/cpu1 GSW_BIN=$BASE_DIR/gsw/cosmos/build/openc3-cosmos-nos3 GSW_DIR=$BASE_DIR/gsw/cosmos -SIM_DIR=$BASE_DIR/sims/build +SIM_DIR=$USER_NOS3_BUILD_DIR/sims SIM_BIN=$SIM_DIR/bin -if [ -d $SIM_DIR/bin ]; then - SIMS=$(ls $SIM_BIN/nos3*simulator) -fi +#if [ -d $SIM_DIR/bin ]; then +# SIMS=$(ls $SIM_BIN/nos3*simulator) +#fi DATE=$(date "+%Y%m%d%H%M") NUM_CPUS="$( nproc )" -USERDIR=$(cd ~/ && pwd) -USER_NOS3_DIR=$(cd ~/ && pwd)/.nos3 OPENC3_DIR=$USER_NOS3_DIR/cosmos OPENC3_PATH=$OPENC3_DIR/openc3.sh diff --git a/scripts/fsw/fsw_cfs_build.sh b/scripts/fsw/fsw_cfs_build.sh index f9e4e261..b0566f6e 100755 --- a/scripts/fsw/fsw_cfs_build.sh +++ b/scripts/fsw/fsw_cfs_build.sh @@ -5,9 +5,8 @@ # https://github.com/nasa-itc/deployment # -# Note this is copied to ./cfg/build as part of `make config` -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -source $SCRIPT_DIR/../../scripts/env.sh +# Note the first argument passed is expected to be the BASE_DIR of the NOS3 repository +source $1/scripts/env.sh # Check that local NOS3 directory exists if [ ! -d $USER_NOS3_DIR ]; then @@ -18,15 +17,12 @@ if [ ! -d $USER_NOS3_DIR ]; then fi # Check that configure build directory exists -if [ ! -d $BASE_DIR/cfg/build ]; then +if [ ! -d $USER_NOS3_BUILD_DIR/cfg ]; then echo "" echo " Need to run make config first!" echo "" exit 1 fi -# Make flight software build directory -mkdir -p $BASE_DIR/fsw/build - # Build -$DFLAGS_CPUS -v $BASE_DIR:$BASE_DIR --name "nos_build_fsw" -w $BASE_DIR $DBOX make -j$NUM_CPUS -e FLIGHT_SOFTWARE=cfs build-fsw +$DFLAGS_CPUS -v $BASE_DIR:$BASE_DIR -v $USER_NOS3_BUILD_DIR:$USER_NOS3_BUILD_DIR --name "nos_build_fsw" -w $BASE_DIR $DBOX make -j$NUM_CPUS -e FLIGHT_SOFTWARE=cfs build-fsw diff --git a/scripts/fsw/fsw_cfs_launch.sh b/scripts/fsw/fsw_cfs_launch.sh index 9dd354a8..0465543d 100755 --- a/scripts/fsw/fsw_cfs_launch.sh +++ b/scripts/fsw/fsw_cfs_launch.sh @@ -5,9 +5,8 @@ # https://github.com/nasa-itc/deployment # -# Note this is copied to ./cfg/build as part of `make config` -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -source $SCRIPT_DIR/../../scripts/env.sh +# Note the first argument passed is expected to be the BASE_DIR of the NOS3 repository +source $1/scripts/env.sh # Check that local NOS3 directory exists if [ ! -d $USER_NOS3_DIR ]; then @@ -18,7 +17,7 @@ if [ ! -d $USER_NOS3_DIR ]; then fi # Check that configure build directory exists -if [ ! -d $BASE_DIR/cfg/build ]; then +if [ ! -d $USER_NOS3_BUILD_DIR/cfg ]; then echo "" echo " Need to run make config first!" echo "" @@ -53,7 +52,7 @@ echo "" echo "Launch GSW..." echo "" -source $BASE_DIR/cfg/build/gsw_launch.sh +source $BASE_DIR/cfg/build/gsw_launch.sh $BASE_DIR echo "Create NOS interfaces..." export GND_CFG_FILE="-f nos3-simulator.xml" @@ -101,7 +100,7 @@ do cd $FSW_DIR # Debugging # Replace `--tab` with `--window-with-profile=KeepOpen` once you've created this gnome-terminal profile manually - gnome-terminal --title=$SC_NUM" - NOS3 Flight Software" -- $DFLAGS -v $BASE_DIR:$BASE_DIR --name $SC_NUM"_nos_fsw" -h nos_fsw --network=$SC_NETNAME -w $FSW_DIR --sysctl fs.mqueue.msg_max=10000 --ulimit rtprio=99 --cap-add=sys_nice $DBOX $SCRIPT_DIR/fsw/fsw_respawn.sh & + gnome-terminal --title=$SC_NUM" - NOS3 Flight Software" -- $DFLAGS -v $BASE_DIR:$BASE_DIR -v $USER_NOS3_BUILD_DIR:$USER_NOS3_BUILD_DIR --name $SC_NUM"_nos_fsw" -h nos_fsw --network=$SC_NETNAME -w $FSW_DIR --sysctl fs.mqueue.msg_max=10000 --ulimit rtprio=99 --cap-add=sys_nice $DBOX $SCRIPT_DIR/fsw/fsw_respawn.sh & #gnome-terminal --window-with-profile=KeepOpen --title=$SC_NUM" - NOS3 Flight Software" -- $DFLAGS -v $BASE_DIR:$BASE_DIR --name $SC_NUM"_nos_fsw" -h nos_fsw --network=$SC_NETNAME -w $FSW_DIR --sysctl fs.mqueue.msg_max=10000 --ulimit rtprio=99 --cap-add=sys_nice $DBOX $FSW_DIR/core-cpu1 -R PO & echo "" diff --git a/scripts/fsw/fsw_fprime_build.sh b/scripts/fsw/fsw_fprime_build.sh index 199c10be..c449364b 100755 --- a/scripts/fsw/fsw_fprime_build.sh +++ b/scripts/fsw/fsw_fprime_build.sh @@ -5,9 +5,8 @@ # https://github.com/nasa-itc/deployment # -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[1]}" )/scripts" && pwd ) -source $SCRIPT_DIR/env.sh - +# Note the first argument passed is expected to be the BASE_DIR of the NOS3 repository +source $1/scripts/env.sh # Check that local NOS3 directory exists if [ ! -d $USER_NOS3_DIR ]; then @@ -18,7 +17,7 @@ if [ ! -d $USER_NOS3_DIR ]; then fi # Check that configure build directory exists -if [ ! -d $BASE_DIR/cfg/build ]; then +if [ ! -d $USER_NOS3_BUILD_DIR/cfg ]; then echo "" echo " Need to run make config first!" echo "" diff --git a/scripts/fsw/fsw_fprime_launch.sh b/scripts/fsw/fsw_fprime_launch.sh index 4d041f4d..8275b606 100755 --- a/scripts/fsw/fsw_fprime_launch.sh +++ b/scripts/fsw/fsw_fprime_launch.sh @@ -5,9 +5,8 @@ # https://github.com/nasa-itc/deployment # -# Note this is copied to ./cfg/build as part of `make config` -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -source $SCRIPT_DIR/../../scripts/env.sh +# Note the first argument passed is expected to be the BASE_DIR of the NOS3 repository +source $1/scripts/env.sh # Check that local NOS3 directory exists if [ ! -d $USER_NOS3_DIR ]; then @@ -18,7 +17,7 @@ if [ ! -d $USER_NOS3_DIR ]; then fi # Check that configure build directory exists -if [ ! -d $BASE_DIR/cfg/build ]; then +if [ ! -d $USER_NOS3_BUILD_DIR/cfg ]; then echo "" echo " Need to run make config first!" echo "" @@ -52,7 +51,7 @@ $DNETWORK create \ echo "" #echo "Launch GSW..." -$BASE_DIR/cfg/build/gsw_launch.sh +$BASE_DIR/cfg/build/gsw_launch.sh $BASE_DIR echo "" echo "Create NOS interfaces..." diff --git a/scripts/gsw/build_cryptolib.sh b/scripts/gsw/build_cryptolib.sh index c8f47e94..d03849ac 100755 --- a/scripts/gsw/build_cryptolib.sh +++ b/scripts/gsw/build_cryptolib.sh @@ -17,15 +17,12 @@ if [ ! -d $USER_NOS3_DIR ]; then fi # Check that configure build directory exists -if [ ! -d $BASE_DIR/cfg/build ]; then +if [ ! -d $USER_NOS3_BUILD_DIR/cfg ]; then echo "" echo " Need to run make config first!" echo "" exit 1 fi -# Make ground software build directory -mkdir -p $BASE_DIR/gsw/build - # Build -$DFLAGS_CPUS -v $BASE_DIR:$BASE_DIR --name "nos_build_cryptolib" -w $BASE_DIR $DBOX make -j$NUM_CPUS build-cryptolib +$DFLAGS_CPUS -v $BASE_DIR:$BASE_DIR -v $USER_NOS3_BUILD_DIR:$USER_NOS3_BUILD_DIR --name "nos_build_cryptolib" -w $BASE_DIR $DBOX make -j$NUM_CPUS build-cryptolib diff --git a/scripts/gsw/gsw_ait_build.sh b/scripts/gsw/gsw_ait_build.sh index 1ab46d11..73ed59aa 100755 --- a/scripts/gsw/gsw_ait_build.sh +++ b/scripts/gsw/gsw_ait_build.sh @@ -3,9 +3,8 @@ # Convenience script for NOS3 development # -CFG_BUILD_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -SCRIPT_DIR=$CFG_BUILD_DIR/../../scripts -source $SCRIPT_DIR/env.sh +# Note the first argument passed is expected to be the BASE_DIR of the NOS3 repository +source $1/scripts/env.sh echo "AIT build..." $DCALL image pull ghcr.io/sphinxdefense/gsw-ait:main diff --git a/scripts/gsw/gsw_ait_launch.sh b/scripts/gsw/gsw_ait_launch.sh index 02d304e3..096bed69 100755 --- a/scripts/gsw/gsw_ait_launch.sh +++ b/scripts/gsw/gsw_ait_launch.sh @@ -3,9 +3,9 @@ # Convenience script for NOS3 development # -CFG_BUILD_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -SCRIPT_DIR=$CFG_BUILD_DIR/../../scripts -source $SCRIPT_DIR/env.sh +# Note the first argument passed is expected to be the BASE_DIR of the NOS3 repository +source $1/scripts/env.sh + export GSW="ait" echo "AIT launch..." diff --git a/scripts/gsw/gsw_cosmos_build.sh b/scripts/gsw/gsw_cosmos_build.sh index 6f48393c..8300f801 100755 --- a/scripts/gsw/gsw_cosmos_build.sh +++ b/scripts/gsw/gsw_cosmos_build.sh @@ -3,9 +3,8 @@ # Convenience script for NOS3 development # -CFG_BUILD_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -SCRIPT_DIR=$CFG_BUILD_DIR/../../scripts -source $SCRIPT_DIR/env.sh +# Note the first argument passed is expected to be the BASE_DIR of the NOS3 repository +source $1/scripts/env.sh echo "COSMOS build..." $DCALL image pull ballaerospace/cosmos:4.5.0 diff --git a/scripts/gsw/gsw_cosmos_launch.sh b/scripts/gsw/gsw_cosmos_launch.sh index 9d41b671..2b835ce3 100755 --- a/scripts/gsw/gsw_cosmos_launch.sh +++ b/scripts/gsw/gsw_cosmos_launch.sh @@ -3,9 +3,9 @@ # Convenience script for NOS3 development # -CFG_BUILD_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -SCRIPT_DIR=$CFG_BUILD_DIR/../../scripts -source $SCRIPT_DIR/env.sh +# Note the first argument passed is expected to be the BASE_DIR of the NOS3 repository +source $1/scripts/env.sh + export GSW="cosmos_openc3-operator_1" # Debugging diff --git a/scripts/gsw/gsw_openc3_build.sh b/scripts/gsw/gsw_openc3_build.sh index c5c88e3f..d9b23ae0 100755 --- a/scripts/gsw/gsw_openc3_build.sh +++ b/scripts/gsw/gsw_openc3_build.sh @@ -3,9 +3,8 @@ # Convenience script for NOS3 development # -CFG_BUILD_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -SCRIPT_DIR=$CFG_BUILD_DIR/../../scripts -source $SCRIPT_DIR/env.sh +# Note the first argument passed is expected to be the BASE_DIR of the NOS3 repository +source $1/scripts/env.sh # Check that local NOS3 directory exists if [ ! -d $USER_NOS3_DIR ]; then diff --git a/scripts/gsw/gsw_openc3_launch.sh b/scripts/gsw/gsw_openc3_launch.sh index 11d306a5..1529fbd6 100755 --- a/scripts/gsw/gsw_openc3_launch.sh +++ b/scripts/gsw/gsw_openc3_launch.sh @@ -3,9 +3,9 @@ # Convenience script for NOS3 development # -CFG_BUILD_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -SCRIPT_DIR=$CFG_BUILD_DIR/../../scripts -source $SCRIPT_DIR/env.sh +# Note the first argument passed is expected to be the BASE_DIR of the NOS3 repository +source $1/scripts/env.sh + export GSW="cosmos_openc3-operator_1" # Debugging diff --git a/scripts/stop.sh b/scripts/stop.sh index bcb11dcd..8def7b14 100755 --- a/scripts/stop.sh +++ b/scripts/stop.sh @@ -12,7 +12,7 @@ source $SCRIPT_DIR/env.sh rm -rf /tmp/gpio_fake # NOS3 Stored HK -rm -rf $BASE_DIR/fsw/build/exe/cpu1/scratch/* +#rm -rf $BASE_DIR/fsw/build/exe/cpu1/scratch/* # Docker stop cd $SCRIPT_DIR; $DFLAG compose down > /dev/null 2>&1 diff --git a/sims/CMakeLists.txt b/sims/CMakeLists.txt index 9eea63e5..098010c8 100644 --- a/sims/CMakeLists.txt +++ b/sims/CMakeLists.txt @@ -48,8 +48,8 @@ ENDFOREACH() # Install configuration files to bin set(sim_cfg - ../cfg/build/sims/nos_engine_server_config.json - ../cfg/build/sims/nos3-simulator.xml - ../cfg/build/sims/sim_log_config.xml + /tmp/nos3/cfg/sims/nos_engine_server_config.json + /tmp/nos3/cfg/sims/nos3-simulator.xml + /tmp/nos3/cfg/sims/sim_log_config.xml ) install(FILES ${sim_cfg} DESTINATION bin COMPONENT config)