Split gluon-mesh-batman-adv into gluon-mesh-batman-adv-core and gluon-mesh-batman-adv-14
This commit is contained in:
		
							parent
							
								
									cd0a932ac0
								
							
						
					
					
						commit
						279cfd5117
					
				
							
								
								
									
										32
									
								
								package/gluon-mesh-batman-adv-14/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								package/gluon-mesh-batman-adv-14/Makefile
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,32 @@ | |||||||
|  | include $(TOPDIR)/rules.mk | ||||||
|  | 
 | ||||||
|  | PKG_NAME:=gluon-mesh-batman-adv-14 | ||||||
|  | PKG_VERSION:=1 | ||||||
|  | 
 | ||||||
|  | PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) | ||||||
|  | 
 | ||||||
|  | include $(GLUONDIR)/include/package.mk | ||||||
|  | 
 | ||||||
|  | define Package/gluon-mesh-batman-adv-14 | ||||||
|  |   SECTION:=gluon | ||||||
|  |   CATEGORY:=Gluon | ||||||
|  |   TITLE:=Support for batman-adv meshing (compat level 14) | ||||||
|  |   DEPENDS:=+gluon-mesh-batman-adv-core +kmod-batman-adv-legacy | ||||||
|  |   PROVIDES:=gluon-mesh-batman-adv | ||||||
|  | endef | ||||||
|  | 
 | ||||||
|  | define Build/Prepare | ||||||
|  | 	mkdir -p $(PKG_BUILD_DIR) | ||||||
|  | endef | ||||||
|  | 
 | ||||||
|  | define Build/Configure | ||||||
|  | endef | ||||||
|  | 
 | ||||||
|  | define Build/Compile | ||||||
|  | endef | ||||||
|  | 
 | ||||||
