damies Posted August 21, 2016 Posted August 21, 2016 Hi All, I'm new here, well been lurking a while reading heaps, just not posting before now. My Orange Pi's arrived a few days ago so I have been playing, I have Ubuntu_xenial_3.4.112 image on both types and am able to connect to home wifi and do apt-get update/upgrade so all good here. One thing I wanted to do is use batman-adv, but the kernel module seems to have been disabled on the armbian images: @orangepipcplus:~# cat /boot/config-3.4.112-sun8i |grep BATMAN # CONFIG_BATMAN_ADV is not set It took me a while to figure out how to confirm this was the case but another post pointed me to the /boot/config-3.4.112-sun8i file. So this is where I need some pointers on how to move forward. I'm guessing it's not as simple as un-commenting CONFIG_BATMAN_ADV and adding =y I'm also guessing that at least the kernel module will need to be compiled and maybe the whole kernel? I have never done this so don't really know what to do, but I am willing to learn if someone can give a a pointer or two. My understanding from what I have read is this module should already be in the kernel sources so hopefully this won't be too difficult. I am also open to changing to a different build if necessary/easier to get batman-adv working. FYI my hardware is: - Orange Pi PC+ - Orange Pi Lite Dave.
arox Posted August 21, 2016 Posted August 21, 2016 Just out of curiosity, is that a school project ? I didn't know about that implementation of mesh network in the kernel. I am trying to make my mind about the state of the project. But if the routing is made by the module and under heavy development, it seems that it will need frequent updates of the kernel ?
damies Posted August 22, 2016 Author Posted August 22, 2016 Hi arox, No not a school project, just a personal one. I bought a dozen Orange Pi's specifically for experimenting with mesh networks. According this "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=622361"it has been a standard linux kernel module since 2.6 (2011?) era kernels so I was quite surprised that it was not available in armbian. on any recent debian distro (x86 or amd64 at least) you can simply run modprobe batman-adv to load this module, I had incorrectly assumed that such a mature kernel module would be available on all platforms. I am happy to do the work to compile these modules if I can get some guidance on how to do this. Dave.
arox Posted August 22, 2016 Posted August 22, 2016 Well, if you look at this topic, it explains how to generate your own kernel and modules. You should be able to enable batman in config. No reason it should not work. http://docs.armbian.com/Developer-Guide_Build-Preparation/ There are numerous modules available in kernel. I dont know on which criteria they are enabled or disabled (@igor, @zador). I would like to test mesh networks with bluetooth, but my experience with bt since it is "maintained" by opendesktop.org folks dont give me much hope, so I would rather wait. 1
damies Posted August 22, 2016 Author Posted August 22, 2016 Hi arox, Thanks, i hadn't found that section of the doco yet. I will give it a try. According to the batman doco, you should be able to use batman with your bluetooth device, though I have not tried that. Dave
Igor Posted August 22, 2016 Posted August 22, 2016 Additional modules are usually added when: - we found a reason - user request is noticed on the forum - user request is added via Github issues or (best) a merge request ... This one was noticed and added by Zador few hours ago. Our official kernel will be updated soon, week or two - we are doing last fixes, otherwise self compilation ... 1
damies Posted August 23, 2016 Author Posted August 23, 2016 Hi Igor, That's great news, Thanks! I am still trying to figure out self compilation (good learning experience), but it's good to know that it will be in the standard build soon. Dave.
damies Posted August 25, 2016 Author Posted August 25, 2016 Well I had some success, but then not so much, I used compile.sh to build an image "Armbian_5.17_Orangepilite_Ubuntu_xenial_3.4.112.raw" and was able to boot with this and load batman-adv unfortunately it's a really ancient version (2012.1) not the version in Ubuntu xenial on x86 (2015.2). I am now trying a build with the dev kernel to see what I will get. Does anyone know how I can control what version of the module is included in the build? Dave.
Igor Posted August 25, 2016 Posted August 25, 2016 Does anyone know how I can control what version of the module is included in the build? Unless you are an experienced developer you can't. And he also need lot's of luck ... New kernel should work too but it's not fully done yet, so problems are expected.
damies Posted August 30, 2016 Author Posted August 30, 2016 well I found the main.h files with the version numbers: sources/linux-sun8i/sun8i/net/batman-adv/main.h ​2012.1.0 sources/linux-sun8i-mainline/orange-pi-4.7/net/batman-adv/main.h ​2016.2 However when I built the dev version with the 4.7 kernel no batman-adv module was compiled. I went back to Zador's check in and saw that he only updated linux-sun8i-default.config and linux-sunxi-next.config but for my boards there is no next version only default and dev, so hopefully I have understood why? I did try messing around with linux-sunxi-dev.config putting in the changes from Zador's check in, but when I compiled again I still didn't get the batman-adv module, so I will probably have to be patient for this, though I might have another crack at it when I am a bit more familiar with the build process.... Now I understand that compile.sh can be used to create personalised images, I would like to learn more about this as It would be useful for me. From http://docs.armbian.com/Developer-Guide_User-Configurations/#user-provided-patches I think that I need to put my customisations in the userpatches dir, so here are the first things I would like to do in my personalised image and my current guess as to what I think I need to do to achieve them, I haven't tried these yet so would appreciate guidance if i'm on the right track or not. modify the firstrun script to change the hostname (so each device has a unique hostname) copy lib/scripts/firstrun to userpatches/lib/scripts/firstrun and add my changes? add extra preinstalled packages (e.g. Squid) edit customize-image.sh but what do i put in here? apt-get install squid? modify the initial configuration of some files (eg. /etc/network/interfaces and /etc/modules) copy lib/config/network/interfaces.default to userpatches/lib/config/network/interfaces.default and modify? still no idea where to find the source for /etc/modules? I hope i'm at least on the right track for something? Dave.
zador.blood.stained Posted August 30, 2016 Posted August 30, 2016 However when I built the dev version with the 4.7 kernel no batman-adv module was compiled. I went back to Zador's check in and saw that he only updated linux-sun8i-default.config and linux-sunxi-next.config but for my boards there is no next version only default and dev, so hopefully I have understood why? I did try messing around with linux-sunxi-dev.config putting in the changes from Zador's check in, but when I compiled again I still didn't get the batman-adv module, so I will probably have to be patient for this, though I might have another crack at it when I am a bit more familiar with the build process.... Mainline kernel support for H3 is still experimental and far from complete, that's why there is no "next" kernel branch for H3 boards, and "dev" kernel is called "dev" for a reason. Right now we are using separate kernel tree and config for H3 dev branch (compared to A10 and A20 based boards), so branch name is sun8i-dev and kernel config is linux-sun8i-dev.config modify the firstrun script to change the hostname (so each device has a unique hostname) copy lib/scripts/firstrun to userpatches/lib/scripts/firstrun and add my changes? You can customize hostname at compile time by setting HOST variable in userpatches/lib.config, or add extra code to /etc/rc.local (the one inside the image) to change /etc/hostname and /etc/hosts at first boot. I wouldn't recommend editing firstrun script because it may interfere with updates from Armbian repository. In addition providing any custom file in userpatches directory is not implemented, this is only for custom configuration, kernel config and kernel/u-boot patches. add extra preinstalled packages (e.g. Squid) edit customize-image.sh but what do i put in here? apt-get install squid? This should work, or you can add something like PACKAGE_LIST_ADDITIONAL="$PACKAGE_LIST_ADDITIONAL squid" to userpatches/lib.config modify the initial configuration of some files (eg. /etc/network/interfaces and /etc/modules) copy lib/config/network/interfaces.default to userpatches/lib/config/network/interfaces.default and modify? still no idea where to find the source for /etc/modules? You can put custom interfaces file in userpatches/overlay/ directory and then copy it in customize-image.sh like this cp /tmp/overlay/interfaces /etc/network/interfaces Modules list is created from board configuration files, if you want to add new modules, just add something like this to customize-image.sh echo module1 >> /etc/modules echo module2 >> /etc/modules 1
damies Posted August 30, 2016 Author Posted August 30, 2016 Thanks Zador, This is extremely helpful and informative, I will give it a go over the next few days. Dave.
Recommended Posts