zram-config-0.1/0000775000000000000000000000000011702544441010460 5ustar zram-config-0.1/debian/0000755000000000000000000000000011702572235011702 5ustar zram-config-0.1/debian/zram-config.upstart0000664000000000000000000000206011702565634015547 0ustar description "Initializes zram swaping" author "Adam Conrad " start on runlevel [2345] pre-start script # load dependency modules NRDEVICES=$(grep -c ^processor /proc/cpuinfo | sed 's/^0$/1/') if modinfo zram | grep -q ' zram_num_devices:' 2>/dev/null; then MODPROBE_ARGS="zram_num_devices=${NRDEVICES}" elif modinfo zram | grep -q ' num_devices:' 2>/dev/null; then MODPROBE_ARGS="num_devices=${NRDEVICES}" else exit 1 fi modprobe zram $MODPROBE_ARGS # Calculate memory to use for zram (1/2 of ram) totalmem=`free | grep -e "^Mem:" | sed -e 's/^Mem: *//' -e 's/ *.*//'` mem=$(((totalmem / 2 / ${NRDEVICES}) * 1024)) # initialize the devices for i in $(seq ${NRDEVICES}); do DEVNUMBER=$((i - 1)) echo $mem > /sys/block/zram${DEVNUMBER}/disksize mkswap /dev/zram${DEVNUMBER} swapon -p 5 /dev/zram${DEVNUMBER} done end script post-stop script if DEVICES=$(grep zram /proc/swaps | awk '{print $1}'); then for i in $DEVICES; do swapoff $i done fi rmmod -w zram end script zram-config-0.1/debian/compat0000664000000000000000000000000211702544441013100 0ustar 8 zram-config-0.1/debian/source/0000755000000000000000000000000011702544441013200 5ustar zram-config-0.1/debian/source/format0000664000000000000000000000001511702544441014411 0ustar 3.0 (native) zram-config-0.1/debian/changelog0000664000000000000000000000025311702570132013550 0ustar zram-config (0.1) precise; urgency=low * Initial Release of zram swap configuration management. -- Adam Conrad Mon, 09 Jan 2012 04:01:46 -0700 zram-config-0.1/debian/rules0000755000000000000000000000067211702544441012765 0ustar #!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 %: dh $@ zram-config-0.1/debian/control0000664000000000000000000000061611702562557013320 0ustar Source: zram-config Section: utils Priority: extra Maintainer: Ubuntu Developers Build-Depends: debhelper (>= 8.0.0) Standards-Version: 3.9.2 Package: zram-config Architecture: all Depends: ${misc:Depends} Description: Upstart job to enable zram support This installs a simple Upstart job to enable zram support on kernels that have the module available. zram-config-0.1/debian/preinst0000664000000000000000000000150711702546245013320 0ustar #!/bin/sh # preinst script for zram-config # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `install' # * `install' # * `upgrade' # * `abort-upgrade' # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in install|upgrade) if [ -z "$2" ]; then if [ -f /etc/init/zram.conf ]; then rm -f /etc/init/zram.conf fi fi ;; abort-upgrade) ;; *) echo "preinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 zram-config-0.1/debian/copyright0000664000000000000000000000171611702545460013644 0ustar Format: http://dep.debian.net/deps/dep5 Upstream-Name: zram-config Files: * Copyright: 2012 Canonical Ltd. License: GPL-3.0+ Files: debian/* Copyright: 2012 Canonical Ltd. License: GPL-3.0+ License: GPL-3.0+ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. . This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program. If not, see . . On Debian systems, the complete text of the GNU General Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".