openwrt_lede-18.06 icon indicating copy to clipboard operation
openwrt_lede-18.06 copied to clipboard

Issue compiling on Ubuntu 20.04 (Wireguard needed)

Open tkndrm opened this issue 3 years ago • 4 comments

Hello, i have difficulties to compile the firmware on *ubuntu 20.04. My goal is to active wireguard support for my Dragino DLOS8 LoRa Gateway.

It would be very nice, if you guys can provide us with a sysupgrade.bin that comes with wireguard support.

So far i try to compile without modification of the config file

$ ./build_image.sh 

Remove custom files from last build
***Copy general_files to OpenWrt***
***.config.lgw to OpenWrt/.config***

***Find customized .config files***
Replace default .config file with .config.lgw

***Entering build directory***

***Update build version and build date***
Build: lgw-5.4.1625390921
Build Time: So 4. Jul 11:28:41 CEST 2021

***Run make for dragion ms14, HE, LG01N, LG02, LG308, LPS8, DLOS8, LIG16

[...]

make[1]: *** [tools/Makefile:150: /home/user/Programs/dragino-lede-18.06/openwrt/staging_dir/target-mips_24kc_musl/stamp/.tools_compile_yynyyyyynyyyyynyynnyyyyyyyyyyyyyyyyyyyynyynynyyyynnyy] Error 2
make[1]: Leaving directory '/home/user/Programs/dragino-lede-18.06/openwrt'
make: *** [/home/user/Programs/dragino-lede-18.06/openwrt/include/toplevel.mk:218: world] Error 2

Build Fails, run below commands to build the image in single thread and check what is wrong
**************
	./build_image.sh -s V=99
**************
$ ./build_image.sh -s V=99

Remove custom files from last build
***Copy general_files to OpenWrt***
***.config.lgw to OpenWrt/.config***

***Find customized .config files***
Replace default .config file with .config.lgw

***Entering build directory***

***Update build version and build date***
Build: lgw-5.4.1625390983
Build Time: So 4. Jul 11:29:43 CEST 2021

***Run make for dragion ms14, HE in single thread ***

[...]

freadahead.c: In function 'freadahead':
freadahead.c:92:3: error: #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
   92 |  #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
      |   ^~~~~
make[7]: *** [Makefile:1910: freadahead.o] Error 1
make[7]: Leaving directory '/home/user/Programs/dragino-lede-18.06/openwrt/build_dir/host/m4-1.4.18/lib'
make[6]: *** [Makefile:1674: all] Error 2
make[6]: Leaving directory '/home/user/Programs/dragino-lede-18.06/openwrt/build_dir/host/m4-1.4.18/lib'
make[5]: *** [Makefile:1572: all-recursive] Error 1
make[5]: Leaving directory '/home/user/Programs/dragino-lede-18.06/openwrt/build_dir/host/m4-1.4.18'
make[4]: *** [Makefile:1528: all] Error 2
make[4]: Leaving directory '/home/user/Programs/dragino-lede-18.06/openwrt/build_dir/host/m4-1.4.18'
make[3]: *** [Makefile:30: /home/user/Programs/dragino-lede-18.06/openwrt/build_dir/host/m4-1.4.18/.built] Error 2
make[3]: Leaving directory '/home/user/Programs/dragino-lede-18.06/openwrt/tools/m4'
Command exited with non-zero status 2
time: tools/m4/compile#2.01#0.46#2.46
make[2]: *** [tools/Makefile:154: tools/m4/compile] Error 2
make[2]: Leaving directory '/home/user/Programs/dragino-lede-18.06/openwrt'
make[1]: *** [tools/Makefile:150: /home/user/Programs/dragino-lede-18.06/openwrt/staging_dir/target-mips_24kc_musl/stamp/.tools_compile_yynyyyyynyyyyynyynnyyyyyyyyyyyyyyyyyyyynyynynyyyynnyy] Error 2
make[1]: Leaving directory '/home/user/Programs/dragino-lede-18.06/openwrt'
make: *** [/home/user/Programs/dragino-lede-18.06/openwrt/include/toplevel.mk:218: world] Error 2

Build Fails, run below commands to build the image in single thread and check what is wrong
**************
	./build_image.sh -s V=99
**************

Do i miss any requirements for the building/compiling process?

tkndrm avatar Jul 04 '21 09:07 tkndrm

A friend managed to build for me a firmware that includes wireguard on Ubuntu 18.04 but unfortunately it didn't worked after flashing it to my DLOS8 Device.

It still gaves me errors:

# opkg install wireguard
Installing wireguard (1.0.20200611-1) to root...
Downloading https://downloads.openwrt.org/releases/packages-18.06/mips_24kc/base//wireguard_1.0.20200611-1_mips_24kc.ipk
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for wireguard:
 * 	kernel (= 4.9.214-1-2b8f9dfe583e5c09aadd9474da55137f) * 	kernel (= 4.9.214-1-2b8f9dfe583e5c09aadd9474da55137f) * 	kernel (= 4.9.214-1-2b8f9dfe583e5c09aadd9474da55137f) * 
 * opkg_install_cmd: Cannot install package wireguard.

tkndrm avatar Jul 12 '21 18:07 tkndrm

Anyone an idea?

tkndrm avatar Aug 24 '21 19:08 tkndrm

maybe you can patch like previous version m4 see the link : https://github.com/easybuilders/easybuild-easyconfigs/issues/8501

rizqisubeno avatar Oct 18 '21 17:10 rizqisubeno

Can confirm that https://github.com/easybuilders/easybuild-easyconfigs/issues/8501#issuecomment-503719143 fixes the freadahead compile issue

The second patch is also needed, and then the commands at the bottom of this link: https://bugs.archlinux.org/task/59782

sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' gl/lib/*.c
sed -i '/unistd/a #include <sys/sysmacros.h>' gl/lib/mountlist.c
echo "#define _IO_IN_BACKUP 0x100" >> gl/lib/stdio-impl.h #_IO_IN_BACKUP became private in glibc-2.28

... also editing openwrt/package/libs/libmpsse/Makefile PKG_SOURCE_URL to be https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/libmpsse/

nroach44 avatar Oct 22 '22 12:10 nroach44