source: trunk/debathena/scripts/installer/pxe/natty/debathena/check-disks.sh @ 25185

Revision 25185, 759 bytes checked in by jdreed, 13 years ago (diff)
* 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)
Line 
1#!/bin/sh
2#
3# This is run by d-i before the partman step (e.g. d-i partman/early_command)
4
5MIN_DISK_SIZE=20000000
6
7youlose() {
8  chvt 5
9  # Steal STDIN and STDOUT back from the installer
10  exec < /dev/tty5 > /dev/tty5 2>&1
11  echo ""
12  echo "****************************"
13  echo "ERROR: $@"
14  echo "Installation cannot proceed. Press any key to reboot."
15  read foo
16  echo "Rebooting, please wait..."
17  reboot
18}
19
20first_disk=`list-devices disk | head -n1`
21if ! echo "$first_disk" | grep -q ^/dev; then
22  youlose "No disks found."
23fi
24if [ "$(sfdisk -s "$first_disk")" -lt $MIN_DISK_SIZE ]; then
25  youlose "Your disk is too small ($(( $MIN_DISK_SIZE / 1000000)) GB required)."
26fi
27# Tell partman which disk to use
28debconf-set partman-auto/disk "$first_disk"
29exit 0
Note: See TracBrowser for help on using the repository browser.