summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Gilligan <gilligan@vyatta.com>2009-06-24 16:15:52 -0700
committerBob Gilligan <gilligan@vyatta.com>2009-06-24 16:15:52 -0700
commit6a769fda32ddcefde2fecd69eb78938202a6dd67 (patch)
tree52354f1b7dce5f2b3a1690ba25a7f578a66bfc00
parent8fb80130f699253f11c93b431d3d6d181b7cf09a (diff)
downloadvyatta-cfg-system-6a769fda32ddcefde2fecd69eb78938202a6dd67.tar.gz
vyatta-cfg-system-6a769fda32ddcefde2fecd69eb78938202a6dd67.zip
Add optional hooks to setup config files for installing to a Xen VM.
-rwxr-xr-xscripts/install-system33
1 files changed, 33 insertions, 0 deletions
diff --git a/scripts/install-system b/scripts/install-system
index 4fa48054..80fdf33e 100755
--- a/scripts/install-system
+++ b/scripts/install-system
@@ -1233,6 +1233,37 @@ setup_xen_partition_images () {
fi
}
+setup_xen_extras () {
+ echo "Setting up config files for Xen..."
+ # Set up /boot/grub/menu.lst for use by pygrub
+ echo "timeout 5" >> $rootfsdir/boot/grub/menu.lst
+ echo "" >> $rootfsdir/boot/grub/menu.lst
+ echo "title vyatta-virt" >> $rootfsdir/boot/grub/menu.lst
+ echo "root (hd0,0)" >> $rootfsdir/boot/grub/menu.lst
+ echo "kernel /boot/vmlinuz root=/dev/xvda1 ro console=hvc0" >> $rootfsdir/boot/grub/menu.lst
+
+ # Add /proc/xen entry to fstab
+ echo "xenfs /proc/xen xenfs defaults 0 0" >> $rootfsdir/etc/fstab
+
+ # Comment out serial port entry and add Xen console entry to inittab.
+ sed -i -e 's/T0/#T0/' $rootfsdir/etc/inittab
+ echo "" >> $rootfsdiretc/inittab
+ echo "h0:12345:respawn:/sbin/getty 38400 hvc0" >> $rootfsdir/etc/inittab
+}
+
+check_for_xen_extras () {
+ manuf=`/usr/sbin/dmidecode -s system-manufacturer`
+ prod=`/usr/sbin/dmidecode -s system-product-name`
+ if [ "$manuf" = "Xen" -a "$prod" = "HVM domU" ]; then
+ echo "You are installing to a $manuf $prod virtual machine."
+ echo -n "Would you like to set up config files for Xen? [No]: "
+ response=$(get_response "No" "Yes No Y N")
+ if [ "$response" == "yes" ] || [ "$response" == "y" ]; then
+ setup_xen_extras
+ fi
+ fi
+}
+
progress_indicator () {
case "$1" in
start) $vyatta_bindir/progress-indicator $SPID &
@@ -1362,6 +1393,8 @@ setup_xen_partition_images
# Install grub
install_grub
+check_for_xen_extras
+
if [ -z $UNION ]; then
# Fix up PAM configuration for login so that invalid users are prompted
# for password