diff -Nru dphys-swapfile-20061020/FAQ dphys-swapfile-20100506/FAQ --- dphys-swapfile-20061020/FAQ 2006-10-20 12:24:47.000000000 +0000 +++ dphys-swapfile-20100506/FAQ 2006-12-22 13:07:47.000000000 +0000 @@ -1,5 +1,5 @@ -http://www.phys.ethz.ch/~franklin/Projects/dphys-swapfile/FAQ -author Neil Franklin, last modification 2006.10.12 +http://neil.franklin.ch/Projects/dphys-swapfile/FAQ +author Neil Franklin, last modification 2006.12.22 copyright ETH Zuerich Physics Departement use under either modified/non-advertising BSD or GPL license @@ -45,10 +45,10 @@ Q: Where can I get code? A: The current (read: in edit, sometimes not functional) from: - http://www.phys.ethz.ch/~franklin/Projects/dphys-swapfile/ or: - http://www.phys.ethz.ch/~franklin/Projects/dphys-swapfile.tar.gz or + http://neil.franklin.ch/Projects/dphys-swapfile/ or: + http://neil.franklin.ch/Projects/dphys-swapfile.tar.gz or Various milestones/releases (read: archives, working) from: - http://www.phys.ethz.ch/~franklin/Projects/dphys-swapfile-/ or: - http://www.phys.ethz.ch/~franklin/Projects/dphys-swapfile-.tar.gz + http://neil.franklin.ch/Projects/dphys-swapfile-/ or: + http://neil.franklin.ch/Projects/dphys-swapfile-.tar.gz where last milestone/release is =20061020 diff -Nru dphys-swapfile-20061020/INSTALL dphys-swapfile-20100506/INSTALL --- dphys-swapfile-20061020/INSTALL 2006-10-20 12:24:56.000000000 +0000 +++ dphys-swapfile-20100506/INSTALL 2006-12-22 13:08:24.000000000 +0000 @@ -1,5 +1,5 @@ -http://www.phys.ethz.ch/~franklin/Projects/dphys-swapfile/INSTALL -author Neil Franklin, last modification 2006.10.20 +http://neil.franklin.ch/Projects/dphys-swapfile/INSTALL +author Neil Franklin, last modification 2006.12.22 copyright ETH Zuerich Physics Departement use under either modified/non-advertising BSD or GPL license @@ -11,8 +11,8 @@ 1. Download and unpack the .tar.gz archive file from: - http://www.phys.ethz.ch/~franklin/Projects/dphys-swapfile.tar.gz or - http://www.phys.ethz.ch/~franklin/Projects/dphys-swapfile-.tar.gz + http://neil.franklin.ch/Projects/dphys-swapfile.tar.gz or + http://neil.franklin.ch/Projects/dphys-swapfile-.tar.gz where last milestone/release is =20061020 make diff -Nru dphys-swapfile-20061020/Logfile dphys-swapfile-20100506/Logfile --- dphys-swapfile-20061020/Logfile 2006-10-20 12:30:55.000000000 +0000 +++ dphys-swapfile-20100506/Logfile 2010-05-06 18:56:29.000000000 +0000 @@ -1,10 +1,12 @@ -http://www.phys.ethz.ch/~franklin/Projects/dphys-swapfile/Logfile - done, to do +http://neil.franklin.ch/Projects/dphys-swapfile/Logfile - done, to do author Neil Franklin, last modification see last entry near bottom copyright ETH Zuerich Physics Departement use under either modified/non-advertising BSD or GPL license background is the dphys2 project, read its Logfile at: - http://www.phys.ethz.ch/~franklin/Projects/dphys2/Logfile + http://nic.phys.ethz.ch/projects/dphys2/Logfile +and its successor, the dphys3 project, read its Logfile at: + http://nic.phys.ethz.ch/projects/dphys3/Logfile as part of that wrote this tool to auto-generate/us an swapfile here only log of the events pertaining to making this tool @@ -263,6 +265,43 @@ copy to ../dphys-swapfile-20061020, made tar file of that remade ../dphys-swapfile.tar.gz archive for current state +2006.12.22 Fri +as part of taking this over als personal project, after leaving job + moved everything from www.phys.ethz.ch/~franklin to neil.franklin.ch website + changes all URLs to refer to new home, expanded links to other projects + we decided that I will keep on maintaining this project (and dphys-config) + as I also use these 2 projects at home on my own non-Debian systems + +2010.05.04 Wed +bugfixes for reported bug by the new Debian maintainer Axel Beckert + this was not prevented because of the old maintainers unreported patch + which apparently was changed to have no 2048M limit any more + request to make SWAPFACTOR and MAXSWAP into user CONF_* variables + and user switchable fixed size CONF_SWAPSIZE or above computed size + newer 2.6.32 AMD64 kernels report senselessly large 128T /proc/kcore sizes + dphys-swapfile tries to genrate 2*kcore File, fills /var or / Partition + also noticed 2 spelling mistakes in comments and man page + +2010.05.05 Thu +renamed SWAPFACTOR and MAXSWAP to CONF_*, modified/improved comments there + while at it also allow CONF_MAXSWAP to be undefined, for limitless + this is apparently what the old maintainer wanted to achieve + updated man page with the new CONF_* stuff, and improved descriptions + updated dphys-swapfile.example for /etc/dphys-swapfile to fit program CONF_* +change now kernelupgrade-broken old size estimation, use /proc/meminfo +fix a few typos, overwride -> override (or was that intended as overwrite?) + dphys-config uses override, so use that here also for consistency + allready -> already, overwriding -> overriding, man neccessary -> necessary + also a bit of general code tidy up, newer structures from dphys-config +remade ../dphys-swapfile.tar.gz archive for current state + mail to Axel Beckert for his packaging and site testing +mail answer from Axel Beckert about only integral swap factor problem + switch to using dc instead of expr, as in all my other private scripts + allows CONF_SWAPFACTOR to also hab non integral values, such as 1.5 +report that Debian kFreeBSD predictably fails, on swapon -s + while investigation noticed /etc/fstab comment no linebreaks, fixed it + + ------ project status doing: diff -Nru dphys-swapfile-20061020/Makefile dphys-swapfile-20100506/Makefile --- dphys-swapfile-20061020/Makefile 2006-10-13 13:37:24.000000000 +0000 +++ dphys-swapfile-20100506/Makefile 2006-12-22 13:28:45.000000000 +0000 @@ -1,6 +1,5 @@ -# http://www.phys.ethz.ch/~franklin/Projects/dphys-swapfile/Makefile -# author/generator dphys2 makesrcpackage script - expanded by Neil Franklin, -# last modification/generation 2006.10.13 +# http://neil.franklin.ch/Projects/dphys-swapfile/Makefile +# author Franklin, last modification 2006.12.22 # This Makefile is copyright ETH Zuerich Physics Departement # use under either modified/non-advertising BSD or GPL license @@ -12,7 +11,8 @@ # --- no user configurable stuff below here -PATH=/sbin:/bin:/usr/sbin:/usr/bin +# /usr/local added for Slackware, because self installed stuff ends up in there +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin PREFIX = $(DESTDIR)/usr BINDIR = $(PREFIX)/bin diff -Nru dphys-swapfile-20061020/README dphys-swapfile-20100506/README --- dphys-swapfile-20061020/README 2006-10-20 12:26:12.000000000 +0000 +++ dphys-swapfile-20100506/README 2006-12-22 13:15:36.000000000 +0000 @@ -1,5 +1,5 @@ -http://www.phys.ethz.ch/~franklin/Projects/dphys-swapfile/README -author Neil Franklin, last modification 2006.10.20 +http://neil.franklin.ch/Projects/dphys-swapfile/README +author Neil Franklin, last modification 2006.12.22 This text (and all dphys-swapfile) copyright ETH Zuerich Physics Departement use under either modified/non-advertising BSD or GPL license @@ -43,10 +43,10 @@ Installation There is a installation guide at: -http://www.phys.ethz.ch/~franklin/Projects/dphys-swapfile/INSTALL +http://neil.franklin.ch/Projects/dphys-swapfile/INSTALL Questions There is a FAQ file at: -http://www.phys.ethz.ch/~franklin/Projects/dphys-swapfile/FAQ +http://neil.franklin.ch/Projects/dphys-swapfile/FAQ diff -Nru dphys-swapfile-20061020/debian/README.source dphys-swapfile-20100506/debian/README.source --- dphys-swapfile-20061020/debian/README.source 2013-10-21 20:42:18.000000000 +0000 +++ dphys-swapfile-20100506/debian/README.source 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -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. diff -Nru dphys-swapfile-20061020/debian/bash-completion dphys-swapfile-20100506/debian/bash-completion --- dphys-swapfile-20061020/debian/bash-completion 1970-01-01 00:00:00.000000000 +0000 +++ dphys-swapfile-20100506/debian/bash-completion 2013-02-11 17:10:34.000000000 +0000 @@ -0,0 +1,24 @@ +## Bash completion for the Android SDK tools. +# +# Written by Hans-Christoph Steiner, 2012 +# +# This work is too trival to have any copyright, I hereby wave any copyright +# and release it into the public domain. + +function _dphys_swapfile() +{ + local cur prev opts + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + opts="setup swapon swapoff uninstall" + + if [ ${COMP_CWORD} -eq 1 ]; then + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + return 0 + else + COMPREPLY="" + return 0 + fi +} +complete -o default -F _dphys_swapfile dphys-swapfile diff -Nru dphys-swapfile-20061020/debian/changelog dphys-swapfile-20100506/debian/changelog --- dphys-swapfile-20061020/debian/changelog 2013-10-21 20:42:18.000000000 +0000 +++ dphys-swapfile-20100506/debian/changelog 2013-10-01 18:24:22.000000000 +0000 @@ -1,3 +1,48 @@ +dphys-swapfile (20100506-1) unstable; urgency=low + + * Upload to unstable again. + * New upstream release + + Fixes issues on kfreebsd-*. + * Install bash completion file provided by Hans-Christoph Steiner + (Closes: #685113) Thanks! + * Install upstream's example configuration file also to /etc/. (Closes: + #685169) + * Add note to long description about the default values used upon + installation. (See #596187 for reasoning.) + * Switch to source format "3.0 (quilt)" + + Remove debian/README.source + * Bump Standards-Version to 3.9.4 (no changes) + * Fix lintian warnings: + + debian-rules-missing-recommended-target + + no-upstream-changelog + + copyright-refers-to-symlink-license + + init.d-script-does-not-source-init-functions + + init.d-script-does-not-implement-optional-option status + * Switch Vcs-* headers to GitHub + * Add Elmar to Uploaders. + * Bump debhelper compatibility to 9. + + Update versioned debhelper build-dependency accordingly. + * Revamp debian/rules: + + No more clean stamp files manually, done by dh_clean already + + Use dh_auto_{build,install,clean} + + Finally switch to a minimal dh7 style debian/rules file + * Apply wrap-and-sort. + + -- Axel Beckert Tue, 01 Oct 2013 20:20:40 +0200 + +dphys-swapfile (20100506~current-1) experimental; urgency=low + + * New upstream snapshot + - uses dc instead of expr, so depend on dc + - All patches introduced in the previous upload have been accepted by + upstream (partially being improved, too) within a day and therefore + been removed from the package. Thanks, Neil! + + remove build dependency on quilt, too. + - Fixed spelling error in previous changelog entry. + * Bump Standards-Version to 3.9.1 (no changes) + + -- Axel Beckert Fri, 11 Feb 2011 16:21:47 +0100 + dphys-swapfile (20061020-4) unstable; urgency=low * Fix wrong magnitude in last upload's bugfix for 564466 when @@ -10,7 +55,7 @@ * New maintainer * Removed patch which removed the swapfile size limit (#502200). Without - this patch, the problem described in #564466 would have been so + this patch, the problem described in #564466 wouldn't have been so harmful as it is. * Updated homepage URL * Moved to quilt patch management. New patches: diff -Nru dphys-swapfile-20061020/debian/compat dphys-swapfile-20100506/debian/compat --- dphys-swapfile-20061020/debian/compat 2013-10-21 20:42:18.000000000 +0000 +++ dphys-swapfile-20100506/debian/compat 2013-10-01 17:34:57.000000000 +0000 @@ -1 +1 @@ -7 +9 diff -Nru dphys-swapfile-20061020/debian/control dphys-swapfile-20100506/debian/control --- dphys-swapfile-20061020/debian/control 2013-10-21 20:42:18.000000000 +0000 +++ dphys-swapfile-20100506/debian/control 2013-10-01 18:17:56.000000000 +0000 @@ -2,16 +2,22 @@ Section: admin Priority: optional Maintainer: Axel Beckert -Build-Depends: debhelper (>= 7), quilt +Uploaders: Elmar S. Heeb +Build-Depends: bash-completion, + debhelper (>= 9~) 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 +Standards-Version: 3.9.4 +Vcs-Git: git://github.com/isgphys/dphys-swapfile.git +Vcs-Browser: https://github.com/isgphys/dphys-swapfile Package: dphys-swapfile Architecture: all -Depends: ${misc:Depends} +Depends: dc, + ${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. + . + By default (and hence on installation) it creates swapfile twice as + big as the present RAM amount with an upper limit of 2 GB. diff -Nru dphys-swapfile-20061020/debian/copyright dphys-swapfile-20100506/debian/copyright --- dphys-swapfile-20061020/debian/copyright 2013-10-21 20:42:18.000000000 +0000 +++ dphys-swapfile-20100506/debian/copyright 2013-10-01 17:41:51.000000000 +0000 @@ -34,7 +34,8 @@ 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'. +Public License version 2 can be found in +`/usr/share/common-licenses/GPL-2'. License (BSD): diff -Nru dphys-swapfile-20061020/debian/dirs dphys-swapfile-20100506/debian/dirs --- dphys-swapfile-20061020/debian/dirs 2013-10-21 20:42:18.000000000 +0000 +++ dphys-swapfile-20100506/debian/dirs 2013-02-11 17:10:34.000000000 +0000 @@ -1 +1,2 @@ sbin +etc diff -Nru dphys-swapfile-20061020/debian/init.d dphys-swapfile-20100506/debian/init.d --- dphys-swapfile-20061020/debian/init.d 2013-10-21 20:42:18.000000000 +0000 +++ dphys-swapfile-20100506/debian/init.d 2013-10-01 18:11:28.000000000 +0000 @@ -26,6 +26,8 @@ # RAM size. ### END INIT INFO +. /lib/lsb/init-functions + # get ready to work PATH=/sbin:/bin:/usr/sbin:/usr/bin export PATH @@ -60,8 +62,8 @@ ;; - restart|reload|force-reload) - /bin/echo "No daemon to (force-)re[start|load] in ${NAME}" + restart|reload|force-reload|status) + /bin/echo "No daemon to (force-)re[start|load] or status check in ${NAME}" ;; diff -Nru dphys-swapfile-20061020/debian/install dphys-swapfile-20100506/debian/install --- dphys-swapfile-20061020/debian/install 1970-01-01 00:00:00.000000000 +0000 +++ dphys-swapfile-20100506/debian/install 2013-10-01 17:42:46.000000000 +0000 @@ -0,0 +1 @@ +dphys-swapfile.example etc/ diff -Nru dphys-swapfile-20061020/debian/patches/adapt-source-code-comments-and-output.diff dphys-swapfile-20100506/debian/patches/adapt-source-code-comments-and-output.diff --- dphys-swapfile-20061020/debian/patches/adapt-source-code-comments-and-output.diff 2013-10-21 20:42:18.000000000 +0000 +++ dphys-swapfile-20100506/debian/patches/adapt-source-code-comments-and-output.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -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 - diff -Nru dphys-swapfile-20061020/debian/patches/check-for-empty-or-zero-maxswap.diff dphys-swapfile-20100506/debian/patches/check-for-empty-or-zero-maxswap.diff --- dphys-swapfile-20061020/debian/patches/check-for-empty-or-zero-maxswap.diff 2013-10-21 20:42:18.000000000 +0000 +++ dphys-swapfile-20100506/debian/patches/check-for-empty-or-zero-maxswap.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -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 diff -Nru dphys-swapfile-20061020/debian/patches/fix-spelling-errors.diff dphys-swapfile-20100506/debian/patches/fix-spelling-errors.diff --- dphys-swapfile-20061020/debian/patches/fix-spelling-errors.diff 2013-10-21 20:42:18.000000000 +0000 +++ dphys-swapfile-20100506/debian/patches/fix-spelling-errors.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -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 diff -Nru dphys-swapfile-20061020/debian/patches/series dphys-swapfile-20100506/debian/patches/series --- dphys-swapfile-20061020/debian/patches/series 2013-10-21 20:42:18.000000000 +0000 +++ dphys-swapfile-20100506/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -adapt-source-code-comments-and-output.diff -check-for-empty-or-zero-maxswap.diff -use-meminfo-instead-of-kcore.diff -fix-spelling-errors.diff diff -Nru dphys-swapfile-20061020/debian/patches/use-meminfo-instead-of-kcore.diff dphys-swapfile-20100506/debian/patches/use-meminfo-instead-of-kcore.diff --- dphys-swapfile-20061020/debian/patches/use-meminfo-instead-of-kcore.diff 2013-10-21 20:42:18.000000000 +0000 +++ dphys-swapfile-20100506/debian/patches/use-meminfo-instead-of-kcore.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -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 diff -Nru dphys-swapfile-20061020/debian/rules dphys-swapfile-20100506/debian/rules --- dphys-swapfile-20061020/debian/rules 2013-10-21 20:42:18.000000000 +0000 +++ dphys-swapfile-20100506/debian/rules 2013-10-01 17:49:52.000000000 +0000 @@ -2,50 +2,12 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -include /usr/share/quilt/quilt.make +%: + dh $@ --with bash-completion -configure: configure-stamp -configure-stamp: $(QUILT_STAMPFN) - dh_testdir - touch configure-stamp +override_dh_install: + dh_install + cd debian/dphys-swapfile/etc/ && mv -v dphys-swapfile.example dphys-swapfile -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 +override_dh_installchangelogs: + dh_installchangelogs Logfile diff -Nru dphys-swapfile-20061020/debian/source/format dphys-swapfile-20100506/debian/source/format --- dphys-swapfile-20061020/debian/source/format 2013-10-21 20:42:18.000000000 +0000 +++ dphys-swapfile-20100506/debian/source/format 2013-10-21 20:42:18.302613329 +0000 @@ -1 +1 @@ -1.0 +3.0 (quilt) diff -Nru dphys-swapfile-20061020/dphys-swapfile dphys-swapfile-20100506/dphys-swapfile --- dphys-swapfile-20061020/dphys-swapfile 2006-10-20 11:39:45.000000000 +0000 +++ dphys-swapfile-20100506/dphys-swapfile 2010-05-06 18:52:58.000000000 +0000 @@ -1,39 +1,50 @@ #! /bin/sh # /sbin/dphys-swapfile - automatically set up an swapfile -# author Neil Franklin, last modification 2006.10.20 +# author Neil Franklin, last modification 2010.05.05 # This script is copyright ETH Zuerich Physics Departement, # use under either BSD or GPL license +# this script is intended to be run as root user, usually while booting + + ### ------ configuration for this site + +# --- CONF_* various site dependant user config variables + # where we want the swapfile to be, this is the default CONF_SWAPFILE=/var/swap -# size we want to force it to be, default (empty) gives 2*RAM +# set size to absolute value, leaving empty (default) then uses computed value +# you most likely don't want this, unless you have an special disk situation CONF_SWAPSIZE= +# set size to computed value, this times RAM size, dynamically adapts, +# guarantees that there is enough swap without wasting disk space on excess +CONF_SWAPFACTOR=2 + +# restrict size (computed and absolute!) to maximally this limit +# can be set to empty for no limit, but beware of filled partitions! +# this is/was a (outdated?) 32bit kernel limit (in MBytes), do not overrun it +# but is also sensible on 64bit to prevent filling /var or even / partition +CONF_MAXSWAP=2048 + ### ------ actual implementation from here on # no user settings any more below this point set -e -# get ready to work +# sanitise this place, else some commands may fail 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 -# 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}" @@ -46,28 +57,38 @@ # (re-)size/-generate, fast if no memory size change if [ "${CONF_SWAPSIZE}" = "" ] ; then - # compute automatic optimal size + # no absolute size given, so automatically compute 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`" - # default, without config file overwriding, swap=2*RAM - CONF_SWAPSIZE="`expr "${MEMSIZE}" '*' "${SWAPFACTOR}"`" + # but it actually then fails from AMD64 kernel 2.6.32 onwards + #KCORESIZE="`ls -l /proc/kcore | awk '{ print $5 }'`" + ## make MBytes which rounded down will be exactly 1 too few, so add 1 + #MEMSIZE="`echo "${KCORESIZE} 1048576 / 1 + p q" | dc`" + # so second attempt at finding out physical RAM size, lacks about 10M + # see how long this variant stays usable :-) + MEMTOTAL="`grep '^MemTotal:' /proc/meminfo | awk '{ print $2 }'`" + # make MBytes which rounded down will be about 10 too few, so add 10 + MEMSIZE="`echo "${MEMTOTAL} 1024 / 10 + p q" | dc`" + # compute desired swap size, as factor * RAM + CONF_SWAPSIZE="`echo "${MEMSIZE} ${CONF_SWAPFACTOR} * p q" | dc`" + # remove any fractional MBytes + CONF_SWAPSIZE="`echo "${CONF_SWAPSIZE}" | cut -f 1 -d '.'`" 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_MAXSWAP}" != "" ] ; then + # check for swap size limit and restrict to it + if [ "${CONF_SWAPSIZE}" -gt "${CONF_MAXSWAP}" ] ; then + echo -n ", restricting to config limit: ${CONF_MAXSWAP}MBytes" + CONF_SWAPSIZE="${CONF_MAXSWAP}" + fi fi # we will be later starting, and in between possible deleting/rebuilding - # so deactivate any allready running swapfile, to avoid errors + # so deactivate any already running swapfile, to avoid errors "$0" swapoff @@ -78,17 +99,13 @@ echo -n ", checking existing" # we need bytes for comparing with existing swap file - SWAPBYTES="`expr "${CONF_SWAPSIZE}" '*' 1048576`" + SWAPBYTES="`echo "${CONF_SWAPSIZE} 1048576 * p q" | dc`" FILEBYTES="`ls -l "${CONF_SWAPFILE}" | awk '{ print $5 }'`" # wrong size, get rid of existing swapfile, after remake if [ "${FILEBYTES}" != "${SWAPBYTES}" ] ; then - # updates to this section need duplicating in postrm script - # can not simply make subroutine here and call that from postrm - # as this script is deleted before postrm purge is called - echo -n ": deleting wrong size file (${FILEBYTES})" # deactivate and delete existing file, before remaking for new size @@ -117,16 +134,17 @@ # ensure that only root can read possibly critical stuff going in here chmod 600 "${CONF_SWAPFILE}" - # do not mount swapfile via fstab, because S35mountall.sh is already done - # so just add warning comment line that swapfile is not in fstab - # and so gets mounted by this script + # do not mount swapfile via fstab, because swapfile may only + # be created after partitions are all mounted, not here yet + # so just add warning comment line that swapfile is not in fstab + # and because of this will get mounted by this script # get rid of possibly already existing comment about - # swapfile mounted by this script - grep -v "^# a swapfile" /etc/fstab > /etc/.fstab + # swapfile mounted by this script, to avoid duplicate comments + grep -v "a swapfile is not" /etc/fstab > /etc/.fstab grep -v "${NAME}" /etc/.fstab > /etc/fstab # add new comment about this - echo "# a swapfile is not a swap partition, so no using swapon|off" \ - "from here on, use ${NAME} swap[on|off] for that" >> /etc/fstab + echo "# a swapfile is not a swap partition, no line here" >> /etc/fstab + echo "# use ${NAME} swap[on|off] for that" >> /etc/fstab # and inform the user what we did echo -n " of ${CONF_SWAPSIZE}MBytes" @@ -185,8 +203,8 @@ rm "${CONF_SWAPFILE}" fi - # and get rid of comment about swapfile mounting - grep -v "^# a swapfile" /etc/fstab > /etc/.fstab + # and get rid of now superfluous comment about swapfile mounting + grep -v "a swapfile is not" /etc/fstab > /etc/.fstab grep -v "${NAME}" /etc/.fstab > /etc/fstab ;; diff -Nru dphys-swapfile-20061020/dphys-swapfile.8 dphys-swapfile-20100506/dphys-swapfile.8 --- dphys-swapfile-20061020/dphys-swapfile.8 2006-09-15 15:28:22.000000000 +0000 +++ dphys-swapfile-20100506/dphys-swapfile.8 2010-05-06 18:27:50.000000000 +0000 @@ -1,9 +1,9 @@ .\" /usr/share/man/man8/dphys-swapfile.8(.gz) -.\" author Neil Franklin, last modification 2006.09.15 +.\" author Neil Franklin, last modification 2010.05.05 .\" copyright ETH Zuerich Physics Departement .\" use under either modified/non-advertising BSD or GPL license -.TH DPHYS-SWAPFILE 8 "2006.09.15" "D-PHYS Swapfile Tools" +.TH DPHYS-SWAPFILE 8 "2010.05.05" "D-PHYS Swapfile Tools" .SH NAME @@ -12,23 +12,25 @@ .SH SYNOPSIS .B dphys-swapfile -\fBsetup\fP|\fBswapon\fP|\fBswapoff\fP|\fBuninstall\fP +\fBsetup\fP|\fBinstall\fP|\fBswapon\fP|\fBswapoff\fP|\fBuninstall\fP .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 -delete it if not wanted any more. +existing swap file if necessary), mounts an swap file, unmounts it, and +deletes it it is not wanted any more. .SH OPTIONS There is only one parameter, an command, which can be either of these: .TP .B setup -Tells dphys-swapfile to compute the optimal swap file size and (re-)generate -an fitting swap file. Default it 2 times RAM size. This can be called at boot -time, so the file allways stays the right size for current RAM, or run by hand -whenever RAM size has changed. +and +.B install +Both tell dphys-swapfile to compute the optimal swap file size and +(re-)generate an fitting swap file. Default it 2 times RAM size. This can be +called at boot time, so the file allways stays the right size for current RAM, +or run by hand whenever RAM size has changed. .TP .B swapon and @@ -37,10 +39,10 @@ that direct swapon/off from \fI/etc/fstab\fP is not possible, as that is (at least on Debian) done in the same script that mounts /var (which is where the swap file most likely resides). And we need to do our setup between those -actions. So pass up \fI/etc/fstab\fP, and do our own swapon/off. +actions. So we pass up on \fI/etc/fstab\fP, and do our own swapon/off here. .TP .B uninstall -Gets rid of an unwanted swap file, reclaiming the disk space. +Gets rid of an unwanted swap file, reclaiming its disk space. .SH CONFIG @@ -56,9 +58,23 @@ and then you will most likely be using an swap partition anyway. .TP .B CONF_SWAPSIZE -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. +Set size to this absolute value, in MBytes. Leaving this empty (which is the +Default) uses an computed value as size instead. This is unlikely to ever be +needed, unless in some strange diskspace situations. Note, that swap enabled +and size smaller than RAM may causes kernal-internal VM troubles on some +kernels/systems. +.TP +.B CONF_SWAPFACTOR +Set size to computed value. Uses this value times RAM size. It so dynamically +adapts to RAM size, guarantees enough swap on large RAM, without going into +excess diskspace on small RAM (and disk?) systems. Defaults to 2, which gives +swap size = 2 * RAM size. +.TP +.B CONF_MAXSWAP +Set size restriction of maximal computed and absolute(!) values, in MBytes. +Defaults to 2048 which was a former 32bit kernel limit for the swapfile size +and is now a limit to prevent unusually and senselessly big swap files on +systems with a lot of RAM. .SH FILES @@ -92,7 +108,7 @@ exit 0\! .fi .PP -If an sysadmin wants to have his swapfile in annother place, say /var/run/swap, +If an sysadmin wants to have the swapfile in another place, say /var/run/swap, he can use: .PP In \fI/etc/dphys-swapfile\fP: @@ -102,4 +118,4 @@ .SH AUTHOR -franklin@phys.ethz.ch, http://www.phys.ethz.ch/~franklin/ +neil@franklin.ch, http://neil.franklin.ch/ diff -Nru dphys-swapfile-20061020/dphys-swapfile.example dphys-swapfile-20100506/dphys-swapfile.example --- dphys-swapfile-20061020/dphys-swapfile.example 2006-09-15 15:43:26.000000000 +0000 +++ dphys-swapfile-20100506/dphys-swapfile.example 2010-05-06 18:27:14.000000000 +0000 @@ -1,12 +1,26 @@ # /etc/dphys-swapfile - user settings for dphys-swapfile package -# author Neil Franklin, last modification 2006.09.15 +# author Neil Franklin, last modification 2010.05.05 # copyright ETH Zuerich Physics Departement # use under either modified/non-advertising BSD or GPL license # this file is sourced with . so full normal sh syntax applies +# the default settings are added as commented out CONF_*=* lines + + # where we want the swapfile to be, this is the default #CONF_SWAPFILE=/var/swap -# size we want to force it to be, default (empty) gives 2*RAM +# set size to absolute value, leaving empty (default) then uses computed value +# you most likely don't want this, unless you have an special disk situation #CONF_SWAPSIZE= + +# set size to computed value, this times RAM size, dynamically adapts, +# guarantees that there is enough swap without wasting disk space on excess +#CONF_SWAPFACTOR=2 + +# restrict size (computed and absolute!) to maximally this limit +# can be set to empty for no limit, but beware of filled partitions! +# this is/was a (outdated?) 32bit kernel limit (in MBytes), do not overrun it +# but is also sensible on 64bit to prevent filling /var or even / partition +#CONF_MAXSWAP=2048 diff -Nru dphys-swapfile-20061020/index.html.de dphys-swapfile-20100506/index.html.de --- dphys-swapfile-20061020/index.html.de 2006-10-20 12:30:18.000000000 +0000 +++ dphys-swapfile-20100506/index.html.de 2006-12-22 14:21:19.000000000 +0000 @@ -1,11 +1,11 @@ - + - dphys-swapfile setup/mount script + dphys-swapfile Auto-setup/-activation System + content="neil franklin, dphys-swapfile, Linux, autosetup, swap file"> + content="dphys-swapfile auto-setup/-activation system"> Home | @@ -14,7 +14,7 @@
-

