mrrl

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

linux-qemu-guest (3608B)


      1 #!/usr/bin/env pthbs-build
      2 #+busybox.ee3440974794767b833fd3299226771f170d3f8601cf225cb884f0a513db8ab3
      3 #+gnu-make.ba8d7c64a23885182fc1c9dc0331d52adcdbc45df6000fb81e8e1dd3ee05694b
      4 #+musl-cross-make.98979eb41109d371f19d0637d51116db18c7aeef61fbf804a68094c22a302a78
      5 #+diffutils.6969e96fd52d27b6d8c65d20fefbe74600ba820eaad1ba0054751b61752d8a86
      6 #+patch.05834624d74752d1cbe386cd61dbd0dd98d69aad7777828dcf07390ab8772d4b
      7 #+flex.322ebabc6eba6cdfd84b1b90f25790b8d917035872c2e6bb2f4c8e2f05eabcfd
      8 #+bison.1a189980b7909de4d49b57a4821f58147c2cc150fcd4227cb88b63342551a10f
      9 #+rsync.32b87b85bdc766953843afdf5f56abafcce8c9738dfdbe184a7f7be86a86b833
     10 #+zstd.8b11bd81c450d61aa6a44ffd019654c590439df68ebd8987db4cdbbcf182d67c
     11 #+libelf.fd68f03f03caea1e71ca235bd8e1c0d4dc9fe6b5556ff45c3892c4940218c018
     12 #+pkgconf-pkg-config.86f9c193f6ccc64cc2ac696a7e3a258f01b8d0c539312ae37c08ea2354332e90
     13 #@untar:-J:sha256:7586962547803be7ecc4056efc927fb25214548722bd28171172f3599abb9764:.
     14 #@sha256:cc2633ee136db0283d4faf7c27c890641e90cd835fc3adb19eaf0569e4078867:linux.config
     15 #@sha256:ff3ddd131d73fee6838b11a6c4773bdb85c5f60fdd4b9ac4120ced021c341417:noobjtool.patch
     16 
     17 printf '%s\n' "TODO: fix paths"; exit 1
     18 export CPATH="$pthbs_build_environment/include"
     19 
     20 cd 'linux-6.15'
     21 patch -p1 -N <../noobjtool.patch
     22 cp -v ../linux.config .config
     23  make olddefconfig
     24 diff -u ../linux.config .config || true
     25  make -j${JOBS:-1} -l$((1+${JOBS:-1})) \
     26 	V=1 \
     27 	HOSTLDFLAGS="-static -L$pthbs_build_environment/library" \
     28 	HOSTCFLAGS="-L$pthbs_build_environment/library"
     29 
     30 installdir="$pthbs_destdir//home/ccx/versions/$pthbs_package"
     31 mkdir -p "$installdir/doc/linux" "$installdir/boot"
     32 cp -v .config "$installdir/config"
     33 mv Documentation/* "$installdir/doc/linux"
     34  make modules_install install \
     35 	INSTALL_MOD_PATH="$installdir" \
     36 	INSTALL_MOD_STRIP=1 \
     37 	INSTALL_PATH="$installdir"/boot \
     38 	INSTALL_DTBS_PATH="$installdir/boot/dtbs"
     39 
     40 cd "$pthbs_destdir/home/ccx/versions/$pthbs_package"
     41 find -type d -o -print | awk -F/ '
     42 BEGIN {
     43 	kernel_name="6.15.0"
     44 	x["./boot/vmlinuz"]=1
     45 	x["./boot/System.map"]=1
     46 	x["./lib/modules/" kernel_name "/modules.alias"]=1
     47 	x["./lib/modules/" kernel_name "/modules.builtin"]=1
     48 	x["./lib/modules/" kernel_name "/modules.dep"]=1
     49 	x["./lib/modules/" kernel_name "/modules.order"]=1
     50 	x["./lib/modules/" kernel_name "/modules.symbols"]=1
     51 }
     52 
     53 function r1(s) {
     54 	sub("^[.]/[^/]*", ".", s)
     55 	return s
     56 }
     57 function s1(repl, s) {
     58 	sub("^[.]/[^/]*", "./"repl, s)
     59 	return s
     60 }
     61 function link(src) {
     62 	x[$0]=0
     63 	printf "%s\t%s\n", $0, src
     64 	printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
     65 }
     66 $1!="."{exit 1}
     67 
     68 
     69 $2 == "boot" { link($0); next }
     70 $2 == "lib" && $3 == "modules" { exit 3 }  # TODO move to better location
     71 $2 == "command" { link($0); next }
     72 $2 == "bin" { link(s1("command", $0)); next }
     73 
     74 $2 == "library.so" { link($0); next }
     75 $2 == "library" { link($0); next }
     76 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
     77 $2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next }
     78 
     79 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
     80 
     81 $2 == "man" { link($0); next }
     82 $2 == "info" { link($0); next }
     83 $2 == "doc" { link($0); next }
     84 $2 == "icons" { link($0); next }
     85 $2 == "terminfo" { link($0); next }
     86 $2 == "data" { link($0); next }
     87 $2 == "include" { link($0); next }
     88 
     89 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
     90 
     91 END {
     92 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
     93 	for(fname in x) {
     94 		if(x[fname]) {
     95 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
     96 			exit 3
     97 		}
     98 	}
     99 }' >.install-links.new
    100 mv .install-links.new .install-links