mrrl

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

linux-qemu-guest (4326B)


      1 #!/usr/bin/env pthbs-build
      2 #+busybox.d2d7aa00eac6ec561a10d126b1866f22e226a1276307466251e80fd8a4a1ebc7
      3 #+busybox-modutils.95945d9c074dc63a024f634518b98fb6060ebf274465cd2ecfcab9a899debf5f
      4 #+gnu-make.75a726f6c19f7bc10b95a84da3ce72fb785ebdf587504430c6b74cfb6610b728
      5 #+musl-cross-make.e4735d8572f9b6654a7381ebdfbd62e665d1d1da5e06a56923e89274cc6a510f
      6 #+findutils.f7e98e991b4780b47ce6d2ab429158d542f7185606022a40324ecbb4e4057b5e
      7 #+diffutils.156555a911f29226b4808f1cf6a96ba5b0f8f0bc6b0807c8dce0304797940ea5
      8 #+patch.f68185f5f766e7ba981276f806b05c1b549d908db89557d83873e53100c3a74f
      9 #+flex.8d55075854419dc463afd7f07f87a549edeef87b98da674548d2c5c511521357
     10 #+bison.4d593c48fa3d4403c468571fa999dacc4e7ee9e92bf546d1b792b2b8ec0df3bc
     11 #+rsync.c5cc99cab95e21c4d120f3cec027a3544b92f42016d43fb064458794fd7971dc
     12 #+zstd.9736e321b1b8e6549f338d427549f01301473de674823230efeaeb274d899796
     13 #+libelf.5874304fa5c4a27a5a7b2da474d530e1c80fdf28e2f0bc6d44e64bcd498eafd1
     14 #+pkgconf-pkg-config.2af12027cd145d8e8d3961bf73608011ba873a8f7ee9646708ac87d0fcb055c9
     15 #+nawk.20e61757d30ba2271f207e142d393eb446a3ce4af79060fea9822a996e9eee29
     16 #@untar:-J:sha256:7586962547803be7ecc4056efc927fb25214548722bd28171172f3599abb9764:.
     17 #@sha256:cc2633ee136db0283d4faf7c27c890641e90cd835fc3adb19eaf0569e4078867:linux.config
     18 #@sha256:ff3ddd131d73fee6838b11a6c4773bdb85c5f60fdd4b9ac4120ced021c341417:noobjtool.patch
     19 
     20 
     21 # - build script start -
     22 
     23 
     24 prefix=/home/ccx/versions/$pthbs_package
     25 dest=${pthbs_destdir%/}${prefix}
     26 cd 'linux-6.15'
     27 
     28 patch -p1 -N <../noobjtool.patch
     29 
     30 
     31 export CPATH="$pthbs_build_environment/include"
     32 
     33 cp -v ../linux.config .config
     34  make olddefconfig
     35 diff -u ../linux.config .config || true
     36 
     37 
     38 
     39  make -j${JOBS:-1} -l$((1+${JOBS:-1})) \
     40 	V=1 \
     41 	HOSTLDFLAGS="-static -L$pthbs_build_environment/library" \
     42 	HOSTCFLAGS="-L$pthbs_build_environment/library"
     43 
     44 
     45 mkdir -p "${dest}/doc/linux" "${dest}/boot"
     46 cp -v .config "${dest}/config"
     47 mv Documentation/* "${dest}/doc/linux"
     48  make modules_install install \
     49 	INSTALL_MOD_PATH="${dest}/kernel" \
     50 	INSTALL_MOD_STRIP=1 \
     51 	INSTALL_PATH="${dest}/boot" \
     52 	INSTALL_DTBS_PATH="${dest}/boot/dtbs"
     53 
     54 # remove dangling symlinks
     55 module_dir="${dest}/kernel/lib/modules/6.15.0"
     56 rm -f "$module_dir/build" "$module_dir/source"
     57 ls -lhA "$module_dir"
     58 
     59 
     60 
     61 
     62 
     63 cd "$pthbs_destdir/home/ccx/versions/$pthbs_package"
     64 find -type d -o -print | awk -F/ '
     65 BEGIN {
     66 	kernel_name="6.15.0"
     67 	x["./boot/vmlinuz"]=1
     68 	x["./boot/System.map"]=1
     69 	x["./kernel/lib/modules/" kernel_name "/modules.alias"]=1
     70 	x["./kernel/lib/modules/" kernel_name "/modules.builtin"]=1
     71 	x["./kernel/lib/modules/" kernel_name "/modules.dep"]=1
     72 	x["./kernel/lib/modules/" kernel_name "/modules.order"]=1
     73 	x["./kernel/lib/modules/" kernel_name "/modules.symbols"]=1
     74 }
     75 
     76 function r1(s) {
     77 	sub("^[.]/[^/]*", ".", s)
     78 	return s
     79 }
     80 function s1(repl, s) {
     81 	sub("^[.]/[^/]*", "./"repl, s)
     82 	return s
     83 }
     84 function link(src) {
     85 	x[$0]=0
     86 	printf "%s\t%s\n", $0, src
     87 	printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
     88 }
     89 $1!="."{exit 1}
     90 
     91 
     92 $2 == "boot" { link($0); next }
     93 $2 == "lib" && $3 == "modules" { exit 3 }  # make sure kernel modules do not mix with userspace libraries
     94 function mod_path(s) {
     95 	sub("^[.]/kernel/lib/", "./kernel/", s)
     96 	return s
     97 }
     98 $2 == "kernel" && $3 == "lib" && $4 == "modules" { link(mod_path($0)); next }
     99 
    100 $2 == "config" { link($0); next }
    101 $2 == "keys" { link($0); next }
    102 $2 == "zsh" { link($0); next }
    103 $2 == "env" { link($0); next }
    104 $2 == "command" { link($0); next }
    105 $2 == "bin" { link(s1("command", $0)); next }
    106 
    107 $2 == "library.so" { link($0); next }
    108 $2 == "library" { link($0); next }
    109 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
    110 $2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next }
    111 
    112 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
    113 
    114 $2 == "man" { link($0); next }
    115 $2 == "info" { link($0); next }
    116 $2 == "doc" { link($0); next }
    117 $2 == "icons" { link($0); next }
    118 $2 == "terminfo" { link($0); next }
    119 $2 == "data" { link($0); next }
    120 $2 == "include" { link($0); next }
    121 
    122 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
    123 
    124 END {
    125 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
    126 	for(fname in x) {
    127 		if(x[fname]) {
    128 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
    129 			exit 3
    130 		}
    131 	}
    132 }' >.install-links.new
    133 mv .install-links.new .install-links
    134