sys-apps/calculate-toolkit: update

pull/3/head
Alexander Tratsevskiy 2 years ago
parent 01104aff95
commit c888dd9394

@ -41,4 +41,5 @@ PATCHES=(
"${FILESDIR}"/${P}-mac.patch
"${FILESDIR}"/${P}-unique_veth_pair.patch
"${FILESDIR}"/${P}-noop_net.patch
"${FILESDIR}"/${P}-bash.patch
)

@ -0,0 +1,152 @@
diff --git a/cl-lxc b/cl-lxc
index 2cee054..ad4ab1a 100755
--- a/cl-lxc
+++ b/cl-lxc
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Copyright 2022 Mir Calculate. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -269,25 +269,25 @@ set_vars(){
debug_vars(){
local log=/var/log/calculate/cl-lxc.log
- cat > /var/log/calculate/cl-lxc.log <<EOF
-lxc_release = $lxc_release
-net_domain = $net_domain
-path_def = $path_def
-name_lxc = $name_lxc
-name_upgrading = $name_upgrading
-name_rootfs = $name_rootfs
-status_lxc = $status_lxc
-path_work = $path_work
-path_lxc = $path_lxc
-path_cache = $path_cache
-path_lxc_prepare = $path_lxc_prepare
-path_change = $path_change
-type_fs = $type_fs
-num_cur = $num_cur
-num_next = $num_next
-lxc_distro = $lxc_distro
-
-EOF
+ cat > /var/log/calculate/cl-lxc.log <<-EOF
+ lxc_release = $lxc_release
+ net_domain = $net_domain
+ path_def = $path_def
+ name_lxc = $name_lxc
+ name_upgrading = $name_upgrading
+ name_rootfs = $name_rootfs
+ status_lxc = $status_lxc
+ path_work = $path_work
+ path_lxc = $path_lxc
+ path_cache = $path_cache
+ path_lxc_prepare = $path_lxc_prepare
+ path_change = $path_change
+ type_fs = $type_fs
+ num_cur = $num_cur
+ num_next = $num_next
+ lxc_distro = $lxc_distro
+
+ EOF
}
check_vars(){
@@ -502,48 +502,47 @@ ${veth_pair}"
sed -i -r 's/(lxc.mount.auto)/#\1/g' ${path_lxc}/config
sed -i "s/${lxc_distro}/${name_lxc}/g" ${path_lxc}/config
- cat << EOL >> ${path_lxc}/config
-${network_conf}
-
-${calculate_mount}${portage_mount}
-lxc.mount.entry = /var/db/repos/calculate var/db/repos/calculate none ro,bind 0 0
-${container_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
-EOL
+ cat <<- EOF >> ${path_lxc}/config
+ ${network_conf}
+ ${calculate_mount}${portage_mount}
+ lxc.mount.entry = /var/db/repos/calculate var/db/repos/calculate none ro,bind 0 0
+ ${container_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
+ EOF
eend
ebegin $"Configuring utility variables"
- cat << EOL > ${calculate_dir}/calculate.env
-[install]
-os_install_net_hostname = ${name_lxc}
-os_install_net_domain = ${net_domain}
-os_install_locale_lang = ${LANG/.utf8/}
-os_install_clock_timezone = $(cat /etc/timezone)
-
-[update]
-cl_update_rep_name =
-cl_update_rep_url =
-cl_update_eixupdate_force = force
-cl_update_force_fix_set = on
-EOL
+ cat <<- EOF > ${calculate_dir}/calculate.env
+ [install]
+ os_install_net_hostname = ${name_lxc}
+ os_install_net_domain = ${net_domain}
+ os_install_locale_lang = ${LANG/.utf8/}
+ os_install_clock_timezone = $(cat /etc/timezone)
+
+ [update]
+ cl_update_rep_name =
+ cl_update_rep_url =
+ cl_update_eixupdate_force = force
+ cl_update_force_fix_set = on
+ EOF
eend
ebegin $"Creating templates"
mkdir -p ${calculate_dir}/templates/default
- cat << EOL > ${calculate_dir}/templates/default/.calculate_directory
-# Calculate env=install ac_install_live==on append=skip
-EOL
+ cat <<- EOF > ${calculate_dir}/templates/default/.calculate_directory
+ # Calculate env=install ac_install_live==on append=skip
+ EOF
if [ $net_conf == veth ]
then
- cat << EOL > ${calculate_dir}/templates/default/runlevel.eth0
-# Calculate mergepkg(sys-apps/openrc)!= path=/etc/runlevels/default name=net.eth0 protected link=/etc/init.d/net.lo symbolic
-EOL
+ cat <<- EOF > ${calculate_dir}/templates/default/runlevel.eth0
+ # Calculate mergepkg(sys-apps/openrc)!= path=/etc/runlevels/default name=net.eth0 protected link=/etc/init.d/net.lo symbolic
+ EOF
fi
- cat << EOL > ${calculate_dir}/templates/default/portage.binhost
-# Calculate mergepkg(sys-apps/portage)!= path=/etc/portage/make.conf name=binhost protected comment=#
-$(emerge --info | grep PORTAGE_BINHOST)
-EOL
+ cat <<- EOF > ${calculate_dir}/templates/default/portage.binhost
+ # Calculate mergepkg(sys-apps/portage)!= path=/etc/portage/make.conf name=binhost protected comment=#
+ $(emerge --info | grep PORTAGE_BINHOST)
+ EOF
eend
[ -z "$name_upgrading" ] && printf $"Your container is ready. To start it, please run 'lxc-start %s'.\n" $name_lxc
true
@@ -652,11 +651,11 @@ upgrade_lxc() {
eend
ebegin $"Preparing first boot setup script"
-cat << EOL > $path_work/$name_upgrading/rootfs$num_next/etc/local.d/firststart.start
-cl-core --method setup_system --no-progress --usenew-conf --network on
-openrc
-rm /etc/local.d/firststart.start
-EOL
+ cat <<- EOF > $path_work/$name_upgrading/rootfs$num_next/etc/local.d/firststart.start
+ cl-core --method setup_system --no-progress --usenew-conf --network on
+ openrc
+ rm /etc/local.d/firststart.start
+ EOF
chmod 755 $path_work/$name_upgrading/rootfs$num_next/etc/local.d/firststart.start
eend
Loading…
Cancel
Save