dphys-swapfile Setup/Mount Script

+

dphys-swapfile Auto-setup/-activation System

Project Basics
Project Status
@@ -35,7 +35,10 @@ init.d script that runs this script at boot and shutdown time.

- This project was spawned from the dphys2 project. + This project was spawned from the + dphys2 project + (later replaced and made obsolete by the + dphys3 project). @@ -47,10 +50,11 @@

Done are:

Milestone/Release 4 (2004.02.19):
    -
  • Thsi was still as part of dphys2. Made +
  • This was still as part of + dphys2. Made dphys-swapfile script to automatically - generate/activate/resize an swapfile, default 2*RAM size, and also - deactivate/delete it at the approriate time
  • + generate/resize and activate an swapfile, default 2*RAM size, and also + deactivate and delete it at the approriate times
Milestone/Release 5 (2004.07.29):
    @@ -159,8 +163,8 @@
Milestone/Release 4 (2004.02.19) was done as part of: - dphys2. Milestones/Releases 1-3 of dphys2 predate - dphys-swapfile. + dphys2. + Milestones/Releases 1-3 of dphys2 predate dphys-swapfile. @@ -168,10 +172,13 @@ Various links that may be usefull: @@ -180,6 +187,6 @@ Home | Projects | dphys-swapfile

- This page is by Neil Franklin, last modification 2006.10.20 + This page is by Neil Franklin, last modification 2006.12.22 diff -Nru dphys-swapfile-20061020/index.html.en dphys-swapfile-20100506/index.html.en --- dphys-swapfile-20061020/index.html.en 2006-10-20 12:30:18.000000000 +0000 +++ dphys-swapfile-20100506/index.html.en 2006-12-22 14:21:19.000000000 +0000 @@ -1,11 +1,11 @@ - + - dphys-swapfile setup/mount script + dphys-swapfile Auto-setup/-activation System + content="neil franklin, dphys-swapfile, Linux, autosetup, swap file"> + content="dphys-swapfile auto-setup/-activation system"> Home | @@ -14,7 +14,7 @@


