[lxc-devel] [PATCH] oracle template: install additional user specified pkgs

Dwight Engen dwight.engen at oracle.com
Wed Apr 3 16:31:46 UTC 2013


Can I assume since the final pull request was sent for 0.9 that we can
start sending patches for post 0.9 in? Hope so :)

---

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 at oracle.com>
---
 src/lxc/lxc-create.in   | 2 +-
 templates/lxc-oracle.in | 8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/lxc/lxc-create.in b/src/lxc/lxc-create.in
index ebbdd7b..fbb566f 100644
--- a/src/lxc/lxc-create.in
+++ b/src/lxc/lxc-create.in
@@ -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
diff --git a/templates/lxc-oracle.in b/templates/lxc-oracle.in
index aad21e8..16a622e 100644
--- a/templates/lxc-oracle.in
+++ b/templates/lxc-oracle.in
@@ -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 ;;
-- 
1.7.12.3





More information about the lxc-devel mailing list