mrrl

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

linux-qemu-guest (6780B)


      1 #!/usr/bin/env pthbs-build
      2 #@pragma:nofail_digest
      3 #+busybox.7f0e4d86f69de7624b0468018b9933c3e3c1757c8ff73938746c292196f916dd
      4 #+busybox-bzip2.52d2053dff44277d3c6f700eec6807d2c64c226e0f1bf589372ff5ff625be40e
      5 #+busybox-gzip.085fc42ce36be284c89a9dec6889cca59dedd07b9ba93a21d3198c4adcac5840
      6 #+busybox-lzop.bccd8f86de85a74d466d34f802ab1ea355f0a9d9886bdfa4d7bb4a785d695be6
      7 #+busybox-unzip.237a4ec36283b7fbdb85df583c7c77c0aaf70d335b1cbae09a40a9bb4b6c82bb
      8 #+busybox-xz.db25ed2ffbfc91e7b5cff54faf2e80de59ab5b15167c2c5bb338fa1ee62de122
      9 #+busybox-cpio.307e9495bcd9b79fd9559882115d55d22c5b687e08886e696f1e53d8db7eebcd
     10 #+busybox-dpkg.3aec8347093bb5b774a0c25795cdf9e624268a3b04cc48e867d74e4e06461db7
     11 #+busybox-rpm.8435251ea7058aea0cbcd41478b144b1a15c5aa121509af887847c0ef45bf5aa
     12 #+busybox-tar.c77139157bce13db8820740b756572c22e29cfbd8bb8c2a3b22b465b70e2eae9
     13 #+busybox-ed.4ac872215d7b9c8096c4cfd508434fbd2e825aebd9a9ea8589a0033b8e50aac2
     14 #+busybox-sed.14269a860b3706f7122b827818365fecaa0e62ce5bc3273e89948685c0953f2d
     15 #+busybox-vi.7e41b306c9c47aaaa281aa8347b9fa6dca260788fd73f53a7ba9260b315627ee
     16 #+busybox-xxd.9df3407fd75b89cb640d65870298eaba77327d6e387d25d8ce1ebab01cb47857
     17 #+busybox-process-extra.65afeaded3cb8fdeea327262f28f08e50f18d51a2b456ea97b293d200c7f558e
     18 #+busybox-procps.e5dc609521d29d8aec8253147269314439131c088a6beeacc172fc07594c4a37
     19 #+busybox-psmisc.7d760b69f45bb1b8d458f2f408b9cb3a42e919e8022f0508c440a5fd20ebb66f
     20 #+busybox-ash.fd5d266905d40248735e0e2e1ae22165b6f0d42c0bacb652660f69f39c1ee71e
     21 #+busybox-bc.6f2fe17efab2237c3036eba1c37d432d696d1b5dba130e21365016ceae0a3184
     22 #+busybox-coreutils.7e581faa6901f832a2a022d72b2858c3091f47afc80a4a463adb2f2a68f1843d
     23 #+busybox-coreutils-extra.5ab183b839676b0780a9a83d75cc345a06221fa34627c44aa3732c4a5a47f9b9
     24 #+busybox-daemontools.bcea69c867a61fe1d49d2f6a27e406959c484ed20d54fd7c0341828d3cdbd428
     25 #+busybox-grep.ac20e6a4295eb7fb0a09d700e10e5fe55e2009d2858e0a1525e461d4914e820b
     26 #+busybox-misc.7f0588b97809fac8061c489b686424de1a7dd17d8eb3431aae56513c7288f1e7
     27 #+busybox-sh.288f0583edc783a176bbbc59a3e854b186258ba2605291377a545cc3191c3d52
     28 #+busybox-util-linux-unpriv.5a286246aa7204f7fa8c9a247f1c93c751979690a65200030f29e255645c1eae
     29 #+busybox-modutils.4aef0ae5907514beeff60f30370a78d0e294055c92d2409920150a5ebeedca2a
     30 #+gnu-make.17b0037e8a3f24180cb7bb9ddb488039d540ba905aecca0315de313adfbae81c
     31 #+musl-cross-make.19d51dec5328ccacd41d47d7f24e33bac084aebefb839cb3fecb6573577b831a
     32 #+findutils.337df827b790b33c27518f2bf52fb537e3b5756ccdbde9dedfa26f6922395b60
     33 #+diffutils.fc3b1b10f669e9e7b906baeaccda743718beb2525f062132853123f854aa4cbf
     34 #+patch.96351292cca51303a6659875ff00da38adbcc491e1966e0db30cea5469b8c123
     35 #+flex.06df30c870e62ce8f95024e74ad8d03b7f1d675d3501563cd55f16409d438b4a
     36 #+bison.183ae03f9de10534e919d4bd2bef1fa782b047f671fea90044796180284d38a7
     37 #+rsync.0862e31de38b4a570ee619a737c7cd3f382d195dcfeee77fab3c00386fd8609b
     38 #+zstd.b096b77421f338e2452668ae6faa2713158264b0378007a1c772d73ab2aefd52
     39 #+libelf.26505a004da49c1196387fe32aa0e848ecdcf19b385212f632e9305d785c6480
     40 #+pkgconf-pkg-config.c656966f2889c43d4e39921cc583813e6b7894db3754ea7af30d3361c7c40c63
     41 #+nawk.84c186be0a6d09a951a8c6a5377d16b0ba0a9e476e6b554c0c832d6407ebb5b2
     42 #@untar:-J:sha256:7586962547803be7ecc4056efc927fb25214548722bd28171172f3599abb9764:.
     43 #@sha256:cc2633ee136db0283d4faf7c27c890641e90cd835fc3adb19eaf0569e4078867:linux.config
     44 #@sha256:ff3ddd131d73fee6838b11a6c4773bdb85c5f60fdd4b9ac4120ced021c341417:noobjtool.patch
     45 
     46 
     47 # - build script start -
     48 
     49 
     50 prefix=/versions/$pthbs_package
     51 dest=${pthbs_destdir%/}${prefix}
     52 cd 'linux-6.15'
     53 
     54 patch -p1 -N <../noobjtool.patch
     55 
     56 
     57 export CPATH="$pthbs_build_environment/include"
     58 
     59 cp -v ../linux.config .config
     60  make olddefconfig
     61 diff -u ../linux.config .config || true
     62 
     63 
     64 
     65  make -j${JOBS:-1} -l$((1+${JOBS:-1})) \
     66 	V=1 \
     67 	HOSTLDFLAGS="-static -L$pthbs_build_environment/library" \
     68 	HOSTCFLAGS="-L$pthbs_build_environment/library"
     69 
     70 
     71 mkdir -p "${dest}/doc/linux" "${dest}/boot"
     72 cp -v .config "${dest}/config"
     73 mv Documentation/* "${dest}/doc/linux"
     74  make modules_install install \
     75 	INSTALL_MOD_PATH="${dest}/kernel" \
     76 	INSTALL_MOD_STRIP=1 \
     77 	INSTALL_PATH="${dest}/boot" \
     78 	INSTALL_DTBS_PATH="${dest}/boot/dtbs"
     79 
     80 # remove dangling symlinks
     81 module_dir="${dest}/kernel/lib/modules/6.15.0"
     82 rm -f "$module_dir/build" "$module_dir/source"
     83 ls -lhA "$module_dir"
     84 
     85 
     86 
     87 
     88 
     89 cd "$pthbs_destdir/versions/$pthbs_package"
     90 find -type d -o -print | awk -F/ '
     91 BEGIN {
     92 	kernel_name="6.15.0"
     93 	x["./boot/vmlinuz"]=1
     94 	x["./boot/System.map"]=1
     95 	x["./kernel/lib/modules/" kernel_name "/modules.alias"]=1
     96 	x["./kernel/lib/modules/" kernel_name "/modules.builtin"]=1
     97 	x["./kernel/lib/modules/" kernel_name "/modules.dep"]=1
     98 	x["./kernel/lib/modules/" kernel_name "/modules.order"]=1
     99 	x["./kernel/lib/modules/" kernel_name "/modules.symbols"]=1
    100 }
    101 
    102 function r1(s) {
    103 	sub("^[.]/[^/]*", ".", s)
    104 	return s
    105 }
    106 function s1(repl, s) {
    107 	sub("^[.]/[^/]*", "./"repl, s)
    108 	return s
    109 }
    110 function link(src) {
    111 	x[$0]=0
    112 	printf "%s\t%s\n", $0, src
    113 	printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
    114 }
    115 $1!="."{exit 1}
    116 $2 == "boot" { link($0); next }
    117 $2 == "lib" && $3 == "modules" { exit 3 }  # make sure kernel modules do not mix with userspace libraries
    118 function mod_path(s) {
    119 	sub("^[.]/kernel/lib/", "./kernel/", s)
    120 	return s
    121 }
    122 $2 == "kernel" && $3 == "lib" && $4 == "modules" { link(mod_path($0)); next }
    123 
    124 $2 == "env" { link($0); next }
    125 $2 == ".env-template" { link($0); next }
    126 
    127 $2 == "command" { link($0); next }
    128 $2 == "command" { link($0); next }
    129 $2 == "bin" { link(s1("command", $0)); next }
    130 $2 == "sbin" { link(s1("command", $0)); next }
    131 
    132 $2 == "library.so" { link($0); next }
    133 $2 == "library" { link($0); next }
    134 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
    135 $2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next }
    136 
    137 $2 == "share" && $3 == "info" { link(s1("info", r1($0))); next }
    138 $2 == "share" && $3 == "man" { link(s1("man", r1($0))); next }
    139 $2 == "share" && $3 == "doc" { link(s1("doc", r1($0))); next }
    140 
    141 $2 == "config" { link($0); next }
    142 $2 == "man" { link($0); next }
    143 $2 == "info" { link($0); next }
    144 $2 == "doc" { link($0); next }
    145 $2 == "data" { link($0); next }
    146 $2 == "include" { link($0); next }
    147 
    148 $2 == "share" && $3 ~ /^(icons|terminfo)$/ { link(r1($0)); next }
    149 
    150 $2 == "library.ocaml" { link($0); next }
    151 
    152 $2 == "keys" { link($0); next }
    153 $2 == "zsh" { link($0); next }
    154 $2 == "vimfiles" { link($0); next }
    155 $2 == "icons" { link($0); next }
    156 $2 == "terminfo" { link($0); next }
    157 
    158 
    159 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
    160 
    161 END {
    162 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
    163 	retcode = 0
    164 	for(fname in x) {
    165 		if(x[fname]) {
    166 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
    167 			retcode = 3
    168 		}
    169 	}
    170 	exit retcode
    171 }' >.install-links.new
    172 mv .install-links.new .install-links
    173