OpenWrt Build System on FreeBSD

Here's my attempt to create an OpenWrt Build System on FreeBSD:-

#  Install required pkgs

cat <<EOF | xargs pkg install -y
git
bash
gmake
gtar
gcc
gawk
ncurses
findutils
patch
wget
getopt
coreutils
EOF

# Build and install GNU time

wget https://ftp.gnu.org/gnu/time/time-1.9.tar.gz
tar zxf time-1.9.tar.gz
cd time-1.9
./configure
make
make install
mv /usr/local/bin/time /usr/local/bin/gtime

# Install OpenWrt Build System

mkdir ~/OpenWrt-BuildSystem
cd ~/OpenWrt-BuildSystem
git clone https://github.com/openwrt/openwrt.git
cd openwrt

# patch mkhash.c

wget 'https://bugs.openwrt.org/index.php?getfile=292' -O patchfile
patch scripts/mkhash.c -i patchfile -o scripts/mkhash.c

# Let's go!!!

./scripts/feeds update -a
./scripts/feeds install -a

make  menuconfig

If anyone here uses FreeBSD, could you see how far it gets?

Dependency on GNU time has been removed just hours ago:
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=d3ddf6631e491a831617a5ae8b3d7924e47a275a

1 Like

Great! After I'd spent a while trying to get GNU time working....:grinning:

Could you also include the FreeBSD patch for mkhash.c ?

[https://bugs.openwrt.org/index.php?getfile=292 ]

Any chance of this patch being added?

You know it is still the weekend in some timezones. It has been less than 24hrs since you asked
Login to bugs and vote for it
Also link the task instead of the file so others can vote to help your cause

Sorry, didn't mean to be pushy just wondered if anyone had noticed my request.

I'm not sure what you mean by 'login to bugs' also not sure about any task ID.

I'm pretty new to all this stuff.

You posted a link from bugs.openwrt.org

Do I need to register, or do I use the same details as I use for logging on here? The problem is obviously known about, since a patch is already available. Am I just supposed to ask for it to be incorporated?

Yes you need to register

Not necessary to ask, just add your vote.

If you have any info to help in progressing task you can add that , such as you can confirm you tested and it worked for you, if that is the case.

Have you actually tested it yourself, it is not clear from your post.

Note that votes have no influence on when and how fast a bug gets fixed.

The thing is the bug was fixed almost a year ago, but the fix has never been implemented.

Yes, but have you tested it and can you confirm the patch works?

Yes, i can download and install the OpenWrt Build System on FreeBSD without any errors once the patch to mkhash.c is applied.

1 Like

I use the script, get the following error:

gmake[8]: Entering directory '/usr/home/xiangsiwei/openwrt-v18.06.2/build_dir/host/xz-5.2.4/src/xzdec'
/usr/bin/env bash ../../libtool  --tag=CC   --mode=link gcc -D_THREAD_SAFE -pthread -fvisibility=hidden -Wall -Wextra -Wvla -Wformat=2 -Winit-self -Wmissing-include-dirs -Wstrict-aliasing -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wlogical-op -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wredundant-decls -O2 -I/usr/home/xiangsiwei/openwrt-v18.06.2/staging_dir/host/include   -L/usr/home/xiangsiwei/openwrt-v18.06.2/staging_dir/host/lib  -o xzdec xzdec-xzdec.o xzdec-tuklib_progname.o xzdec-tuklib_exit.o  ../../src/liblzma/liblzma.la  -lintl
libtool: link: gcc -D_THREAD_SAFE -pthread -fvisibility=hidden -Wall -Wextra -Wvla -Wformat=2 -Winit-self -Wmissing-include-dirs -Wstrict-aliasing -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wlogical-op -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wredundant-decls -O2 -I/usr/home/xiangsiwei/openwrt-v18.06.2/staging_dir/host/include -o xzdec xzdec-xzdec.o xzdec-tuklib_progname.o xzdec-tuklib_exit.o  -L/usr/home/xiangsiwei/openwrt-v18.06.2/staging_dir/host/lib ../../src/liblzma/.libs/liblzma.a -lintl -pthread
/usr/local/bin/ld: ../../src/liblzma/.libs/liblzma.a(liblzma_la-sha256.o): in function `transform':
sha256.c:(.text+0x68): undefined reference to `bswap32'
/usr/local/bin/ld: sha256.c:(.text+0x106): undefined reference to `bswap32'
/usr/local/bin/ld: sha256.c:(.text+0x183): undefined reference to `bswap32'
/usr/local/bin/ld: sha256.c:(.text+0x205): undefined reference to `bswap32'
/usr/local/bin/ld: sha256.c:(.text+0x27b): undefined reference to `bswap32'
/usr/local/bin/ld: ../../src/liblzma/.libs/liblzma.a(liblzma_la-sha256.o):sha256.c:(.text+0x2f5): more undefined references to `bswap32' follow                                                                                                                                 
/usr/local/bin/ld: ../../src/liblzma/.libs/liblzma.a(liblzma_la-sha256.o): in function `lzma_sha256_finish':
sha256.c:(.text+0x151f): undefined reference to `bswap64'
/usr/local/bin/ld: sha256.c:(.text+0x154a): undefined reference to `bswap32'
collect2: error: ld returned 1 exit status
gmake[8]: *** [Makefile:501: xzdec] Error 1

Please tell me, did you manage to solve this problem?

Ogogon.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.