=== modified file 'zsh-functions/confz_containers_init' --- old/zsh-functions/confz_containers_init 2021-01-15 17:43:24 +0000 +++ new/zsh-functions/confz_containers_init 2021-01-15 17:09:20 +0000 @@ -50,8 +50,8 @@ require fs_l filename=$vars[svc_dir]/data/root \ destination=$vars[root_link] - require fs_contentnl filename=$vars[svc_dir]/data/fstab \ - content=$vars[fstab] + require fs_c filename=$vars[svc_dir]/data/fstab \ + content_call="printf '%s\n' ${(Q)vars[fstab]}" require fs_m filename=$vars[svc_dir]/data/fstab mode=644 require fs_l filename=$vars[svc_dir]/run \ @@ -142,10 +142,10 @@ root_link=$container_user_dir/root \ fstab=${(F)fstab} \?down require fs_d filename=$svc_dir/env - require fs_contentnl filename=$svc_dir/env/CONTAINER_USER \ - content=$vars[user] - require fs_contentnl filename=$svc_dir/env/CONTAINER_NAME \ - content=$vars[image_name] + require fs_c filename=$svc_dir/env/CONTAINER_USER \ + content_call="printf '%s\n' "${(q)vars[user]} + require fs_c filename=$svc_dir/env/CONTAINER_NAME \ + content_call="printf '%s\n' "${(q)vars[image_name]} } confz_container_service_xsession_check() { @@ -192,10 +192,10 @@ root_link=$container_user_dir/root \ fstab=${(F)fstab} \?down require fs_d filename=$svc_dir/env - require fs_contentnl filename=$svc_dir/env/CONTAINER_USER \ - content=$vars[user] - require fs_contentnl filename=$svc_dir/env/CONTAINER_NAME \ - content=$HOST + require fs_c filename=$svc_dir/env/CONTAINER_USER \ + content_call="printf '%s\n' "${(q)vars[user]} + require fs_c filename=$svc_dir/env/CONTAINER_NAME \ + content_call="printf '%s\n' "${(q)HOST} } # --- old @@ -224,10 +224,10 @@ # repos=( $=vars[repositories] ) require fs_d flags=p filename=$R/etc/apk - require fs_contentnl filename=$R/etc/apk/repositories \ - content=$vars[repositories] - require fs_contentnl filename=$R/etc/apk/arch \ - content=$vars[arch] + require fs_c flags= filename=$R/etc/apk/repositories \ + content_call="printf '%s\n' "$vars[repositories] + require fs_c flags= filename=$R/etc/apk/arch \ + content_call="printf '%s\n' "$vars[arch] } confz_container_alpine_base_check() { @@ -262,3 +262,78 @@ ) grep -q '^'$vars[package]'$' $vars[container_root]/etc/apk/world } + +containers_fstab_gen(){ + printf '%\n' \ + "overlay $2/union overlay nosuid,nodev,lowerdir=$1,upperdir=$2/changes,workdir=$2/work 0 0" \ + "run_tmpfs $2/union/run tmpfs rw,nosuid,nodev,mode=755,uid=1000 0 0" +} + +confz_container_user_setup_check() { + checkvars container_name containers_dir user + defvar container_root $vars[containers_dir]/$vars[container_name] + defvar nameserver 127.0.0.1 + + local D=$vars[containers_dir]/user/$vars[user]/$vars[container_name] + local S=$vars[containers_dir]/service/$vars[container_name] + local uid=$(awk