mrrl-containers

MRRL version of container scripts
git clone https://ccx.te2000.cz/git/mrrl-containers
Log | Files | Refs

commit cbcc2cd5e73b5b4a5083a499a33d2907ee19f933
parent 91fe3b7c2adc9f27a52e665cd596a76152537782
Author: Jan Pobříslo <ccx@te2000.cz>
Date:   Mon, 24 Oct 2022 12:51:36 +0200

Add fakeroot support for apt
Diffstat:
Mzsh-functions/confz_containers_init | 31+++++++++++++++++++++++++++++++
Mzsh-functions/confz_site_containers_init | 2+-
2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/zsh-functions/confz_containers_init b/zsh-functions/confz_containers_init @@ -1330,6 +1330,37 @@ confz_container_debian_packages_installed_check() { (( $#missing == 0 )) } +confz_container_debian_packages_installed_with_fakeroot_check() { + checkvars containers_dir image_name packages svscan_dir + + require container_service_sysroot \ + :containers_dir :svscan_dir :image_name \ + %uid %gid %root %sysroot_user %sysroot_svc + + require container_service_sysroot \ + :containers_dir :svscan_dir :image_name packages=fakeroot + + local root=$vars[containers_dir]/systems/$vars[image_name] + local -a missing installed + local pkg + + installed=( ${(f)"$( + awk '/^Package: /{p=$2} /^Status:.* installed/{print p}' $vars[root]/var/lib/dpkg/status + )"} ) + + for pkg in $=vars[packages]; do + (( $installed[(I)${pkg}] )) || missing+=( $pkg ) + done + + do_command=( + $commands[cd] $vars[sysroot_svc] container_sysroot_run + /usr/bin/fakeroot-sysv /usr/bin/apt-get install --yes -- $missing + ) + + fail_reason="Following packages are not installed: $missing" + (( $#missing == 0 )) +} + confz_container_puppet_apt_repo_check() { checkvars containers_dir svscan_dir image_name arch suite defvar puppet_version 7 diff --git a/zsh-functions/confz_site_containers_init b/zsh-functions/confz_site_containers_init @@ -198,7 +198,7 @@ confz_site_container_debian_puppetserver_check() { :containers_dir :image_name :svscan_dir :arch :suite \?root require container_puppet_apt_repo \ :containers_dir :image_name :svscan_dir :arch :suite - require container_debian_packages_installed \ + require container_debian_packages_installed_with_fakeroot \ :containers_dir :svscan_dir :image_name :packages }