diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-09-15 00:41:01 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-09-15 00:41:01 +0200 |
commit | e2a402c198dcabf2391184b8e2229b441fab6d78 (patch) | |
tree | d96f2353040de9a841181acfea3e4e2a72b02d0d | |
parent | Also, gprs. (diff) | |
download | OpenBSC-Bootstrap-e2a402c198dcabf2391184b8e2229b441fab6d78.tar.xz OpenBSC-Bootstrap-e2a402c198dcabf2391184b8e2229b441fab6d78.zip |
-rw-r--r-- | README.md | 5 | ||||
-rwxr-xr-x | start.sh | 22 | ||||
-rwxr-xr-x | stop.sh | 2 |
3 files changed, 26 insertions, 3 deletions
@@ -7,12 +7,15 @@ Network from Scratch on Gentoo =net-wireless/osmobts-9999 ** =net-wireless/osmotrx-9999 ** =net-libs/libosmo-abis-9999 ** + =net-libs/libosmo-netif-9999 ** =net-wireless/openggsn-9999 ** + =net-libs/libosmocore-9999 ** + =net-misc/lcr-9999 ** #### 2. Make sure your portage tree is up to date, and emerge the right packages: $ sudo emerge --sync - $ sudo emerge openbsc osmobts osmotrx + $ sudo emerge openbsc osmobts osmotrx lcr #### 3. Customize config files. @@ -3,13 +3,19 @@ config_dir="$(readlink -f "$(dirname "$0")")" openbsc_config="$config_dir/open-bsc.cfg" osmobts_config="$config_dir/osmo-bts.cfg" +osmosgsn_config="$config_dir/osmo-sgsn.cfg" +openggsn_config="$config_dir/ggsn.conf" +ggsn_state_dir="$config_dir/ggsn-state/" +ggsn_config="$config_dir/ggsn.conf" hlr_db="$config_dir/hlr.sqlite3" window_title="GSM" lcr="" channels="1" +gprs=0 -[[ $2 == "lcr" || $1 == "lcr" ]] && lcr="-m" -[[ $2 == "mimo" || $1 == "mimo" ]] && channels="2" +[[ $3 == "lcr" || $2 == "lcr" || $1 == "lcr" ]] && lcr="-m" +[[ $3 == "mimo" || $2 == "mimo" || $1 == "mimo" ]] && channels="2" +[[ $3 == "gprs" || $2 == "gprs" || $1 == "gprs" ]] && gprs=1 tmux new-session -s "$window_title" -n close-me -d @@ -27,6 +33,18 @@ fi tmux new-window -n OsmoTRX -t "$window_title" tmux send-keys -t OsmoTRX "osmo-trx -c $channels" Enter +if [[ $gprs -eq 1 ]]; then + #TODO in ebuild: sudo setcap cap_net_admin=ep /usr/bin/ggsn + tmux new-window -n OpenGGSN -t "$window_title" + tmux send-keys -t OpenGGSN "ggsn --statedir='$ggsn_state_dir' --conf='$openggsn_config' --pidfile='$ggsn_state_dir/ggsn.pid' --fg --debug" Enter + + tmux new-window -n OsmoSGSN -t "$window_title" + tmux send-keys -t OsmoSGSN "osmo-sgsn -c '$osmosgsn_config'" Enter + + tmux new-window -n SGSN-Control -t "$window_title" + tmux send-keys -t SGSN-Control "while ! /sbin/ss -n -l -t state listening src \"*:4245\" | grep -q :4245; do sleep 0.5; done; telnet 127.0.0.1 4245" Enter +fi + tmux new-window -n BSC-Control -t "$window_title" tmux send-keys -t BSC-Control "while ! /sbin/ss -n -l -t state listening src \"*:4242\" | grep -q :4242; do sleep 0.5; done; telnet 127.0.0.1 4242" Enter @@ -6,4 +6,6 @@ pkill osmo-nitb pkill osmobts-trx pkill osmo-trx pkill lcr +pkill ggsn +pkill osmo-sgsn tmux kill-session -t GSM |