/[sysadmin-cookbook]/recepies/lxc/lxc-debian
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /recepies/lxc/lxc-debian

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 174 by dpavlin, Sat Mar 13 13:21:48 2010 UTC revision 246 by dpavlin, Sat May 7 12:35:18 2011 UTC
# Line 3  Line 3 
3  #  #
4  # lxc: linux Container library  # lxc: linux Container library
5    
6    apt-get install debootstrap
7    
8  # Authors:  # Authors:
9  # Daniel Lezcano <daniel.lezcano@free.fr>  # Daniel Lezcano <daniel.lezcano@free.fr>
10    
# Line 95  EOF Line 97  EOF
97      chroot $rootfs /usr/sbin/update-rc.d -f hwclockfirst.sh remove      chroot $rootfs /usr/sbin/update-rc.d -f hwclockfirst.sh remove
98  }  }
99    
100    arch=$(arch)
101    
102  download_debian()  download_debian()
103  {  {
104      packages=\      packages=\
# Line 109  iproute,\ Line 113  iproute,\
113  openssh-server  openssh-server
114    
115      cache=$1      cache=$1
     arch=$2  
116    
117      # check the mini debian was not already downloaded      # check the mini debian was not already downloaded
118      mkdir -p "$cache/partial-$arch"      mkdir -p "$cache/partial-$arch"
# Line 137  openssh-server Line 140  openssh-server
140  copy_debian()  copy_debian()
141  {  {
142      cache=$1      cache=$1
     arch=$2  
143      rootfs=$3      rootfs=$3
144    
145      # make a local copy of the minidebian      # make a local copy of the minidebian
# Line 158  install_debian() Line 160  install_debian()
160              return 1              return 1
161          fi          fi
162    
         arch=$(arch)  
163          if [ "$arch" == "x86_64" ]; then          if [ "$arch" == "x86_64" ]; then
164              arch=amd64              arch=amd64
165          fi          fi
# Line 251  clean() Line 252  clean()
252  usage()  usage()
253  {  {
254      cat <<EOF      cat <<EOF
255  $1 -h|--help -p|--path=<path> --clean  $1 -h|--help -p|--path=<path> -a|--arch=stable --clean
256  EOF  EOF
257      return 0      return 0
258  }  }
259    
260  options=$(getopt -o hp:n:c -l help,path:,name:,clean -- "$@")  options=$(getopt -o hp:n:ca: -l help,path:,name:,clean,arch: -- "$@")
261  if [ $? -ne 0 ]; then  if [ $? -ne 0 ]; then
262          usage $(basename $0)          usage $(basename $0)
263          exit 1          exit 1
# Line 268  do Line 269  do
269      case "$1" in      case "$1" in
270          -h|--help)      usage $0 && exit 0;;          -h|--help)      usage $0 && exit 0;;
271          -p|--path)      path=$2; shift 2;;          -p|--path)      path=$2; shift 2;;
272          -n|--name)      name=$2; shift 2;;                  -n|--name)      name=$2; shift 2;;
273          -c|--clean)     clean=$2; shift 2;;                  -c|--clean)     clean=$2; shift 2;;
274                    -a|--arch)              arch=$2; shift 2;;
275          --)             shift 1; break ;;          --)             shift 1; break ;;
276          *)              break ;;          *)              break ;;
277      esac      esac

Legend:
Removed from v.174  
changed lines
  Added in v.246

  ViewVC Help
Powered by ViewVC 1.1.26