--- dphys-swapfile-20061020.orig/debian/README.source +++ dphys-swapfile-20061020/debian/README.source @@ -0,0 +1,58 @@ +This package uses quilt to manage all modifications to the upstream +source. Changes are stored in the source package as diffs in +debian/patches and applied during the build. + +To configure quilt to use debian/patches instead of patches, you want +either to export QUILT_PATCHES=debian/patches in your environment +or use this snippet in your ~/.quiltrc: + + for where in ./ ../ ../../ ../../../ ../../../../ ../../../../../; do + if [ -e ${where}debian/rules -a -d ${where}debian/patches ]; then + export QUILT_PATCHES=debian/patches + break + fi + done + +To get the fully patched source after unpacking the source package, cd to +the root level of the source package and run: + + quilt push -a + +The last patch listed in debian/patches/series will become the current +patch. + +To add a new set of changes, first run quilt push -a, and then run: + + quilt new + +where is a descriptive name for the patch, used as the filename in +debian/patches. Then, for every file that will be modified by this patch, +run: + + quilt add + +before editing those files. You must tell quilt with quilt add what files +will be part of the patch before making changes or quilt will not work +properly. After editing the files, run: + + quilt refresh + +to save the results as a patch. + +Alternately, if you already have an external patch and you just want to +add it to the build system, run quilt push -a and then: + + quilt import -P /path/to/patch + quilt push -a + +(add -p 0 to quilt import if needed). as above is the filename to +use in debian/patches. The last quilt push -a will apply the patch to +make sure it works properly. + +To remove an existing patch from the list of patches that will be applied, +run: + + quilt delete + +You may need to run quilt pop -a to unapply patches first before running +this command. --- dphys-swapfile-20061020.orig/debian/compat +++ dphys-swapfile-20061020/debian/compat @@ -0,0 +1 @@ +7 --- dphys-swapfile-20061020.orig/debian/watch +++ dphys-swapfile-20061020/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://neil.franklin.ch/Projects/dphys-swapfile/ ../dphys-swapfile-(\d{8}.*)\.tar\.gz --- dphys-swapfile-20061020.orig/debian/changelog +++ dphys-swapfile-20061020/debian/changelog @@ -0,0 +1,55 @@ +dphys-swapfile (20061020-4) unstable; urgency=low + + * Fix wrong magnitude in last upload's bugfix for 564466 when + calculating swap size. (Closes: #612877, LP: #706764) Thanks Antonio + Galea for a very unintrusive patch. + + -- Axel Beckert Fri, 11 Feb 2011 14:40:33 +0100 + +dphys-swapfile (20061020-3) unstable; urgency=low + + * New maintainer + * Removed patch which removed the swapfile size limit (#502200). Without + this patch, the problem described in #564466 would have been so + harmful as it is. + * Updated homepage URL + * Moved to quilt patch management. New patches: + - adapt-source-code-comments-and-output.diff + - check-for-empty-or-zero-maxswap.diff + - use-meminfo-instead-of-kcore.diff (Closes: #564466) + - fix-spelling-errors.diff (fixes lintian warnings) + * Bumped standards version to 3.8.4 (no changes necessary) + * Added Vcs-* headers + * Added debian/source/format + * Added watch file + * Added "Depends: ${misc:Depends}" to debian/control due to debhelper + usage + * Added "$remote_fs" to Required-Start and Required-Stop in LSB init.d + section + * Added NEWS.Debian mentioning behaviour changes + + -- Axel Beckert Wed, 05 May 2010 21:33:53 +0200 + +dphys-swapfile (20061020-2) unstable; urgency=low + + * Apply patch to remove maximal swapfile size. (Closes: #502200) + Thanks to Jacob Elder for the patch. + * Update my email address. + * Bump standards version. + * Bump debhelper version. + * Update debian/copyright. + * Move Homepage field in debian/control. + + -- Gürkan Sengün Thu, 19 Mar 2009 13:34:14 +0100 + +dphys-swapfile (20061020-1) unstable; urgency=low + + * New upstream version. + + -- Gürkan Sengün Thu, 26 Oct 2006 09:15:10 +0200 + +dphys-swapfile (20060915-1) unstable; urgency=low + + * Initial release. (Closes: #388631) + + -- Gürkan Sengün Fri, 15 Sep 2006 19:02:47 +0200 --- dphys-swapfile-20061020.orig/debian/copyright +++ dphys-swapfile-20061020/debian/copyright @@ -0,0 +1,70 @@ +This package was debianized by: + + Gürkan Sengün on Fri, 15 Sep 2006 19:02:47 +0200. + +It was downloaded from: + + http://www.phys.ethz.ch/~franklin/Projects/dphys-config/ + +Upstream Author: + + Neil Franklin + +Copyright: + + Copyright (C) 2003-2006 Neil Franklin + +This software is dual-licensed under the GNU General Public License (GPL), +and the modified/non-advertising BSD License (BSD). + +License (GPL): + + This package 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 2 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 package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + +License (BSD): + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +The Debian packaging is: + + Copyright (C) 2006 Gürkan Sengün + +and is licensed under the GPL version 3, +see `/usr/share/common-licenses/GPL-3'. --- dphys-swapfile-20061020.orig/debian/init.d +++ dphys-swapfile-20061020/debian/init.d @@ -0,0 +1,76 @@ +#!/bin/sh +# /etc/init.d/dphys-swapfile - automatically set up an swapfile +# author Neil Franklin, last modification 2006.09.15 +# This script is copyright ETH Zuerich Physics Departement, +# use under either modified/non-advertising BSD or GPL license + +# this init.d script is intended to be run from rcS.d +# must run after mount of /var which may only happen in S35mountall.sh +# for this reason we can not build swapfile until after S35mountall.sh +# so we also need to use init.d start|stop to swapon|off our file +# and sensibly before the lots of stuff which may happen in S40networking +# so we run it as rcS.d/S37dphys-config + +### BEGIN INIT INFO +# Provides: dphys-swapfile +# Required-Start: $syslog $remote_fs +# Required-Stop: $syslog $remote_fs +# Should-Start: $local_fs +# Should-Stop: $local_fs +# Default-Start: 2 3 4 5 +# Default-Stop: +# Short-Description: Autogenerate and use a swap file +# Description: This init.d script exists so one does not need to have a fixed size +# swap partition. Instead install without swap partition and then run +# this, with file size (re-)computed automatically to fit the current +# RAM size. +### END INIT INFO + +# get ready to work +PATH=/sbin:/bin:/usr/sbin:/usr/bin +export PATH + +# what we are +NAME=dphys-swapfile + +case "$1" in + + start) + /bin/echo "Starting ${NAME} swapfile setup ..." + + # (re-)size/-generate (and also first time install) + # this will produce output, so no -n in above echo + /sbin/dphys-swapfile setup + + # as S35mountall.sh has already run, do this from here + # as there can be no swapon in /etc/fstab + /sbin/dphys-swapfile swapon + + /bin/echo "done." + ;; + + + stop|default-stop) + /bin/echo -n "Stopping ${NAME} swapfile setup ..." + + # as no swapon or swapoff in /etc/fstab, do this from here + /sbin/dphys-swapfile swapoff + + /bin/echo ", done." + ;; + + + restart|reload|force-reload) + /bin/echo "No daemon to (force-)re[start|load] in ${NAME}" + ;; + + + *) + /bin/echo "Usage: $0 {start|stop}" + + exit 1 + ;; + +esac + +exit 0 --- dphys-swapfile-20061020.orig/debian/docs +++ dphys-swapfile-20061020/debian/docs @@ -0,0 +1,2 @@ +FAQ +README --- dphys-swapfile-20061020.orig/debian/control +++ dphys-swapfile-20061020/debian/control @@ -0,0 +1,17 @@ +Source: dphys-swapfile +Section: admin +Priority: optional +Maintainer: Axel Beckert +Build-Depends: debhelper (>= 7), quilt +Homepage: http://neil.franklin.ch/Projects/dphys-swapfile/ +Standards-Version: 3.8.4 +Vcs-Git: http://git.phys.ethz.ch/dphys-swapfile-debian.git +Vcs-Browser: http://git.phys.ethz.ch/?p=dphys-swapfile-debian.git + +Package: dphys-swapfile +Architecture: all +Depends: ${misc:Depends} +Description: Autogenerate and use a swap file + This init.d script exists so one does not need to have a fixed size + swap partition. Instead install without swap partition and then run this, + with file size (re-)computed automatically to fit the current RAM size. --- dphys-swapfile-20061020.orig/debian/dirs +++ dphys-swapfile-20061020/debian/dirs @@ -0,0 +1 @@ +sbin --- dphys-swapfile-20061020.orig/debian/NEWS +++ dphys-swapfile-20061020/debian/NEWS @@ -0,0 +1,10 @@ +dphys-swapfile (20061020-3) unstable; urgency=low + + dphys-swapfile now also recognizes CONF_MAXSWAP and CONF_SWAPFACTOR in + /etc/dphys-swapfile. See dphys-swapfile(8) for details. + + The old undocumented variables MAXSWAP and SWAPFACTOR do not work + anymore and have been replaced by the variables mentioned above. + + -- Axel Beckert Wed, 05 May 2010 21:30:55 +0200 + --- dphys-swapfile-20061020.orig/debian/rules +++ dphys-swapfile-20061020/debian/rules @@ -0,0 +1,51 @@ +#!/usr/bin/make -f +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +include /usr/share/quilt/quilt.make + +configure: configure-stamp +configure-stamp: $(QUILT_STAMPFN) + dh_testdir + touch configure-stamp + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + $(MAKE) + touch $@ + +clean: unpatch + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + $(MAKE) clean + dh_clean + +install: build + dh_testdir + dh_testroot + dh_prep + dh_installdirs + $(MAKE) install DESTDIR=$(CURDIR)/debian/dphys-swapfile + +# Build architecture-independent files here. +binary-indep: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installinit + dh_compress + dh_fixperms + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +# Build architecture-dependent files here. +binary-arch: build install + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- dphys-swapfile-20061020.orig/debian/patches/adapt-source-code-comments-and-output.diff +++ dphys-swapfile-20061020/debian/patches/adapt-source-code-comments-and-output.diff @@ -0,0 +1,74 @@ +Makes SWAPFACTOR and MAXPATH officially configurable values + +Index: dphys-swapfile-20061020/dphys-swapfile +=================================================================== +--- dphys-swapfile-20061020.orig/dphys-swapfile 2010-05-05 21:20:23.000000000 +0200 ++++ dphys-swapfile-20061020/dphys-swapfile 2010-05-05 21:24:16.000000000 +0200 +@@ -12,6 +12,12 @@ + # size we want to force it to be, default (empty) gives 2*RAM + CONF_SWAPSIZE= + ++# this is what we want, 2 times RAM size ++CONF_SWAPFACTOR=2 ++ ++# Formerly a hard kernel limit (in MBytes), now a safeguard from using ++# up too much disk space on modern computers with a lot of RAM ++CONF_MAXSWAP=2048 + + ### ------ actual implementation from here on + # no user settings any more below this point +@@ -22,13 +28,6 @@ + PATH=/sbin:/bin:/usr/sbin:/usr/bin + export PATH + +- +-# this is what we want, 2 times RAM size +-SWAPFACTOR=2 +-# this is a (outdated?) kernel limit (in MBytes), do not overrun it +-MAXSWAP=2048 +- +- + # what we are + NAME=dphys-swapfile + PNAME=dphys-swapfile +@@ -53,16 +52,16 @@ + # make MBytes which rounded down will be exactly 1 too few, so add 1 + MEMSIZE="`expr "${KCORESIZE}" / 1048576 + 1`" + # default, without config file overwriding, swap=2*RAM +- CONF_SWAPSIZE="`expr "${MEMSIZE}" '*' "${SWAPFACTOR}"`" ++ CONF_SWAPSIZE="`expr "${MEMSIZE}" '*' "${CONF_SWAPFACTOR}"`" + fi + + # announce end resulting config + echo -n "want ${CONF_SWAPFILE}=${CONF_SWAPSIZE}MByte" + + # check for legitimate swap size and restrict to it +- if [ "${CONF_SWAPSIZE}" -gt "${MAXSWAP}" ] ; then +- echo -n ", limiting to kernel limit: ${MAXSWAP}MBytes" +- CONF_SWAPSIZE="${MAXSWAP}" ++ if [ "${CONF_SWAPSIZE}" -gt "${CONF_MAXSWAP}" ] ; then ++ echo -n ", limiting to ${CONF_MAXSWAP}MBytes as configured" ++ CONF_SWAPSIZE="${CONF_MAXSWAP}" + fi + + +Index: dphys-swapfile-20061020/dphys-swapfile.8 +=================================================================== +--- dphys-swapfile-20061020.orig/dphys-swapfile.8 2010-05-05 21:20:23.000000000 +0200 ++++ dphys-swapfile-20061020/dphys-swapfile.8 2010-05-05 21:25:07.000000000 +0200 +@@ -59,6 +59,15 @@ + Force file size to this. Default is 2*RAM size. This is unlikely to be needed, + unless in strange diskspace situations. Note that swap enabled and smaller + than RAM causes kernal-internal VM trouble on random systems. ++.TP ++.B CONF_SWAPFACTOR ++Set the relation between RAM and swap size. Must be an ++integer. Defaults to 2 which means swap size = 2 * RAM size ++.TP ++.B CONF_MAXSWAP ++Set maximum size of the swap file in MBytes. Defaults to 2048 which ++was the former kernel limit for the swapfile size and is now a limit ++to prevent unusual big swap files on systems with a lot of RAM. + + .SH FILES + --- dphys-swapfile-20061020.orig/debian/patches/series +++ dphys-swapfile-20061020/debian/patches/series @@ -0,0 +1,4 @@ +adapt-source-code-comments-and-output.diff +check-for-empty-or-zero-maxswap.diff +use-meminfo-instead-of-kcore.diff +fix-spelling-errors.diff --- dphys-swapfile-20061020.orig/debian/patches/check-for-empty-or-zero-maxswap.diff +++ dphys-swapfile-20061020/debian/patches/check-for-empty-or-zero-maxswap.diff @@ -0,0 +1,17 @@ +Do not apply limit if limit is empty or set to zero. + +Index: dphys-swapfile-20061020/dphys-swapfile +=================================================================== +--- dphys-swapfile-20061020.orig/dphys-swapfile 2010-05-05 20:33:48.000000000 +0200 ++++ dphys-swapfile-20061020/dphys-swapfile 2010-05-05 20:33:53.000000000 +0200 +@@ -59,7 +59,9 @@ + echo -n "want ${CONF_SWAPFILE}=${CONF_SWAPSIZE}MByte" + + # check for legitimate swap size and restrict to it +- if [ "${CONF_SWAPSIZE}" -gt "${CONF_MAXSWAP}" ] ; then ++ if [ -n "${CONF_MAXSWAP}" ] && \ ++ [ "${CONF_MAXSWAP}" != "0" ] && \ ++ [ "${CONF_SWAPSIZE}" -gt "${CONF_MAXSWAP}" ] ; then + echo -n ", limiting to ${CONF_MAXSWAP}MBytes as configured" + CONF_SWAPSIZE="${CONF_MAXSWAP}" + fi --- dphys-swapfile-20061020.orig/debian/patches/use-meminfo-instead-of-kcore.diff +++ dphys-swapfile-20061020/debian/patches/use-meminfo-instead-of-kcore.diff @@ -0,0 +1,21 @@ +Use /proc/meminfo instead of the size of /proc/kcore since the later +is beyond good and evil with newer kernels (2.6.32 and above as it +seems). This fixes Debian bug #564466. + +Index: dphys-swapfile-20061020/dphys-swapfile +=================================================================== +--- dphys-swapfile-20061020.orig/dphys-swapfile 2010-05-05 20:37:42.000000000 +0200 ++++ dphys-swapfile-20061020/dphys-swapfile 2010-05-05 20:41:27.000000000 +0200 +@@ -47,10 +47,8 @@ + if [ "${CONF_SWAPSIZE}" = "" ] ; then + # compute automatic optimal size + echo -n "computing size, " +- # this seems to be the nearest to physical RAM size, lacks about 60k +- KCORESIZE="`ls -l /proc/kcore | awk '{ print $5 }'`" +- # make MBytes which rounded down will be exactly 1 too few, so add 1 +- MEMSIZE="`expr "${KCORESIZE}" / 1048576 + 1`" ++ # /proc/kcore became unreliable so let's use /proc/meminfo instead ++ MEMSIZE="`head -1 /proc/meminfo | awk '{ print int($2/1024) }'`" + # default, without config file overwriding, swap=2*RAM + CONF_SWAPSIZE="`expr "${MEMSIZE}" '*' "${CONF_SWAPFACTOR}"`" + fi --- dphys-swapfile-20061020.orig/debian/patches/fix-spelling-errors.diff +++ dphys-swapfile-20061020/debian/patches/fix-spelling-errors.diff @@ -0,0 +1,37 @@ +Fixes some spelling errors + +Index: dphys-swapfile-20061020/dphys-swapfile +=================================================================== +--- dphys-swapfile-20061020.orig/dphys-swapfile 2010-05-05 21:02:12.000000000 +0200 ++++ dphys-swapfile-20061020/dphys-swapfile 2010-05-05 21:02:55.000000000 +0200 +@@ -32,7 +32,7 @@ + NAME=dphys-swapfile + PNAME=dphys-swapfile + +-# check user config file, let user overwride settings ++# check user config file, let user override settings + # swap file place/filename and size + if [ -f /etc/"${PNAME}" ] ; then + . /etc/"${PNAME}" +@@ -49,7 +49,7 @@ + echo -n "computing size, " + # /proc/kcore became unreliable so let's use /proc/meminfo instead + MEMSIZE="`head -1 /proc/meminfo | awk '{ print int($2/1024) }'`" +- # default, without config file overwriding, swap=2*RAM ++ # default, without config file overriding, swap=2*RAM + CONF_SWAPSIZE="`expr "${MEMSIZE}" '*' "${CONF_SWAPFACTOR}"`" + fi + +Index: dphys-swapfile-20061020/dphys-swapfile.8 +=================================================================== +--- dphys-swapfile-20061020.orig/dphys-swapfile.8 2010-05-05 21:01:59.000000000 +0200 ++++ dphys-swapfile-20061020/dphys-swapfile.8 2010-05-05 21:02:06.000000000 +0200 +@@ -17,7 +17,7 @@ + .SH DESCRIPTION + + dphys-swapfile computes the size for an optimal swap file (and resizes an +-existing swap file if neccessary), mounts an swap file, unmounts it, and and ++existing swap file if necessary), mounts an swap file, unmounts it, and and + delete it if not wanted any more. + + .SH OPTIONS --- dphys-swapfile-20061020.orig/debian/source/format +++ dphys-swapfile-20061020/debian/source/format @@ -0,0 +1 @@ +1.0