Changeset 10830 in hybrid for branches


Ignore:
Timestamp:
May 13, 2012, 2:10:04 PM (13 years ago)
Author:
rick
Message:

Merge config into tools/image

Location:
branches/releng-9.0/nanobsd/tools
Files:
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • branches/releng-9.0/nanobsd/tools/image

    r10799 r10830  
    2020# build force kernel            - Build NanoBSD and force rebuilding the kernel
    2121# build force world             - Build NanoBSD and force rebuilding world
     22# config [for <node>]           - Configure image to be used for <node>
    2223# rebuild                       - Rebuild NanoBSD (aka force rebuilding all)
    2324# deploy on <node> [and reboot] - Deploy the image on node and reboot if needed
     
    5152    ssh $host reboot
    5253  fi
     54}
     55
     56config_image() {
     57  node_name=${1:+"-b -c $1"}
     58
     59  img=$OBJDIR/_.disk.full
     60
     61  mnt=`mktemp -d -t $(basename $0)`
     62  md=`mdconfig -a -t vnode -f $img`
     63 
     64  # Clean up when done
     65  trap "umount $mnt/dev; umount $mnt/cfg; umount $mnt; mdconfig -d -u $md; rm -d $mnt" 0
     66  trap "exit 1" 1 2 3 15
     67
     68  # Root filesystem
     69  mount /dev/${md}s1a $mnt || exit 1
     70
     71  # /dev/null in chroot
     72  mount -t devfs devfs ${mnt}/dev || exit 1
     73 
     74  # Config files lives at /cfg  location
     75  mount /dev/${md}s3 $mnt/cfg || exit 1
     76 
     77  # Try to fetch and store config
     78  chroot $mnt /tools/wl-config -d -n -m startup $node_name || exit 1
    5379}
    5480
     
    176202    echo "Arguments Error - '$*'"; exit 128
    177203  fi
     204elif [ "$1" = "config" ]; then
     205  if [ "$2" = "for" ]; then
     206    if [ -n "$3" ]; then
     207      node_name=$3
     208    else
     209      echo "Arguments Error - '$*'"; exit 128
     210    fi
     211  else
     212    echo "Arguments Error - '$*'"; exit 128
     213  fi
     214  config_image $node_name
    178215else
    179216  echo "Argument Error - '$1'"; exit 128
Note: See TracChangeset for help on using the changeset viewer.