#!/bin/sh if [ ! -c /dev/vcs ]; then mknod /dev/vcs c 7 0 fi while [ -z "$instdisk" ]; do VIRTDISKS=`ls /dev/vd*|wc -l` if [ $VIRTDISKS -gt 0 ]; then for disk in /dev/vd*[^0-9]; do if [ -z "$firstdirectdisk" ]; then firstdirectdisk=$disk; fi #remember first disk as a guess of medium resort #no edd_id in debian installer, no edd hints supported done fi if [ -z "$firstdirectdisk" ]; then SCSIDISKS=`ls /dev/sd*|wc -l` if [ $SCSIDISKS -gt 0 ]; then for disk in /dev/sd*[^0-9]; do currdriver=`udevadm info --attribute-walk --name $disk |grep DRIVERS|grep -v '""'|grep -v '"sd"'|head -n 1|sed -e 's/[^"]*"//' -e 's/"//'` case "$currdriver" in "ata_piix4"|"PMC MaxRAID"|"ahci"|"megaraid_sas") #certainly direct if [ -z "$firstdirectdisk" ]; then firstdirectdisk=$disk; fi #remember first disk as a guess of medium resor ;; "mptsas"|"mpt2sas") #*PROBABLY* not SAN, but SAS SAN is possible if [ -z "$probablyfirstdirectdisk" ]; then probablyfirstdirectdisk=$disk; fi ;; *) # could be san or who knows what, use it as a last resort if [ -z "$firstdisk" ]; then firstdisk=$disk; fi ;; esac done fi fi if [ -z "$instdisk" ]; then if [ ! -z "$firstdirectdisk" ]; then instdisk=$firstdirectdisk elif [ ! -z "$probablyfirstdirectdisk" ]; then instdisk=$probablyfirstdirectdisk elif [ ! -z "$firstdisk" ]; then instdisk=$firstdisk fi fi if [ ! -z "$instdisk" ]; then debconf-set partman-auto/disk "$instdisk"; fi debconf-get open-iscsi/targets > /tmp/q sleep 0.1 done & cat >/tmp/foo.sh </dev/null) if [ -z "\$output" ]; then output="installing prep" fi echo "\$output" ;; esac exit 0 EOF chmod 755 /tmp/foo.sh /tmp/foo.sh >/tmp/foo.log 2>&1 & if [ -d /sys/firmware/efi ]; then echo "ubuntu-efi ::" > /tmp/partitioning echo " 512 512 1024 fat16" >> /tmp/partitioning echo ' $iflabel{ gpt } $reusemethod{ } method{ efi } format{ }' >> /tmp/partitioning echo " ." >> /tmp/partitioning else echo "ubuntu-boot ::" > /tmp/partitioning echo "100 50 100 ext3" >> /tmp/partitioning echo ' $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext3 } mountpoint{ /boot }' >> /tmp/partitioning echo " ." >> /tmp/partitioning fi echo "500 10000 1000000000 ext3" >> /tmp/partitioning echo " method{ format } format{ } use_filesystem{ } filesystem{ ext3 } mountpoint{ / }" >> /tmp/partitioning echo " ." >> /tmp/partitioning echo "2048 512 300% linux-swap" >> /tmp/partitioning echo " method{ swap } format{ }" >> /tmp/partitioning echo " ." >> /tmp/partitioning exit 0