summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/install-system.in45
1 files changed, 35 insertions, 10 deletions
diff --git a/scripts/install-system.in b/scripts/install-system.in
index 49634a03..4c31b2ad 100755
--- a/scripts/install-system.in
+++ b/scripts/install-system.in
@@ -458,13 +458,11 @@ install_root_filesystem () {
# make the dir for the boot files and copy em' over
mkdir -p $rootfsdir/boot
output=$(cp -pR /boot/* $rootfsdir/boot/)
- output+=$(cp /live/image/live/vmlinuz-* $rootfsdir/boot/)
status=$?
- output+=$(cp /live/image/live/initrd.img-* $rootfsdir/boot/initrd.img)
+ output+=$(cp /live/image/live/initrd1.img $rootfsdir/boot/initrd.img)
status=$status$?
if [ "$status" -ne 0 ]; then
- echo -e "Error trying to copy the bootfiles.\nPlease see install log for more details.\nExiting.
-.."
+ echo -e "Error trying to copy the bootfiles.\nPlease see install log for more details.\nExiting..."
echo -e "Error trying to copy the bootfiles.\ncp /boot/initrd.img $rootfsdir/boot/\n$output" >> $INSTALL_LOG
exit 1
fi
@@ -590,21 +588,48 @@ install_grub () {
root="(hd0,$part)"
fi
+ # Figure out whether we are running on the serial or KVM console:
+ if [ "`tty`" == "/dev/ttyS0" ]; then
+ # Since user is running on serial console, make that the default.
+ DEFAULT_CONSOLE="1"
+ else
+ # Since user is running on KVM console, make that the default
+ DEFAULT_CONSOLE="0"
+ fi
+
# create the menu.lst file for grub
+ # The "default=" line selects which boot option will be used by default.
+ # Numbering starts at 0 for the first option.
grub_file="$rootfsdir/boot/grub/menu.lst"
- echo -e "default=0\ntimeout=5\n#splashimage=(hd0,0)/grub/splash.xpm.gz\nhiddenmenu" > $grub_file
+ echo -e "default=$DEFAULT_CONSOLE\ntimeout=5\n#splashimage=(hd0,0)/grub/splash.xpm.gz\nhiddenmenu" > $grub_file
# set serial console options
echo -e "serial --unit=0 --speed=9600\nterminal --timeout=5 console serial\n\n" >> $grub_file
- # set primary boot option
- echo -e "title Vyatta OFR\n\troot $root" >> $grub_file
+
+ # Set first system boot option. Make KVM the default console in this one.
+ echo -e "title Vyatta OFR (KVM console)\n\troot $root" >> $grub_file
echo -en "\tkernel /boot/vmlinuz root=/dev/$ROOT_PARTITION $ISCF console=ttyS0,9600 console=tty0 \n" >> $grub_file
echo -e "\tinitrd /boot/initrd.img" >> $grub_file
- # Set root password reset option
+ # Set the second system boot option. Make the serial port be the default
+ # console in this one.
+ echo >> $grub_file
+ echo -e "title Vyatta OFR (Serial console)\n\troot $root" >> $grub_file
+ echo -en "\tkernel /boot/vmlinuz root=/dev/$ROOT_PARTITION $ISCF console=tty0 console=ttyS0,9600 \n" >> $grub_file
+ echo -e "\tinitrd /boot/initrd.img" >> $grub_file
+
+ # Set third and fourth boot options for root password reset. Offer
+ # options for both serial and KVM console.
+
+ echo >> $grub_file
+ echo -e "title Root password reset to factory (KVM console)" >> $grub_file
+ echo -e "\troot $root" >> $grub_file
+ echo -e "\tkernel /boot/vmlinuz root=/dev/$ROOT_PARTITION $ISCF console=ttyS0,9600 console=tty0 init=$PWRESET" >> $grub_file
+ echo -e "\tinitrd /boot/initrd.img" >> $grub_file
+
echo >> $grub_file
- echo -e "title Root password reset to factory (serial console)" >> $grub_file
+ echo -e "title Root password reset to factory (Serial console)" >> $grub_file
echo -e "\troot $root" >> $grub_file
- echo -e "\tkernel /boot/vmlinuz root=/dev/$ROOT_PARTITION $ISCF console=ttyS0,9600 init=$PWRESET" >> $grub_file
+ echo -e "\tkernel /boot/vmlinuz root=/dev/$ROOT_PARTITION $ISCF console=tty0 console=ttyS0,9600 init=$PWRESET" >> $grub_file
echo -e "\tinitrd /boot/initrd.img" >> $grub_file
echo "OK"