diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-11-11 15:54:04 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-11-11 15:54:04 -0800 |
commit | 8392f72c7c78d94601c83234526cd5d231ce48ab (patch) | |
tree | ad0bfec388c737d74ca1ad25b2b624173d47f94b | |
parent | b40d5ead178e32595b27b352d8da6d3e3d311259 (diff) | |
parent | 5c21e9f6d804fe47e71564d0119684dfe02513de (diff) | |
download | vyatta-cfg-quagga-8392f72c7c78d94601c83234526cd5d231ce48ab.tar.gz vyatta-cfg-quagga-8392f72c7c78d94601c83234526cd5d231ce48ab.zip |
Merge branch 'kenwood' of suva.vyatta.com:/git/vyatta-cfg-system into kenwood
-rw-r--r-- | debian/changelog | 29 | ||||
-rwxr-xr-x | lib/Vyatta/Login/User.pm | 2 | ||||
-rwxr-xr-x | scripts/install-image | 168 | ||||
-rwxr-xr-x | scripts/install/install-image-existing | 11 | ||||
-rwxr-xr-x | scripts/vyatta-grub-setup | 14 |
5 files changed, 45 insertions, 179 deletions
diff --git a/debian/changelog b/debian/changelog index 679ed013..66f06daf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,32 @@ +vyatta-cfg-system (0.15.100) unstable; urgency=low + + * copy the whole config directory during install + + -- An-Cheng Huang <ancheng@vyatta.com> Tue, 10 Nov 2009 14:08:59 -0800 + +vyatta-cfg-system (0.15.99) unstable; urgency=low + + [ An-Cheng Huang ] + * use new vyatta-union arg to reduce kernel cmdline length. + + [ Robert Bays ] + * Fix library include + + -- Robert Bays <rbays@roatan> Fri, 06 Nov 2009 05:53:10 -0800 + +vyatta-cfg-system (0.15.98) unstable; urgency=low + + [ Stephen Hemminger ] + * Remove blank line + * Fix pam-auth-update errors from radius + * Move user configuration information to files + * radius: only try first password if first module + + [ An-Cheng Huang ] + * move custom script to custom repo + + -- An-Cheng Huang <ancheng@vyatta.com> Thu, 05 Nov 2009 15:01:40 -0800 + vyatta-cfg-system (0.15.97) unstable; urgency=low * Fix 5063: committing "set interfaces ethernet <> bridge-group bridge diff --git a/lib/Vyatta/Login/User.pm b/lib/Vyatta/Login/User.pm index 8c459850..cca84636 100755 --- a/lib/Vyatta/Login/User.pm +++ b/lib/Vyatta/Login/User.pm @@ -19,7 +19,7 @@ use strict; use warnings; use lib "/opt/vyatta/share/perl5"; use Vyatta::Config; -use Vyatta::Login::Misc; +use Vyatta::Misc; # Exit codes form useradd.8 man page my %reasons = ( diff --git a/scripts/install-image b/scripts/install-image deleted file mode 100755 index 201500e3..00000000 --- a/scripts/install-image +++ /dev/null @@ -1,168 +0,0 @@ -#!/bin/bash - -# this script installs a new release image into a running "union-installed" -# system to the new release. the specified image is a release ISO image. -# the script sets up a new union mount for the new release. a reboot is -# then required to boot into the newly installed release. - -NEW_ISO=$1 - -PI_ROOT='' -SQUASH_MOUNT='' -ISO_MOUNT='' -TMP_DIR='' - -vyatta_sysconfdir=/opt/vyatta/etc - -failure_exit () { - echo "$*" - exit 1 -} - -clean_up () { - if [ -n "$PI_ROOT" ] && [ -d "$PI_ROOT" ]; then - umount $PI_ROOT >&/dev/null || true - fi - if [ -n "$SQUASH_MOUNT" ] && [ -d "$SQUASH_MOUNT" ]; then - umount $SQUASH_MOUNT >&/dev/null || true - fi - if [ -n "$ISO_MOUNT" ] && [ -d "$ISO_MOUNT" ]; then - umount $ISO_MOUNT >&/dev/null || true - fi - if [ -n "$TMP_DIR" ] && [ -d "$TMP_DIR" ]; then - rm -rf $TMP_DIR - fi - PI_ROOT='' - SQUASH_MOUNT='' - ISO_MOUNT='' - TMP_DIR='' -} - -sig_handler () { - echo "ERROR: Signal received. Exiting..." - clean_up - echo "Done" - trap - EXIT - exit 1 -} - -exit_handler () { - echo "Exiting..." - clean_up - echo "Done" -} - -trap sig_handler INT KILL -trap exit_handler EXIT - -if [ `whoami` != 'root' ] ; then - failure_exit 'This script must be run with root privileges.' -fi - -# make sure it's a union-installed system -CURVER=$(sed -n 's/^Version \+: \+\([^ ]\+\)$/\1/p' \ - ${vyatta_sysconfdir}/version 2>/dev/null) -if [ -z "$CURVER" ]; then - failure_exit 'Cannot find current version.' -fi -if [ ! -d "/live/image/boot/$CURVER" ] \ - || ! grep -q ' /live/image ' /proc/mounts \ - || grep -q ' /live/image iso9660 ' /proc/mounts \ - || ! grep -q " /$CURVER.squashfs " /proc/mounts; then - failure_exit 'This script can only be used on a "union-installed" system.' -fi - -# check the ISO -if [ ! -f "$NEW_ISO" ] || ! (file $NEW_ISO | grep -q 9660); then - failure_exit "\"$NEW_ISO\" is not a valid ISO image file." -fi -TMP_DIR=$(mktemp -d /tmp/install-image.XXXXXX) \ - || failure_exit 'Failed to create temporary directory.' -ISO_MOUNT=$TMP_DIR/iso-mount -if ! mkdir $ISO_MOUNT || ! mount -o loop,ro "$NEW_ISO" $ISO_MOUNT; then - failure_exit 'Failed to mount ISO image.' -fi - -# check the squashfs image -SQUASH_FILE=$ISO_MOUNT/live/filesystem.squashfs -if [ ! -f "$SQUASH_FILE" ] || ! (file $SQUASH_FILE | grep -q Squashfs) \ - || ! grep -q '^ii vyatta-version ' $ISO_MOUNT/live/packages.txt; then - failure_exit "\"$NEW_ISO\" is not a Vyatta ISO image file." -fi -SQUASH_MOUNT=$TMP_DIR/squash-mount -if ! mkdir $SQUASH_MOUNT \ - || ! mount -o loop,ro "$SQUASH_FILE" $SQUASH_MOUNT; then - failure_exit 'Failed to mount squashfs image.' -fi - -# get version string -NEWVER=$(grep '^Version ' ${SQUASH_MOUNT}${vyatta_sysconfdir}/version \ - | tr -s ' ' | cut -d ' ' -f 3) -if [ -z "$NEWVER" ]; then - failure_exit 'Cannot find new release version.' -fi -if [ "$CURVER" == "$NEWVER" ]; then - failure_exit "Cannot install the same release version \"$NEWVER\"." -fi - -# start the install -echo "Installing \"$NEWVER\" release." - -# create the new release directories -REL_ROOT="/live/image/boot/$NEWVER" -RW_DIR="$REL_ROOT/live-rw" -if ! mkdir -p "$RW_DIR"; then - failure_exit 'Cannot create directory for new release.' -fi - -# copy the squashfs image and boot files -echo -n "Copying new release files..." -cp -p $SQUASH_FILE $REL_ROOT/$NEWVER.squashfs >&/dev/null -cp -p $SQUASH_MOUNT/boot/* $REL_ROOT/ >&/dev/null -echo " Done" - -# mount copied squashfs -umount $SQUASH_MOUNT -SQUASH_FILE=$REL_ROOT/$NEWVER.squashfs -if ! mount -o loop,ro "$SQUASH_FILE" $SQUASH_MOUNT; then - failure_exit 'Failed to mount new squashfs image.' -fi - -# set up root for postinst -PI_ROOT=$TMP_DIR/pi_root -if ! mkdir $PI_ROOT \ - || ! mount -t unionfs -o noatime,dirs=$RW_DIR=rw:$SQUASH_MOUNT=ro unionfs \ - $PI_ROOT; then - failure_exit 'Failed to set up root directory for postinst.' -fi - -# set up /var/run fstab entry -PI_FSTAB=$PI_ROOT/etc/fstab -if ! grep -q 'tmpfs /var/run ' $PI_FSTAB >&/dev/null; then - # replace the fstab. the default one has header that will cause - # it to be wiped out on live boot. - echo 'tmpfs /var/run tmpfs nosuid,nodev 0 0' >$PI_FSTAB -fi - -# postinst hook -PI_SCRIPT=${PI_ROOT}${vyatta_sysconfdir}/install-image/postinst -if [ -e "$PI_SCRIPT" ]; then - echo "running post-install script" - $PI_SCRIPT $PI_ROOT -fi - -# set up grub entry (if provided) -DEF_GRUB=${PI_ROOT}${vyatta_sysconfdir}/grub/default-union-grub-entry -if [ -e "$DEF_GRUB" ]; then - old_grub_cfg=/live/image/boot/grub/grub.cfg - new_grub_cfg=$TMP_DIR/grub.cfg - sed -n '/^menuentry/q;p' $old_grub_cfg >$new_grub_cfg - cat $DEF_GRUB >>$new_grub_cfg - sed -n '/^menuentry/,${p}' $old_grub_cfg >>$new_grub_cfg - sed -i 's/^set default=[0-9]\+$/set default=0/' $new_grub_cfg - mv $new_grub_cfg $old_grub_cfg -fi - -# done -exit 0 - diff --git a/scripts/install/install-image-existing b/scripts/install/install-image-existing index 0b5cba62..214fd2c8 100755 --- a/scripts/install/install-image-existing +++ b/scripts/install/install-image-existing @@ -87,19 +87,20 @@ if ! grep -q 'tmpfs /var/run ' $PI_FSTAB >&/dev/null; then echo 'tmpfs /var/run tmpfs nosuid,nodev 0 0' >$PI_FSTAB fi -# save current config if needed -def_cfg="$VYATTA_CFG_DIR/config.boot" -if [ -f "$def_cfg" ]; then +# save current config dir if needed +if [ -f "$VYATTA_CFG_DIR/config.boot" ]; then resp='' while [ -z "$resp" ]; do - echo 'Would you like to use the current configuration' + echo 'Would you like to save the current configuration ' + echo 'directory and use the current start-up configuration ' echo -n 'for the new version? (Yes/No) [Yes]: ' resp=$(get_response "Yes" "Yes No Y N") if [ "$resp" == 'yes' ] || [ "$resp" == 'y' ]; then echo 'Copying current configuration...' ndir=${INST_ROOT}${VYATTA_CFG_DIR} mkdir -p $ndir - cp -p $def_cfg $ndir/ + find $VYATTA_CFG_DIR -maxdepth 1 -mindepth 1 \ + -exec cp '-a' '{}' "$ndir/" ';' chgrp -R vyattacfg $ndir chmod -R 775 $ndir fi diff --git a/scripts/vyatta-grub-setup b/scripts/vyatta-grub-setup index 817223b3..487356c4 100755 --- a/scripts/vyatta-grub-setup +++ b/scripts/vyatta-grub-setup @@ -88,7 +88,7 @@ else fi if eval "$UNION"; then - GRUB_OPTIONS="boot=live live-media-path=/boot/$livedir persistent-path=/boot/$livedir quiet persistent noautologin nonetworking nouser hostname=vyatta" + GRUB_OPTIONS="boot=live quiet vyatta-union=/boot/$livedir" union_xen_kernel_version=$(ls $ROOTFSDIR/boot/$livedir/vmlinuz*-xen* \ 2>/dev/null \ | awk -F/ '{ print $6 }' \ @@ -253,17 +253,21 @@ fi # Set options for root password reset. Offer # options for both serial and KVM console. + reset_boot_path=/boot + if eval "$UNION"; then + reset_boot_path=/boot/$livedir + fi echo echo -e "menuentry \"Lost password change (KVM console)\" {" - echo -e "\tlinux /boot/vmlinuz $GRUB_OPTIONS $vga_logo $vty_console init=$pass_reset" - echo -e "\tinitrd /boot/initrd.img" + echo -e "\tlinux $reset_boot_path/vmlinuz $GRUB_OPTIONS $vga_logo $vty_console init=$pass_reset" + echo -e "\tinitrd $reset_boot_path/initrd.img" echo -e "}" echo echo -e "menuentry \"Lost password change (Serial console)\" {" - echo -e "\tlinux /boot/vmlinuz $GRUB_OPTIONS $serial_console init=$pass_reset" - echo -e "\tinitrd /boot/initrd.img" + echo -e "\tlinux $reset_boot_path/vmlinuz $GRUB_OPTIONS $serial_console init=$pass_reset" + echo -e "\tinitrd $reset_boot_path/initrd.img" echo -e "}" if [ -n "$diag_drive_number" ]; then |