linux-qemu-guest (3590B)
1 #!/usr/bin/env pthbs-build 2 #+busybox.f4ef3d511c029095beda8d21dd48f7730bec63fb09792ca951402d6620338089 3 #+gnu-make.444e811a68f4f16724e21354b710fad3592e53a2dbf7c0c78658f3d4e7c8e465 4 #+musl-cross-make.d0431fc0def788be03da43136972361827de52c8e6f0a6f3890dc57fe32e8ecc 5 #+diffutils.3624d5d708d8d0c246f53189fddbc8008971f0c085ba8ab2e2d4e177d6dc7940 6 #+patch.9d8b2c370a0ccf6e5ad48c27070ff1da2d30d41327fd5711a76cf570b34ae523 7 #+flex.42bdab01fb2083e92a4417d5fb289c468b9a1a5b8092904b965455b74559262f 8 #+bison.d9992ea20119a82e24982f67479e65e94ec0fdc686f024f0ed04e87c83a00ef0 9 #+rsync.ba5e1b943d7caedd402b472208d5450dd417de7bd509aac5bf46f94d73bbc907 10 #+zstd.a83f72c5953bd6b7afc171528a503710b3144bf9197961833fd27926b0a18137 11 #+libelf.b129c20086c9a39a997886caaa57b3f7c5be24fd0ceb34289b62e794ff722ed0 12 #+pkgconf-pkg-config.ea4d3fe0fca073b8e3eb3b731df4d36c062498864ee04f68ce000a6f282b5621 13 #@untar:-J:sha256:7586962547803be7ecc4056efc927fb25214548722bd28171172f3599abb9764:. 14 #@sha256:cc2633ee136db0283d4faf7c27c890641e90cd835fc3adb19eaf0569e4078867:linux.config 15 #@sha256:ff3ddd131d73fee6838b11a6c4773bdb85c5f60fdd4b9ac4120ced021c341417:noobjtool.patch 16 17 printf '%s\n' "TODO: fix paths"; exit 1 18 export CPATH="$pthbs_build_environment/include" 19 20 cd 'linux-6.15' 21 patch -p1 -N <../noobjtool.patch 22 cp -v ../linux.config .config 23 make olddefconfig 24 diff -u ../linux.config .config || true 25 make -j${JOBS:-1} -l$((1+${JOBS:-1})) \ 26 V=1 \ 27 HOSTLDFLAGS="-static -L$pthbs_build_environment/library" \ 28 HOSTCFLAGS="-L$pthbs_build_environment/library" 29 30 installdir="$pthbs_destdir//versions/$pthbs_package" 31 mkdir -p "$installdir/doc/linux" "$installdir/boot" 32 cp -v .config "$installdir/config" 33 mv Documentation/* "$installdir/doc/linux" 34 make modules_install install \ 35 INSTALL_MOD_PATH="$installdir" \ 36 INSTALL_MOD_STRIP=1 \ 37 INSTALL_PATH="$installdir"/boot \ 38 INSTALL_DTBS_PATH="$installdir/boot/dtbs" 39 40 cd "$pthbs_destdir/versions/$pthbs_package" 41 find -type d -o -print | awk -F/ ' 42 BEGIN { 43 kernel_name="6.15.0" 44 x["./boot/vmlinuz"]=1 45 x["./boot/System.map"]=1 46 x["./lib/modules/" kernel_name "/modules.alias"]=1 47 x["./lib/modules/" kernel_name "/modules.builtin"]=1 48 x["./lib/modules/" kernel_name "/modules.dep"]=1 49 x["./lib/modules/" kernel_name "/modules.order"]=1 50 x["./lib/modules/" kernel_name "/modules.symbols"]=1 51 } 52 53 function r1(s) { 54 sub("^[.]/[^/]*", ".", s) 55 return s 56 } 57 function s1(repl, s) { 58 sub("^[.]/[^/]*", "./"repl, s) 59 return s 60 } 61 function link(src) { 62 x[$0]=0 63 printf "%s\t%s\n", $0, src 64 printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr" 65 } 66 $1!="."{exit 1} 67 68 69 $2 == "boot" { link($0); next } 70 $2 == "lib" && $3 == "modules" { exit 3 } # TODO move to better location 71 $2 == "command" { link($0); next } 72 $2 == "bin" { link(s1("command", $0)); next } 73 74 $2 == "library.so" { link($0); next } 75 $2 == "library" { link($0); next } 76 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next } 77 $2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next } 78 79 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next } 80 81 $2 == "man" { link($0); next } 82 $2 == "info" { link($0); next } 83 $2 == "doc" { link($0); next } 84 $2 == "icons" { link($0); next } 85 $2 == "terminfo" { link($0); next } 86 $2 == "data" { link($0); next } 87 $2 == "include" { link($0); next } 88 89 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" } 90 91 END { 92 for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" } 93 for(fname in x) { 94 if(x[fname]) { 95 printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr" 96 exit 3 97 } 98 } 99 }' >.install-links.new 100 mv .install-links.new .install-links