LoginSignup
0
0

More than 1 year has passed since last update.

[失敗]OpenWRT on FreeBSD

Last updated at Posted at 2022-01-07

ちょっと確認したい事があり、OpenWRTをFreeBSDでビルドできないか試してみました。

BastiileBSDを使いますが、FreeBSD/amd64で試してみます。

ネットで検索するといくつかパッケージをインストールしてちょっとパッチを宛てればビルドできるような情報が出てきます。

たしかに下記のパッチでmakeが実行できるようになります。

diff --git a/include/prereq-build.mk b/include/prereq-build.mk
index d28432f726..d82bd5e9f4 100644
--- a/include/prereq-build.mk
+++ b/include/prereq-build.mk
@@ -130,6 +130,7 @@ $(eval $(call SetupHostCommand,getopt, \
        Please install an extended getopt version that supports --long, \
        gnugetopt -o t --long test -- --test | grep '^ *--test *--', \
        getopt -o t --long test -- --test | grep '^ *--test *--', \
+       /usr/local/bin/getopt -o t --long test -- --test | grep '^ *--test *--', \
        /usr/local/opt/gnu-getopt/bin/getopt -o t --long test -- --test | grep '^ *--test *--'))

 $(eval $(call SetupHostCommand,stat,Cannot find a file stat utility, \
diff --git a/scripts/mkhash.c b/scripts/mkhash.c
index ed3d42d4c3..a28d5fd537 100644
--- a/scripts/mkhash.c
+++ b/scripts/mkhash.c
@@ -105,7 +105,6 @@ be32enc(void *buf, uint32_t u)
        p[2] = ((uint8_t) ((u >> 8) & 0xff));
        p[3] = ((uint8_t) (u & 0xff));
 }
-#endif

 static void
 be64enc(void *buf, uint64_t u)
@@ -132,6 +131,7 @@ be32dec(const void *buf)

        return (((uint32_t) be16dec(p)) << 16) | be16dec(p + 2);
 }
+#endif

 #define MD5_DIGEST_LENGTH      16

makeは実行できますが、toolsとかのビルドでエラーがつぎつぎ出て無理みたいです。

ツールのソース内にdevnameという変数があり、FreeBSDではシステムのヘッダーでこの名前を使っていて、エラーになるケースがありました。これはFreeBSD側が悪いような気もします。

先日twitterで見つけたBastiileBSDのDebian jailでも試してみました。

こちらは何もしないでmakeが実行できますがmakeしているとサポートされてないシステムコールがあり、止まってしまいます。

Linuxバイナリ互換環境はあまり意味がないので試してません。

Linux互換はOpenWatcomのインストーラーも動かなかったので、結構使えないことあるようです。ただOpenWatcomのツールやPlatformIOのツールなどは問題ないので、向き不向きがあるのかもしれません。

あきらめてceleron(32Bit)なDebian10でビルドしました。ほぼほぼ一日がかりでした。このマシン71Wくらいあって24時間だと1704whで40円くらいのお金がかかってしまったと思われます。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0