summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-12-14 16:46:36 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-12-14 16:46:36 -0800
commit6b2468116a7eb2786f8bb449d8c49af3dd3ac357 (patch)
tree8ce9d84744f6c1897ac49fe5b56df5137e563c11
parent3986778af80d01f48340408d1dda5709e67c0ce3 (diff)
parentdeb5ecade97c1ba0aa9f9e762c8bf2e1f2839c42 (diff)
downloadvyatta-cfg-system-6b2468116a7eb2786f8bb449d8c49af3dd3ac357.tar.gz
vyatta-cfg-system-6b2468116a7eb2786f8bb449d8c49af3dd3ac357.zip
Merge branch 'kenwood' of 192.168.100.1:vyatta/kenwood/vyatta-cfg-system into kenwood
-rwxr-xr-xscripts/install-system5
-rwxr-xr-xscripts/install/install-get-partition51
-rwxr-xr-xscripts/vyatta-grub-setup19
3 files changed, 40 insertions, 35 deletions
diff --git a/scripts/install-system b/scripts/install-system
index fd55b102..d214d93d 100755
--- a/scripts/install-system
+++ b/scripts/install-system
@@ -83,9 +83,8 @@ SPID=$$
# Grub options
GRUB_OPTIONS="quiet"
-# Output to both console (last device is /dev/console)
-VTY_CONSOLE="console=ttyS0,9600 console=tty0"
-SERIAL_CONSOLE="console=tty0 console=ttyS0,9600"
+# Enable Vesa framebuffer mode (comment out to disable)
+VGA_LOGO="vga=0x314" # 800 x 600 (16bit colors)
# trap signals so we can kill runaway progress indicators
trap 'progress_indicator stop; exit 1' 1
diff --git a/scripts/install/install-get-partition b/scripts/install/install-get-partition
index 5ab44a86..9eebc307 100755
--- a/scripts/install/install-get-partition
+++ b/scripts/install/install-get-partition
@@ -399,18 +399,18 @@ rename_old_config() {
done
}
-## check_config_partition
-# look to see if this partition contains a config file
-# and back it up
+## save_old_config
+# Copy config files from /mnt/tmp to /mnt/config
save_old_config() {
+ local part=$1
+ local response=''
# Cleanup from possible partial last run
rm -fr /mnt/config
# Look to see if there is a config partition there
- response=''
while [ -z "$response" ]; do
- echo "/dev/$lpart has an old configuration directory!"
+ echo "$part has an old configuration directory!"
echo -ne "Would you like me to save the data on it\nbefore I delete it? (Yes/No) [Yes]: "
response=$(get_response "Yes" "Yes No Y N")
done
@@ -430,12 +430,15 @@ save_old_config() {
fi
}
+## save_old_keys
+# Copy SSH keys from /mnt/tmp/etc/ssh /mnt/ssh
save_old_keys() {
+ local part=$1
local response=''
while [ -z "$response" ]
do
- echo "/dev/$lpart has SSH host keys"
+ echo "$part has SSH host keys"
echo -ne "Would you like me to keep SSH keys on new install? (Yes/No) [Yes]: "
response=$(get_response "Yes" "Yes No Y N")
done
@@ -460,6 +463,18 @@ save_old_keys() {
fi
}
+save_old_info() {
+ # Look to see if this is a config partition
+ if [ -f /mnt/tmp/opt/vyatta/etc/config/.vyatta_config ] \
+ || [ -f /mnt/tmp/.vyatta_config ]; then
+ save_old_config $1
+ fi
+ if [ -d /mnt/tmp/etc/ssh ]; then
+ save_old_keys $1
+ fi
+}
+
+
# Delete all existing partitions for an automated install
# $1 is the drive to delete partitions from
delete_partitions () {
@@ -475,21 +490,13 @@ delete_partitions () {
# now for each part, blow it away
for part in $partitions; do
- output=$(mount /dev/$lpart /mnt/tmp 2>&1)
+ output=$(mount -r /dev/$lpart /mnt/tmp 2>&1)
if [ $? != 0 ]; then
lecho "Cannot mount /dev/$lpart"."\n"
- lecho "mount /dev/$ldrive$part /mnt/tmp\nExiting..."
+ lecho "mount /dev/$ldrive$part /mnt/tmp\n"
lecho "$output"
else
- # Look to see if this is a config partition
- if [ -f /mnt/tmp/opt/vyatta/etc/config/.vyatta_config ] \
- || [ -f /mnt/tmp/.vyatta_config ]; then
- save_old_config
- fi
- if [ -d /mnt/tmp/etc/ssh ]; then
- save_old_keys
- fi
-
+ save_old_info $lpart
umount /mnt/tmp
fi
@@ -625,8 +632,14 @@ setup_method_manual() {
fi
done
- # check for an old config on the partition
- check_config_partition "$ROOT_PARTITION"
+ # See if partition has old data
+ mkdir -p /mnt/tmp
+
+ # Is there an old filesystem there?
+ if mount -r /dev/"$ROOT_PARTITION" /mnt/tmp 2>&1; then
+ save_old_info "$ROOT_PARTITION"
+ umount /mnt/tmp
+ fi
# create the filesystem on the part
make_filesystem "$ROOT_PARTITION"
diff --git a/scripts/vyatta-grub-setup b/scripts/vyatta-grub-setup
index 487356c4..68d12614 100755
--- a/scripts/vyatta-grub-setup
+++ b/scripts/vyatta-grub-setup
@@ -60,16 +60,9 @@ serial_console="console=tty0 console=ttyS0,9600"
# If vga_logo is set, enable use of the VGA monitor for displaying the
# logo during boot. The "vga=" boot command specifies a VGA mode that
# is encoded as shown below. We pick a value that is likely to work
-# on most systems:
-#
-# Color depth | 640x480 | 800x600 | 1024x768 | 1280x1024
-# -----------------+---------+---------+----------+----------
-# 256 (8bit) | 769 771 773 775
-# 32000 (15bit) | 784 787 790 793
-# 65000 (16bit) | 785 788 791 794
-# 16.7 Mill.(24bit)| 786 789 792 795
-#
-#vga_logo="vga=785"
+# on most systems. (Disabled on Xen)
+# See kernel Documentation/fb/vesafb.txt for resolution constants
+#VGA_LOGO="vga=785"
# get list of kernels, except Xen
kernel_versions=$(ls $ROOTFSDIR/boot/vmlinuz-* 2> /dev/null | grep -v xen | awk -F/ '{ print $5 }' | sed 's/vmlinuz//g' | sort -r)
@@ -185,7 +178,7 @@ fi
echo
echo -e "menuentry \"Vyatta Xen linux$xversion dom0\" {"
echo -e "\tmultiboot /boot/$xen_version dom0_mem=512M"
- echo -e "\tmodule /boot/vmlinuz$xversion $GRUB_OPTIONS $vga_logo $vty_console"
+ echo -e "\tmodule /boot/vmlinuz$xversion $GRUB_OPTIONS $vty_console"
echo -e "\tmodule /boot/initrd.img$xversion"
echo -e "}"
done
@@ -197,7 +190,7 @@ fi
echo
echo -e "menuentry \"Vyatta Xen linux$xversion dom0\" {"
echo -e "\tmultiboot /boot/$livedir/$union_xen_version dom0_mem=512M"
- echo -e "\tmodule /boot/$livedir/vmlinuz$xversion $GRUB_OPTIONS $vga_logo $vty_console"
+ echo -e "\tmodule /boot/$livedir/vmlinuz$xversion $GRUB_OPTIONS $vty_console"
echo -e "\tmodule /boot/$livedir/initrd.img$xversion"
echo -e "}"
done
@@ -206,7 +199,7 @@ fi
if [ -f "$ROOTFSDIR/boot/vmlinuz" ] && ! eval $UNION ; then
# Set first system boot option. Make KVM the default console in this one.
echo -e "menuentry \"Vyatta (KVM console)\" {"
- echo -e "\tlinux /boot/vmlinuz $GRUB_OPTIONS $vga_logo $vty_console"
+ echo -e "\tlinux /boot/vmlinuz $GRUB_OPTIONS $VGA_LOGO $vty_console"
echo -e "\tinitrd /boot/initrd.img"
echo -e "}"