@@ -25,8 +25,6 @@ declare -r TFW_NAME=`basename $0`
25
25
declare -r LONG_OPTS=" help,install,remove,purge"
26
26
declare -r DOWNLOAD_DIR=tfw_downloads
27
27
28
- declare -r GITHUB_USER=" tempesta-tech"
29
- declare -r GITHUB_REPO_TEMPESTA=" tempesta"
30
28
declare -r GITHUB_REPO_LINUX=" linux-5.10.35-tfw"
31
29
32
30
# TODO: currently Ubuntu 24 is the only supported distribution, other
@@ -59,7 +57,7 @@ log() {
59
57
shift
60
58
local MESSAGE=" $@ "
61
59
local TIMESTAMP=$( date " +%Y-%m-%d %H:%M:%S" )
62
-
60
+
63
61
if [ -z " $LOGFILE " ]; then
64
62
echo " Error: LOGFILE is not defined."
65
63
return 1
@@ -68,43 +66,16 @@ log() {
68
66
echo " ${TIMESTAMP} [${LEVEL} ] - ${MESSAGE} " | tee -a $LOGFILE
69
67
}
70
68
71
- # Use github API to get information about latest release.
72
- #
73
- # `latest` release shows ONLY releases which are not marked as `prereleases`.
74
- # Github restricts 60 API requests per hour without authorisation. Enough for
75
- # our needs.
76
69
tfw_download ()
77
70
{
78
71
log " INFO" " Starting download process..."
79
72
80
- release_tag=` curl -s https://api.github.com/repos/$GITHUB_USER /$GITHUB_REPO_TEMPESTA /tags | grep \" $DISTRO / | cut -d ' "' -f 4 | sort -V -r | head -n1`
81
- if [[ ! " $release_tag " ]]; then
82
- log " ERROR" " Can't find the latest release in repo: https://github.com/$GITHUB_USER /$GITHUB_REPO_TEMPESTA "
83
- log " INFO" " Attempting to download using fallback URLs."
84
- else
85
- log " INFO" " Found the latest release tag: $release_tag "
86
- uri=" https://api.github.com/repos/$GITHUB_USER /$GITHUB_REPO_LINUX /releases/tags/${release_tag} "
87
- links=` curl -s $uri | grep browser_download_url | grep -P " $2 " | cut -d ' "' -f 4`
88
- fi
89
-
90
- if [[ ! " $links " ]]; then
91
- log " INFO" " Can't download file $2 from release ${release_tag} in repo:"
92
- log " INFO" " https://github.com/$GITHUB_USER /$GITHUB_REPO_LINUX "
93
- # TODO: show next line only if received 403 status code.
94
- log " INFO" " Or may be Github API rate limit exceeded. Fallback download from repo instead github.com"
95
- fall_links=(" http://172.240.91.52:8081/repository/tempesta/pool/l/linux-headers-5.10.35.tfw-4c9ba16/linux-headers-5.10.35.tfw-4c9ba16_5.10.35.tfw-4c9ba16-1_amd64.deb"
96
- " http://172.240.91.52:8081/repository/tempesta/pool/l/linux-image-5.10.35.tfw-4c9ba16/linux-image-5.10.35.tfw-4c9ba16_5.10.35.tfw-4c9ba16-1_amd64.deb"
97
- " http://172.240.91.52:8081/repository/tempesta/pool/l/linux-libc-dev/linux-libc-dev_5.10.35.tfw-4c9ba16-1_amd64.deb"
98
- " http://172.240.91.52:8081/repository/tempesta/pool/t/tempesta-fw-dkms/tempesta-fw-dkms_0.7.1_amd64.deb -O tempesta-fw-dkms.deb" )
99
-
100
- for file in ${fall_links[@]}
101
- do
102
- log " INFO" " Downloading $file using fallback URL"
103
- wget -q --show-progress -P $DOWNLOAD_DIR /$repo $file || log " ERROR" " Failed to download $file "
104
- done
105
- fi
73
+ links=(" http://172.240.91.52:8081/repository/tempesta/pool/l/linux-headers-5.10.35.tfw-83b4909/linux-headers-5.10.35.tfw-83b4909_5.10.35.tfw-83b4909-1_amd64.deb"
74
+ " http://172.240.91.52:8081/repository/tempesta/pool/l/linux-image-5.10.35.tfw-83b4909/linux-image-5.10.35.tfw-83b4909_5.10.35.tfw-83b4909-1_amd64.deb"
75
+ " http://172.240.91.52:8081/repository/tempesta/pool/l/linux-libc-dev/linux-libc-dev_5.10.35.tfw-83b4909-1_amd64.deb"
76
+ " http://172.240.91.52:8081/repository/tempesta/pool/t/tempesta-fw-dkms/tempesta-fw-dkms_0.8.0_amd64.deb -O tempesta-fw-dkms.deb" )
106
77
107
- for file in ${links}
78
+ for file in ${links[@] }
108
79
do
109
80
wget -q --show-progress -P $DOWNLOAD_DIR /$repo $file || log " ERROR" " Failed to download $file "
110
81
done
@@ -119,7 +90,7 @@ tfw_install_packages()
119
90
case $DISTRO in
120
91
" ubuntu-24" )
121
92
repo=" "
122
- log " INFO" " Downloading latest packages from github.com/ $GITHUB_USER / $repo ... "
93
+ log " INFO" " Downloading packages"
123
94
mkdir -p $DOWNLOAD_DIR /$repo
124
95
;;
125
96
* )
@@ -148,11 +119,9 @@ tfw_install_deps()
148
119
" ubuntu-24" )
149
120
echo " "
150
121
log " INFO" " Installation on Ubuntu 24 LTS requires updating system from jessie-backports repository before installing TempestaFW."
151
- log " INFO" " Updating system from jammy repository for Ubuntu 24 LTS."
122
+ log " INFO" " Updating system from noble repository for Ubuntu 24 LTS."
152
123
tfw_confirm
153
124
154
- echo " deb http://ru.archive.ubuntu.com/ubuntu " \
155
- " jammy main" >> /etc/apt/sources.list
156
125
apt-get update || log " ERROR" " Failed to update package lists for Ubuntu 24 LTS."
157
126
apt-get dist-upgrade -y || log " ERROR" " Failed to dist-upgrade on Ubuntu 24 LTS."
158
127
;;
@@ -170,7 +139,7 @@ tfw_install_deps()
170
139
read -n 1 -s -p " Press any key to continue..."
171
140
# curl and wget are required for the script itself.
172
141
apt-get ${APT_OPTS} install -y dkms libboost-dev libboost-program-options-dev \
173
- kdump-tools curl wget ethtool bc libtemplate-perl
142
+ kdump-tools curl wget ethtool bc libtemplate-perl libfmt-dev libspdlog-dev
174
143
if [ $? -eq 0 ]; then
175
144
log " INFO" " Dependencies installation completed."
176
145
else
@@ -191,7 +160,7 @@ tfw_install()
191
160
log " ERROR" " Failed to install dependencies."
192
161
exit 2
193
162
fi
194
-
163
+
195
164
# TempestaFW is shipped as DKMS module. By default, dkms framework
196
165
# installs module only for running kernel. Configure dkms to install
197
166
# module to all kernels. BUILD_EXCLUSIVE variable in TempestaFW's
@@ -208,14 +177,11 @@ tfw_install()
208
177
echo " *************************************************************************"
209
178
read -n 1 -s -p " Press any key to continue..."
210
179
echo " "
211
- log " INFO" " Installing packages from $GITHUB_REPO_LINUX ."
212
180
tfw_install_packages $GITHUB_REPO_LINUX " ${FILES_LINUX[@]} "
213
181
if [ $? -ne 0 ]; then
214
182
log " ERROR" " Failed to install packages."
215
183
exit 2
216
184
fi
217
-
218
- # tfw_install_packages $GITHUB_REPO_TEMPESTA "${FILES_TEMPESTA[@]}"
219
185
}
220
186
221
187
# Find all installed packages that suit *_FILES regular expressions and save
0 commit comments