diff options
-rw-r--r-- | configure.ac | 3 | ||||
-rwxr-xr-x | scripts/install-system (renamed from scripts/install-system.in) | 45 |
2 files changed, 21 insertions, 27 deletions
diff --git a/configure.ac b/configure.ac index d4a46fab..39771f0a 100644 --- a/configure.ac +++ b/configure.ac @@ -22,8 +22,7 @@ AC_ARG_ENABLE([nostrip], AC_CONFIG_FILES( [Makefile] - [debian/vyatta-cfg-system.postinst] - [scripts/install-system]) + [debian/vyatta-cfg-system.postinst]) AC_SUBST(NOSTRIP) diff --git a/scripts/install-system.in b/scripts/install-system index 0a3ed1e6..a05141ff 100755 --- a/scripts/install-system.in +++ b/scripts/install-system @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Module: install-system # @@ -30,12 +30,16 @@ # # If you set VYATTA_AUTO_INSTALL I will try to do an automated install for you -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@ -sbindir=@sbindir@ -sysconfdir=@sysconfdir@ -ofrconfdir=$sysconfdir/config +if [ -e /etc/default/vyatta ] ; then + . /etc/default/vyatta +fi +: ${vyatta_prefix:=/opt/vyatta} +: ${vyatta_exec_prefix:=$vyatta_prefix} +: ${vyatta_bindir:=${vyatta_exec_prefix}/bin} +: ${vyatta_sbindir:=${vyatta_exec_prefix}/sbin} +: ${vyatta_sysconfdir:=${vyatta_prefix}/etc} + +ofrconfdir=${vyatta_sysconfdir}/config fdconfdir=/media/floppy/config rootfsdir=/mnt/rootfs @@ -43,8 +47,6 @@ rootfsdir=/mnt/rootfs INSTALL_LOG="install.log" # root partition minimum size in MB ROOT_MIN="450" -# config partition minium size in MB -CONFIG_MIN="10" # the base install drive e.g. sda if [ -n "$INSTALL_DRIVE" ]; then INSTALL_DRIVE="" @@ -61,10 +63,6 @@ fi if [ -n "$ROOT_PARTITION_SIZE" ]; then ROOT_PARTITION_SIZE="" fi -# the size of the config partition -if [ -n "$CONFIG_PARTITION_SIZE" ]; then - CONFIG_PARTITION_SIZE="" -fi # global holding variable used in the select_partition sub PARTITION='' @@ -352,8 +350,7 @@ make_filesystem () { # create the root partition # $1 is the install drive e.g. sda # $2 is the partition size e.g. 512 -# $3 config partition size e.g. 100 -# This will set the globals ROOT_PARTITION and CONFIG_PARTITION +# This will set the global ROOT_PARTITION create_partitions() { ldrive=$1 root_part_size=$2 @@ -463,8 +460,8 @@ install_root_filesystem () { copy_config () { config_partition=$1 lerror='' - config_default=$sysconfdir/config.boot.default - tmp_config_default=/tmp/${sysconfdir//\//__} + config_default=$vyatta_sysconfdir/config.boot.default + tmp_config_default=/tmp/${vyatta_sysconfdir//\//__} # create the config directory on the union file system mkdir -p $rootfsdir$ofrconfdir @@ -611,9 +608,8 @@ install_grub () { setup_method_manual() { parted=$1 - echo "The Vyatta install needs a minimum $ROOT_MIN"MB" root" - echo "and a minimum $CONFIG_MIN"MB" config partition. These" - echo "partitions need to be set to partiton type 83 (Linux)." + echo "The Vyatta install needs a minimum ${ROOT_MIN}MB root" + echo "with partiton type 83 (Linux)." echo -e "\n\n" # if this is parted, let the user create the partitions @@ -671,7 +667,7 @@ setup_method_auto() { # check to make sure the drive is large enough to hold the image if [ -n "$INSTALL_DRIVE" ]; then lsize=$(get_drive_size "$INSTALL_DRIVE") - total=$(($ROOT_MIN + $CONFIG_MIN)) + total=$ROOT_MIN if [ "$total" -gt "$lsize" ]; then echo "Unfortunately, the OFR requires a total of at least $total"MB" to properly install." echo "$INSTALL_DRIVE is below the minimum required capacity and therefore, cannot be used to" @@ -763,7 +759,7 @@ unmount () { progress_indicator () { case "$1" in - "start") $bindir/progress-indicator $SPID & + "start") $vyatta_bindir/progress-indicator $SPID & ;; "stop") rm -f /tmp/pi.$SPID sleep 1 @@ -810,8 +806,7 @@ probe_drives progress_indicator "stop" echo "OK" -echo "The Vyatta image will require a minimum $ROOT_MIN"MB" root" -echo "partition and a minimum $CONFIG_MIN"MB" configuration partition." +echo "The Vyatta image will require a minimum ${ROOT_MIN}MB root." echo "Would you like me to try to partition a drive automatically" echo "or would you rather partition it manually with parted? If" echo "you have already setup your partitions, you may skip this step." @@ -841,7 +836,7 @@ elif [ "$method" == "vyatta" ]; then echo "deleting partitions on $INSTALL_DRIVE" delete_partitions "$INSTALL_DRIVE" echo "creating config partition" - create_partitions "$INSTALL_DRIVE" "$ROOT_PARTITION_SIZE" "$CONFIG_PARTITION_SIZE" + create_partitions "$INSTALL_DRIVE" "$ROOT_PARTITION_SIZE" fi # Install the root filesystem |