lowmem/0000755000000000000000000000000012176700236007250 5ustar lowmem/partman/0000755000000000000000000000000011515547711010715 5ustar lowmem/partman/init.d/0000755000000000000000000000000011515547711012102 5ustar lowmem/partman/init.d/05lowmem_modules0000755000000000000000000000042511515547711015226 0ustar #!/bin/sh set -e if [ ! -e /var/lib/lowmem ]; then exit 0 fi # Let's not delete anything yet if no discs have been found if [ "$(list-devices disk)" ]; then if cd /lib/modules/*/kernel/drivers; then rm -rf net cdrom ide ieee1394 input scsi usb video parport block fi fi lowmem/debian/0000755000000000000000000000000012176700332010467 5ustar lowmem/debian/lowmemcheck.templates0000644000000000000000000000152311515547711014714 0ustar Template: lowmem/low Type: note # Note: not translatable, runs before language is chosen Description: Entering low memory mode This system has relatively little free memory, so it will enter low memory mode. Among other things, this means that this program will proceed in English. You should set up swap space as soon as possible. Template: lowmem/insufficient Type: error # Note: not translatable, runs before language is chosen Description: Insufficient memory This system does not have enough memory to be supported by this program. At least ${MIN} megabytes of memory are required. If you continue, unpredictable and broken behavior will likely result. You should reboot now and add memory or find some other program to use. Template: lowmem/info Type: title # Note: not translatable, lowmem runs in English Description: Low memory mode lowmem/debian/clean0000644000000000000000000000001611515547711011477 0ustar trimtemplates lowmem/debian/lowmemcheck.install0000644000000000000000000000011411515547711014357 0ustar trimtemplates lowmem_debconf bin main-menu.d debian-installer-startup.d lib lowmem/debian/rules0000755000000000000000000000045212176700125011550 0ustar #! /usr/bin/make -f DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) %: dh $@ ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) override_dh_auto_build: dh_auto_build -- CC=$(DEB_HOST_GNU_TYPE)-gcc endif lowmem/debian/copyright0000644000000000000000000000016411515547711012431 0ustar This package is copyright 2004 by Joey Hess under the terms of the GNU GPL, version 2 or higher. lowmem/debian/lowmem.postinst0000755000000000000000000000131212011213351013560 0ustar #!/bin/sh if [ ! -e /var/lib/lowmem ]; then exit 0 fi for log in syslog messages; do logpath=/var/log/$log [ -s $logpath ] && echo "Log file truncated to save memory." > $logpath # using % in place of / allows us to look for a pattern containing /'s # the [t] stops sed's ps listing from matching it's own pattern pid=$(ps ax | sed -n 's%^[ ]*\([0-9]*\).*[t]ail -f '$logpath'.*%\1%p') if [ -n "$pid" ]; then kill $pid || true fi done rm -rf /usr/share/keymaps \ /usr/share/console-setup-mini/*.ekmap* \ /usr/share/console-setup-mini/*.ekbd* \ /usr/share/console-setup/*.ekmap* \ /usr/share/console-setup/*.ekbd* \ /usr/share/console-setup/keyboard-configuration.config \ /usr/share/consolefonts lowmem/debian/lowmem.templates0000644000000000000000000000033511515547711013716 0ustar # Lowmem mode disables translations, and this is only installed in lowmem # mode, so there is no point in translating this. Template: debian-installer/lowmem/title Type: text Description: Free memory (low memory install) lowmem/debian/source/0000755000000000000000000000000012176700125011767 5ustar lowmem/debian/source/format0000644000000000000000000000001512176700125013176 0ustar 3.0 (native) lowmem/debian/compat0000644000000000000000000000000212176700125011665 0ustar 9 lowmem/debian/control0000644000000000000000000000156012176700152012074 0ustar Source: lowmem Section: debian-installer Priority: optional Maintainer: Ubuntu Installer Team XSBC-Original-Maintainer: Debian Install System Team Uploaders: Christian Perrier Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.9.0) XS-Debian-Vcs-Browser: http://anonscm.debian.org/gitweb/?p=d-i/lowmem.git XS-Debian-Vcs-Git: git://anonscm.debian.org/d-i/lowmem.git Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-core-dev/lowmem/ubuntu Package: lowmemcheck Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, cdebconf-udeb (>= 0.75), main-menu (>= 1.03) Package-Type: udeb Description: detect low-memory systems and enter lowmem mode Package: lowmem Architecture: all Depends: ${misc:Depends} Package-Type: udeb XB-Installer-Menu-Item: 2500 Description: free memory for lowmem install lowmem/debian/changelog0000644000000000000000000005253112176700332012347 0ustar lowmem (1.40ubuntu1) saucy; urgency=low * Resynchronise with Debian. Remaining changes: - Don't install the desktop in lowmem mode. - Even in lowmem mode, leave the framebuffer enabled if vga= is found on the kernel command line. * Move most of lowmem_debconf to happen after the framebuffer is (conditionally) loaded. If the framebuffer is enabled, then we need this to happen later otherwise the initial lowmem warning is invisible. -- Colin Watson Fri, 02 Aug 2013 10:50:14 +0100 lowmem (1.40) unstable; urgency=low [ Samuel Thibault ] * Document that we need to update the figure in the boot help text too. [ Dmitrijs Ledkovs ] * Set debian source format to '3.0 (native)'. * Bump debhelper compat level to 9. * Set Vcs-* to canonical format. -- Christian Perrier Sat, 13 Jul 2013 13:09:07 +0200 lowmem (1.39) unstable; urgency=low [ Colin Watson ] * Use correct compiler when cross-building. -- Christian Perrier Thu, 16 May 2013 17:41:47 +0200 lowmem (1.38) unstable; urgency=low [ Steven Chamberlain ] * Update lowmem limit for kfreebsd; make sure we have enough memory to manage ZFS volumes (Closes: #696786). -- Christian Perrier Wed, 02 Jan 2013 22:33:30 +0100 lowmem (1.37) unstable; urgency=low [ Samuel Thibault ] * Make lowmem limit comments point at where the manual also needs update. -- Christian Perrier Sat, 22 Dec 2012 14:56:25 +0100 lowmem (1.36ubuntu1) raring; urgency=low * Merge from Debian unstable. Remaining changes: - Don't install the desktop in lowmem mode. - Even in lowmem mode, leave the framebuffer enabled if vga= is found on the kernel command line. -- Logan Rosen Mon, 19 Nov 2012 21:00:14 -0500 lowmem (1.36) unstable; urgency=low [ Samuel Thibault ] * Update lowmem limits. -- Christian Perrier Tue, 18 Sep 2012 06:52:37 +0200 lowmem (1.35ubuntu2) quantal; urgency=low * Even in lowmem mode, leave the framebuffer enabled if vga= is found on the kernel command line. -- Colin Watson Fri, 28 Sep 2012 14:11:37 +0100 lowmem (1.35ubuntu1) quantal; urgency=low * Resynchronise with Debian. Remaining changes: - Don't install the desktop in lowmem mode. -- Colin Watson Fri, 10 Aug 2012 15:14:04 +0100 lowmem (1.35) unstable; urgency=low * Team upload [ Samuel Thibault ] * Remove more big files from console-setup. [ Christian Perrier ] * Remplace XC-Package-Type by package-Type * Add an override for "not-using-debconf". We know what we're doing, pal! -- Christian Perrier Sat, 07 Jul 2012 21:56:31 +0200 lowmem (1.34ubuntu1) precise; urgency=low * Resynchronise with Debian. Remaining changes: - Don't install the desktop in lowmem mode. -- Colin Watson Mon, 17 Oct 2011 11:59:18 +0100 lowmem (1.34) unstable; urgency=low [ Hector Oron ] * debian-installer-startup.d/S15lowmem: - add armhf support [ Philipp Kern ] * debian-installer-startup.d/S15lowmem: - add s390x support * debian/control: add ${misc:Depends} -- Philipp Kern Tue, 04 Oct 2011 13:49:14 +0200 lowmem (1.33ubuntu1) natty; urgency=low * Resynchronise with Debian. Remaining changes: - Don't install the desktop in lowmem mode. -- Colin Watson Sat, 13 Nov 2010 13:34:39 +0000 lowmem (1.33) unstable; urgency=low [ Samuel Thibault ] * Update minimal memory values for armel, i386 and amd64, mark others as needing update. -- Otavio Salvador Fri, 12 Nov 2010 14:38:27 -0200 lowmem (1.32ubuntu1) maverick; urgency=low * Resynchronise with Debian. Remaining changes: - Don't install the desktop in lowmem mode. -- Colin Watson Thu, 27 May 2010 08:54:51 +0100 lowmem (1.32) unstable; urgency=low [ Colin Watson ] * Upgrade to debhelper v7. * Add ${shlibs:Depends} to lowmemcheck. [ Frans Pop ] * Remove no longer needed Lintian override for missing Standards- Version field. [ Aurelien Jarno ] * Add memory values for sh4. -- Aurelien Jarno Wed, 12 May 2010 22:25:16 +0200 lowmem (1.31ubuntu2) lucid; urgency=low * rebuild rest of main for armel armv7/thumb2 optimization; UbuntuSpec:mobile-lucid-arm-gcc-v7-thumb2 -- Alexander Sack Sun, 07 Mar 2010 00:56:20 +0100 lowmem (1.31ubuntu1) karmic; urgency=low * Resynchronise with Debian. Remaining changes: - Don't install the desktop in lowmem mode. -- Colin Watson Mon, 15 Jun 2009 13:33:41 +0100 lowmem (1.31) unstable; urgency=low [ Colin Watson ] * Clean up keymaps and fonts from console-setup as well as console-data's keymaps. [ Frans Pop ] * Remove myself as uploader. -- Christian Perrier Thu, 11 Jun 2009 22:11:59 +0200 lowmem (1.30ubuntu1) jaunty; urgency=low * Resynchronise with Debian. Remaining changes: - Don't install the desktop in lowmem mode. -- Colin Watson Wed, 05 Nov 2008 12:55:14 +0000 lowmem (1.30) unstable; urgency=low [ Jérémy Bobbio ] * Document the procedure on how to update lowmem levels in README. Credits to Frans Pop for explaining this on the mailing-list. -- Otavio Salvador Tue, 23 Sep 2008 21:32:31 -0300 lowmem (1.29) unstable; urgency=low [ Frans Pop ] * Update lowmem levels for i386 and set separate lowmem levels for amd64. Based on daily netinsts d.d. 30-04-2008 using 2.6.24. -- Otavio Salvador Thu, 08 May 2008 13:23:27 -0300 lowmem (1.28ubuntu1) intrepid; urgency=low * Resynchronise with Debian. Remaining changes: - Don't install the desktop in lowmem mode. -- Colin Watson Tue, 06 May 2008 18:05:00 +0100 lowmem (1.28) unstable; urgency=low * Fix regression so that error is displayed when available memory is below the minimum limit. -- Frans Pop Wed, 02 Apr 2008 15:29:15 +0200 lowmem (1.27ubuntu1) hardy; urgency=low * Resynchronise with Debian. Remaining changes: - Don't install the desktop in lowmem mode. * Add XS-Vcs-Bzr for Ubuntu branch. -- Evan Dandrea Fri, 23 Nov 2007 12:53:05 -0500 lowmem (1.27) unstable; urgency=low [ Frans Pop ] * Allow user to override the lowmem level by specifying a parameter "lowmem" at the boot prompt. Only a level higher than the default is observed. [ Joey Hess ] * Change i386 lowmem to below 48 mb. Needs new cdebconf with template trimming code. (The cutoff point for lowmem level 2 does not change.) -- Jérémy Bobbio Thu, 27 Sep 2007 18:37:50 +0200 lowmem (1.26ubuntu1) gutsy; urgency=low * Resynchronise with Debian. Remaining changes: - Tweak lowmem levels for Ubuntu. - Don't install the desktop in lowmem mode. * Partly revert to updated Debian lowmem levels for now. Need to retest for Ubuntu. -- Colin Watson Thu, 26 Apr 2007 22:39:56 +0100 lowmem (1.26) unstable; urgency=low * Multiply menu-item-numbers by 100 -- Joey Hess Tue, 10 Apr 2007 14:32:28 -0400 lowmem (1.25) unstable; urgency=low [ Joey Hess ] * Add armel lowmem level. Should be close to the same as arm. [ Steve Langasek ] * Add alpha lowmem level. Closes: #410596. -- Frans Pop Wed, 21 Feb 2007 10:10:38 +0100 lowmem (1.24) unstable; urgency=low [ Martin Michlmayr ] * Make sure that SGI machines with 64 MB of RAM don't run in lowmem mode. Closes: #405971. [ Frans Pop ] * Update lowmem levels for x86 for Etch RC2 as tested in VMware. -- Frans Pop Wed, 24 Jan 2007 02:20:24 +0100 lowmem (1.23ubuntu2) feisty; urgency=low * Set Maintainer to ubuntu-installer@lists.ubuntu.com. -- Colin Watson Thu, 15 Mar 2007 00:37:48 +0000 lowmem (1.23ubuntu1) feisty; urgency=low * Resynchronise with Debian. Remaining changes: - Tweak lowmem levels for Ubuntu. - Don't install the desktop in lowmem mode. -- Colin Watson Tue, 19 Dec 2006 16:36:57 +0000 lowmem (1.23) unstable; urgency=low * trimtemplates: don't remove "Choices-C" from templates. Closes: #400263. * Add myself to uploaders. -- Frans Pop Sun, 10 Dec 2006 03:23:38 +0100 lowmem (1.22ubuntu1) feisty; urgency=low * Resynchronise with Debian. Remaining changes: - Tweak lowmem levels for Ubuntu. - Don't install the desktop in lowmem mode. -- Colin Watson Thu, 7 Dec 2006 12:55:46 +0000 lowmem (1.22) unstable; urgency=low * Installations on ARM and MIPS with 32 MB require lowmem level 2. * Installations on ARM and MIPS with 64 MB should not need lowmem. -- Martin Michlmayr Sun, 26 Nov 2006 11:44:34 +0100 lowmem (1.21ubuntu1) feisty; urgency=low * Resynchronise with Debian. Remaining changes: - Tweak lowmem levels for Ubuntu. - Don't install the desktop in lowmem mode. * Update preseeding (archive-copier is obsolete, and pkgsel/install-pattern is superseded by tasksel/first). -- Colin Watson Wed, 22 Nov 2006 11:42:58 +0000 lowmem (1.21) unstable; urgency=low [ Colin Watson ] * Use list-devices to discover whether any discs have been found. Requires di-utils 1.33. [ Frans Pop ] * Remove standards-version and add Lintian override for it. -- Frans Pop Sat, 16 Sep 2006 11:42:29 +0200 lowmem (1.20) unstable; urgency=low [ Martin Michlmayr ] * Level1 installations work again on ARM with 32 MB RAM thanks to the temporary removal of crypto modules. [ Frans Pop ] * Assume amd64 needs similar limits as i386. * Update lowmem settings for Etch Beta 3; settings are somewhat conservative and can hopefully be lowered again in the future. Main culprit for increased memory usage is the number of supported languages which also explains the large differences between level 1 and 2 limits. -- Frans Pop Mon, 31 Jul 2006 13:33:05 +0200 lowmem (1.19) unstable; urgency=low [ Philip Hands ] * get rid of a couple of redundant greps from the postinst * don't bother "truncating" already empty log files [ Martin Michlmayr ] * Increase level2 on ARM. -- Martin Michlmayr Wed, 12 Jul 2006 21:45:28 +0200 lowmem (1.18ubuntu2) edgy; urgency=low * Backport from trunk: - Use list-devices to discover whether any discs have been found. Requires di-utils 1.33. -- Colin Watson Tue, 29 Aug 2006 11:06:15 +0100 lowmem (1.18ubuntu1) edgy; urgency=low * Resynchronise with Debian. -- Colin Watson Mon, 3 Jul 2006 11:36:19 +0100 lowmem (1.18) unstable; urgency=low * Do not delete modules when partman is started if no discs have been found yet. This allows the user to go back to anna to load additional module udebs and run hw-detect again without having to find out that core modules have already been deleted. * Standards-version is not required for udebs. -- Frans Pop Wed, 21 Jun 2006 13:41:21 +0200 lowmem (1.17) unstable; urgency=low * Change limits for level2 and minimum for i386. Level2 is needed below 44MB * Add a Standards field in control. Shut up, lintian -- Christian Perrier Thu, 19 Jan 2006 19:33:37 +0100 lowmem (1.16ubuntu1) dapper; urgency=low * Resynchronise with Debian. * Tweak lowmem levels for Ubuntu (closes: Malone #18870, #28286). 68MB works for a normal install; 52MB works in lowmem level1; 32MB works in lowmem level2. Only tested for i386 so far. -- Colin Watson Wed, 18 Jan 2006 14:42:46 +0000 lowmem (1.16) unstable; urgency=low * Move anna-install lowmem to after rootskel has loaded debconf templates; anna-install requires a functional debconf and will fail to install lowmem otherwise. -- Colin Watson Wed, 18 Jan 2006 13:38:23 +0000 lowmem (1.15) unstable; urgency=low * Fix syntax error introduced in last upload. -- Martin Michlmayr Mon, 16 Jan 2006 01:33:41 +0000 lowmem (1.14) unstable; urgency=low * Add armeb lowmem levels. -- Martin Michlmayr Sat, 14 Jan 2006 23:09:42 +0000 lowmem (1.13) unstable; urgency=low * Add arm lowmem levels (based on Linksys NSLU2). -- Martin Michlmayr Sat, 14 Jan 2006 10:37:43 +0000 lowmem (1.12ubuntu1) dapper; urgency=low * Resynchronise with Debian. * Adjust preseeding for new pkgsel question names. -- Colin Watson Mon, 2 Jan 2006 01:01:42 +0000 lowmem (1.12) unstable; urgency=low [ Sylvain Ferriol ] * Optimize trimtemplates.c * Add a script to trimtemplate before debconf_loadtemplate [ Joey Hess ] * Rename the debian-installer-startup.d scripts for clarity. * Misc cleanups. * Remove svn exclusion stuff in rules file; if building from a svn checkout you should use standard workarounds to avoid svn directories. * Clean up kernel fuzz in minimum memory checking. * Update mipsel lowmem levels to match the numbers in the changelog for 1.07. [ Christian Perrier ] * Set the locale to C in lowmem mode. Closes: #341540 (with localechooser 0.24) * Add self to Uploaders -- Christian Perrier Mon, 5 Dec 2005 18:51:27 +0100 lowmem (1.11ubuntu1) breezy; urgency=low * Resynchronise with Debian. -- Colin Watson Thu, 22 Sep 2005 11:00:20 +0100 lowmem (1.11) unstable; urgency=low * Fix preseeding of localechooser by using db_fset to set debian-installer/locale as seen Closes: #329175 * Avoid installing .svn directories in /lib (well, mostly cosmectic) -- Christian Perrier Tue, 20 Sep 2005 18:12:08 +0200 lowmem (1.10ubuntu2) breezy; urgency=low * Make main-menu.d/5lowmem executable again (closes: Ubuntu #13397). -- Colin Watson Fri, 12 Aug 2005 13:43:23 +0100 lowmem (1.10ubuntu1) breezy; urgency=low * Resynchronise with Debian. -- Colin Watson Tue, 19 Jul 2005 18:36:59 +0100 lowmem (1.10) unstable; urgency=low * Mark debian-installer/locale seen to properly preseed it and avoid the localechooser questions being asked. -- Joey Hess Mon, 20 Jun 2005 22:28:00 -0400 lowmem (1.09) unstable; urgency=low * Joey Hess - Modify control file priority to match overrides. - Update preseeding for localechooser. -- Joey Hess Sat, 11 Jun 2005 14:53:23 -0400 lowmem (1.08) unstable; urgency=low * Joey Hess - Try to reword the templates to avoid referring to installation, since the system may be used in rescue mode. - Set a "low memory mode" info message (rescue mode comes after and beats this message). Requires cdebconf-udeb 0.75 and main-menu 1.03. -- Joey Hess Thu, 5 May 2005 10:58:37 -0400 lowmem (1.07ubuntu1) breezy; urgency=low * Resynchronise with Debian. * Update preseeding to force server-style installation. -- Colin Watson Fri, 15 Apr 2005 17:19:03 +0100 lowmem (1.07) unstable; urgency=low * Thiemo Seufer - Ajust memory usage values for mips. - Exclude .svn directories from build. * Martin Michlmayr - Test and update Cobalt (mipsel): 36+ real memory: no lowmem, 25-35: lowmem 1, 22-24: lowmem 2. -- Thiemo Seufer Mon, 14 Feb 2005 01:02:18 +0100 lowmem (1.06ubuntu1) hoary; urgency=low * In lowmem mode, default ubuntu/install-type to custom; GNOME won't be usable anyway. -- Colin Watson Wed, 1 Dec 2004 11:29:42 +0000 lowmem (1.06) unstable; urgency=low * Joey Hess - Preseed countrychooser/shortlist, needed due to preseeding change in countrychooser. Closes: #277493 -- Joey Hess Wed, 20 Oct 2004 13:13:34 -0400 lowmem (1.05) unstable; urgency=low * Joey Hess - Add a keymap file removal hack, post-anna. - Add partman hook and module removal hack. - i386 can run in lowmem level 1 for 32 mb installs again. -- Joey Hess Fri, 1 Oct 2004 17:01:18 -0400 lowmem (1.04) unstable; urgency=low * Frans Pop - Template name change in countrychooser: country-name-shortlist -> shortlist -- Joey Hess Mon, 27 Sep 2004 20:46:12 -0400 lowmem (1.03) unstable; urgency=low * Martin Michlmayr - Set level2 and min values for mipsel (Cobalt). * Bastian Blank - Set values for s390. -- Joey Hess Mon, 6 Sep 2004 20:27:36 -0400 lowmem (1.02) unstable; urgency=low * Joey Hess - Add Sylvain Ferriol's lowmem level patch. - Modifed to store the level in /var/lib/lowmem. Level 1 is default lowmem mode, level 2 is super lowmem mode. The file still doesn't exist in non-lowmem mode. - Documented this. - Add error message if the machine doesn't have even the minimum supported memory. Closes: #266984 -- Joey Hess Fri, 27 Aug 2004 16:12:07 -0400 lowmem (1.01) unstable; urgency=low * Bastian Blank - Move script into startup code to follow rootskel changes. Needs rootskel 0.89. * Joey Hess - Patch from Bubulle to hack in non-removal of -en "translations". Closes: #245166 -- Joey Hess Tue, 17 Aug 2004 16:28:55 +0100 lowmem (1.00) unstable; urgency=low * Thiemo Seufer - Increase userspace RAM trigger for mips to 33 MB. -- Joey Hess Thu, 29 Jul 2004 23:31:55 -0400 lowmem (0.14) unstable; urgency=low * Martin Michlmayr - Before running the "kill" command, check whether there is actually any suitable "tail" process to kill; otherwise the postinst will fail when there is no such process which is always the case in serial console installs and might be the case when the postinst is run twice. Closes: #260949 - Also, be super cautious and use kill $pid || true because there is the possibilty for a race occuring; thanks, Joey Hess. - Increase needed ram on mipsel from 25 to 33: installations on Cobalt machines without lowmem do not work with 32 MB but work with 36 MB, so enable lowmem when less than 36 MB are found. (Machines with 35 MB RAM are shown to have 32, 32 MB are shown as 29, so pick 33 for needed ram.) -- Martin Michlmayr Fri, 23 Jul 2004 16:04:27 +0100 lowmem (0.13) unstable; urgency=low * Fixes for when countrychooser is not installed, as in a floppy install, and for general robustness if other debconf questions are missing. Closes: #260628 -- Joey Hess Wed, 21 Jul 2004 20:05:54 -0400 lowmem (0.12) unstable; urgency=low * Move the stuff in S31lowmem to S10lowmem, so it runs before the code that decides whether to enable framebuffer. I think this code moved during recent rootskel changes. -- Joey Hess Tue, 20 Jul 2004 18:19:50 -0400 lowmem (0.11) unstable; urgency=low * Rebuild without .svn directory in deb. Closes: #256953 -- Joey Hess Wed, 30 Jun 2004 11:19:05 -0400 lowmem (0.10) unstable; urgency=low * Put back the code coping with recent languagechooser changes Closes: #254631 -- Christian Perrier Wed, 16 Jun 2004 07:17:25 +0200 lowmem (0.9) unstable; urgency=low * Re-upload, 0.8 release was botched. -- Joey Hess Fri, 11 Jun 2004 13:11:38 -0400 lowmem (0.8) unstable; urgency=low * Joey Hess - Languagechooser has been reverted back to old behavior, follow suite. * Stephen R. Marenka - Add m68k minimum ram. * Joey Hess - Typo fix. Closes: #247934 * Sylvain Ferriol - To be compliant with new languagechooser/language-name template -- Joey Hess Fri, 11 Jun 2004 12:32:02 -0400 lowmem (0.6) unstable; urgency=low * Print a message before running expensive trimtemplates operation at boot time. -- Joey Hess Thu, 29 Apr 2004 22:25:31 -0400 lowmem (0.5) unstable; urgency=HIGH * Don't always nuke all translations; test for flag file when operating on single files too. Closes: #245418 -- Joey Hess Fri, 23 Apr 2004 00:00:18 -0400 lowmem (0.4) unstable; urgency=low * Sylvain Ferriol - To be compliant with the previous trimtemplates in shell, trimtemplates can have directory or file as argument. * Joey Hess - Converted to use MemTotal, which will work with thre 2.4 and 2.6 kernels. - Don't crash the boot process if the free memory cannot be detected. -- Joey Hess Sat, 27 Mar 2004 01:11:03 -0500 lowmem (0.3) unstable; urgency=low * Sylvain Ferriol - Re-code trimtemplates in C. * Joey Hess - Clean the binary. - lowmemcheck is binary any, not all. - Build it in in binary-arch. - Buils -Os. -- Joey Hess Tue, 23 Mar 2004 20:46:09 -0500 lowmem (0.2) unstable; urgency=low * Thiemo Seufer - Make amount of memory for lowmem installs arch-dependent. -- Joey Hess Mon, 22 Mar 2004 15:14:42 -0500 lowmem (0.1) unstable; urgency=low * First release. 32 mb installs work again on i386 with this package. -- Joey Hess Mon, 8 Mar 2004 13:31:36 -0500 lowmem/debian/lowmem.install0000644000000000000000000000001411515547711013360 0ustar partman lib lowmem/Makefile0000644000000000000000000000014111515547711010707 0ustar CC = gcc CFLAGS = -Wall -Os trimtemplates: trimtemplates.c ${CC} ${CFLAGS} -o trimtemplates $^ lowmem/debian-installer-startup.d/0000755000000000000000000000000012176700125014404 5ustar lowmem/debian-installer-startup.d/S15lowmem0000644000000000000000000000572012176700125016124 0ustar ram=$(grep ^MemTotal: /proc/meminfo | { read x y z; echo $y; }) || true # in kilobytes if [ -z "$ram" ]; then echo "Cannot determine system memory, skipping lowmem probe" >&2 else ram=$(expr $ram / 1024) # convert to megabytes # See README in lowmem source on how to update these levels # Also update the values in the installation manual, in # build/arch-options/ # Also update the gtk values in rootskel, S60frontend # Also update the values in debian-installer/build/boot/x86/f2.txt ARCH=$(udpkg --print-architecture) case $ARCH in alpha) # Update needed level1=82 level2=55 min=39 ;; amd64) level1=97 # MT=98352, qemu: -m 105 level2=97 # MT=98352, qemu: -m 105 min=82 # MT=82992, qemu: -m 90 ;; arm|armel|armhf) level1=76 # MT=77036, qemu: -m 80 level2=76 # MT=77036, qemu: -m 80 min=27 # MT=27316, qemu: -m 31 ;; armeb) # Update needed level1=32 # MT=32792, qemu: -m 36 level2=21 min=18 ;; i386) level1=90 # MT=91480, qemu: -m 95 level2=90 # MT=91480, qemu: -m 95 min=75 # MT=76248, qemu: -m 80 ;; mips) level1=78 # MT=79788, qemu: -m 85 level2=78 # MT=79788, qemu: -m 85 min=27 # MT=27004, qemu: -m 33 ;; mipsel) level1=78 # MT=79788, qemu: -m 85 level2=74 # MT=74760, qemu: -m 80 min=27 # MT=27004, qemu: -m 33 ;; m68k) # Update needed level1=64 level2=32 min=0 #FIXME ;; s390|s390x) # Update needed level1=44 # needs MAINSIZE=48 in Hercules level2=28 min=20 ;; sh4) # Update needed level1=41 level2=36 min=28 ;; kfreebsd-amd64) # Please see #696786 for how these were chosen level1=134 # MT=138136, qemu: -m 224 level2=134 # MT=138136, qemu: -m 224 min=38 # MT=39444, qemu: -m 128 ;; kfreebsd-i386) # Please see #696786 for how these were chosen level1=39 # MT=40020, qemu: -m 96 level2=39 # MT=40020, qemu: -m 96 min=23 # MT=23636, qemu: -m 80 ;; hurd-i386) level1=349 # MT=358392, qemu: -m 350 level2=349 # MT=358392, qemu: -m 350 min=349 # MT=358392, qemu: -m 350 ;; *) level1=64 level2=32 min=0 #FIXME ;; esac use_level=0 if [ $ram -lt $min ]; then use_level=9 elif [ $ram -lt $level2 ]; then use_level=2 elif [ $ram -lt $level1 ]; then use_level=1 fi # Check for lowmem level set by user; only 1 and 2 supported # We cannot use preseeding yet, so parse /proc/cmdline directly user_level=$(grep "lowmem=[12]" /proc/cmdline | \ sed "s/^.*lowmem=\([0-9]*\).*$/\1/") if [ "$user_level" ] && [ $user_level -gt $use_level ]; then logger -t lowmem "Using $user_level instead of default level $use_level" use_level=$user_level fi if [ $use_level -gt 0 ]; then logger -t lowmem "Entering low memory mode" if [ $use_level -le 2 ]; then echo $use_level > /var/lib/lowmem else echo 2 > /var/lib/lowmem # 4 mb fuzz for kernel echo "$(($min + 4))" > /var/lib/lowmem_insufficient fi trimtemplates /var/lib/dpkg/info || true fi fi lowmem/debian-installer-startup.d/S50lowmemwarn0000644000000000000000000000034611515547711017020 0ustar if [ -e /var/lib/lowmem ]; then anna-install lowmem if [ -e /var/lib/lowmem_insufficient ]; then min=`cat /var/lib/lowmem_insufficient` lowmem_debconf lowmem/insufficient "$min" else lowmem_debconf lowmem/low "" fi fi lowmem/debian-installer-startup.d/S38lowmem-framebuffer0000644000000000000000000000013712032355036020406 0ustar if [ -e /var/lib/lowmem ]; then anna-install lowmem lowmem_debconf --disable-framebuffer fi lowmem/lowmem_debconf0000755000000000000000000000173312032355030012147 0ustar #!/bin/sh . /usr/share/debconf/confmodule if [ "x$1" = "x--disable-framebuffer" ]; then vga= for arg in $(cat /proc/cmdline); do case $arg in vga=*) vga="${arg#vga=}" ;; esac done if [ -z "$vga" ]; then db_set debian-installer/framebuffer false || true fi exit 0 fi template="$1" min="$2" db_info lowmem/info db_title "Low memory" db_subst "$template" MIN "$min" db_input critical "$template" || true db_go || true for var in debian-installer/locale; do if ! db_get $var; then db_register debian-installer/dummy $var || true fi done db_set debian-installer/locale "C" || true db_fset debian-installer/locale seen true set_question () { if ! db_fget "$1" seen; then db_register debian-installer/dummy "$1" db_subst "$1" ID "$1" db_fget "$1" seen fi if [ "$RET" = false ]; then db_set "$1" "$2" db_fset "$1" seen true fi } # GNOME's not going to run anyway. set_question tasksel/first '' set_question pkgsel/install-language-support false lowmem/trimtemplates.c0000644000000000000000000000614711515547711012321 0ustar #include #include #include #include #include #define STATUS_FILE "/var/lib/lowmem" #define TEMPLATE_FILE_EXTENSION ".templates" #define TEMPLATE_LINE_MAX_LENGTH 10000 /* languagechooser/country-name is * very very long */ #define FILENAME_LENGTH 256 #define TAG_LENGTH 30 #define LANG_TO_KEEP "en" char tags_to_remove[][TAG_LENGTH] = { "Default-", "Description-", "Choices-", "Indices-" }; int trimtemplate(char *filename) { int ignore = 0; FILE *fd = NULL; FILE *tmpfd = NULL; char template_line[TEMPLATE_LINE_MAX_LENGTH]; char tmpfilename[FILENAME_LENGTH]; int i=0; int nbr_tags = sizeof(tags_to_remove)/TAG_LENGTH; char tag_to_keep[TAG_LENGTH]; if ((fd = fopen(filename, "r")) == NULL) { perror("unable to open template file"); return 0; } snprintf(tmpfilename, FILENAME_LENGTH,"%s.%s", filename,"tmp"); if ((tmpfd = fopen(tmpfilename, "w")) == NULL) { perror("unable to open temp file"); return 0; } ignore = 0; /* parse template file */ while (fgets(template_line, TEMPLATE_LINE_MAX_LENGTH, fd) != NULL) { if (ignore == 1 && strstr(template_line, " ") == template_line) { continue; } ignore = 0; for( i=0; id_name, TEMPLATE_FILE_EXTENSION) != NULL) { snprintf(abs_path_file_name, FILENAME_LENGTH,"%s/%s",dir,dit->d_name); if (trimtemplate(abs_path_file_name) == 0) { return 0; } } } if (closedir(dip) == -1) { return 0; } return 1; } if (S_ISREG(buf.st_mode)) { char *filename = NULL; filename = argv[1]; if (trimtemplate(filename) == 0) { return 0; } return 1; } return 0; } lowmem/README0000644000000000000000000001365712176700002010133 0ustar This package is, frankly, a collection of hacks, hung on a reasonable framework to which you can add more hacks to save memory. The memory saving hacks are divided into four groups, which run at different times: initialisation, post anna run, and pre partitioning. Initialisation hacks are in the debian-installer-startup.d/*lowmem script, in the lowmemcheck package. The is what decides if the system is low on memory, and it creates /var/lib/lowmem as a flag indicating the system should be in lowmem mode. Other hacks test for this file. There are actually different low memory levels, as determined by the number in the file. 1 is standard low memory mode, 2 turns on additional lowmem hacks that can make the installation more difficult for the user. Post anna run hacks are in the lowmem package, which is queued for install by anna on lowmem systems, and provides a menu item. Pre partitioning hacks are also in the lowmem package, and are run as the partitioner is starting up. Current hacks: disable framebuffer Running w/o framebuffer saves lots of memory. The unifont.bgf is also removed, saving much ram. remove translations, force English Happens at both init, and also trimtemplates is called by udpkg when unpacking packages. Saves a significant, but not huge amount of memory. (Used to save more, but cdebconf has gotten pretty good at dropping unused translations on its own.) truncate log files Happens after anna run. By now the log files may be rather large, and so this truncates them and restarts the tails. Saves a few hundred K of memory, at the expense of diagnostics. remove debconf templates after load This is done at initialisation by rootskel. After initialisation, udpkg takes care of it. It's not in lowmem, because this is a safe, simple trick that's worth doing on even systems with lots of memory. Saves a few hundred K of memory. allow user more control over what udebs are loaded This hack is enabled in level 2 lowmem mode. It makes anna not install standard priority udebs by default, and the user can choose which to install. Careful selection by the user can allow for installs with as little as 24 mb of memory. remove all keymaps After keyboard is selected, not needed. Done post-anna. remove selected modules Pre partitioning, only kernel modules for filesystems, raid, lvm, and the like are needed anymore. This hack deletes some other modules to save memory. This frees up several megabytes for the partitioner to run in, but unfortunately runs too late (after all these udebs are unpacked to the initrd) to reduce the overall amount of memory needed to install by more than the memory footprint of the partitioner. Therefore, removing even more modules at this point is not likely to help save any more memory. Possible future hacks: remove locale definition Removing /usr/lib/locale might be worth it. If done after the main cdebconf is running, we should not even notice this 300k of stuff is gone, unless cdebconf is started on another VT or the like. It does cause cdebconf to not display borders properly and some other display ugliness for wide characters. progressive udeb installation Anna can install udebs on demand, so use this to defer loading some udebs until we know we need them, and particularly until after partitioning has enabled swap. For example, have os-prober only load its kernel module udebs on demand. find swap partitions and auto-swapon Try to scan disks for existing swap partitions and swapon. This will make later partitioning a bit more difficult, and requires a previous install. let user choose a partition to use as swap Scan disks for existing small-ish partitions, list them, and offer to turn them into swap space. Updating lowmem levels ---------------------- To update the various lowmem levels, the process is to perform installations with tight memory constraints. If the installer does not crash before the base system installation, the amount of memory can be considered fine for the lowmem level being tested. To limit the amount of available memory for an installations, this can be either done by specifying emulator settings (e.g. qemu -m option) or by booting the kernel with the 'mem=...' option (which will work for real machines). The levels are set in debian-installer-startup.d/S15lowmem. In order to test lower limits than currently allowed, parameters can be changed by booting with BOOT_DEBUG=3 and modifying the values before the installer starts. The level1 value should be set to the lowest amount of memory that will support an install not in lowmem mode. (This is the max memory footprint of the installer in non lowmem mode up to running the partitioner and swapon.) Use Portuguese as language (because that will ask for country and timezone) and choose Guided partitioning with all partitions separate to test this! The level2 value should be set to the lowest amount of memory that will support an install in lowmem mode. (This is the max memory footprint of the installer in lowmem mode up to running the partitioner and swapon.) Again, choose Guided partitioning with all partitions separate. The distinction between these two levels are extremely minimal since all unused debconf translations are dropped after anna. In most cases, the two levels can probably be set to the same value. Exception is when an architecture uses DEBCONF_DROP_TRANSLATIONS=0. This can be necessary for installs where running languagechooser is postponed (as is currently the case for installs to arm NAS devices). In both cases, you need to set min to absolute minimum amount of memory needed for an install. Ideally, constraints should be tested for both netboot and businesscard images (businesscard CD will use slightly more memory before partitioning that netinst because of mirror selection). NB: the minimum memory required to run the graphical installer must also be tested. See rootskel (debian-installer.d/S60frontend). lowmem/main-menu.d/0000755000000000000000000000000011515547711011363 5ustar lowmem/main-menu.d/5lowmem0000755000000000000000000000014311515547711012674 0ustar #! /bin/sh . /usr/share/debconf/confmodule if [ -e /var/lib/lowmem ]; then db_info lowmem/info fi