I'm doing an unattended installation of Ubuntu-14.04-server with a USB drive and a preseed file on different type of servers (HP Proliant ML110, ML310, ML350).
- On the ML110 and ML310, the hard drive is in
/dev/sda
and the USB drive takes/dev/sdb
. - While on the servers ML350, the USB drive takes the
/dev/sda
and the hard drive shows up in/dev/sdb
.
As this should be a completely unattended installation, regardless of the server type, I need to find a way to give the correct device path to d-i partman-auto/disk
.
My first idea was to force the hard drive to show up before the USB drive, allowing it to take /dev/sda
on the ML350 servers ; but I didn't find a way do that.
Therefore, I made a small script that detects the device name just before partman
executes, and record that in a variable $INSTALL_DEV
:
d-i partman/early_command string \
for DEV in `ls /sys/block | grep sd`; do \
if [ -n "`ls -l /sys/block/$DEV | grep /usb`" ]; then \
USB_DEV=/dev/${DEV}; \
echo "USB_DEV is $USB_DEV" >> /var/log/syslog; \
else \
INSTALL_DEV=/dev/${DEV}; \
echo "INSTALL_DEV = $INSTALL_DEV" >> /var/log/syslog; \
break; \
fi; \
done; \
Since then, I'm struggeling to find a way to give that variable to d-i partman-auto/disk
. I thought of different alternatives but I couldn't find a way to implement one of them:
- Make the
partma-auto/disk
interpret a variable. But unfortunately it only takes a string as a value. - Modify the
debian-installer
database where I hope the preseeded values are stored. But I didn't find the database file (neither the way to alter it). - Make a script that includes a tiny preseed file with the correct device. But I can only include files from
preseed/include
, before the hard drive shows in/dev
.