diff options
Diffstat (limited to 'scripts/install-system')
-rwxr-xr-x | scripts/install-system | 85 |
1 files changed, 42 insertions, 43 deletions
diff --git a/scripts/install-system b/scripts/install-system index eb182e39..6dd7f360 100755 --- a/scripts/install-system +++ b/scripts/install-system @@ -50,9 +50,9 @@ rootfsdir=/mnt/rootfs # UNION=false # install log file name -INSTALL_LOG="install.log" +INSTALL_LOG=/tmp/install-$$.log # root partition minimum size in MB -ROOT_MIN="450" +ROOT_MIN=500 # the base install drive e.g. sda if [ -n "$INSTALL_DRIVE" ]; then INSTALL_DRIVE="" @@ -75,9 +75,6 @@ PARTITION='' # Process ID of this script for the lame marketing spinner SPID=$$ -# Path to standalone root password reset script -PWRESET=/opt/vyatta/sbin/standalone_root_pw_reset - # Grub options GRUB_OPTIONS="quiet" @@ -85,20 +82,6 @@ GRUB_OPTIONS="quiet" VTY_CONSOLE="console=ttyS0,9600 console=tty0" 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=788" - # trap signals so we can kill runaway progress indicators trap 'progress_indicator stop; exit 1' 1 trap 'progress_indicator stop; exit 1' 2 @@ -271,9 +254,41 @@ check_for_old_raid () { response=$(get_response "Yes" "Yes No Y N") if [ "$response" == "no" ] || [ "$response" == "n" ]; then + echo echo "Ok. Not using existing RAID groups." - echo "Stopping existing RAID groups:" - mdadm --stop --scan + echo + + # pick the first RAID group to be broken + raid_drive=$(echo $raid_drives | /usr/bin/awk '{ print $1 }') + + echo "Would you like to break RAID group $raid_drive so that its" + echo "members can be re-used for a new installation, understanding" + echo -n "that doing so will destroy all data on it? (Yes/No) [No]:" + destroy_raid=$(get_response "No" "Yes No Y N") + echo + + if [ "${destroy_raid:0:1}" = "y" ]; then + echo "OK. Breaking the RAID group $raid_drive." + + members=`ls /sys/block/$raid_drive/slaves` + + echo "First, stopping all existing RAID groups:" + mdadm --stop --scan + + for member in $members ; do + drive=${member:0:3} + part=${member:3:1} + echo "Re-setting partition ID for RAID group $raid_drive member /dev/${member}:" + sfdisk --change-id /dev/$drive $part 0x83 + echo "Clearing RAID superblock from RAID group $raid_drive member /dev/${member}." + mdadm --zero-superblock /dev/$member + done + else + echo "OK. Stopping, but not breaking, existing RAID groups:" + mdadm --stop --scan + fi + + echo return fi @@ -798,7 +813,7 @@ install_root_filesystem () { echo "Unable to read filesystem UUID. Exiting." exit 1 else - echo -e "UUID=$uuid\t/\text3\tdefaults\t0 1" >> $rootfsdir/etc/fstab + echo -e "UUID=$uuid\t/\text3\tnoatime\t0 1" >> $rootfsdir/etc/fstab fi #setup the hostname file @@ -915,17 +930,6 @@ change_password() { set_encrypted_password $user $epwd $rootfsdir$ofrconfdir/config.boot } -system_setup () { - echo -n "Would you like to set the passwords for system users (Yes/No) [Yes]: " - local response=$(get_response "Yes" "Yes No Y N") - - if [ "$response" == "yes" ] || [ "$response" == "y" ]; then - change_password root - change_password vyatta - fi -} - - # setup grub on the boot sector of a user queried drive install_grub () { # we now use INSTALL_DRIVE to reference the grub boot drive. @@ -1240,15 +1244,6 @@ progress_indicator () { ##### Main ## -# clean up existing log files -if [ -f $INSTALL_LOG.old ]; then - rm -f $INSTALL_LOG.old -fi -if [ -f $INSTALL_LOG ]; then - mv $INSTALL_LOG $INSTALL_LOG.old - rm -f $INSTALL_LOG -fi - # turn off any mounted swap files turnoffswap @@ -1341,7 +1336,11 @@ copy_config "$CONFIG_PARTITION" # Modify config to match system # Assume user wants to keep password from old config if [ ! -d /mnt/config ]; then - system_setup + # Disable root login + set_encrypted_password root "*" $rootfsdir$ofrconfdir/config.boot + + echo "Enter password for administrator account" + change_password vyatta fi # check for xen part images in /var/xen |