From 6a040ff8506966bae20d7e0638750c7a837e48ad Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 3 Sep 2008 15:12:52 -0700 Subject: Add support for aufs If system is booted with aufs (instead of aufs) then propogate it to the installed grub options. --- scripts/install-system | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) (limited to 'scripts/install-system') diff --git a/scripts/install-system b/scripts/install-system index 724ced9d..e8f05cc7 100755 --- a/scripts/install-system +++ b/scripts/install-system @@ -765,9 +765,25 @@ copy_config () { change_password() { local user=$1 - local pwd - read pwd - local epwd=$(mkpasswd -H md5 $pwd | sed 's:/:\\/:g') + local pwd1="1" + local pwd2="2" + + until [ $pwd1 == $pwd2 ] + do + echo -n "Enter $user " + pwd1=$(mkpasswd -H md5) + local salt=$(echo $pwd1 | awk -F$ '{print $3}') + + echo -n "Retype $user " + pwd2=$(mkpasswd -H md5 -S $salt) + + if [ $pwd1 != $pwd2 ] + then echo "Passwords do not match" + fi + done + + # escape any slashes in resulting password + local epwd=$(echo $pwd | sed 's:/:\\/:g') sed -i \ -e "/ user $user {/,/}/s/encrypted-password:.*\$/encrypted-password: \"$epwd\"/" \ @@ -779,9 +795,7 @@ system_setup () { local response=$(get_response "Yes" "Yes No Y N") if [ "$response" == "yes" ] || [ "$response" == "y" ]; then - echo -n 'System administrator (root) password: ' change_password root - echo -n 'Router administrator (vyatta) password: ' change_password vyatta fi } @@ -821,6 +835,17 @@ install_grub () { grub_options="ide=nodma" fi + # Check if using aufs + if grep -q aufs /proc/filesystems + then + if [ -z "$grub_options" ] + then + grub_options="union=aufs" + else + grub_options="$grub_options union=aufs" + fi + fi + if /opt/vyatta/sbin/grub-setup "$ROOT_PARTITION" "$grub_options" /mnt/rootfs >>$INSTALL_LOG then echo "OK" -- cgit v1.2.3