diff options
-rwxr-xr-x | scripts/install-system.in | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/scripts/install-system.in b/scripts/install-system.in index 49634a03..fc5ad7c4 100755 --- a/scripts/install-system.in +++ b/scripts/install-system.in @@ -458,7 +458,7 @@ 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/) + output+=$(cp /live/image/live/initrd*.img* $rootfsdir/boot/initrd.img) status=$? output+=$(cp /live/image/live/initrd.img-* $rootfsdir/boot/initrd.img) status=$status$? @@ -590,21 +590,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" |