|
|
|
@ -66,8 +66,7 @@ get_args(){
|
|
|
|
|
diff_=0
|
|
|
|
|
clear_=0
|
|
|
|
|
mirror_=mirror.calculate-linux.org
|
|
|
|
|
while (( $# > 0 ))
|
|
|
|
|
do
|
|
|
|
|
while (( $# > 0 )); do
|
|
|
|
|
case "$1" in
|
|
|
|
|
-P|--profile)
|
|
|
|
|
check_val $@
|
|
|
|
@ -423,7 +422,7 @@ create_lxc(){
|
|
|
|
|
# Очистка и создание пути для монтирования ресурсов из хостовой машины
|
|
|
|
|
mv $path_lxc/rootfs/var/calculate $path_lxc
|
|
|
|
|
mkdir $path_lxc/rootfs/var/calculate
|
|
|
|
|
calculate_mount="lxc.mount.entry = ${path_lxc}/calculate var/calculate none rw,bind 0 0"$'\n'
|
|
|
|
|
calculate_mount="lxc.mount.entry = ${path_lxc}/calculate var/calculate none rw,bind 0 0"
|
|
|
|
|
calculate_dir="${path_lxc}/calculate"
|
|
|
|
|
eend
|
|
|
|
|
else
|
|
|
|
@ -444,7 +443,7 @@ create_lxc(){
|
|
|
|
|
portage_mount="lxc.mount.entry = ${gentoo_from} ${gentoo_to} none ro,bind 0 0"
|
|
|
|
|
|
|
|
|
|
if [[ ! -e /var/db/repos/container ]]; then
|
|
|
|
|
container_mount="lxc.mount.entry = /var/calculate/repos/container var/db/repos/container none ro,bind 0 0"$'\n'
|
|
|
|
|
container_mount="lxc.mount.entry = /var/calculate/repos/container var/db/repos/container none ro,bind 0 0"
|
|
|
|
|
if [[ -e /var/calculate/repos/container ]]; then
|
|
|
|
|
rm -rf ${path_lxc}/rootfs/var/db/repos/container
|
|
|
|
|
else
|
|
|
|
@ -466,7 +465,7 @@ create_lxc(){
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
# для совместимости с предыдушими установками
|
|
|
|
|
container_mount="lxc.mount.entry = /var/db/repos/calculate var/db/repos/container none ro,bind 0 0"$'\n'
|
|
|
|
|
container_mount="lxc.mount.entry = /var/db/repos/container var/db/repos/container none ro,bind 0 0"
|
|
|
|
|
rm -rf ${path_lxc}/rootfs/var/db/repos/container
|
|
|
|
|
fi
|
|
|
|
|
mkdir $path_lxc/rootfs/var/db/repos/container
|
|
|
|
@ -517,8 +516,10 @@ create_lxc(){
|
|
|
|
|
${network_conf}
|
|
|
|
|
|
|
|
|
|
# Mount points
|
|
|
|
|
${container_mount}${calculate_mount}${portage_mount}
|
|
|
|
|
${calculate_mount}
|
|
|
|
|
${container_mount}
|
|
|
|
|
lxc.mount.entry = /var/db/repos/calculate var/db/repos/calculate none ro,bind 0 0
|
|
|
|
|
${portage_mount}
|
|
|
|
|
lxc.mount.entry = /var/cache/edb/binhost var/cache/edb/binhost none ro,bind 0 0
|
|
|
|
|
lxc.mount.entry = /var/calculate/packages var/calculate/packages none rw,bind 0 0
|
|
|
|
|
lxc.mount.entry = /var/calculate/distfiles var/calculate/distfiles none rw,bind 0 0
|
|
|
|
@ -577,8 +578,7 @@ start_container(){
|
|
|
|
|
ebegin $"Starting container"
|
|
|
|
|
lxc-start $name_lxc
|
|
|
|
|
# ожидание первоначальной настройки контейнера
|
|
|
|
|
while ! lxc-attach $name_lxc -- ps ax | grep 'init \[3\]' > /dev/null
|
|
|
|
|
do
|
|
|
|
|
while ! lxc-attach $name_lxc -- ps ax | grep 'init \[3\]' > /dev/null; do
|
|
|
|
|
sleep 0.1
|
|
|
|
|
done
|
|
|
|
|
eend
|
|
|
|
@ -617,8 +617,7 @@ update_prepare(){
|
|
|
|
|
eend
|
|
|
|
|
|
|
|
|
|
ebegin $"Creating mount points"
|
|
|
|
|
for mount_point in $(grep '^lxc.mount.entry' $path_work/$name_upgrading/config | awk {'print $4'})
|
|
|
|
|
do
|
|
|
|
|
for mount_point in $(grep '^lxc.mount.entry' $path_work/$name_upgrading/config | awk {'print $4'}); do
|
|
|
|
|
if [ ! -e "$path_lxc/rootfs/$mount_point" ]; then
|
|
|
|
|
mkdir -p "$path_lxc/rootfs/$mount_point"
|
|
|
|
|
fi
|
|
|
|
@ -759,8 +758,8 @@ upgrade_lxc(){
|
|
|
|
|
|
|
|
|
|
[ $diff_ == 1 ] && diff_pkg # Отобразим разницу в пакетах
|
|
|
|
|
|
|
|
|
|
while ! (test -a $path_work/$name_upgrading/rootfs$num_next/etc/resolv.conf)
|
|
|
|
|
do sleep 0.1
|
|
|
|
|
while ! (test -a $path_work/$name_upgrading/rootfs$num_next/etc/resolv.conf); do
|
|
|
|
|
sleep 0.1
|
|
|
|
|
done
|
|
|
|
|
einfo $(lxc-info -i $name_upgrading)
|
|
|
|
|
|
|
|
|
@ -784,8 +783,7 @@ diff_pkg(){
|
|
|
|
|
find $path_lxc_prepare/var/db/pkg/ -type d | sed 's/.*db\/pkg\///' | grep \/ | sort > $lock/new
|
|
|
|
|
cp $lock/new $lock/work
|
|
|
|
|
|
|
|
|
|
while IFS= read -r pkg
|
|
|
|
|
do
|
|
|
|
|
while IFS= read -r pkg; do
|
|
|
|
|
if grep -q $pkg$ $lock/cur; then
|
|
|
|
|
sed -i "/$pkg/d" $lock/new
|
|
|
|
|
sed -i "/$pkg/d" $lock/cur
|
|
|
|
@ -812,8 +810,7 @@ clear_cache(){
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
for i in /var/calculate/lxc/*
|
|
|
|
|
do
|
|
|
|
|
for i in /var/calculate/lxc/*; do
|
|
|
|
|
if [[ $i == /var/calulate/lxc/* ]]; then
|
|
|
|
|
break
|
|
|
|
|
fi
|
|
|
|
|