Tiny Core Linux

Tiny Core Extensions => TCE Q&A Forum => Topic started by: bonbob on August 07, 2017, 02:26:22 PM

Title: My first TCZ bilding.
Post by: bonbob on August 07, 2017, 02:26:22 PM
Hello all. I used old version hostapd 1.0 from repository x86/4.x till now. This version is stable, but it was compiled without N-mode. Only G. So i try to make new Hostapd extension build on latest version 2.6 and with N-mode support. Also it AC-mode, TNC, Hotspot 2.0, MBO, ACS supported now. It woks good on my TCL 8.x 32bit, and it would be good to add this extension to repository. You can take it here http://tinycorelinux.sytes.net/hostapd2.6.zip (http://tinycorelinux.sytes.net/hostapd2.6.zip), check and if it be OK add to repository.  :)
Title: Re: My first TCZ bilding.
Post by: Juanito on August 08, 2017, 04:14:02 AM
Thanks for the proposed extension.

There are four tcz files in the zip archive, hostapd, hostapd2.6, libnl and libnl1 - which of these are you proposing to submit?

Was hostapd compiled with the tinycore standard of :
Code: [Select]
$ CC="gcc -flto -fuse-linker-plugin -march=i486 -mtune=i686 -Os -pipe" CXX="g++ -flto -fuse-linker-plugin -march=i486 -mtune=i686 -Os -pipe -fno-exceptions -fno-rtti" ./configure --blah-blah
The binaries in the hostapd tcz are not stripped as per tinycore guidelines.

Please also see: http://wiki.tinycorelinux.net/wiki:creating_extensions
Title: Re: My first TCZ bilding
Post by: bonbob on August 08, 2017, 05:06:31 AM
Sorry for garbage in archive. Seems i have packed old files too. hostapd.tcz - is old version 1.0 from repository 4.x wich i used before. My compilation is hostapd2.6.tcz and libnl1.tcz dependence of it. libnl ver 1.0 need for hostapd launch. I wish to compile hostapd with libnl3 wich are present in 8.x repository, but compilation process has failed.  :-\

I will recompile my hostapd lately with
Code: [Select]
$ CC="gcc -flto -fuse-linker-plugin -march=i486 -mtune=i686 -Os -pipe" CXX="g++ -flto -fuse-linker-plugin -march=i486 -mtune=i686 -Os -pipe -fno-exceptions -fno-rtti" ./configure --blah-blah
Is it the same as:
Code: [Select]
export CFLAGS="-march=i486 -mtune=i686 -Os -pipe"
export CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe"
export LDFLAGS="-Wl,-O1"
Title: Re: My first TCZ bilding.
Post by: Juanito on August 08, 2017, 05:35:33 AM
You can use this in the config to use the existing libnl:
Code: [Select]
# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored)
CONFIG_LIBNL32=y
Title: Re: My first TCZ
Post by: bonbob on August 08, 2017, 06:15:49 AM
You can use this in the config to use the existing libnl:
Code: [Select]
# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored)
CONFIG_LIBNL32=y

Oh, if any compilation was so simple... Then I would be the hapiest man in the world.  :)

Maybe i could compile hostapd with libnl3 if you help me. It will be better. Soon i will copy here an error messages appearing during compilation.
Title: Re: My first TCZ bilding.
Post by: Juanito on August 08, 2017, 07:07:01 AM
This works:
Code: [Select]
$ tce-load -i compiletc libnl-dev openssl-dev

$ cd hostapd-2.6
$ cd hostapd

[edit Makefile]
CFLAGS = -MMD -Wall

[edit defconfig]
CONFIG_LIBNL32=y
$ cp defconfig .config

$ make V=1 CC="gcc -flto -fuse-linker-plugin -march=i486 -mtune=i686 -Os -pipe"
$ sudo make V=1 CC="gcc -flto -fuse-linker-plugin -march=i486 -mtune=i686 -Os -pipe" install
Title: Re: My first TCZ bilding.
Post by: bonbob on August 08, 2017, 12:07:41 PM
Code: [Select]
CONFIG_IEEE80211N=yDo you use this option?

It stops making with

Code: [Select]
../src/drivers/driver_nl80211.o: In function `nl80211_handle_destroy':
/home/tc/hostapd-2.6/hostapd/../src/drivers/driver_nl80211.c:80: undefined reference to `nl_handle_destroy'
../src/drivers/driver_nl80211.o: In function `nl80211_handle_alloc':
/home/tc/hostapd-2.6/hostapd/../src/drivers/driver_nl80211.c:58: undefined reference to `nl_handle_alloc_cb'
collect2: error: ld returned 1 exit status
make: *** [Makefile:1063: hostapd] Error 1

