ubuntu-cloud-prep revision 1e0f62acaacb4e7639d6203a9f008c66be712026
369N/A## specified, then the specified hooks will be called for the new 369N/A## container. The arguments passed to the clone hook are: 369N/A## 1. the container name 369N/A## 3. hook type ('clone') 369N/A## 4. .. additional arguments to lxc-clone 369N/A## Environment variables: 369N/A## LXC_ROOTFS_MOUNT: path to the root filesystem 369N/A## LXC_CONFIG_FILE: path to config file 369N/A## LXC_SRC_NAME: old container name 369N/A## LXC_ROOTFS_PATH: path or device on which the root fs is located 369N/AUsage: ${0##*/} [options] root-dir 369N/A root-dir is the root directory to operate on 369N/A [ -C | --cloud ]: do not configure a datasource. incompatible with 844N/A [ -i | --instance-id]: instance-id for cloud-init, defaults to random [ds] 369N/A [ -L | --nolocales ]: Do not copy host's locales into container 369N/A [ -S | --auth-key ]: ssh public key file for datasource [ds] 369N/A [ -u | --userdata ]: user-data file for cloud-init [ds] 369N/A local long_opts="auth-key:,cloud,help,hostid:,name:,nolocales:,create-etc-init,userdata:,verbose" 369N/A eval set -- "${getopt_out}" || 369N/A { error "Unexpected error reading usage"; return 1; } { error "--auth-key: '$next' not a file"; return 1; } { error "--userdata: '$next' not a file"; return 1; } # getopt above failed, but we were called from lxc clone. there might # be multiple clone hooks and the args provided here not for us. This # seems like not the greatest interface, so all we'll do is mention it. error "${0##*}: usage failed, continuing with defaults" echo "#upstart needs help for overlayfs (LP: #1213925)." > \ { error "failed to create /etc/init in overlay"; return 1; } { error "failed to get hostid"; return 1; } { error "failed to write public keys to metadata"; return 1; } echo "manage_etc_hosts: localhost" echo "chpasswd: { expire: false; }" error "failed to write user-data write to '$seed_d/user-data'"; # main just joins 2 modes of being called. from user one from lxc clone # if mountpoint is overlayfs then add '--create-etc-init' [ "${LXC_ROOTFS_PATH#overlayfs}" != "${LXC_ROOTFS_PATH}" ] &&