Simple script and config (type-safe) for building custom Linux kernels for Firecracker MicroVMs

refactor: improve git reset and cleanup process in build script

+14 -5
+14 -5
build.ts
··· 146 await run(["git", "-C", "linux-stable", "fetch", "origin", REF]); 147 } 148 149 - await run(["git", "-C", "linux-stable", "reset", "--hard", REF]); 150 151 - await run(["git", "-C", "linux-stable", "checkout", "-f", REF]); 152 } 153 154 if (!(await Deno.stat(".config").catch(() => false))) { ··· 162 163 Deno.chdir("linux-stable"); 164 165 - await run(["rm", "-rf", "Documentation/Kbuild"]); 166 - await run(["make", "mrproper"]); 167 168 - await Deno.copyFile("../.config", ".config"); 169 170 const nproc = await getNproc(); 171 const makeProcess = new Deno.Command("make", {
··· 146 await run(["git", "-C", "linux-stable", "fetch", "origin", REF]); 147 } 148 149 + Deno.chdir("linux-stable"); 150 + 151 + await run(["rm", "-rf", "Documentation/Kbuild"]); 152 + await run(["make", "mrproper"]); 153 + await run([ 154 + "sh", 155 + "-c", 156 + "rm -rf include/uapi/linux/netfilter/xt_* include/uapi/linux/netfilter_ipv4/ipt_*.h include/uapi/linux/netfilter_ipv6/ip6t_*.h net/netfilter/xt_*.c rm -f tools/memory-model/litmus-tests", 157 + ]); 158 + 159 + await run(["git", "checkout", "-f", REF]); 160 161 + Deno.chdir(".."); 162 } 163 164 if (!(await Deno.stat(".config").catch(() => false))) { ··· 172 173 Deno.chdir("linux-stable"); 174 175 + await Deno.copyFile("../.config", ".config"); 176 177 + await run(["make", "prepare"]); 178 179 const nproc = await getNproc(); 180 const makeProcess = new Deno.Command("make", {