Skip to content
Snippets Groups Projects
Commit 70ada175 authored by Roland's avatar Roland
Browse files

Using own version for FFS, based on clone from FFRN

parent aa36fe1d
No related branches found
No related tags found
No related merge requests found
include $(TOPDIR)/rules.mk
PKG_NAME:=ffrn-lowmem-patches
PKG_VERSION:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(GLUONDIR)/include/package.mk
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
define Package/ffrn-lowmem-patches
SECTION:=gluon
CATEGORY:=Gluon
TITLE:=Patch files for routers with only 32mb ram
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/ffrn-lowmem-patches/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/etc/init.d/ffrn-lowmem $(1)/etc/init.d/ffrn-lowmem
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) ./files/usr/sbin/ffrn-lowmem $(1)/usr/sbin/ffrn-lowmem
endef
$(eval $(call BuildPackage,ffrn-lowmem-patches))
#!/bin/sh /etc/rc.common
START=11
start () {
/usr/sbin/ffrn-lowmem
}
stop() {
true
}
#!/bin/sh
# only do something if less than 40megs of RAM
RAMSIZE=`grep MemTotal /proc/meminfo | awk '{print $2}'`
if [ $RAMSIZE -le 40000 ] ; then
# start haveged in config mode
MODE=`uci get gluon-setup-mode.@setup_mode[0].enabled`
if [ $MODE == "1" ] ; then
/etc/init.d/haveged start
# disable and stop haveged if enabled
elif [ -f /etc/rc.d/S13haveged ] ; then
/etc/init.d/haveged disable
/etc/init.d/haveged stop
fi
# tweak some sysctls
/sbin/sysctl -w net.ipv6.neigh.default.gc_interval=60
/sbin/sysctl -w net.ipv6.neigh.default.gc_stale_time=120
/sbin/sysctl -w net.ipv6.neigh.default.gc_thresh1=64
/sbin/sysctl -w net.ipv6.neigh.default.gc_thresh2=128
/sbin/sysctl -w net.ipv6.neigh.default.gc_thresh3=512
/sbin/sysctl -w net.ipv4.neigh.default.gc_interval=60
/sbin/sysctl -w net.ipv4.neigh.default.gc_stale_time=120
/sbin/sysctl -w net.ipv4.neigh.default.gc_thresh1=64
/sbin/sysctl -w net.ipv4.neigh.default.gc_thresh2=128
/sbin/sysctl -w net.ipv4.neigh.default.gc_thresh3=512
/sbin/sysctl -w vm.min_free_kbytes=1024
/sbin/sysctl -w vm.dirty_background_ratio=5
/sbin/sysctl -w vm.dirty_ratio=30
/sbin/sysctl -w vm.dirty_expire_centisecs=0
fi
#!/bin/sh
/etc/init.d/ffrn-lowmem enable
......@@ -5,19 +5,12 @@
RAMSIZE=`grep MemTotal /proc/meminfo | awk '{print $2}'`
if [ $RAMSIZE -le 40000 ] ; then
# start haveged in config mode
# start haveged in config mode, else disable and stop it
MODE=`uci get gluon-setup-mode.@setup_mode[0].enabled`
if [ $MODE == "1" ] ; then
/etc/init.d/haveged start
# disable and stop haveged if enabled
elif [ -f /etc/rc.d/S13haveged ] ; then
/etc/init.d/haveged disable
/etc/init.d/haveged stop
fi
# tweak some sysctls
/sbin/sysctl -w net.ipv6.neigh.default.gc_interval=60
/sbin/sysctl -w net.ipv6.neigh.default.gc_stale_time=120
/sbin/sysctl -w vm.min_free_kbytes=1024
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment