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

Add ffs-lowmem-patches as fork of ffrn-lowmem-patches with adaptions for FFS

parent afc8c7ad
No related branches found
No related tags found
No related merge requests found
include $(TOPDIR)/rules.mk
PKG_NAME:=ffs-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/ffs-lowmem-patches
SECTION:=gluon
CATEGORY:=Gluon
TITLE:=Patch files for FFS 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/ffs-lowmem-patches/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/etc/init.d/ffs-lowmem $(1)/etc/init.d/ffs-lowmem
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) ./files/usr/sbin/ffs-lowmem $(1)/usr/sbin/ffs-lowmem
endef
$(eval $(call BuildPackage,ffs-lowmem-patches))
#!/bin/sh /etc/rc.common
START=11
start () {
/usr/sbin/ffs-lowmem
}
stop() {
true
}
#!/bin/sh
# Content based on patches from FFRN
# 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 vm.min_free_kbytes=1024
fi
#!/bin/sh
/etc/init.d/ffs-lowmem enable
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment