|
From: <abe...@us...> - 2013-07-13 20:21:36
|
Revision: 6133
http://sourceforge.net/p/astlinux/code/6133
Author: abelbeck
Date: 2013-07-13 20:21:34 +0000 (Sat, 13 Jul 2013)
Log Message:
-----------
fop2, add RAM check to disallow less than 512 MB systems, move to S98 runlevel
Modified Paths:
--------------
branches/1.0/package/asterisk-fop2/asterisk-fop2.mk
branches/1.0/package/asterisk-fop2/fop2.init
branches/1.0/project/astlinux/target_skeleton/usr/sbin/upgrade-package
Modified: branches/1.0/package/asterisk-fop2/asterisk-fop2.mk
===================================================================
--- branches/1.0/package/asterisk-fop2/asterisk-fop2.mk 2013-07-13 14:09:46 UTC (rev 6132)
+++ branches/1.0/package/asterisk-fop2/asterisk-fop2.mk 2013-07-13 20:21:34 UTC (rev 6133)
@@ -13,16 +13,16 @@
$(INSTALL) -D -m 0644 package/asterisk-fop2/config/fop2.cfg $(TARGET_DIR)/stat/etc/fop2/fop2.cfg
$(INSTALL) -D -m 0644 package/asterisk-fop2/config/buttons.cfg $(TARGET_DIR)/stat/etc/fop2/buttons.cfg
ln -snf /tmp/etc/fop2 $(TARGET_DIR)/etc/fop2
- ln -sf ../../init.d/fop2 $(TARGET_DIR)/etc/runlevels/default/S82fop2
- ln -sf ../../init.d/fop2 $(TARGET_DIR)/etc/runlevels/default/K00fop2
+ ln -sf ../../init.d/fop2 $(TARGET_DIR)/etc/runlevels/default/S98fop2
+ ln -sf ../../init.d/fop2 $(TARGET_DIR)/etc/runlevels/default/K00fop2
endef
define ASTERISK_FOP2_UNINSTALL_TARGET_CMDS
rm -f $(TARGET_DIR)/etc/init.d/fop2
rm -rf $(TARGET_DIR)/stat/etc/fop2
rm -f $(TARGET_DIR)/etc/fop2
- rm -f $(TARGET_DIR)/etc/runlevels/default/S82fop2
- rm -f $(TARGET_DIR)/etc/runlevels/default/K00fop2
+ rm -f $(TARGET_DIR)/etc/runlevels/default/S98fop2
+ rm -f $(TARGET_DIR)/etc/runlevels/default/K00fop2
endef
$(eval $(call GENTARGETS,package,asterisk-fop2))
Modified: branches/1.0/package/asterisk-fop2/fop2.init
===================================================================
--- branches/1.0/package/asterisk-fop2/fop2.init 2013-07-13 14:09:46 UTC (rev 6132)
+++ branches/1.0/package/asterisk-fop2/fop2.init 2013-07-13 20:21:34 UTC (rev 6133)
@@ -13,7 +13,11 @@
PIDFILE="/var/run/fop2.pid"
-TMPSIZEMAX=30000
+# fop2 uses Perl Archive (PAR) which generates many "/tmp/par-root/cache-" files
+# The value of TMPSIZEMAX should be 2x the normal par-root size (to allow for two different versions)
+# plus the standard 10 MB headroom. Removing the /tmp/par-root directory on a fop2 stop would
+# eliminate the 2x requirement, but would be bad practice if another PAR application was in use.
+TMPSIZEMAX=50000
init () {
Modified: branches/1.0/project/astlinux/target_skeleton/usr/sbin/upgrade-package
===================================================================
--- branches/1.0/project/astlinux/target_skeleton/usr/sbin/upgrade-package 2013-07-13 14:09:46 UTC (rev 6132)
+++ branches/1.0/project/astlinux/target_skeleton/usr/sbin/upgrade-package 2013-07-13 20:21:34 UTC (rev 6133)
@@ -12,6 +12,16 @@
LOCKFILE="/var/lock/upgrade-package.lock"
#
+RAM_needed_MB() {
+ local MB="$1"
+
+ # Get amount of RAM in machine (in MB)
+ if [ $(awk '/^MemTotal:/ { print int($2 / 1024) }' /proc/meminfo) -lt $MB ]; then
+ return 1
+ fi
+ return 0
+}
+
upgrade() {
local suffix="${SRC_URL##*.}" tar_args pkg_dir err_str sha1
@@ -183,6 +193,9 @@
case $PKG in
fop2)
+ if ! RAM_needed_MB 475; then
+ finish $RED "Not enough RAM installed. Minimum: 512 MB, Recommended: 1024+ MB"
+ fi
SRC_URL="http://files.astlinux.org/fop2-2.27-debian-i386.tgz"
;;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|