Skip to content

Commit 861a028

Browse files
committed
Tag v1.6.0
1 parent 65b42d2 commit 861a028

192 files changed

Lines changed: 7591 additions & 7701 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5G_Core_Network/Additional_Cores_5GDeploy/full_install.sh

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ PARENT_DIR=$(dirname "$SCRIPT_DIR")
4444
cd "$PARENT_DIR"
4545

4646
# Ensure the correct YAML editor is installed
47-
sudo "$SCRIPT_DIR/install_scripts/./ensure_consistent_yq.sh"
47+
"$SCRIPT_DIR/install_scripts/./ensure_consistent_yq.sh"
4848

4949
# Ensure that 5G_Core_Network/options.yaml is configured to use 5gdeploy instead of Open5GS
5050
if [ -f "options.yaml" ]; then
@@ -89,6 +89,19 @@ fi
8989
echo "Using CP: $CORE_TO_USE"
9090
echo "Using UP: $UPF_TO_USE"
9191

92+
# Detect if systemctl is available
93+
USE_SYSTEMCTL=false
94+
if command -v systemctl >/dev/null 2>&1; then
95+
if [ "$(cat /proc/1/comm 2>/dev/null)" = "systemd" ]; then
96+
OUTPUT="$(systemctl 2>&1 || true)"
97+
if echo "$OUTPUT" | grep -qiE 'not supported|System has not been booted with systemd'; then
98+
echo "Detected systemctl is not supported. Using background processes instead."
99+
elif systemctl list-units >/dev/null 2>&1 || systemctl is-system-running --quiet >/dev/null 2>&1; then
100+
USE_SYSTEMCTL=true
101+
fi
102+
fi
103+
fi
104+
92105
cd "$SCRIPT_DIR"
93106

94107
if [ "$CORE_TO_USE" == "5gdeploy-phoenix" ]; then
@@ -106,21 +119,33 @@ sed -i '0,/^[[:space:]]*nci[[:space:]]*=.*$/s// nci = hexPad(((3584 + i) <<
106119

107120
cd $SCRIPT_DIR
108121

109-
# Step 1: Install dependencies
122+
# Install dependencies
110123
mkdir -p logs
124+
125+
# Prevent nvm from interfering with the Node.js installation
126+
if [ -d "$HOME/.nvm" ]; then
127+
export NVM_DIR="$HOME/.nvm"
128+
if [ -s "$NVM_DIR/nvm.sh" ]; then
129+
source "$NVM_DIR/nvm.sh"
130+
echo "Deactivating nvm to prevent interference with Node.js installation..."
131+
nvm deactivate || true
132+
nvm unload || true
133+
fi
134+
fi
135+
136+
if command -v node &>/dev/null; then
137+
NODE_VERSION=$(node --version | sed 's/v//g' | cut -d. -f1)
138+
if [ "$NODE_VERSION" -lt 22 ]; then
139+
echo "Node.js version is less than 22, reinstalling Node.js 22.x"
140+
sudo apt-get purge -y nodejs npm || true
141+
rm -f logs/full_install_step_1_complete
142+
fi
143+
fi
144+
111145
if [ -f logs/full_install_step_1_complete ]; then
112146
if ! command -v docker &>/dev/null; then
113147
rm logs/full_install_step_1_complete
114148
fi
115-
# If node version is less than 22, re-run step 1
116-
if command -v node &>/dev/null; then
117-
NODE_VERSION=$(node --version | sed 's/v//g' | cut -d. -f1)
118-
if [ "$NODE_VERSION" -lt 22 ]; then
119-
echo "Node.js version is less than 22, reinstalling Node.js 22.x"
120-
sudo apt-get purge -y nodejs npm || true
121-
rm logs/full_install_step_1_complete
122-
fi
123-
fi
124149
fi
125150
if [ ! -f logs/full_install_step_1_complete ]; then
126151
# Install system packages
@@ -187,8 +212,7 @@ fi
187212

188213
cd "$SCRIPT_DIR/5gdeploy"
189214

190-
# Step 2: Install 5gdeploy
191-
# For more information, see the 5gdeploy documentation: https://github.com/usnistgov/5gdeploy/blob/main/docs/INSTALL.md
215+
# Install 5gdeploy. For more information, see the 5gdeploy documentation: https://github.com/usnistgov/5gdeploy/blob/main/docs/INSTALL.md
192216
echo "Starting installation of 5G Core Deployment Helper (5gdeploy)..."
193217
./install.sh \
194218
--dpdk-version v24.11 \

5G_Core_Network/Additional_Cores_5GDeploy/full_uninstall.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ SCRIPT_DIR=$(dirname "$(realpath "$0")")
4141
PARENT_DIR=$(dirname "$SCRIPT_DIR")
4242
cd "$SCRIPT_DIR"
4343

44-
echo "Stopping all Open5GS containers..."
44+
echo "Stopping all 5G Core Deployment Helper (5gdeploy) containers..."
4545
./stop.sh
4646

4747
./install_scripts/uninstall_lazydocker.sh

5G_Core_Network/Additional_Cores_5GDeploy/generate_configurations.sh

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ PARENT_DIR=$(dirname "$SCRIPT_DIR")
5252
cd "$SCRIPT_DIR"
5353

