Don't use sudo for diskimage-create.sh script

Root privileges needed for only installs packages

Change-Id: I7d7395f3a3cb95f595895c169ae530bb3aa10718
This commit is contained in:
Sergey Reshetnyak 2015-03-22 19:13:12 +03:00
parent 4cd8af1b4e
commit 81d2ab1fd1
4 changed files with 15 additions and 15 deletions

View File

@ -7,6 +7,6 @@ Script for creating Fedora and Ubuntu cloud images with our elements and default
.. sourcecode:: bash
sudo bash diskimage-create.sh
bash diskimage-create.sh
Note: More information about script `diskimage-create <https://github.com/openstack/sahara-image-elements/blob/master/diskimage-create/README.rst>`_

View File

@ -13,13 +13,13 @@ For users:
.. sourcecode:: bash
sudo bash sahara-image-elements/diskimage-create/diskimage-create.sh
bash sahara-image-elements/diskimage-create/diskimage-create.sh
3. If you want to use your local mirrors, you should specify http urls for Fedora, CentOS and Ubuntu mirrors using parameters 'FEDORA_MIRROR', 'CENTOS_MIRROR' and 'UBUNTU_MIRROR' like this:
.. sourcecode:: bash
sudo USE_MIRRORS=true FEDORA_MIRROR="url_for_fedora_mirror" CENTOS_MIRROR="url_for_centos_mirror" UBUNTU_MIRROR="url_for_ubuntu_mirror" bash sahara-image-elements/diskimage-create/diskimage-create.sh
USE_MIRRORS=true FEDORA_MIRROR="url_for_fedora_mirror" CENTOS_MIRROR="url_for_centos_mirror" UBUNTU_MIRROR="url_for_ubuntu_mirror" bash sahara-image-elements/diskimage-create/diskimage-create.sh
NOTE: Do not create all images for all plugins with the same mirrors. Different plugins use different OS version.
@ -27,19 +27,19 @@ NOTE: Do not create all images for all plugins with the same mirrors. Different
.. sourcecode:: bash
sudo bash sahara-image-elements/diskimage-create/diskimage-create.sh -p [vanilla|spark|hdp|cloudera|storm|mapr]
bash sahara-image-elements/diskimage-create/diskimage-create.sh -p [vanilla|spark|hdp|cloudera|storm|mapr]
5. To select which hadoop version to target use the '-v' commandline option like this:
.. sourcecode:: bash
sudo bash sahara-image-elements/diskimage-create/diskimage-create.sh -v [1|2|plain]
bash sahara-image-elements/diskimage-create/diskimage-create.sh -v [1|2|plain]
6. To select which operating system to target use the '-i' commandline option like this:
.. sourcecode:: bash
sudo bash sahara-image-elements/diskimage-create/diskimage-create.sh -i [ubuntu|fedora|centos]
bash sahara-image-elements/diskimage-create/diskimage-create.sh -i [ubuntu|fedora|centos]
7. If the host system is missing packages required for diskimage-create.sh, the '-u' commandline option will instruct the script to install them without prompt.
@ -56,7 +56,7 @@ Resizing disk space during firstboot on that images fails with errors (https://b
.. sourcecode:: bash
sudo DIB_IMAGE_SIZE=40 bash sahara-image-elements/diskimage-create/diskimage-create.sh -i centos
DIB_IMAGE_SIZE=40 bash sahara-image-elements/diskimage-create/diskimage-create.sh -i centos
For all another images parameter DIB_IMAGE_SIZE will be unset.
@ -73,10 +73,10 @@ For developers:
.. sourcecode:: bash
sudo SIM_REPO_PATH="$(pwd)/sahara-image-elements" DIB_REPO_PATH="$(pwd)/diskimage-builder" bash sahara-image-elements/diskimage-create/diskimage-create.sh
SIM_REPO_PATH="$(pwd)/sahara-image-elements" DIB_REPO_PATH="$(pwd)/diskimage-builder" bash sahara-image-elements/diskimage-create/diskimage-create.sh
3. If you want to specify the diskimage-builder repository branch, or tag, that is used during the diskimage-create script there are two methods. The '-m' option of diskimage-create.sh will always use the 'master' branch of diskimage-builder. Alternatively exporting 'DIB_REPO_BRANCH' will allow the use of an arbitrary branch or tag. By default diskimage-create will use a known good tag from the upstream repository.
.. sourcecode:: bash
sudo DIB_REPO_BRANCH="custom-branch" bash sahara-image-elements/diskimage-create/diskimage-create.sh
DIB_REPO_BRANCH="custom-branch" bash sahara-image-elements/diskimage-create/diskimage-create.sh

View File

@ -208,16 +208,16 @@ if need_required_packages; then
# install required packages if requested
if [ -n "$DIB_UPDATE_REQUESTED" ]; then
if [ "$platform" = 'NAME="Ubuntu"' ]; then
apt-get install $package_list -y
sudo apt-get install $package_list -y
elif [ "$platform" = 'NAME=openSUSE' ]; then
zypper --non-interactive --gpg-auto-import-keys in $package_list
sudo zypper --non-interactive --gpg-auto-import-keys in $package_list
else
# fedora, centos, and rhel share an install command
if [ ${platform:0:6} = "CentOS" ]; then
# install EPEL repo, in order to install argparse
rpm -Uvh --force http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -Uvh --force http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
fi
yum install $package_list -y
sudo yum install $package_list -y
fi
else
echo "Missing one of the following packages: $package_list"
@ -662,4 +662,4 @@ if [ -z "$PLUGIN" -o "$PLUGIN" = "mapr" ]; then
fi
popd # out of $TEMP
rm -rf $TEMP
sudo rm -rf $TEMP

View File

@ -3,4 +3,4 @@
PLUGIN=$1
export SIM_REPO_PATH=$(pwd)
sudo -E ./diskimage-create/diskimage-create.sh -u -p $PLUGIN
./diskimage-create/diskimage-create.sh -u -p $PLUGIN