mrrl

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

containers (7040B)


      1 #!/usr/bin/env pthbs-build
      2 #+busybox.379b7b2d8316b3678245563c8e592d71e6c380bc22a735c30c1c0e6f8f60caf3
      3 #+busybox-bzip2.4788e6edf9eeb73c7c665238a23aeed4703f8e25ab101509aee01440865ccdb1
      4 #+busybox-gzip.4fc908cacf4533192819578a079617c0cbe879b8ebd3e2140d896b067d3a574c
      5 #+busybox-lzop.e6e42a1a8451a4b845355899c9cd49efea2e395a0ef0c6ae7099103213a7bf4f
      6 #+busybox-unzip.93b5e83122059c87a2ddf489cdc7381bb80288630c508c218c2cfbadff524784
      7 #+busybox-xz.34137cc6ac8d23bf1bf5979b7fd047d4f50b34be07cd6ab636368952a199368d
      8 #+busybox-cpio.de88944ccff44a1f3abe06c42f83492a7e080de89fba27aadf5fe1a40e830cae
      9 #+busybox-dpkg.17e445a8089bc61db749a44c665597ecac3f21c4088daaa024f574412eb4d704
     10 #+busybox-rpm.669ed61ee218bc72206e069c896f392a025c88772ceb92ecb37b01ab0765baf8
     11 #+busybox-tar.15f67670238651149114006ae79359f24e1fa3c62be2e229a48f1334747ba413
     12 #+busybox-ed.78c51627a372c5b2ad3d046d0e77f341ae7c79917c4a16ca8abba284e7472cb7
     13 #+busybox-sed.8782396ae5c7b6e7d6bc8a93a7cff9912e6427e3d919dd5e5b00d1813ae88caf
     14 #+busybox-vi.e661d8eb052fbeebdd3be36ff6bd27651a7e59c857dad05c8633589790caa38c
     15 #+busybox-xxd.d2dc96e92cfdafae2c91d6fe897f42fdccae2dbc8b2d79f31eccc49d4e3a2d68
     16 #+busybox-process-extra.993cfd65eae2892ecb3fdfbece44b11e7ff6caa78f73e9f22bc2c97e7cd8a267
     17 #+busybox-procps.51ea8cb23d5eb1498f9167cc80b97c1a873758a8c1a7293079f50a2365466a71
     18 #+busybox-psmisc.ff1f9cf00f4c448946acb65d52b3b598e0495822af70b1504720cadf559e2090
     19 #+busybox-ash.7d10753f118afb2568e9f950c9cffa559b053a9b3ea516d6b46c3c73ebb6f8d8
     20 #+busybox-bc.c595636f103108c81f0ae55d2bf10d7cbc06ef1455a8353fcf04e42e765780a8
     21 #+busybox-coreutils.6b8071260ab4297f0e71013e42ac2a1a83fa99d92378d181ba49003fd349134a
     22 #+busybox-coreutils-extra.fc1b0766c881ee461d36c386833909553fcb0c31a547bfb563a7c6a50206bdcd
     23 #+busybox-daemontools.97aad28bbe5f38cff29db16c0f0d21e2fdc931825f683137df9bb57ef3a9b628
     24 #+busybox-grep.261a809c35cb58acc896143c2a81406a097f5870e02ce9906953181ef6b4c72b
     25 #+busybox-misc.5c2c025f1b74b9243a0128cd3f10dd1577b5ae123f53244d8e6895d4bdbd161d
     26 #+busybox-sh.25a9438d8449ade9c98af61b14af5711990dd002462a046b13b61969634c4d94
     27 #+busybox-util-linux-unpriv.4ea1c8c8746d7e80d36dea8924c576bc9666905b461dd543ceb5595394406c97
     28 #+busybox-findutils.052256c5bf9c3e7fef2e69d22f3d402d004f22113ce10b4d2c54ff417bf42622
     29 #+busybox-awk.f44da758ab8e737f05fb82ca4342acdf29ec44a9c2a9670cded75b04e8208058
     30 #+zsh.08bac2dd5a59108ff97c33e090b80edb1f96413026c95358eb03d4ef039a75a9
     31 #+pthbs-banginstall.abc777c872ae02114ad6beafef1e6fded22e76fcbcb88e79df1edb9b8e97f03d
     32 #+execline.5d88993134dc7d05e6124e7bd182279794ef9bac128f552aa1e98c17220e3c37
     33 #+alpine-keys.45710280cfed92e477b9d1845237fa7952cfaf0586b67d430f8c2b46161fdf60
     34 #+apk-tools.737744d7f1e537e0669488ffc6c29f7d50ac201aeebd20461c48e35406d4f43d
     35 #+xbps.555ac935d5ed432d29b5e2d5c902b217fe1abdc895d06289330614a0374e3e6e
     36 #+container-bin-image.7f9fd6ac09ed5f38f47b26d87c098ef9b129338d641648621f401fca146a77fb
     37 #@git:9820dbea1cf5060d7d04632f0fed7e91ea608309:containers
     38 
     39 
     40 # - build script start -
     41 
     42 prefix=/home/ccx/versions/$pthbs_package
     43 dest=${pthbs_destdir%/}${prefix}
     44 cd 'containers'
     45 
     46 
     47 
     48 mkdir -p "$dest"
     49 
     50 for d in bin sbin command; do
     51 	if test -d "$d"; then
     52 		pthbs-banginstall "$d"/* "${dest}"
     53 	fi
     54 done
     55 
     56 if test -d vim; then
     57 	mkdir -p "${dest}/vimfiles/pack/plugins/start"
     58 	mv -v vim "${dest}/vimfiles/pack/plugins/start/$pthbs_package"
     59 fi
     60 
     61 if test -d zsh-functions; then
     62 	mkdir -p "${dest}/zsh"
     63 	mv -v zsh-functions "${dest}/zsh/site-functions"
     64 fi
     65 
     66 mkdir "${dest}/data"
     67 mv -v service_scripts container_template "${dest}/data/"
     68 printf '%s\n' >"${dest}/zsh/site-functions/confz_containers_pthbs_init" \
     69 	"typeset -g container_template_dir='$prefix/data/container_template'" \
     70 	"typeset -g container_service_script_dir='$prefix/data/service_scripts'" \
     71 	"typeset -g container_ns_bin_dir='$prefix/deps/container-bin-image'" \
     72 	'container_ns_bin_dir=${container_ns_bin_dir:P}' \
     73 	"typeset -g container_alpine_keys_dir='$prefix/deps/keys/alpine/x86_64'" \
     74 	"typeset -g container_apk_executable='$prefix/deps/command/apk.static'" \
     75 	"typeset -g container_void_keys_dir='$prefix/deps/keys/void'" \
     76 	"typeset -g container_xbps_install_executable='$prefix/deps/command/xbps-install.static'"
     77 
     78 mkdir -p "${dest}/deps/command"
     79 ln -sf '/home/ccx/versions/apk-tools.737744d7f1e537e0669488ffc6c29f7d50ac201aeebd20461c48e35406d4f43d/command/apk.static' "${dest}/deps/command/"
     80 ln -sf '/home/ccx/versions/xbps.555ac935d5ed432d29b5e2d5c902b217fe1abdc895d06289330614a0374e3e6e/command/xbps-install.static' "${dest}/deps/command/"
     81 
     82 for f in '/home/ccx/versions/alpine-keys.45710280cfed92e477b9d1845237fa7952cfaf0586b67d430f8c2b46161fdf60'/keys/alpine/*/*; do
     83 	test -f "$f"
     84 	d=$(basename "${f%/*}")
     85 	mkdir -p "${dest}/deps/keys/alpine/$d"
     86 	ln -sf "$f" "${dest}/deps/keys/alpine/$d/"
     87 done
     88  
     89 mkdir -p "${dest}/deps/keys/void"
     90 for f in '/home/ccx/versions/xbps.555ac935d5ed432d29b5e2d5c902b217fe1abdc895d06289330614a0374e3e6e'/keys/void/*; do
     91 	ln -sf "$f" "${dest}/deps/keys/void/"
     92 done
     93 
     94 test -d '/home/ccx/versions/container-bin-image.7f9fd6ac09ed5f38f47b26d87c098ef9b129338d641648621f401fca146a77fb/container-bin-image'
     95 test -f '/home/ccx/versions/container-bin-image.7f9fd6ac09ed5f38f47b26d87c098ef9b129338d641648621f401fca146a77fb/container-bin-image/if'
     96 ln -sf '/home/ccx/versions/container-bin-image.7f9fd6ac09ed5f38f47b26d87c098ef9b129338d641648621f401fca146a77fb/container-bin-image' "${dest}/deps/"
     97  
     98 
     99 
    100 
    101 
    102 cd "$pthbs_destdir/home/ccx/versions/$pthbs_package"
    103 find -type d -o -print | awk -F/ '
    104 BEGIN {
    105 	x["./command/container_sysroot_run"]=1
    106 	x["./command/ns_run"]=1
    107 	x["./command/ns_umount_script.awk"]=1
    108 	x["./command/pidns_run.py"]=1
    109 	x["./zsh/site-functions/confz_containers_init"]=1
    110 	x["./zsh/site-functions/confz_site_containers_init"]=1
    111 }
    112 
    113 function r1(s) {
    114 	sub("^[.]/[^/]*", ".", s)
    115 	return s
    116 }
    117 function s1(repl, s) {
    118 	sub("^[.]/[^/]*", "./"repl, s)
    119 	return s
    120 }
    121 function link(src) {
    122 	x[$0]=0
    123 	printf "%s\t%s\n", $0, src
    124 	printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
    125 }
    126 $1!="."{exit 1}
    127 
    128 
    129 $2 == "vimfiles" { link($0); next }
    130 
    131 $2 == "config" { link($0); next }
    132 $2 == "keys" { link($0); next }
    133 $2 == "zsh" { link($0); next }
    134 $2 == "env" { link($0); next }
    135 $2 == "command" { link($0); next }
    136 $2 == "bin" { link(s1("command", $0)); next }
    137 
    138 $2 == "library.so" { link($0); next }
    139 $2 == "library" { link($0); next }
    140 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
    141 $2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next }
    142 
    143 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
    144 
    145 $2 == "man" { link($0); next }
    146 $2 == "info" { link($0); next }
    147 $2 == "doc" { link($0); next }
    148 $2 == "icons" { link($0); next }
    149 $2 == "terminfo" { link($0); next }
    150 $2 == "data" { link($0); next }
    151 $2 == "include" { link($0); next }
    152 
    153 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
    154 
    155 END {
    156 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
    157 	for(fname in x) {
    158 		if(x[fname]) {
    159 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
    160 			exit 3
    161 		}
    162 	}
    163 }' >.install-links.new
    164 mv .install-links.new .install-links
    165