Commit 944476e9 by Dwight Engen Committed by Stéphane Graber

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: 's avatarDwight Engen <dwight.engen@oracle.com> Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
parent bb418ce2
...@@ -498,15 +498,13 @@ container_rootfs_create() ...@@ -498,15 +498,13 @@ container_rootfs_create()
if [ $container_release_major -lt "6" ]; then if [ $container_release_major -lt "6" ]; then
if [ $host_distribution = "Ubuntu" -o $host_distribution = "Debian" ]; then if [ $host_distribution = "Ubuntu" -o $host_distribution = "Debian" ]; then
db_dump_cmd="db5.1_dump" db_dump_cmd="db5.1_dump"
db_load_cmd="db4.3_load"
fi fi
if [ $host_distribution = "OracleServer" -o \ if [ $host_distribution = "OracleServer" -o \
$host_distribution = "Fedora" ]; then $host_distribution = "Fedora" ]; then
db_dump_cmd="db_dump" db_dump_cmd="db_dump"
db_load_cmd="db43_load"
fi fi
cmds="$cmds $db_dump_cmd $db_load_cmd file" cmds="$cmds $db_dump_cmd file"
fi fi
for cmd in $cmds; do for cmd in $cmds; do
which $cmd >/dev/null 2>&1 which $cmd >/dev/null 2>&1
...@@ -588,6 +586,9 @@ container_rootfs_create() ...@@ -588,6 +586,9 @@ container_rootfs_create()
rpm --root $container_rootfs --initdb rpm --root $container_rootfs --initdb
yum_args="--installroot $container_rootfs --disablerepo=* --enablerepo=$repo -y --nogpgcheck" 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" 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 # we unshare the mount namespace because yum installing the ol4
# packages causes $rootfs/proc to be mounted on # packages causes $rootfs/proc to be mounted on
...@@ -640,7 +641,7 @@ container_rootfs_create() ...@@ -640,7 +641,7 @@ container_rootfs_create()
echo "Fixing (downgrading) rpm database from version $db_version" echo "Fixing (downgrading) rpm database from version $db_version"
rm -f $container_rootfs/var/lib/rpm/__db* rm -f $container_rootfs/var/lib/rpm/__db*
for db in $container_rootfs/var/lib/rpm/* ; do 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 mv $db.new $db
done done
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment