linux (3743B)
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:2ca1f17051a430f6fed1196e4952717507171acfd97d96577212502703b25deb:. 14 #@sha256:d9b01e4dac3dd140c394227603c8b3339bb2f1e10c97afd3607d84e3003ec75a:patch-6.1.34.xz 15 #@sha256:cc2633ee136db0283d4faf7c27c890641e90cd835fc3adb19eaf0569e4078867:linux.config 16 #@sha256:ff3ddd131d73fee6838b11a6c4773bdb85c5f60fdd4b9ac4120ced021c341417:noobjtool.patch 17 18 printf '%s\n' "TODO: fix paths"; exit 1 19 export CPATH="$pthbs_build_environment/include" 20 21 cd 'linux-6.1' 22 unxz -c < '../patch-6.1.34.xz' | patch -p1 -N 23 patch -p1 -N <../noobjtool.patch 24 cp -v ../linux.config .config 25 make olddefconfig 26 diff -u ../linux.config .config || true 27 make -j${JOBS:-1} -l$((1+${JOBS:-1})) \ 28 V=1 \ 29 HOSTLDFLAGS="-static -L$pthbs_build_environment/library" \ 30 HOSTCFLAGS="-L$pthbs_build_environment/library" 31 32 installdir="$pthbs_destdir//home/ccx/versions/$pthbs_package" 33 mkdir -p "$installdir/doc/linux" "$installdir/boot" 34 cp -v .config "$installdir/config" 35 mv Documentation/* "$installdir/doc/linux" 36 make modules_install install \ 37 INSTALL_MOD_PATH="$installdir" \ 38 INSTALL_MOD_STRIP=1 \ 39 INSTALL_PATH="$installdir"/boot \ 40 INSTALL_DTBS_PATH="$installdir/boot/dtbs" 41 42 cd "$pthbs_destdir/home/ccx/versions/$pthbs_package" 43 find -type d -o -print | awk -F/ ' 44 BEGIN { 45 kernel_name="6.1.34" 46 x["./boot/vmlinuz"]=1 47 x["./boot/System.map"]=1 48 x["./lib/modules/" kernel_name "/modules.alias"]=1 49 x["./lib/modules/" kernel_name "/modules.builtin"]=1 50 x["./lib/modules/" kernel_name "/modules.dep"]=1 51 x["./lib/modules/" kernel_name "/modules.order"]=1 52 x["./lib/modules/" kernel_name "/modules.symbols"]=1 53 } 54 55 function r1(s) { 56 sub("^[.]/[^/]*", ".", s) 57 return s 58 } 59 function s1(repl, s) { 60 sub("^[.]/[^/]*", "./"repl, s) 61 return s 62 } 63 function link(src) { 64 x[$0]=0 65 printf "%s\t%s\n", $0, src 66 printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr" 67 } 68 $1!="."{exit 1} 69 70 71 $2 == "boot" { link($0); next } 72 $2 == "lib" && $3 == "modules" { exit 3 } # TODO move to better location 73 $2 == "command" { link($0); next } 74 $2 == "bin" { link(s1("command", $0)); next } 75 76 $2 == "library.so" { link($0); next } 77 $2 == "library" { link($0); next } 78 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next } 79 $2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next } 80 81 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next } 82 83 $2 == "man" { link($0); next } 84 $2 == "info" { link($0); next } 85 $2 == "doc" { link($0); next } 86 $2 == "icons" { link($0); next } 87 $2 == "terminfo" { link($0); next } 88 $2 == "data" { link($0); next } 89 $2 == "include" { link($0); next } 90 91 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" } 92 93 END { 94 for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" } 95 for(fname in x) { 96 if(x[fname]) { 97 printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr" 98 exit 3 99 } 100 } 101 }' >.install-links.new 102 mv .install-links.new .install-links