mrrl

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

linux (3202B)


      1 #!/usr/bin/env pthbs-build
      2 #+busybox.7818e9d6df97d97317c8fcdf404811731aa0c5c3ab7eb6aec00c9652b6da511c
      3 #+gnu-make.152d99fd58e3130b4bd4d23833643ca418555a0560e88962cd8a28ffcd9a9ab7
      4 #+musl-cross-make.675bc960d97b88b341ba4c64ea1b10f6afd9c9f0394ed84ca848768c5e1b646c
      5 #+diffutils.23bff923b4bf51b9e847332026fe76c89752a1ee5998ac80c7565310bcfa39e1
      6 #+patch.7eea774dc5402ab08569b8a038980075864cade9b04048a89bc70f65a54bd72e
      7 #+flex.5161ec585b7f27d244f7a454e7566c5ab5f63315e8a7fc61804973af5862bbc7
      8 #+bison.bda0e07151bdf7813a4aa5bb2cf81fc5e0a0ff548eece5889c2b4d6d7223e360
      9 #+rsync.a49c7aadcfbc5214221fc1d1d9292b452f98891205b15cea0b5af1bf6179d227
     10 #+libelf-compat.bb519eb8dada12f02c07717bd3b73cb7e2d8ebf9255b8a1a19598bce5d4a4f5a
     11 #@untar:-J:sha256:2ca1f17051a430f6fed1196e4952717507171acfd97d96577212502703b25deb:.
     12 #@sha256:d9b01e4dac3dd140c394227603c8b3339bb2f1e10c97afd3607d84e3003ec75a:patch-6.1.34.xz
     13 #@sha256:cb8081499f316acdc7b31b486b8d68afd68094db8f420aba0eab2c3e8de13888:linux.config
     14 #@sha256:ff3ddd131d73fee6838b11a6c4773bdb85c5f60fdd4b9ac4120ced021c341417:noobjtool.patch
     15 
     16 export CFLAGS="-L$pthbs_build_environment/library -L$pthbs_build_environment/library.so"
     17 export LD_LIBRARY_PATH="$pthbs_build_environment/library:$pthbs_build_environment/library.so"
     18 export CPATH="$pthbs_build_environment/include"
     19 
     20 cd linux-6.1
     21 unxz -c < ../patch-6.1.34.xz | patch -p1 -N
     22 patch -p1 -N <../noobjtool.patch
     23 cp -v ../linux.config .config
     24 linux64 make -j${JOBS:-1} -l$((1+${JOBS:-1})) olddefconfig
     25 diff -u ../linux.config .config || true
     26 linux64 make -j${JOBS:-1} -l$((1+${JOBS:-1}))
     27 
     28 installdir="$pthbs_destdir//versions/$pthbs_package"
     29 mkdir -p "$installdir"
     30 cp -v .config "$installdir/config"
     31 mkdir -p "$installdir/doc"
     32 mv Documentation/* "$installdir/doc"
     33 linux64 make modules_install install \
     34 	INSTALL_MOD_PATH="$installdir" \
     35 	INSTALL_MOD_STRIP=1 \
     36 	INSTALL_PATH="$installdir"/boot \
     37 	INSTALL_DTBS_PATH="$installdir/boot/dtbs"
     38 
     39 cd "$pthbs_destdir/versions/$pthbs_package"
     40 find -type d -o -print | awk -F/ '
     41 BEGIN {
     42 }
     43 
     44 function r1(s) {
     45 	sub("^[.]/[^/]*", ".", s)
     46 	return s
     47 }
     48 function s1(repl, s) {
     49 	sub("^[.]/[^/]*", "./"repl, s)
     50 	return s
     51 }
     52 function link(src) {
     53 	x[$0]=0
     54 	printf "%s\t%s\n", $0, src
     55 	printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
     56 }
     57 $1!="."{exit 1}
     58 
     59 
     60 $2 == "command" { link($0); next }
     61 $2 == "bin" { link(s1("command", $0)); next }
     62 
     63 $2 == "library.so" { link($0); next }
     64 $2 == "library" { link($0); next }
     65 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
     66 $2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next }
     67 
     68 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
     69 
     70 $2 == "man" { link($0); next }
     71 $2 == "info" { link($0); next }
     72 $2 == "doc" { link($0); next }
     73 $2 == "icons" { link($0); next }
     74 $2 == "terminfo" { link($0); next }
     75 $2 == "data" { link($0); next }
     76 $2 == "include" { link($0); next }
     77 
     78 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
     79 
     80 END {
     81 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
     82 	for(fname in x) {
     83 		if(x[fname]) {
     84 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
     85 			exit 3
     86 		}
     87 	}
     88 }' >.install-links.new
     89 mv .install-links.new .install-links