Сompile failed

I want to compile the https://github.com/aa65535/openwrt packet . I use this guide https://openwrt.org/docs/guide-developer/using_the_sdk
for router https://openwrt.org/toh/hwdata/gl.inet/gl.inet_gl-ar150
compile on vmware debian 9 x64
below part of the code with fault from the console

Summary

)
mips-openwrt-linux-musl-gcc -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -iremap/home/coc/openwrt-sdk-18.06.1-ar71xx-generic_gcc-7.3.0_musl.Linux-x86_64/build_dir/target-mips_24kc_musl/redsocks2//redsocks2-0.60:redsocks2-0.60 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/home/coc/openwrt-sdk-18.06.1-ar71xx-generic_gcc-7.3.0_musl.Linux-x86_64/staging_dir/target-mips_24kc_musl/usr/include -I/home/coc/openwrt-sdk-18.06.1-ar71xx-generic_gcc-7.3.0_musl.Linux-x86_64/staging_dir/target-mips_24kc_musl/include -I/home/coc/openwrt-sdk-18.06.1-ar71xx-generic_gcc-7.3.0_musl.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/usr/include -I/home/coc/openwrt-sdk-18.06.1-ar71xx-generic_gcc-7.3.0_musl.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/include/fortify -I/home/coc/openwrt-sdk-18.06.1-ar71xx-generic_gcc-7.3.0_musl.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/include -fPIC -O3 -std=gnu99 -Wall -c -o parser.o parser.c
In file included from parser.c:29:0:
utils.h:6:10: fatal error: event.h: No such file or directory
#include <event.h>
^~~~~~~~~
compilation terminated.
: recipe for target 'parser.o' failed
make[3]: *** [parser.o] Error 1
make[3]: Leaving directory '/home/coc/openwrt-sdk-18.06.1-ar71xx-generic_gcc-7.3.0_musl.Linux-x86_64/build_dir/target-mips_24kc_musl/redsocks2/redsocks2-0.60'
Makefile:55: recipe for target '/home/coc/openwrt-sdk-18.06.1-ar71xx-generic_gcc-7.3.0_musl.Linux-x86_64/build_dir/target-mips_24kc_musl/redsocks2//redsocks2-0.60/.built' failed
make[2]: *** [/home/coc/openwrt-sdk-18.06.1-ar71xx-generic_gcc-7.3.0_musl.Linux-x86_64/build_dir/target-mips_24kc_musl/redsocks2//redsocks2-0.60/.built] Error 2
make[2]: Leaving directory '/home/coc/openwrt-sdk-18.06.1-ar71xx-generic_gcc-7.3.0_musl.Linux-x86_64/package/redsocks2'
Command exited with non-zero status 2
time: package/redsocks2/compile#0.37#0.20#5.10
package/Makefile:107: recipe for target 'package/redsocks2/compile' failed
make[1]: *** [package/redsocks2/compile] Error 2
make[1]: Leaving directory '/home/coc/openwrt-sdk-18.06.1-ar71xx-generic_gcc-7.3.0_musl.Linux-x86_64'
/home/coc/openwrt-sdk-18.06.1-ar71xx-generic_gcc-7.3.0_musl.Linux-x86_64/include/toplevel.mk:209: recipe for target 'package/redsocks2/compile' failed
make: *** [package/redsocks2/compile] Error 2
user@debian:~/openwrt-sdk-18.06.1-ar71xx-generic_gcc-7.3.0_musl.Linux-x86_64$

what am I doing wrong?

upd:please move to For developer

(OK, done.)

Have you been able to successfully compile a known-good set of sources, such as the official OpenWrt's git repository version of 18.06 for the AR150?

how can i check it?
I'm a newbie

I use the full build system, not the SDK. Its documentation is at https://openwrt.org/docs/guide-developer/build-system/use-buildsystem and related pages.

The current official git repository for OpenWrt is (Dec 2018) https://git.openwrt.org/openwrt/openwrt.git

Assuming that you've got all the prerequisites installed, the in-brief, happy-path instructions would be along the lines of:

git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt
git checkout openwrt-18.06
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig   # and select the AR150 and save the .config
make -jN clean download world   # where N is appropriate for the number of CPU threads of your system
1 Like

what will it give me ? I will get a replacement for this packet? openwrt-sdk-18.06.1-ar71xx-generic_gcc-7.3.0_musl.Linux-x86_64.tar.xz

with which I can continue to compile?

It will confirm that you are able to build a known-good version of official OpenWrt on your machine, or let you resolve any issues with your system using a known-good set of sources.

Once you have confirmed that you can build "official" OpenWrt, then you will be in a better position to try to build the additions that you found at https://github.com/aa65535/openwrt-redsocks2. You should be able to build them with the build system described above by adding the package to your list of feeds. See, for example https://openwrt.org/docs/guide-developer/feeds

There are current AR150 sources available in the OpenWrt git repo, as well as from GL.iNet directly (including their own additions and modifications). The OpenWrt sources are supported here, among other places. GL.iNet has their own support forum for their sources and firmware.

1 Like

after executing the Update feeds:

./scripts/feeds update -a

got an ERROR

Summary

coc@debian:~/openwrt$ ./scripts/feeds update -a
Updating feed 'packages' from 'https://git.openwrt.org/feed/packages.git;openwrt-18.06' ...
Cloning into './feeds/packages'...
remote: Enumerating objects: 4244, done.
remote: Counting objects: 100% (4244/4244), done.
remote: Compressing objects: 100% (3600/3600), done.
remote: Total 4244 (delta 174), reused 3078 (delta 99)
Receiving objects: 100% (4244/4244), 2.50 MiB | 662.00 KiB/s, done.
Resolving deltas: 100% (174/174), done.
Create index file './feeds/packages.index'
Checking 'working-make'... ok.
Checking 'case-sensitive-fs'... ok.
Checking 'proper-umask'... ok.
Checking 'gcc'... ok.
Checking 'working-gcc'... ok.
Checking 'g++'... ok.
Checking 'working-g++'... ok.
Checking 'ncurses'... ok.
Checking 'perl-thread-queue'... ok.
Checking 'tar'... ok.
Checking 'find'... ok.
Checking 'bash'... ok.
Checking 'patch'... ok.
Checking 'diff'... ok.
Checking 'cp'... ok.
Checking 'seq'... ok.
Checking 'awk'... ok.
Checking 'grep'... ok.
Checking 'getopt'... ok.
Checking 'stat'... ok.
Checking 'unzip'... ok.
Checking 'bzip2'... ok.
Checking 'wget'... ok.
Checking 'time'... ok.
Checking 'perl'... ok.
Checking 'python'... ok.
Checking 'git'... ok.
Checking 'file'... ok.
Checking 'ldconfig-stub'... ok.
Collecting package info: done
Collecting target info: done
Updating feed 'luci' from 'https://git.openwrt.org/project/luci.git;openwrt-18.06' ...
Cloning into './feeds/luci'...
remote: Enumerating objects: 3907, done.
remote: Counting objects: 100% (3907/3907), done.
remote: Compressing objects: 100% (2233/2233), done.
remote: Total 3907 (delta 799), reused 2770 (delta 372)
Receiving objects: 100% (3907/3907), 3.73 MiB | 606.00 KiB/s, done.
Resolving deltas: 100% (799/799), done.
Create index file './feeds/luci.index'
Collecting package info: done
Collecting target info: done
Updating feed 'routing' from 'https://git.openwrt.org/feed/routing.git;openwrt-18.06' ...
Cloning into './feeds/routing'...
remote: Enumerating objects: 405, done.
remote: Counting objects: 100% (405/405), done.
remote: Compressing objects: 100% (335/335), done.
remote: Total 405 (delta 27), reused 132 (delta 2)
Receiving objects: 100% (405/405), 281.38 KiB | 0 bytes/s, done.
Resolving deltas: 100% (27/27), done.
Create index file './feeds/routing.index'
Collecting package info: done
Collecting target info: done
Updating feed 'telephony' from 'https://git.openwrt.org/feed/telephony.git;openwrt-18.06' ...
Cloning into './feeds/telephony'...
remote: Enumerating objects: 259, done.
remote: Counting objects: 100% (259/259), done.
remote: Compressing objects: 100% (247/247), done.
remote: Total 259 (delta 21), reused 29 (delta 0)
Receiving objects: 100% (259/259), 166.81 KiB | 0 bytes/s, done.
Resolving deltas: 100% (21/21), done.
Create index file './feeds/telephony.index'
ERROR: please fix feeds/telephony/net/freeswitch/Makefile - see logs/feeds/telephony/net/freeswitch/dump.txt for details
Collecting package info: done
Collecting target info: done

link to file
logs/feeds/telephony/net/freeswitch/dump.txt https://ptpb.pw/K1Eh

You don't need it so you can just ignore that error. It's been like that "forever".

1 Like

made.
log

make -j4 clean download world

https://ptpb.pw/WH8Y

/openwrt/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-gl-ar150-squashfs-sysupgrade.bin
that's what it is my ready firmware file? he is different from that which i downloaded from http://downloads.openwrt.org/releases/18.06.1/targets/ar71xx/generic/openwrt-18.06.1-ar71xx-generic-gl-ar150-squashfs-sysupgrade.bin
original = 3.8 mb
my compiled = 3.5 mb

what's next?

It's probably smaller as it may not include LuCI by default.

If you want LuCI, you'll need to add that using make menuconfig and selecting the appropriate LuCI collection. I personally recommend a TLS-enabled version. I would confirm that the image you build from the "stock" sources installs and runs as you expect before moving on to adding "non-standard" things.

You'll then need to add the package feed for the custom package you are trying to build and add it in make menuconfig as well. Then building the image should include what you're looking for.

1 Like

I starting from this paragraph . right?

Creating the package directory

Adding your package to an existing feed

For this example we assume that your are in /home/user/openwrt as your base directory.

  1. You create your current project dir project .

  2. Then while in /home/user/openwrt/project

  3. `svn co svn:svn.openwrt.org/openwrt/trunk openwrt (for the OpenWRT base system)

- ` svn co svn:svn.openwrt.org/openwrt/packages packages (for the packages feed)
  1. Add your package in the appropriate subdirectory under /home/user/openwrt/project/packages

after entering the command

svn co svn:svn.openwrt.org/openwrt/trunk openwrt

getting an error

svn: E125002: 'svn:svn.openwrt.org/openwrt/trunk' not a well formed URL

I think you should be able to add the package's git repo to your build by:

  • Copying feeds.conf.default to feeds.conf
  • Adding src-git redsocks2 https://github.com/aa65535/openwrt-redsocks2 to that file

This is based on the "feeds" link above and looking at scripts/feeds which contains

sub parse_config() {
        my $line = 0;
        my %name;

        open FEEDS, "feeds.conf" or
                open FEEDS, "feeds.conf.default" or
                die "Unable to open feeds configuration";
        while (<FEEDS>) {
[...]
1 Like

I think that guide must be outdated. It's using Git now, not svn. If it was svn it would have been svn://svn.openwrt.org, but that server does not exist.

I'm in stupor
I created a file /openwrt/project/openwrt/feeds.conf

src-git packages https://git.openwrt.org/feed/packages.git;openwrt-18.06
src-git luci https://git.openwrt.org/project/luci.git;openwrt-18.06
src-git routing https://git.openwrt.org/feed/routing.git;openwrt-18.06
src-git telephony https://git.openwrt.org/feed/telephony.git;openwrt-18.06
src-git redsocks2 https://github.com/aa65535/openwrt-redsocks2.git

executed these commands

  1. ./scripts/feeds update customfeed
    2)./scripts/feeds install -p customfeed
    further in make menuconfig I can not find this package

everything is so confusing in this wiki

Yes, very often wiki pages are written by experts that forget that non-experts read them!

"customfeed" there is just an example. If you run

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

it should find the new "redsocks2" feed you added.

Looking at the Makefile from that package

define Package/redsocks2
	SECTION:=net
	CATEGORY:=Network
	TITLE:=Redirect any TCP connection to a SOCKS or HTTPS proxy server
	URL:=https://github.com/semigodking/redsocks
	DEPENDS:=+libevent2
endef

tells me that you should find it in the Network section. You can also search in make menuconfig with the slash / key.

1 Like

not found.
thereafter I added it to original feed file /openwrt/feeds.conf.default
after entering

./scripts/feeds update -a
Updating feed 'packages' from 'https://git.openwrt.org/feed/packages.git;openwrt-18.06' ...
Already up-to-date.
Create index file './feeds/packages.index' 
Updating feed 'luci' from 'https://git.openwrt.org/project/luci.git;openwrt-18.06' ...
Already up-to-date.
Create index file './feeds/luci.index' 
Updating feed 'routing' from 'https://git.openwrt.org/feed/routing.git;openwrt-18.06' ...
Already up-to-date.
Create index file './feeds/routing.index' 
Updating feed 'telephony' from 'https://git.openwrt.org/feed/telephony.git;openwrt-18.06' ...
Already up-to-date.
Create index file './feeds/telephony.index' 
Updating feed 'redsocks2' from 'https://github.com/aa65535/openwrt-redsocks2' ...
Already up-to-date.
Create index file './feeds/redsocks2.index' 
/openwrt/feeds/redsocks2.tmp/info/.files-packageinfo.mk:1: *** target pattern contains no `%'.  Stop.

I executed this command a second time, because of this you see

Updating feed 'redsocks2' from 'https://github.com/aa65535/openwrt-redsocks2' ...
Already up-to-date.

It looks like the package was "installed" but that there might be some problem with the Makefile of the package or the sources it downloads. I don't see "target pattern contains no" in the OpenWrt build system itself.


Looks like the package might be broken

Updating feed 'redsocks2' from 'https://github.com/aa65535/openwrt-redsocks2' ...
Cloning into './feeds/redsocks2'...
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 9 (delta 0), reused 6 (delta 0), pack-reused 0
Unpacking objects: 100% (9/9), done.
Create index file './feeds/redsocks2.index' 
grep: feeds/redsocks2/Makefile:$(eval: No such file or directory
grep: $(call: No such file or directory
grep: BuildPackage,redsocks2))/Makefile: No such file or directory
/home/jeff/devel/openwrt/feeds/redsocks2.tmp/info/.files-packageinfo.mk:1: *** target pattern contains no '%'.  Stop.

Looking into it now

this package may conflict with /openwrt/feeds/packages/net/redsocks folder? which has already been installed with all openwrt system?

upd:didn't see your updated post

Looks like it's failing on the "update" step when (printed for debug from within the perl script in update_index($))

make -s -f include/scan.mk IS_TTY=1 SCAN_TARGET="packageinfo" \
SCAN_DIR="feeds/redsocks2" SCAN_NAME="package" \
SCAN_DEPTH=5 SCAN_EXTRA="" \
TMP_DIR="path/to/openwrt/feeds/redsocks2.tmp"

is executed
(I've never looked into just what this is)


OK, I've cloned the repo with the package files into ./package/openwrt-redsocks2

openwrt/package$ git clone https://github.com/aa65535/openwrt-redsocks2 

and it's showing up in make menuconfig (and removed feeds.conf). My apologies if this has sent you down a frustrating path. Trying a build now.

[...]
 make[2] -C package/openwrt-redsocks2 download
[...]
 make[3] -C package/openwrt-redsocks2 compile
[...]
 make[2] package/install
 make[2] target/install
 make[3] -C target/linux install
 make[2] package/index
 make[2] checksum

Looks like it's working! Shows in the .manifest as well.

Might want to look into https://github.com/semigodking/redsocks to see if that is more up-to-date for source than the package file's reference, but let's get at least one built!

1 Like