]> git.ipfire.org Git - thirdparty/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)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 11 Apr 2014 15:08:18 +0000 (11:08 -0400)
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 92361f832808fb8e68cd2ace2db9cc465c6aa279..e88309e8a0e00649fe82955c465a2a3440608839 100644 (file)
@@ -498,15 +498,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
@@ -588,6 +586,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
@@ -640,7 +641,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