package rosa import ( "slices" "hakurei.app/internal/pkg" ) // newKernel is a helper for interacting with Kbuild. func (t Toolchain) newKernel( exclusive bool, patches [][2]string, script string, extra ...pkg.Artifact, ) pkg.Artifact { const ( version = "6.18.5" checksum = "-V1e1WWl7HuePkmm84sSKF7nLuHfUs494uNMzMqXEyxcNE_PUE0FICL0oGWn44mM" ) return t.New("kernel-"+version, exclusive, slices.Concat([]pkg.Artifact{ t.Load(Make), }, extra), nil, nil, ` export LLVM=1 export HOSTLDFLAGS="${LDFLAGS}" cd /usr/src/linux `+script, pkg.Path(AbsUsrSrc.Append("linux"), true, t.NewPatchedSource( "kernel", version, pkg.NewHTTPGetTar( nil, "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/"+ "snapshot/linux-"+version+".tar.gz", mustDecode(checksum), pkg.TarGzip, ), false, patches..., ))) } func (t Toolchain) newKernelHeaders() pkg.Artifact { return t.newKernel(false, nil, ` make "-j$(nproc)" \ INSTALL_HDR_PATH=/work/system \ headers_install `, t.Load(Rsync)) } func init() { artifactsF[KernelHeaders] = Toolchain.newKernelHeaders }