[25708] in Source-Commits
Re: /svn/athena r25185 -
daemon@ATHENA.MIT.EDU (Geoffrey Thomas)
Wed Jun 29 12:56:01 2011
Date: Wed, 29 Jun 2011 12:55:55 -0400 (EDT)
From: Geoffrey Thomas <geofft@MIT.EDU>
To: Jonathan D Reed <jdreed@mit.edu>
cc: source-commits@mit.edu
In-Reply-To: <201106291627.p5TGRVVJ017134@drugstore.mit.edu>
Message-ID: <alpine.DEB.2.00.1106291255430.13891@tyger.mit.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Seems like it'll work. ACK.
--
Geoffrey Thomas
geofft@mit.edu
On Wed, 29 Jun 2011, Jonathan D Reed wrote:
> Author: jdreed
> Date: 2011-06-29 12:27:30 -0400 (Wed, 29 Jun 2011)
> New Revision: 25185
>
> Added:
> trunk/debathena/scripts/installer/pxe/natty/debathena/check-disks.sh
> Modified:
> trunk/debathena/scripts/installer/pxe/natty/debathena/preseed.autoinstall
> Log:
> * Installer now checks for sufficient disk space (Trac: #224)
> * Pick the first disk, bypassing a prompt if there's more than one
> disk in the machine (say, a flash drive was left plugged in)
>
>
> Added: trunk/debathena/scripts/installer/pxe/natty/debathena/check-disks.sh
> ===================================================================
> --- trunk/debathena/scripts/installer/pxe/natty/debathena/check-disks.sh (rev 0)
> +++ trunk/debathena/scripts/installer/pxe/natty/debathena/check-disks.sh 2011-06-29 16:27:30 UTC (rev 25185)
> @@ -0,0 +1,29 @@
> +#!/bin/sh
> +#
> +# This is run by d-i before the partman step (e.g. d-i partman/early_command)
> +
> +MIN_DISK_SIZE=20000000
> +
> +youlose() {
> + chvt 5
> + # Steal STDIN and STDOUT back from the installer
> + exec < /dev/tty5 > /dev/tty5 2>&1
> + echo ""
> + echo "****************************"
> + echo "ERROR: $@"
> + echo "Installation cannot proceed. Press any key to reboot."
> + read foo
> + echo "Rebooting, please wait..."
> + reboot
> +}
> +
> +first_disk=`list-devices disk | head -n1`
> +if ! echo "$first_disk" | grep -q ^/dev; then
> + youlose "No disks found."
> +fi
> +if [ "$(sfdisk -s "$first_disk")" -lt $MIN_DISK_SIZE ]; then
> + youlose "Your disk is too small ($(( $MIN_DISK_SIZE / 1000000)) GB required)."
> +fi
> +# Tell partman which disk to use
> +debconf-set partman-auto/disk "$first_disk"
> +exit 0
>
> Modified: trunk/debathena/scripts/installer/pxe/natty/debathena/preseed.autoinstall
> ===================================================================
> --- trunk/debathena/scripts/installer/pxe/natty/debathena/preseed.autoinstall 2011-06-29 12:45:56 UTC (rev 25184)
> +++ trunk/debathena/scripts/installer/pxe/natty/debathena/preseed.autoinstall 2011-06-29 16:27:30 UTC (rev 25185)
> @@ -31,6 +31,11 @@
>
> ### Partitioning
> # Use the whole disk. Any disk.
> +# No, use the first disk (via a shell script that also does sanity checking
> +d-i partman/early_command string sh /debathena/check-disks.sh
> +# We could also do this to just pick the first disk
> +#d-i partman/early_command string debconf-set partman-auto/disk "$(list-devices disk | head -n1)"
> +
> # The presently available methods are: "regular", "lvm" and "crypto"
> d-i partman-auto/method string lvm
>
>
>