2
0
mirror of git://github.com/lxc/lxc synced 2025-08-30 08:22:00 +00:00

oracle template: install additional user specified pkgs

Fix lxc-create to not word split template arguments. This makes
lxc-create -n ol -t oracle -- -r "at cronie wget" work since the argument
to -r will be passed as one arg instead of three.

Fix oracle template -u option to shift the correct amount.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
Dwight Engen 2013-04-03 12:31:46 -04:00 committed by Stéphane Graber
parent 33892746e3
commit 9eee2f7739
2 changed files with 6 additions and 4 deletions

View File

@ -336,7 +336,7 @@ if [ "$backingstore" = "lvm" ]; then
fi
if [ ! -z "$lxc_template" ]; then
$template_path --path=$lxc_path/$lxc_name --name=$lxc_name $*
$template_path --path=$lxc_path/$lxc_name --name=$lxc_name "$@"
if [ $? -ne 0 ]; then
echo "$(basename $0): failed to execute template '$lxc_template'" >&2
cleanup

View File

@ -511,7 +511,7 @@ container_rootfs_create()
# we unshare the mount namespace because yum installing the ol4
# packages causes $rootfs/proc to be mounted on
lxc-unshare -s MOUNT yum -- $yum_args install $min_pkgs
lxc-unshare -s MOUNT yum -- $yum_args install $min_pkgs $user_pkgs
if [ $? -ne 0 ]; then
die "Failed to download and install the rootfs, aborting."
fi
@ -599,6 +599,7 @@ usage()
cat <<EOF
-a|--arch=<arch> architecture (ie. i386, x86_64)
-R|--release=<release> release to download for the new container
-r|--rpms=<rpm name> additional rpms to install into container
-u|--url=<url> replace yum repo url (ie. local yum mirror)
-t|--templatefs=<path> copy/clone rootfs at path instead of downloading
-h|--help
@ -608,7 +609,7 @@ EOF
return 0
}
options=$(getopt -o hp:n:a:R:u:t: -l help,path:,name:,arch:,release:,url:,templatefs: -- "$@")
options=$(getopt -o hp:n:a:R:r:u:t: -l help,path:,name:,arch:,release:,rpms:,url:,templatefs: -- "$@")
if [ $? -ne 0 ]; then
usage $(basename $0)
exit 1
@ -624,7 +625,8 @@ do
-n|--name) name=$2; shift 2;;
-a|--arch) arch=$2; shift 2;;
-R|--release) container_release_version=$2; shift 2;;
-u|--url) repourl=$2; shift;;
-r|--rpms) user_pkgs=$2; shift 2;;
-u|--url) repourl=$2; shift 2;;
-t|--templatefs) template_rootfs=$2; shift 2;;
--) shift 1; break ;;
*) break ;;