]> git.proxmox.com Git - mirror_lxc.git/commitdiff
lxc-oracle: use db_load from container
authorDwight Engen <dwight.engen@oracle.com>
Wed, 9 Apr 2014 19:20:30 +0000 (15:20 -0400)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 9 Apr 2014 19:30:15 +0000 (14:30 -0500)
This makes it so that the host doesn't need to have an old, compat
version of db43_load installed by using the db_load from the just
installed container. Some newer distributions do not even have an old
enough compat-db4 package available.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
templates/lxc-oracle.in

index d1718afc376fcb49f73cc4d66eec70e96f400a1e..3d245ebc57e39c8caa5ac5c51929f00e4eaef611 100644 (file)
@@ -556,15 +556,13 @@ container_rootfs_create()
     if [ $container_release_major -lt "6" ]; then
         if [ $host_distribution = "Ubuntu" -o $host_distribution = "Debian" ]; then
             db_dump_cmd="db5.1_dump"
-            db_load_cmd="db4.3_load"
         fi
         if [ $host_distribution = "OracleServer" -o \
              $host_distribution = "Fedora" ]; then
             db_dump_cmd="db_dump"
-            db_load_cmd="db43_load"
         fi
 
-        cmds="$cmds $db_dump_cmd $db_load_cmd file"
+        cmds="$cmds $db_dump_cmd file"
     fi
     for cmd in $cmds; do
         which $cmd >/dev/null 2>&1
@@ -661,6 +659,9 @@ container_rootfs_create()
         rpm --root $container_rootfs --initdb
         yum_args="--installroot $container_rootfs --disablerepo=* --enablerepo=$repo -y --nogpgcheck"
         min_pkgs="yum initscripts passwd rsyslog vim-minimal openssh-server openssh-clients dhclient chkconfig rootfiles policycoreutils oraclelinux-release"
+        if [ $container_release_major -lt "6" ]; then
+            min_pkgs="$min_pkgs db4-utils"
+        fi
 
         # we unshare the mount namespace because yum installing the ol4
         # packages causes $rootfs/proc to be mounted on
@@ -722,7 +723,7 @@ container_rootfs_create()
             echo "Fixing (downgrading) rpm database from version $db_version"
             rm -f $container_rootfs/var/lib/rpm/__db*
             for db in $container_rootfs/var/lib/rpm/* ; do
-                $db_dump_cmd $db |$db_load_cmd $db.new
+                $db_dump_cmd $db |chroot $container_rootfs db_load /var/lib/rpm/`basename $db`.new
                 mv $db.new $db
             done
         fi