Hello Milorad,
Had to adapt the command line a little bit but works now, see
below. I also think you missed a ; after make in the line below.
Updated the script also for cleanup and multiple invocations and
output versioning (see below).
dnf install git gcc
CFLAGS="-I $SRCDIR/libnl-tiny/src/include -D_GNU_SOURCE"
LDFLAGS="-L $SRCDIR/libnl-tiny/src" make cli.o swlib.o; cc -L
$SRCDIR/libnl-tiny/src -o swconfig cli.o swlib.o -lnl-tiny -ldl
Also installed the LED service, but it is only for one CPU (e.g.
cpu0, cpu1 is not handled)...
I'm currently not physically at the Banana so I can't verify it
now ...
Uboot is currently compiling ...
There are also newer versions available:
ftp://ftp.denx.de/pub/u-boot/
Ciao,
Gerhard
#!/bin/bash
# This script is used to compile 'swconfig' for the BPI-R1 based
on the OpenWrt sources.
# Big thanks to mattrix and x4711 from the LeMaker forum who
discovered this procedure.
# Requires : lua-devel cmake lua git
# Requires2: dnf install git gcc
git clone
https://github.com/Bananian/openwrt.git
pushd .
cd openwrt
git pull
popd
# cp
openwrt/target/linux/generic/files/include/uapi/linux/switch.h
/usr/include/linux/switch.h
\cp -f
openwrt/target/linux/generic/files/include/uapi/linux/switch.h
/usr/include/linux/switch.h
chmod 644 /usr/include/linux/switch.h
rm -f swconfig
rm -f libnl-tiny
ln -s openwrt/package/network/config/swconfig/src swconfig
ln -s openwrt/package/libs/libnl-tiny libnl-tiny
SRCDIR=`pwd`
cd $SRCDIR/libnl-tiny/src
#rm libnl-tiny.so
rm -f *.o libnl-tiny.so libnl-tiny.a
make
ar rcs libnl-tiny.a nl.o handlers.o msg.o attr.o cache.o
cache_mngt.o object.o socket.o error.o genl.o genl_family.o
genl_ctrl.o genl_mngt.o unl.o
cp -f libnl-tiny.so /lib
cp -f libnl-tiny.so $SRCDIR/libnl-tiny.so.`date
+%Y.%m.%d.%H.%M.%S`
cd $SRCDIR/swconfig
rm -f *.o swconfig
#CFLAGS="-I $SRCDIR/libnl-tiny/src/include -D_GNU_SOURCE"
LDFLAGS="-L $SRCDIR/libnl-tiny/src" make cc -L
$SRCDIR/libnl-tiny/src -o swconfig cli.o swlib.o -lnl-tiny -ldl
CFLAGS="-I $SRCDIR/libnl-tiny/src/include -D_GNU_SOURCE"
LDFLAGS="-L $SRCDIR/libnl-tiny/src" make cli.o swlib.o; cc -L
$SRCDIR/libnl-tiny/src -o swconfig cli.o swlib.o -lnl-tiny -ldl
cp -f swconfig /usr/local/bin
cp -f swconfig $SRCDIR/swconfig.`date +%Y.%m.%d.%H.%M.%S`
On 17.08.2015 15:29, OM Ugarcina wrote:
Not really , it is that I just got all the services and
apps configured and working : Avahi, cups, radius, Apache,
squid, firewall, dhcp, DNS, PPPoE. Would want to see if the
fc22 versions were really that much newer . Also would hate to
brake something . But have been thinking about doing a yum
upgrade . F2fs is really developed for sdcards and flash
storage . It works well with different internal geometries
used with flash devices and their block sizes . It is being
developed by Samsung . Check this article which looks into how
to get the best out of a sdcard :
And the reason for f2fs is to do this optimized approach
automatically.
Best Regards
O&M Ugarcina
Hello Milorad,
Thanx. Any reason not to update to fc22?
Any advantage from f2fs over xfs (which is the default
fedora image I used)?
All my x64 systems and also banana work well with fc22.
Ciaom
Gerhard
On 17.08.2015 15:00, OM Ugarcina wrote:
Hello Gerhard,
My system is mostly fc21 but with latest fc22 kernel
and fc23 uboot and using f2fs file system . The system
will probably stay mostly like that , but I will keep
updating important packages if security warrants or if
there is a great feature . Hans is :
https://github.com/jwrdegoede
BTW: are you already on
FC22?
Ciao,
Gerhard
On 17.08.2015 13:01, mo.ucina wrote:
Sounds Good,
Here is the kernel src rpm :
http://tinyurl.com/pwnctea
that error looks like a missing dependency , you
will need to install an equivalent of
glibc-headers for arm on the machine . Technically
the switch is an 8 port device , and WAN port is
wired internally to port 3 . I would have thought
that all ports would behave similarly . But anyway
it is purely a cosmetic thing .
Not much activity on the R1 with the Fedora users
at the moment . There is a bit of work being done
by sunxi with the u-boot people , and there have
been patches submitted for a separate Lamobo R1
(that is probably going to be the official name
for our router) but they have not made it in yet .
I think probably due to maintenance ownership , no
one wanted to sign up for it . So Hans is probably
sitting on the patches and not putting them in .
I have installed the latest u-boot 2015-07 with
the latest code additions .
You can see it here :
https://lists.fedoraproject.org/pipermail/arm/2015-June/009582.html
On 17/08/15 19:50,
Gerhard Wiesinger wrote:
Hello Milorad,
Thank you for the information.
I had to define the cross compile flags as I
compiled on a x64 machine because I had no
network connectivity at the beginning.
# Yours/mine:
rpmbuild -ba --target armv7hl --without=perf
--without=debuginfo --without=pae
--define="_arch arm" --define="_build_arch
arm" kernel.spec
rpmbuild -ba --target armv7hl --without=perf
--without=debuginfo --without=pae
--define="_arch arm" --define="_build_arch
arm" --define="_with_cross 1"
--define="_without_tools 1" kernel.spec
I had the following compile errors without the
"_without_tools" defines:
+ make CROSS_COMPILE=arm-linux-gnu-
arm-linux-gnu-gcc -O1 -Wall -Wshadow -W
-Wformat -Wimplicit-function-declaration
-Wimplicit-int -fstack-protector -D
VERSION=\"1.0\" -c -o tmon.o tmon.c
tmon.c:19:20: fatal error: getopt.h: No such
file or directory
compilation terminated.
<builtin>: recipe for target 'tmon.o'
failed
make: *** [tmon.o] Error 1
error: Bad exit status from
/var/tmp/rpm-tmp.SJeffm (%build)
So I decided to to disable the tools. Will try
to compile also directly on the Banana. But at
that time I had no network connectivity and
therefore it was really annoying to work
directly there. But now Banana is in
production and I will try in the future to
compile.
OK, you are having the same issue on the LED.
I guess it can be software controlled, too (it
works well as it toggles on startup).
Information from the chinese seller:
dear Gerhard,
the R1 is a router, this port is the ADSL
port,
it is different from the other 4 ports,
the status is common, it is not a quality
problem, dear friend!
I think we should stay in contact and share
information as we find something new regarding
Banana and Fedora.
Any active community around Fedora on Banana
(Forum/mailing lists)?
BTW: any information of the sources of the
Allwinner A20 uboot?
BTW2: Do you know a source of the schematic of
the Banana Pi-R (I only found other versions).
Thank you.
Ciao,
Gerhard
On 17.08.2015 11:25, mo.ucina wrote:
Hello Gerhard,
I use the banana hardware to compile the
kernel , it is slow but works always 100% . I
used to get funny issues when trying to cross
compile . SO now I just kick off a compile
before going to bed , and in the morning it is
done . My compile line is :
rpmbuild -ba --target armv7hl
--without=perf --without=debuginfo
--without=pae --define="_arch arm"
--define="_build_arch arm" kernel.spec
My swconfig comes from this script :
#!/bin/bash
# This script is used to compile
'swconfig' for the BPI-R1 based on the
OpenWrt sources.
# Big thanks to mattrix and x4711
from the LeMaker forum who discovered this
procedure.
# Requires : lua-devel cmake lua
git
git clone https://github.com/Bananian/openwrt.git
cp
openwrt/target/linux/generic/files/include/uapi/linux/switch.h
/usr/include/linux/switch.h
chmod 644
/usr/include/linux/switch.h
ln -s
openwrt/package/network/config/swconfig/src
swconfig
ln -s
openwrt/package/libs/libnl-tiny libnl-tiny
SRCDIR=`pwd`
cd $SRCDIR/libnl-tiny/src
make
rm libnl-tiny.so
ar rcs libnl-tiny.a nl.o handlers.o
msg.o attr.o cache.o cache_mngt.o object.o
socket.o error.o genl.o genl_family.o
genl_ctrl.o genl_mngt.o unl.o
cd $SRCDIR/swconfig
CFLAGS="-I
$SRCDIR/libnl-tiny/src/include
-D_GNU_SOURCE" LDFLAGS="-L
$SRCDIR/libnl-tiny/src" make cc -L
$SRCDIR/libnl-tiny/src -o swconfig cli.o
swlib.o -lnl-tiny -ldl
The led on the WAN port is always on - for
some reason , even with drivers , irrespective
of the cable being in or out . I am not using
the hdmi , my board is acting purely as a
wired router . I have defined two interfaces
with different subnets , one for in , the
other for out . Because the board has just one
NIC , the interfaces need to be done with
vlans . And I connect to it via ssh . One
interesting thing that I have borrowed form
the ubuntu people is using the green LED
indicator for indicating activity , in my case
CPU activity , but can be used instead for
others as well . I have set it up as a service
:
cat /etc/systemd/system/led.service
[Unit]
Description=Assign LED Function
[Service]
Type=oneshot
ExecStart=/bin/sh -c "echo 'cpu0'
>
/sys/class/leds/bananapi\:green\:usr/trigger"
[Install]
WantedBy=multi-user.target
I will send you the link to the src rpm with
switch drivers .
Best Regards
Milorad
Melbourne/AUstralia
On 17/08/15
16:05, Gerhard Wiesinger wrote:
Hello Milorad,
Great, thank you for the answers. Some
comments and questions below.
1.) Ad kernel
In the meantime I got a working kernel,
you can find it on
https://www.wiesinger.com/opensource/fedora/kernel/BananaPi-R1/
I integrated 2 patches, the dmesg spamming
patch and the switch patch. Can you also
post the SRPM on a cloud service like
Google Drive/Dropbox, etc.
BTW: What's your command line compiling
the kernel?
I had to disable the tools to get compile
done.
rpmbuild -ba --target armv7hl
--without=perf --without=debuginfo
--without=pae --define="_arch arm"
--define="_build_arch arm"
--define="_with_cross 1"
--define="_without_tools 1" kernel.spec
2.) swconfig
Where did you find the instructions for
compiling swconfig? (The Ubuntu version
works well).
3.) LEDs
Can you try the following: No connection
at the uplink port. Is one the LED always
on like in the picture from my previous
email?
It already is on when the uboot comes up.
Except the uplink port LEDs look ok to me
4.) Regarding Display & console:
Does full HD work for you?
Currently I boot into normal console login
only.
I don't see any service startup messages
at the screen but maybe they go into the
serial console. Any hint?
Thank you.
BTW: I'm from Austria/Vienna, where are
you from?
Ciao,
Gerhard
On 17.08.2015 07:49, OM Ugarcina wrote:
Hello Gerhard,
The kernel that comes from the
fedora image will not have the
switch driver in it , so it is
normal that the networking
does not work out of the box .
That is also the reason why
the swconfig utility is not
seeing anything yet . I
compiled the swconfig utility
from sources using the
ubuntu-bananian instructions .
The one you copied from ubuntu
should work just as well .
Once you have the switch
drivers the LEDs will start
blinking when data is going ,
but I am still not sure if
they are working perfectly 100
% . The LED colours when it
comes to link speed look odd
to me .
If your are in a position to
compile the kernel I have a src
rpm for you . It is a bit big ,
about 80 Mb , if you have an FTP
server I can uploaded for you .
The kernel devs at Fedora are still
not including the drivers for the
switch because of a few issues to do
with missing APIs which need to be
agreed on . The driver that I use
comes from open-wrt and uses their
approach which works very well .
Best Regards
Milorad