With libnl v1 compilation is successful.
Title: Re: My first TCZ bilding.
Post by: Juanito on August 08, 2017, 12:13:00 PM
Yes, I used that option (and also CONFIG_IEEE80211AC=y) and hostapd compiled without errors with the libnl(3) extension from the repo.
Title: Re: My first TCZ bilding.
Post by: bonbob on August 08, 2017, 12:42:13 PM
Before this error i've got another one

Code: [Select]
make: *** No rule to make target '/home/tc/hostapd-2.6/src/netlink/genl/genl.h', needed by '../src/drivers/driver_nl80211.o'.  Stop.

But i fixed it by copying directory netlink from libnl-3.2.25 source to hostapd-2.6/src. I make this hostapd for Tinycore v 8.x 32bit.

Did you do the same?

Anyway i have repacked archive for anyone who want to install hostapd v2.6 extension.
Title: Re: My first TCZ bilding.
Post by: Juanito on August 08, 2017, 12:54:32 PM
No, I didn't need to do that - are you sure that you had libnl and libnl-dev loaded and that you did not have your libnl1 and libnl1-dev loaded?
Title: Re: My first TCZ bilding.
Post by: bonbob on August 08, 2017, 02:31:23 PM
I have deleted all libnl.tcz, libnl1.tcz files, reboot system and installed libnl-dev again.
I execute all you have posted, step by step. Untill making not stop with
Code: [Select]
make: *** No rule to make target '/home/tc/hostapd-2.6/src/netlink/genl/genl.h', needed by '../src/drivers/driver_nl80211.o'.  Stop.That's all i've got.
Title: Re: My first TCZ bilding.
Post by: bonbob on August 08, 2017, 03:44:25 PM
Even using this option has no effect:
Code: [Select]
CFLAGS += -I$/usr/local/include/libnl3
LIBS += -L$/usr/local/lib

Compiler still searching /home/tc/hostapd-2.6/src/netlink/genl/genl.h
Title: Re: My first TCZ bilding.
Post by: Juanito on August 09, 2017, 03:22:53 AM
I left those lines commented out, but in any case they would be:
Code: [Select]
CFLAGS += -I/usr/local/include/libnl3
LIBS += -L/usr/local/lib
Title: Re: My first TCZ bilding.
Post by: bonbob on August 09, 2017, 03:50:33 AM
I try this lines too. There is no effect. Mystic.  :o
Title: Re: My first TCZ bilding.
Post by: Juanito on August 09, 2017, 04:03:32 AM
you could try my config from here: http://tinycorelinux.net/8.x/x86/tcz/src/hostapd/
Title: Re: My first TCZ bilding.
Post by: Juanito on August 10, 2017, 11:00:53 AM
hostapd posted in case you'd like to test it
Title: Re: My first TCZ bilding.
Post by: bonbob on August 12, 2017, 04:52:31 AM
Another errors has appeared using your CONFIG.
Code: [Select]
../src/drivers/driver_nl80211.o: In function `nl80211_handle_destroy':
/home/tc/hostapd-2.6/hostapd/../src/drivers/driver_nl80211.c:80: undefined reference to `nl_handle_destroy'
../src/drivers/driver_nl80211.o: In function `nl80211_handle_alloc':
/home/tc/hostapd-2.6/hostapd/../src/drivers/driver_nl80211.c:58: undefined reference to `nl_handle_alloc_cb'
../src/ap/hw_features.o: In function `hostapd_check_chans':
/home/tc/hostapd-2.6/hostapd/../src/ap/hw_features.c:820: undefined reference to `acs_init'
collect2: error: ld returned 1 exit status
make: *** [Makefile:1063: hostapd] Error 1

Leave this problem and don't waste time on it. I already have hostapd-2.6 with N-mode support and this enough for me.
Title: Re: My first TCZ bilding.
Post by: Juanito on August 12, 2017, 06:30:01 AM
That looks like it's trying to use the incorrect libnl?

Anyway, as mentioned, I posted hostapd(2.6) to the tc8.x x86 repo, you can try it if you like.
Title: Re: My first TCZ bilding.
Post by: bonbob on August 12, 2017, 09:43:49 AM
The real error is
Code: [Select]
make: *** No rule to make target '/home/tc/hostapd-2.6/src/netlink/genl/genl.h', needed by '../src/drivers/driver_nl80211.o'.  Stop.

Even with your config. Errors i have posted before became by my mistake. I did not deleted folder scr/netlink.
After deleting compiler still searching genl.h, but i see it really present in the system by path /usr/local/include/libnl3/netlink/genl/.
I don't know why compiler don't see this include-path.

This lines ignoring too:
Code: [Select]
CFLAGS += -I/usr/local/include/libnl3
LIBS += -L/usr/local/lib

I already installed new extension and use it. Working good. Except one little thing. It does not show any information duiring launch process. No errors answer, no success answer. Just Empty line. Your newer will know why your hostapd not launch and where mistake is in config file.