mrrl

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

linux (6933B)


      1 #!/usr/bin/env pthbs-build
      2 #@pragma:nofail_digest
      3 #+busybox.504428034e649f598212c8994966e36667178683ec90987355f495ad3ca4abac
      4 #+busybox-bzip2.4ea548a271f41e7147568dc02e5071fb200eab38a9a22e733d3106b71e354812
      5 #+busybox-gzip.0999e8c6a8b7df82fc1cf10ade2468fb2bc4352f76d4b1d2af5099a65ccada9b
      6 #+busybox-lzop.f0d93621bfd8ca106a8590562d93158b05087e5ef48068c7a84d9967b67d2d25
      7 #+busybox-unzip.737f61aac20ef6c0554fca59bb599bf98e4fb77fbd97fba65a3692ac9d4afb84
      8 #+busybox-xz.639cf99dd37a7d6f719b937d13af92202e01adf11c130f8647574c1d9ef5b0d2
      9 #+busybox-cpio.d22266c2b6c056c0ea96873402d06591aa23368ea24d91f1fbf8a8327cb210f8
     10 #+busybox-dpkg.2b0dd2fa41e946e98f2f8948ae3d3a152a069c77460768d9c76d41f56974e514
     11 #+busybox-rpm.62bb242b4fbb3fd51b233ed9ce6c257ab997b1ee3a68ef3048656addc98f3d97
     12 #+busybox-tar.dd3d9b0075fc038df431ce2a16fc1b140de521e1aa6d154dc7b607f9403d5ac0
     13 #+busybox-ed.6ff6cd59168705c6b256d800cde7e8c69dd05c556520317dae6a0b492029fe6b
     14 #+busybox-sed.8793bcd2536ab32fa528bbb0c22f0c014663ac5e045193aa7bd113a07f58c5b9
     15 #+busybox-vi.db3d29c62845a55b7c5491d057cb9ea6c6deba93c567f4ef9eb15f06be8ad171
     16 #+busybox-xxd.9dff38f0c9dbf57856a0824bc23cc99cb31a67ce5138de7a6de2e255880a5696
     17 #+busybox-process-extra.448a35fa5362e576a23ef306ec6e0da2f625adae08cc5c3b12a01d5d28f76ce6
     18 #+busybox-procps.835712dc539d5583773d175255a5c4e27b5823d97e855948d27cc2c194247b0f
     19 #+busybox-psmisc.f2434b74cd3e07ddea335da52c222567bc111b621f0f060afef8bcc26a8d96fd
     20 #+busybox-ash.039eb4051853cdde4d03b8dbd5d6128957bf933be5ac398471666e5db0d33dab
     21 #+busybox-bc.e731e83c11906525d676777835256a3f478779eafe7152701adfc46558d73009
     22 #+busybox-coreutils.a57a12f85d58388c284d4f93f6c485d4bc2a7eac0d0f4be57b20d2ddbd4c8b8f
     23 #+busybox-coreutils-extra.09de38ce2d65026888577e8314766e4b17205b2a99a4fecfdd5cd89c1cd82aed
     24 #+busybox-daemontools.d12e277e7154028f0beaae44ad1e2c7e1cd12d28549b6861604fc634c3e09aaf
     25 #+busybox-grep.474abd8ddad6afb320c55141078cb4507d02c4610181a4d72a4d98ba93434a60
     26 #+busybox-misc.ea211db457ee098923eeff82a4388d5864254a6c2718f38471b5b2867c73d158
     27 #+busybox-sh.49a7505969c9882c8a9a7ad3f5dba6d1382add3559f4da21ceafb2708d3fd4c8
     28 #+busybox-util-linux-unpriv.95b792cd49d1f00d5488b15d93809166916ef3b8a63a69ea11f3bf6e92a74f24
     29 #+busybox-modutils.1ac8d2c6af837ebeb3ae0c6bab96dc43b66f22f25d727325b851d4898b5c731f
     30 #+gnu-make.fb4cff1c46827d02016d0f94d5256a263e7710025f7480fffb7580dc922a6069
     31 #+musl-cross-make.4bca2cd43f4a72eaaeefc4befc0b0ce736a5906ec0245552a8db7dc56fa9e5ec
     32 #+findutils.efdc2b649d6fcaea4f7b4716e770de6197dbc3d02ce14907eeda729116f581e2
     33 #+diffutils.c44d0701c69295321eaa64bf7cf82233b2eec05a6c640cb8175af9a4e3ee7122
     34 #+patch.a77c8e315f380834752e2d22243a6276d4779f7f49c0a1ed7a01bd661a431898
     35 #+flex.8a5aecde13d2d283b5914eaebaa5386638c0c7e8f81df17f90e7a693e75b8bcd
     36 #+bison.101f9166d34a37221f88a74b20d14d9a10138f88e4b8195996de66d7fba93e2c
     37 #+rsync.3060eb88668700798b531a6f6d3647352e1a572ad8f5b55a75fd22a3326de06a
     38 #+zstd.1569c43f77b4031079e930f7eb6107e77b72dd641fac5228c4d2c784a6f15361
     39 #+libelf.744e554297f7156922dfe9796d38839734f76c515083c6052e22a4c64a8c7c21
     40 #+pkgconf-pkg-config.e727e04fa14db15c16a52d4d389e55602d35b463dfe80b75d5120e383ec17ffb
     41 #+nawk.ec8a7f9ea4618a151470a1c1a0026f688a5032eb06b8e459510fe82316c17a60
     42 #@untar:-J:sha256:2ca1f17051a430f6fed1196e4952717507171acfd97d96577212502703b25deb:.
     43 #@sha256:d9b01e4dac3dd140c394227603c8b3339bb2f1e10c97afd3607d84e3003ec75a:patch-6.1.34.xz
     44 #@sha256:cc2633ee136db0283d4faf7c27c890641e90cd835fc3adb19eaf0569e4078867:linux.config
     45 #@sha256:ff3ddd131d73fee6838b11a6c4773bdb85c5f60fdd4b9ac4120ced021c341417:noobjtool.patch
     46 
     47 
     48 # - build script start -
     49 
     50 
     51 prefix=/home/ccx/versions/$pthbs_package
     52 dest=${pthbs_destdir%/}${prefix}
     53 cd 'linux-6.1'
     54 
     55 unxz -c < '../patch-6.1.34.xz' | patch -p1 -N
     56 patch -p1 -N <../noobjtool.patch
     57 
     58 
     59 export CPATH="$pthbs_build_environment/include"
     60 
     61 cp -v ../linux.config .config
     62  make olddefconfig
     63 diff -u ../linux.config .config || true
     64 
     65 
     66 
     67  make -j${JOBS:-1} -l$((1+${JOBS:-1})) \
     68 	V=1 \
     69 	HOSTLDFLAGS="-static -L$pthbs_build_environment/library" \
     70 	HOSTCFLAGS="-L$pthbs_build_environment/library"
     71 
     72 
     73 mkdir -p "${dest}/doc/linux" "${dest}/boot"
     74 cp -v .config "${dest}/config"
     75 mv Documentation/* "${dest}/doc/linux"
     76  make modules_install install \
     77 	INSTALL_MOD_PATH="${dest}/kernel" \
     78 	INSTALL_MOD_STRIP=1 \
     79 	INSTALL_PATH="${dest}/boot" \
     80 	INSTALL_DTBS_PATH="${dest}/boot/dtbs"
     81 
     82 # remove dangling symlinks
     83 module_dir="${dest}/kernel/lib/modules/6.1.34"
     84 rm -f "$module_dir/build" "$module_dir/source"
     85 ls -lhA "$module_dir"
     86 
     87 
     88 
     89 
     90 
     91 cd "$pthbs_destdir/home/ccx/versions/$pthbs_package"
     92 find -type d -o -print | awk -F/ '
     93 BEGIN {
     94 	kernel_name="6.1.34"
     95 	x["./boot/vmlinuz"]=1
     96 	x["./boot/System.map"]=1
     97 	x["./kernel/lib/modules/" kernel_name "/modules.alias"]=1
     98 	x["./kernel/lib/modules/" kernel_name "/modules.builtin"]=1
     99 	x["./kernel/lib/modules/" kernel_name "/modules.dep"]=1
    100 	x["./kernel/lib/modules/" kernel_name "/modules.order"]=1
    101 	x["./kernel/lib/modules/" kernel_name "/modules.symbols"]=1
    102 }
    103 
    104 function r1(s) {
    105 	sub("^[.]/[^/]*", ".", s)
    106 	return s
    107 }
    108 function s1(repl, s) {
    109 	sub("^[.]/[^/]*", "./"repl, s)
    110 	return s
    111 }
    112 function link(src) {
    113 	x[$0]=0
    114 	printf "%s\t%s\n", $0, src
    115 	printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
    116 }
    117 $1!="."{exit 1}
    118 $2 == "boot" { link($0); next }
    119 $2 == "lib" && $3 == "modules" { exit 3 }  # make sure kernel modules do not mix with userspace libraries
    120 function mod_path(s) {
    121 	sub("^[.]/kernel/lib/", "./kernel/", s)
    122 	return s
    123 }
    124 $2 == "kernel" && $3 == "lib" && $4 == "modules" { link(mod_path($0)); next }
    125 
    126 $2 == "env" { link($0); next }
    127 $2 == ".env-template" { link($0); next }
    128 
    129 $2 == "command" { link($0); next }
    130 $2 == "command" { link($0); next }
    131 $2 == "bin" { link(s1("command", $0)); next }
    132 $2 == "sbin" { link(s1("command", $0)); next }
    133 
    134 $2 == "library.so" { link($0); next }
    135 $2 == "library" { link($0); next }
    136 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
    137 $2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next }
    138 
    139 $2 == "share" && $3 == "info" { link(s1("info", r1($0))); next }
    140 $2 == "share" && $3 == "man" { link(s1("man", r1($0))); next }
    141 $2 == "share" && $3 == "doc" { link(s1("doc", r1($0))); next }
    142 
    143 $2 == "config" { link($0); next }
    144 $2 == "man" { link($0); next }
    145 $2 == "info" { link($0); next }
    146 $2 == "doc" { link($0); next }
    147 $2 == "data" { link($0); next }
    148 $2 == "include" { link($0); next }
    149 
    150 $2 == "share" && $3 ~ /^(icons|terminfo)$/ { link(r1($0)); next }
    151 
    152 $2 == "library.ocaml" { link($0); next }
    153 
    154 $2 == "keys" { link($0); next }
    155 $2 == "zsh" { link($0); next }
    156 $2 == "vimfiles" { link($0); next }
    157 $2 == "icons" { link($0); next }
    158 $2 == "terminfo" { link($0); next }
    159 
    160 
    161 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
    162 
    163 END {
    164 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
    165 	retcode = 0
    166 	for(fname in x) {
    167 		if(x[fname]) {
    168 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
    169 			retcode = 3
    170 		}
    171 	}
    172 	exit retcode
    173 }' >.install-links.new
    174 mv .install-links.new .install-links
    175