AlmaLinuxでx86_64なOpenWRT用に最新のSoftetherVPN 4.38をコンパイルする

AlmaLinux 8.5 にて x86 用の SoftetherVPN をコンパイルし IPK ファイルを作成する手順を残しておきます。
各インストールから行っておりますが、Aloma Linux を VMWare 上にインストールした直後を想定しています。
Softether VPN のバージョンは 4.38-9760-2 を使用しています。

まずは必要なものをインストール

コンパイルに必要なものをインストールします。
OS は AlmaLinux 8.5 x86_64 を利用しています。
https://mirrors.almalinux.org/isos.html

$ sudo dnf install subversion binutils bzip2 gcc gcc-c++ gawk gettext flex ncurses-devel zlib-devel  make patch unzip perl-ExtUtils-MakeMaker glibc glibc-devel ncurses-libs sed intltool bison wget git-core openssl-devel xz readline-devel

コンパイル準備中に下記も必要と怒られたのでインストールします。

$ sudo dnf install tar rsync python39

OpenWRTの SDK を準備

GIT さんから OpenWRT の SDK を取得しカレントディレクトリを変更します。

$ git clone https://github.com/openwrt/openwrt.git
$ cd openwrt

SoftetherVPN 用の FEED を設定ファイルに追記します。

$ echo "src-git softethervpn https://github.com/el1n/OpenWRT-package-softether.git" >> feeds.conf.default

各 Feed を更新します。

$ ./scripts/feeds update

SoftetherVPN のコンパイルに必要なライブラリと Softether 自体をインストールします。

$ ./scripts/feeds install libpam liblzma libnetsnmp
$ ./scripts/feeds install softethervpn

コンパイル環境の構成を作成します

コンパイル環境の構成を実施します。

$ make defconfig
$ make menuconfig

menuconfig では次の通り選択します。

Target System:x86
Subtarget:x86_64
Target Profile:Generic x86/64

Softether 自体は次の通り選択します。
Network —> VPN —>
 softethervpn-base
 softethervpn-bridge
 softethervpn-client
 softethervpn-server

続いてコンパイル作業に入ります。
マシンスペックにもよると思いますが、1時間以上かかるかもしれません。
気長に待ちましょう。

なお、root ユーザでコンパイルを実行すると TAR のコンパイル部分で失敗しますので、一般ユーザを作成して実行しましょう。

いざコンパイル!

$ make prepare
$ make package/softethervpn/compile

以下のようにエラーなど無いことを確認します。

$ make prepare
make[2]: Entering directory '/home/user/openwrt/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/home/user/openwrt/scripts/config'
 make[1] prepare
 make[2] target/compile
 make[3] -C target/linux compile
 make[2] buildinfo
 make[3] diffconfig buildversion feedsversion
 make[4] scripts/config/conf
$ make package/softethervpn/compile
make[2]: Entering directory '/home/user/openwrt/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/home/user/openwrt/scripts/config'
 make[1] package/softethervpn/compile
 make[2] -C package/libs/libiconv host-compile
 make[2] -C package/libs/ncurses host-compile
 make[2] -C package/libs/readline host-compile
 make[2] -C feeds/packages/net/softethervpn host-compile
 make[2] -C package/libs/toolchain compile
 make[2] -C package/firmware/linux-firmware compile
 make[2] -C package/firmware/prism54-firmware compile
 make[2] -C package/kernel/gpio-button-hotplug compile
 make[2] -C package/system/gpio-cdev/nu801 compile
 make[2] -C package/kernel/linux compile
 make[2] -C package/libs/zlib compile
 make[2] -C package/libs/ncurses compile
 make[2] -C package/libs/openssl compile
 make[2] -C package/libs/readline compile
 make[2] -C package/libs/libiconv compile
 make[2] -C feeds/packages/net/softethervpn compile

そうすると
bin/packages/x86_64/packages/
上記パスにIPKパッケージが保存されますのでルーターにインストールします。
私がコンパイルした時点では次のようなファイル名となっています。

softethervpn-base_4.38-9760-2_x86_64.ipk
softethervpn-bridge_4.38-9760-2_x86_64.ipk
softethervpn-client_4.38-9760-2_x86_64.ipk
softethervpn-server_4.38-9760-2_x86_64.ipk

ご注意

システムの破損等責任は負いかねますので、インストールの際にはシステムのバックアップ等とってから実施ください。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です