2 ##############################################################################
3 # Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 # bottlenecks: this file is copied from yardstick and slightly modified
10 ##############################################################################
12 # installs required packages
13 # must be run from inside the image (either chrooted or running)
20 # /etc/resolv.conf is a symbolic link to /run, restore at end
22 echo "nameserver $nameserver_ip" > /etc/resolv.conf
23 echo "nameserver 8.8.8.8" >> /etc/resolv.conf
24 echo "nameserver 8.8.4.4" >> /etc/resolv.conf
27 # Add hostname to /etc/hosts.
28 # Allow console access via pwd
29 cat <<EOF >/etc/cloud/cloud.cfg.d/10_etc_hosts.cfg
30 manage_etc_hosts: True
32 chpasswd: { expire: False }
36 #install some software
43 ln -sf /run/resolvconf/resolv.conf /etc/resolv.conf