osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-dev/+/27435 )
Change subject: net/README: update tmux documentation
......................................................................
net/README: update tmux documentation
Change-Id: I5561dae3898bf86176d7693c08732a68a1158a14
---
M net/README
1 file changed, 6 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/35/27435/1
diff --git a/net/README b/net/README
index f3c388a..696a803 100644
--- a/net/README
+++ b/net/README
@@ -123,11 +123,12 @@
When you launch run.sh, many xterms are launched, and when hitting enter, all
of them get destroyed again. This is obviously intended to be run on your
-desktop computer or laptop, not on a remote box. It may also make sense to
-launch all of them in the current shell, and maybe or maybe not switch off
-stderr logging; or to launch each component in a tmux window or whatnot -- if
-you figure out something in that line, I would be glad to get contributions and
-incorporate that.
+desktop computer or laptop, not on a remote box.
+
+It's also possible to set TERMINAL="tmux" in your network configuration, then
+run.sh starts a tmux session and runs each Osmocom program as own tmux window
+inside that session. Switch to the first window (^B + 0) and hit enter to close
+all windows and the whole tmux session. This does work over SSH.
=== Logging and pcaps
--
To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/27435
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: I5561dae3898bf86176d7693c08732a68a1158a14
Gerrit-Change-Number: 27435
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newchange
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-dev/+/27434 )
Change subject: net: get missing config variables from config_2g3g
......................................................................
net: get missing config variables from config_2g3g
Don't ask the user to copy config_2g3g and manually keep it in sync with
config_2g3g with each change anymore. Instead, let the user config be a
diff on top of config_2g3g.
This is in preparation to adding new variables for use with OsmoBSCNAT.
Change-Id: I5870d39aee8be84c2024f8a2a71ee4a734a4fc7c
---
M net/README
M net/fill_config.py
2 files changed, 93 insertions(+), 38 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/34/27434/1
diff --git a/net/README b/net/README
index 73a8d2f..f3c388a 100644
--- a/net/README
+++ b/net/README
@@ -10,28 +10,55 @@
=== Quick Start
-cp config_2g3g config_mine
-$EDITOR config_mine
-# update IP addresses and device names as required
+* Open config_2g3g in a text editor (original config)
+* Open a new file in a text editor (your config)
+* Copy over all lines you want to change in your config and edit them there
+* Your resulting minimal config could look like this:
-mkdir my_network
-cd my_network
-../fill_config.py ../config_mine ../templates
+ TERMINAL="tmux"
-./run.sh
-# Launches numerous x-terminals with one component running in each.
-# Logs and pcap traces are being taken automatically.
+ ETH_DEV=enp0s25
-# hit enter in the original first terminal to tear down all programs.
-# Enter a name to save logs, otherwise all logging will be stored
-# under autolog/<timestamp>
+ TO_RAN_IP="192.168.1.123"
+ TO_RAN_IU_IP="192.168.1.42"
-Then possibly modify the config and refresh:
+ MCC=999
+ MNC=99
-# tweak config?
-$EDITOR ../config_mine
-../fill_config.py
-# picks up same ../config_mine and ../templates from last time
+ BTS0_IPA_UNIT="1234 0"
+ BTS0_ARFCN=800
+
+* Create a network directory and generate configs:
+
+ $ mkdir my_network
+ $ cd my_network
+ $ ../fill_config.py ../config_mine ../templates
+
+* Run the network:
+
+ $ ./run.sh
+
+ This launches numerous terminals with one component running in each.
+ Logs and pcap traces are being taken automatically.
+
+* Tear down:
+
+ Hit enter in the original first terminal to tear down all programs.
+ Enter a name to save logs, otherwise all logging will be stored
+ under autolog/<timestamp>.
+
+* Regenerate configs:
+
+ Modify your config and regenerate the network configs as follows, the same
+ original config, your config and templates will be used as last time.
+
+ $ $EDITOR ../config_mine
+ $ ../fill_config.py
+
+ ('make regen' also works)
+
+
+=== Advanced usage / more examples
# own templates?
cp -r ../templates ../templates_mine
@@ -67,7 +94,7 @@
fill_config.py script. See e.g. templates/.
A *file* contains local config items as name=val pairs that are put into the
-templates. See e.g. config_2g3g.
+templates. It is usually a subset of config_2g3g.
The fill_config.py script helps to fill the templates with the config values. Simply
invoke fill_config.py with a dir argument (templates dir) and a file argument (specific
@@ -77,6 +104,11 @@
If one or both are omitted, the script tries to re-use the most recent paths,
they were stored in local files '.last_config' and '.last_templates'.
+The -o parameter of fill_config.py can be used to supply a different original
+config file than config_2g3g. If it is omitted, the path is read from a
+'.last_config_orig' file inside the network directory if present, and config_2g3g
+is used otherwise.
+
The result is a complete set of .cfg files that match your local machine and
network config.
diff --git a/net/fill_config.py b/net/fill_config.py
index f68f572..8d1b959 100755
--- a/net/fill_config.py
+++ b/net/fill_config.py
@@ -8,7 +8,9 @@
def file_newer(path_a, than_path_b):
return os.path.getmtime(path_a) > os.path.getmtime(than_path_b)
+DEFAULT_ORIG_CONFIG = os.path.normpath(os.path.realpath(__file__) + "/../config_2g3g")
LAST_LOCAL_CONFIG_FILE = '.last_config'
+LAST_ORIG_CONFIG_FILE = '.last_config_orig'
LAST_TMPL_DIR = '.last_templates'
parser = argparse.ArgumentParser(description=__doc__,
@@ -18,10 +20,14 @@
parser.add_argument('-s', '--check-stale', dest='check_stale', action='store_true',
help='only verify age of generated files vs. config and templates.'
' Exit nonzero when any source file is newer. Do not write anything.')
+parser.add_argument('-o', '--original-config',
+ help='get missing variables from this file, default is config_2g3g'
+ ' or the file used previously to fill an existing template dir')
args = parser.parse_args()
local_config_file = None
+orig_config_file = args.original_config
tmpl_dir = None
for src in args.sources:
@@ -37,6 +43,12 @@
if local_config_file is None and os.path.isfile(LAST_LOCAL_CONFIG_FILE):
local_config_file = open(LAST_LOCAL_CONFIG_FILE).read().strip()
+if orig_config_file is None:
+ if os.path.isfile(LAST_ORIG_CONFIG_FILE):
+ orig_config_file = open(LAST_ORIG_CONFIG_FILE).read().strip()
+ else:
+ orig_config_file = DEFAULT_ORIG_CONFIG
+
if tmpl_dir is None and os.path.isfile(LAST_TMPL_DIR):
tmpl_dir = open(LAST_TMPL_DIR).read().strip()
@@ -48,47 +60,57 @@
print("No such config file: %r" % local_config_file)
exit(1)
+if not os.path.isfile(orig_config_file):
+ print("No such config file: %r" % orig_config_file)
+ exit(1)
+
local_config_file = os.path.realpath(local_config_file)
tmpl_dir = os.path.realpath(tmpl_dir)
net_dir = os.path.realpath(".")
print(f'using config file: {local_config_file}')
+print(f'with original: {orig_config_file}')
print(f'on templates: {tmpl_dir}')
print(f'with NET_DIR: {net_dir}')
with open(LAST_LOCAL_CONFIG_FILE, 'w') as last_file:
last_file.write(local_config_file)
+with open(LAST_ORIG_CONFIG_FILE, 'w') as last_file:
+ last_file.write(orig_config_file)
with open(LAST_TMPL_DIR, 'w') as last_file:
last_file.write(tmpl_dir)
-# read in variable values from config file
+# read in variable values from config files
# NET_DIR is the folder where fill_config.py was started
local_config = {"NET_DIR": net_dir}
-line_nr = 0
-for line in open(local_config_file):
- line_nr += 1
- line = line.strip('\n')
+for config_file in [orig_config_file, local_config_file]:
+ current_config_identifiers = ["NET_DIR"]
+ line_nr = 0
+ for line in open(config_file):
+ line_nr += 1
+ line = line.strip('\n')
- if line.startswith('#'):
- continue
+ if line.startswith('#'):
+ continue
- if not '=' in line:
- if line:
- print("Error: %r line %d: %r" % (local_config_file, line_nr, line))
- exit(1)
- continue
+ if not '=' in line:
+ if line:
+ print("Error: %r line %d: %r" % (config_file, line_nr, line))
+ exit(1)
+ continue
- split_pos = line.find('=')
- name = line[:split_pos]
- val = line[split_pos + 1:]
+ split_pos = line.find('=')
+ name = line[:split_pos]
+ val = line[split_pos + 1:]
- if val.startswith('"') and val.endswith('"'):
- val = val[1:-1]
+ if val.startswith('"') and val.endswith('"'):
+ val = val[1:-1]
- if name in local_config:
- print("Error: duplicate identifier in %r line %d: %r" % (local_config_file, line_nr, line))
- local_config[name] = val
+ if name in current_config_identifiers:
+ print("Error: duplicate identifier in %r line %d: %r" % (config_file, line_nr, line))
+ local_config[name] = val
+ current_config_identifiers += [name]
# replace variable names with above values recursively
replace_re = re.compile('\$\{([A-Z_][A-Za-z0-9_]*)\}')
@@ -240,6 +262,7 @@
if args.check_stale:
check_stale(local_config_file, dst)
+ check_stale(orig_config_file, dst)
check_stale(tmpl_src, dst)
local_config['_fname'] = tmpl_name
--
To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/27434
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: I5870d39aee8be84c2024f8a2a71ee4a734a4fc7c
Gerrit-Change-Number: 27434
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newchange
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-dev/+/27432 )
Change subject: net/templates/run.sh: drop 'fg'
......................................................................
net/templates/run.sh: drop 'fg'
This was related to attempting to fix the infinite "q Enter to close"
msgs bug, which has been properly fixed in
Iebb799493f76fd57f24b15c998ded2bd8e284e6b.
Remove fg to get rid of this error:
zsh:fg:1: no job control in this shell.
Change-Id: Iba7a1adbc4f48b0477a53590ffec8af518fdf467
---
M net/templates/run.sh
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/32/27432/1
diff --git a/net/templates/run.sh b/net/templates/run.sh
index 0a8cfb1..fdf4f3d 100755
--- a/net/templates/run.sh
+++ b/net/templates/run.sh
@@ -128,7 +128,7 @@
case "$terminal" in
tmux)
- tmux new-window -d -n "$title" "$launcher &; echo \$! > $pidfile_term; fg; wait"
+ tmux new-window -d -n "$title" "$launcher &; echo \$! > $pidfile_term; wait"
;;
*)
$terminal \
--
To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/27432
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: Iba7a1adbc4f48b0477a53590ffec8af518fdf467
Gerrit-Change-Number: 27432
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: pespin.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-bts/+/27429
to look at the new patch set (#3).
Change subject: osmo-bts-trx: do not run osmo_{fr,hr}_check_sid() on FACCH/U frames
......................................................................
osmo-bts-trx: do not run osmo_{fr,hr}_check_sid() on FACCH/U frames
It makes no sense to perform the SID codeword lookup in signalling
frames (FACCH), because it can be present only in speech frames.
Change-Id: I2f8137993acfe8a8add3fc2af276e5eb4da1605e
Related: SYS#5853
---
M src/osmo-bts-trx/sched_lchan_tchf.c
M src/osmo-bts-trx/sched_lchan_tchh.c
2 files changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/29/27429/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27429
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I2f8137993acfe8a8add3fc2af276e5eb4da1605e
Gerrit-Change-Number: 27429
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: laforge, fixeria.
Hello Jenkins Builder, laforge, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-bts/+/27430
to look at the new patch set (#3).
Change subject: osmo-bts-trx: rx_tchh_fn(): fix HR SID detection (wrong offset)
......................................................................
osmo-bts-trx: rx_tchh_fn(): fix HR SID detection (wrong offset)
For some reason, gsm0503_tch_hr_decode() outputs frames with length
of 15 bytes (120 bits), while according to TS 101 318, section 5.2
the GSM half rate codec has frame length of 14 bytes (112 bits).
osmo_hr_check_sid() follows TS 101 318 and expects a buffer of
14 bytes (112 bits), so we should skip the first octet prepended
by tch_hr_reassemble().
Change-Id: Ie5fa776dcb2b2203a97aed56ecbf2450af7d87c1
Related: SYS#5853
---
M src/osmo-bts-trx/sched_lchan_tchh.c
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/30/27430/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27430
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ie5fa776dcb2b2203a97aed56ecbf2450af7d87c1
Gerrit-Change-Number: 27430
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/27429 )
Change subject: osmo-bts-trx: do not run osmo_{fr,hr}_check_sid() on FACCH/U frames
......................................................................
Patch Set 2:
(1 comment)
Commit Message:
https://gerrit.osmocom.org/c/osmo-bts/+/27429/comment/c0c3d7aa_928cd4e8
PS1, Line 8:
> Please explain better the patch here, why and so on.
Done
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27429
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I2f8137993acfe8a8add3fc2af276e5eb4da1605e
Gerrit-Change-Number: 27429
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 10 Mar 2022 12:37:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: fixeria.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-bts/+/27429
to look at the new patch set (#2).
Change subject: osmo-bts-trx: do not run osmo_{fr,hr}_check_sid() on FACCH/U frames
......................................................................
osmo-bts-trx: do not run osmo_{fr,hr}_check_sid() on FACCH/U frames
It makes no sense to perform the SID codeword lookup in signalling
frames, because it can be present only speech frames.
Change-Id: I2f8137993acfe8a8add3fc2af276e5eb4da1605e
Related: SYS#5853
---
M src/osmo-bts-trx/sched_lchan_tchf.c
M src/osmo-bts-trx/sched_lchan_tchh.c
2 files changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/29/27429/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27429
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I2f8137993acfe8a8add3fc2af276e5eb4da1605e
Gerrit-Change-Number: 27429
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: laforge, fixeria.
Hello Jenkins Builder, laforge, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-bts/+/27430
to look at the new patch set (#2).
Change subject: osmo-bts-trx: rx_tchh_fn(): fix HR SID detection (wrong offset)
......................................................................
osmo-bts-trx: rx_tchh_fn(): fix HR SID detection (wrong offset)
For some reason, gsm0503_tch_hr_decode() outputs frames with length
of 15 bytes (120 bits), while according to TS 101 318, section 5.2
the GSM half rate codec has frame length of 14 bytes (112 bits).
osmo_hr_check_sid() follows TS 101 318 and expects a buffer of
14 bytes (112 bits), so we should skip the first octet prepended
by tch_hr_reassemble().
Change-Id: Ie5fa776dcb2b2203a97aed56ecbf2450af7d87c1
Related: SYS#5853
---
M src/osmo-bts-trx/sched_lchan_tchh.c
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/30/27430/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27430
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ie5fa776dcb2b2203a97aed56ecbf2450af7d87c1
Gerrit-Change-Number: 27430
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newpatchset