|  | define Package/gluon-mesh-batman-adv-14/install | ||||||
|  | 	$(CP) ./files/* $(1)/ | ||||||
|  | endef | ||||||
|  | 
 | ||||||
|  | $(eval $(call BuildPackage,gluon-mesh-batman-adv-14)) | ||||||
| @ -0,0 +1 @@ | |||||||
|  | return 14 | ||||||
							
								
								
									
										37
									
								
								package/gluon-mesh-batman-adv-core/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								package/gluon-mesh-batman-adv-core/Makefile
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,37 @@ | |||||||
|  | include $(TOPDIR)/rules.mk | ||||||
|  | 
 | ||||||
|  | PKG_NAME:=gluon-mesh-batman-adv-core | ||||||
|  | PKG_VERSION:=1 | ||||||
|  | 
 | ||||||
|  | PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) | ||||||
|  | 
 | ||||||
|  | include $(GLUONDIR)/include/package.mk | ||||||
|  | 
 | ||||||
|  | define Package/gluon-mesh-batman-adv-core | ||||||
|  |   SECTION:=gluon | ||||||
|  |   CATEGORY:=Gluon | ||||||
|  |   TITLE:=Support for batman-adv meshing (core) | ||||||
|  |   DEPENDS:=+gluon-core +firewall +kmod-ipt-nathelper | ||||||
|  | endef | ||||||
|  | 
 | ||||||
|  | define Build/Prepare | ||||||
|  | 	mkdir -p $(PKG_BUILD_DIR) | ||||||
|  | endef | ||||||
|  | 
 | ||||||
|  | define Build/Configure | ||||||
|  | endef | ||||||
|  | 
 | ||||||
|  | define Build/Compile | ||||||
|  | endef | ||||||
|  | 
 | ||||||
|  | define Package/gluon-mesh-batman-adv-core/install | ||||||
|  | 	$(CP) ./files/* $(1)/ | ||||||
|  | endef | ||||||
|  | 
 | ||||||
|  | define Package/gluon-mesh-batman-adv-core/postinst | ||||||
|  | #!/bin/sh
 | ||||||
|  | $(call GluonCheckSite,check_site.lua) | ||||||
|  | endef | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | $(eval $(call BuildPackage,gluon-mesh-batman-adv-core)) | ||||||
| @ -0,0 +1 @@ | |||||||
|  | return util.trim(fs.readfile('/sys/module/batman_adv/version')) | ||||||
| @ -16,6 +16,25 @@ uci:save('batman-adv') | |||||||
| uci:commit('batman-adv') | uci:commit('batman-adv') | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | if not uci:get('network', 'client') then | ||||||
|  |   local ifname | ||||||
|  | 
 | ||||||
|  |   if sysconfig.lan_ifname then | ||||||
|  |     ifname = sysconfig.lan_ifname .. ' bat0' | ||||||
|  |   else | ||||||
|  |     ifname = 'bat0' | ||||||
|  |   end | ||||||
|  | 
 | ||||||
|  |   uci:section('network', 'interface', 'client', | ||||||
|  | 	      { | ||||||
|  | 		ifname = ifname, | ||||||
|  | 		type = 'bridge', | ||||||
|  | 		proto = 'dhcpv6', | ||||||
|  | 		reqprefix = 'no', | ||||||
|  | 	      } | ||||||
|  |   ) | ||||||
|  | end | ||||||
|  | 
 | ||||||
| uci:set('network', 'client', 'macaddr', sysconfig.primary_mac) | uci:set('network', 'client', 'macaddr', sysconfig.primary_mac) | ||||||
| uci:set('network', 'client', 'peerdns', 1) | uci:set('network', 'client', 'peerdns', 1) | ||||||
| 
 | 
 | ||||||
| @ -1,41 +0,0 @@ | |||||||
| include $(TOPDIR)/rules.mk |  | ||||||
| 
 |  | ||||||
| PKG_NAME:=gluon-mesh-batman-adv |  | ||||||
| PKG_VERSION:=3 |  | ||||||
| 
 |  | ||||||
| PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) |  | ||||||
| 
 |  | ||||||
| include $(GLUONDIR)/include/package.mk |  | ||||||
| 
 |  | ||||||
| define Package/gluon-mesh-batman-adv |  | ||||||
|   SECTION:=gluon |  | ||||||
|   CATEGORY:=Gluon |  | ||||||
|   TITLE:=Support for batman-adv meshing |  | ||||||
|   DEPENDS:=+gluon-core +kmod-batman-adv-legacy +firewall +kmod-ipt-nathelper |  | ||||||
| endef |  | ||||||
| 
 |  | ||||||
| define Package/gluon-mesh-batman-adv/description |  | ||||||
| 	Gluon community wifi mesh firmware framework: batman-adv support |  | ||||||
| endef |  | ||||||
| 
 |  | ||||||
| define Build/Prepare |  | ||||||
| 	mkdir -p $(PKG_BUILD_DIR) |  | ||||||
| endef |  | ||||||
| 
 |  | ||||||
| define Build/Configure |  | ||||||
| endef |  | ||||||
| 
 |  | ||||||
| define Build/Compile |  | ||||||
| endef |  | ||||||
| 
 |  | ||||||
| define Package/gluon-mesh-batman-adv/install |  | ||||||
| 	$(CP) ./files/* $(1)/ |  | ||||||
| endef |  | ||||||
| 
 |  | ||||||
| define Package/gluon-mesh-batman-adv/postinst |  | ||||||
| #!/bin/sh
 |  | ||||||
| $(call GluonCheckSite,check_site.lua) |  | ||||||
| endef |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| $(eval $(call BuildPackage,gluon-mesh-batman-adv)) |  | ||||||
| @ -1,3 +0,0 @@ | |||||||
| local version = util.trim(fs.readfile('/sys/module/batman_adv/version')) |  | ||||||
| 
 |  | ||||||
| return { version = version } |  | ||||||
| @ -1,26 +0,0 @@ | |||||||
| #!/usr/bin/lua |  | ||||||
| 
 |  | ||||||
| local sysconfig = require 'gluon.sysconfig' |  | ||||||
| local uci = require('luci.model.uci').cursor() |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| local ifname |  | ||||||
| 
 |  | ||||||
| if sysconfig.lan_ifname then |  | ||||||
|    ifname = sysconfig.lan_ifname .. ' bat0' |  | ||||||
| else |  | ||||||
|    ifname = 'bat0' |  | ||||||
| end |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| uci:section('network', 'interface', 'client', |  | ||||||
| 	    { |  | ||||||
| 	       ifname = ifname, |  | ||||||
| 	       type = 'bridge', |  | ||||||
| 	       proto = 'dhcpv6', |  | ||||||
| 	       reqprefix = 'no', |  | ||||||
| 	    } |  | ||||||
| ) |  | ||||||
| 
 |  | ||||||
| uci:save('network') |  | ||||||
| uci:commit('network') |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user