From: Dwight Engen Date: Wed, 9 Apr 2014 19:20:30 +0000 (-0400) Subject: lxc-oracle: use db_load from container X-Git-Tag: lxc-1.0.4~76 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=944476e98e9f7aa2507f0e3257dc4a21424dc601;p=thirdparty%2Flxc.git lxc-oracle: use db_load from container 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 Signed-off-by: Serge Hallyn --- diff --git a/templates/lxc-oracle.in b/templates/lxc-oracle.in index 92361f832..e88309e8a 100644 --- a/templates/lxc-oracle.in +++ b/templates/lxc-oracle.in @@ -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