Revision 25185,
759 bytes
checked in by jdreed, 14 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)
|
Rev | Line | |
---|
[25185] | 1 | #!/bin/sh |
---|
| 2 | # |
---|
| 3 | # This is run by d-i before the partman step (e.g. d-i partman/early_command) |
---|
| 4 | |
---|
| 5 | MIN_DISK_SIZE=20000000 |
---|
| 6 | |
---|
| 7 | youlose() { |
---|
| 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 | |
---|
| 20 | first_disk=`list-devices disk | head -n1` |
---|
| 21 | if ! echo "$first_disk" | grep -q ^/dev; then |
---|
| 22 | youlose "No disks found." |
---|
| 23 | fi |
---|
| 24 | if [ "$(sfdisk -s "$first_disk")" -lt $MIN_DISK_SIZE ]; then |
---|
| 25 | youlose "Your disk is too small ($(( $MIN_DISK_SIZE / 1000000)) GB required)." |
---|
| 26 | fi |
---|
| 27 | # Tell partman which disk to use |
---|
| 28 | debconf-set partman-auto/disk "$first_disk" |
---|
| 29 | exit 0 |
---|
Note: See
TracBrowser
for help on using the repository browser.