mrrl

Minimal Reliable Reproducible Linux
git clone https://ccx.te2000.cz/git/mrrl
Log | Files | Refs | Submodules | README

system-config (2648B)


      1 {%- set pkg_source="git" -%}
      2 {% extends "genlinks" %}
      3 {%- import "package_sets" as ps -%}
      4 {%- block template_deps -%}
      5 {{ ps.busybox_common() }}
      6 {{ ps.busybox_uncommon() }}
      7 #+{{pkg_install_name("busybox-findutils")}}
      8 #+{{pkg_install_name("nawk")}}
      9 {% endblock %}
     10 {% block package_deps -%}
     11 #+{{pkg_install_name("diffutils")}}
     12 #+{{pkg_install_name("gnu-make")}}
     13 #+{{pkg_install_name("aat")}}
     14 #+{{pkg_install_name("fileset")}}
     15 #+{{pkg_install_name("rsync")}}
     16 #+{{pkg_install_name("execline")}}
     17 #+{{pkg_install_name("kbd")}}
     18 #+{{pkg_install_name("mdevd")}}
     19 #+{{pkg_install_name("s6-linux-utils")}}
     20 #+{{pkg_install_name("s6-rc")}}
     21 #+{{pkg_install_name("s6")}}
     22 #+{{pkg_install_name("zsh")}}
     23 #+{{pkg_install_name("libcgroup")}}
     24 #+{{pkg_install_name("system-config-scripts")}}
     25 #+{{pkg_install_name("logincaps")}}
     26 #+{{pkg_install_name(["busybox-modutils", "busybox:modutils"][kernel is defined|int])}}
     27 {% endblock %}
     28 {% block build_and_install -%}
     29 err_notfound() {
     30 	printf >&2 'Executable not found for command "%s"\n' "$1"
     31 	exit 1
     32 }
     33 linkdep() {
     34 	exe=$(command which "$1") || err_notfound "$1"
     35 	exe=$(realpath "$exe")
     36 	name=$(basename "$1")
     37 	if ! test -x "$exe"; then
     38 		printf 'Error: executable not found: %s\n' "$1"
     39 	fi
     40 	mkdir -p "$dest/deps/command"
     41 	ln -sf $exe "$dest/deps/command/$name"
     42 }
     43 
     44 printf '%s\n' >config/etc/motd \
     45 	"Welcome to $(cat ./config/hostname)!" \
     46 	'Current running configuration was generated from {{name}}:{{submodule.current[name]}}' \
     47 	'Last change on {{submodule.commit_info(submodule.current[name])}}'
     48 
     49 printf '%s\n' >config/etc/skel/loginexec \
     50 	"#!$(which execlineb) -S0" \
     51 	'user_loginexec $@'
     52 chmod +x config/etc/skel/loginexec
     53 
     54 env 'pthbs_path_{{name}}'="$prefix" \
     55 	'pthbs_path_containers={{pkg_install_dir("containers.environment")}}' \
     56 	'pthbs_path_mdevd={{pkg_install_dir("mdevd.environment")}}' \
     57 	{{make}} all
     58 
     59 sort -u build/execfile | while IFS= read exename; do
     60 	linkdep "$exename"
     61 done
     62 
     63 mkdir "$dest/command"
     64 awk -v "zsh=$(which zsh)" <./postinstall >"$dest/command/install-as-current-environment.postinstall" '
     65 NR==1 { print "#!" zsh; next }
     66 /@@current@@/ { print "current=/run/current"; next }
     67 /@@versions@@/ { print "versions='{{versions}}'"; next }
     68 1
     69 '
     70 chmod +x "$dest/command/install-as-current-environment.postinstall"
     71 
     72 mkdir -p "$dest/config/"
     73 rsync -ai ./config/ "$dest/config/"
     74 rsync -ai ./out/ "$dest/config/"
     75 mv -v keys "$dest/"
     76 
     77 {% endblock -%}
     78 {% block genlinks_begin %}
     79 	x["./command/install-as-current-environment.postinstall"]=1
     80 	x["./config/etc/fstab"]=1
     81 	x["./config/etc/motd"]=1
     82 	x["./config/etc/skel/loginexec"]=1
     83 	x["./config/hostname"]=1
     84 	x["./keys/ssh/authorized_keys/root"]=1
     85 {% endblock %}