-

dphys-swapfile Setup/Mount Script

+

dphys-swapfile Auto-setup/-activation System

Project Basics
Project Status
@@ -35,7 +35,10 @@ init.d script that runs this script at boot and shutdown time.

- This project was spawned from the dphys2 project. + This project was spawned from the + dphys2 project + (later replaced and made obsolete by the + dphys3 project). @@ -47,10 +50,11 @@

Done are:

Milestone/Release 4 (2004.02.19):
    -
  • Thsi was still as part of dphys2. Made +
  • This was still as part of + dphys2. Made dphys-swapfile script to automatically - generate/activate/resize an swapfile, default 2*RAM size, and also - deactivate/delete it at the approriate time
  • + generate/resize and activate an swapfile, default 2*RAM size, and also + deactivate and delete it at the approriate times
Milestone/Release 5 (2004.07.29):
    @@ -159,8 +163,8 @@
Milestone/Release 4 (2004.02.19) was done as part of: - dphys2. Milestones/Releases 1-3 of dphys2 predate - dphys-swapfile. + dphys2. + Milestones/Releases 1-3 of dphys2 predate dphys-swapfile. @@ -168,10 +172,13 @@ Various links that may be usefull: @@ -180,6 +187,6 @@ Home | Projects | dphys-swapfile

- This page is by Neil Franklin, last modification 2006.10.20 + This page is by Neil Franklin, last modification 2006.12.22 diff -Nru dphys-swapfile-20061020/init.d.example dphys-swapfile-20100506/init.d.example --- dphys-swapfile-20061020/init.d.example 2006-10-13 13:37:43.000000000 +0000 +++ dphys-swapfile-20100506/init.d.example 2006-12-22 13:21:47.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh # /etc/init.d/dphys-swapfile - automatically set up an swapfile -# author Neil Franklin, last modification 2006.10.13 +# author Neil Franklin, last modification 2006.12.22 # This script is copyright ETH Zuerich Physics Departement, # use under either modified/non-advertising BSD or GPL license @@ -13,7 +13,8 @@ # so we run it as rcS.d/S37dphys-config # get ready to work -PATH=/sbin:/bin:/usr/sbin:/usr/bin +# /usr/local added for Slackware, because self installed stuff ends up in there +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin export PATH # what we are