5454
if [ ! -d "5gdeploy" ]; then
55-
echo "Error: Cannot find 5gdeploy directory. Please run the full_install.sh script first."
55+
echo "ERROR: Cannot find 5gdeploy directory. Please run the full_install.sh script first."
5656
exit 1
5757
fi
5858
if [ ! -d "5gdeploy/scenario" ]; then
59-
echo "Error: Cannot find 5gdeploy/scenario directory. Please run the full_install.sh script first."
59+
echo "ERROR: Cannot find 5gdeploy/scenario directory. Please run the full_install.sh script first."
6060
exit 1
6161
fi
6262

@@ -87,7 +87,7 @@ fi
8787
cd "$PARENT_DIR"
8888

8989
# Ensure the correct YAML editor is installed
90-
sudo "$SCRIPT_DIR/install_scripts/./ensure_consistent_yq.sh"
90+
"$SCRIPT_DIR/install_scripts/./ensure_consistent_yq.sh"
9191

9292
echo "Parsing options.yaml..."
9393
# Check if the YAML file exists, if not, set and save default values
@@ -142,9 +142,6 @@ if [ ! -f "options.yaml" ]; then
142142
echo "" >>"options.yaml"
143143
echo "ogstun3_ipv4: 10.47.0.0/16" >>"options.yaml"
144144
echo "ogstun3_ipv6: 2001:db8:face::/48" >>"options.yaml"
145-
echo "" >>"options.yaml"
146-
echo "# If core_to_use=open5gs, the use of systemctl can be disabled to support installations within Docker. Before changing this value, it is recommended to uninstall the testbed." >>"options.yaml"
147-
echo "use_systemctl: true" >>"options.yaml"
148145
fi
149146

150147
# Read PLMN and TAC values from the YAML file using yq
@@ -183,22 +180,22 @@ fi
183180

184181
# Configure the DNN, SST, and SD values
185182
DNN=$(sed -n 's/^dnn: //p' options.yaml)
186-
SST=$(yq eval '.sst' options.yaml)
187-
SD=$(yq eval '.sd' options.yaml)
183+
SST=$(yq eval '.slices[0].sst' options.yaml)
184+
SD=$(yq eval '.slices[0].sd' options.yaml)
188185
if [[ -z "$DNN" || "$DNN" == "null" ]]; then
189186
echo "DNN is not set in options.yaml, please ensure that \"dnn\" is set."
190187
exit 1
191188
fi
192189
if [[ -z "$SST" || -z "$SD" || "$SST" == "null" || "$SD" == "null" ]]; then
193-
echo "SST or SD is not set in options.yaml, please ensure that \"sst\" and \"sd\" are set."
190+
echo "SST or SD is not set in options.yaml, please ensure that \"slices[].sst\" and \"slices[].sd\" are set."
194191
exit 1
195192
fi
196193

197194
cd "$SCRIPT_DIR"
198195

199196
UE_CREDENTIAL_GENERATOR_SCRIPT="$(dirname "$PARENT_DIR")/User_Equipment/ue_credentials_generator.sh"
200197
if [ ! -f "$UE_CREDENTIAL_GENERATOR_SCRIPT" ]; then
201-
echo "Error: Cannot find $UE_CREDENTIAL_GENERATOR_SCRIPT to generate UE subscriber credentials."
198+
echo "ERROR: Cannot find $UE_CREDENTIAL_GENERATOR_SCRIPT to generate UE subscriber credentials."
202199
exit 1
203200
fi
204201

@@ -226,14 +223,14 @@ else
226223
# Remove the prefix if it exists
227224
CORE="${CORE_TO_USE#5gdeploy-}"
228225
echo
229-
read -p "WARNING: Unknown core: \"$CORE\", 5gdeploy may not support this core. Do you want to proceed? (y/n): " yn
230-
case $yn in
231-
[Yy]*) ;;
232-
*)
226+
echo "WARNING: Unknown core: \"$CORE\", 5gdeploy may not support this core."
227+
echo "Do you want to proceed? (Y/n)"
228+
read -r CONFIRM
229+
CONFIRM=$(echo "${CONFIRM:-y}" | tr '[:upper:]' '[:lower:]')
230+
if [[ "$CONFIRM" != "y" && "$CONFIRM" != "yes" ]]; then
233231
echo "Exiting."
234232
exit 1
235-
;;
236-
esac
233+
fi
237234
fi
238235

239236
# Ensure that the UPF is set correctly
@@ -256,16 +253,15 @@ elif [ "$UPF_TO_USE" == "5gdeploy-ndndpdk" ]; then
256253
else
257254
# Remove the prefix if it exists
258255
UPF="${UPF_TO_USE#5gdeploy-}"
259-
echo "Unknown UPF: $UPF"
260256
echo
261-
read -p "WARNING: 5gdeploy may not support this UPF. Do you want to proceed? (y/n): " yn
262-
case $yn in
263-
[Yy]*) ;;
264-
*)
257+
echo "WARNING: Unknown UPF: \"$UPF\", 5gdeploy may not support this UPF."
258+
echo "Do you want to proceed? (Y/n)"
259+
read -r CONFIRM
260+
CONFIRM=$(echo "${CONFIRM:-y}" | tr '[:upper:]' '[:lower:]')
261+
if [[ "$CONFIRM" != "y" && "$CONFIRM" != "yes" ]]; then
265262
echo "Exiting."
266263
exit 1
267-
;;
268-
esac
264+
fi
269265
fi
270266

271267
cd "$SCRIPT_DIR"

0 commit comments

Comments
 (0)