summaryrefslogtreecommitdiff
path: root/scripts/install-system
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:18:49 -0700
commitbd51663226c8c19fbe4e1115a9d0f4095466e7b0 (patch)
treee0e4fa60f7c31e71161556ec0c4e1a8240ee54c7 /scripts/install-system
parent42fb3394ebf5764376882691ec6d2418c87bc677 (diff)
downloadvyatta-cfg-quagga-bd51663226c8c19fbe4e1115a9d0f4095466e7b0.tar.gz
vyatta-cfg-quagga-bd51663226c8c19fbe4e1115a9d0f4095466e7b0.zip
Add optional hooks to setup config files for installing to a Xen VM.
Diffstat (limited to 'scripts/install-system')
-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