|
70 | 70 | "local_bootloader_not_found": `File "bootloader-local.bin" not found.`, |
71 | 71 | "downloading_bootloader": "Downloading bootloader...", |
72 | 72 | "downloading_kernel": "Downloading kernel...", |
| 73 | + "downloading_kexts": "Downloading kernel extensions...", |
73 | 74 | "applying_fixes": "Applying fixes...", |
74 | 75 | "unable_to_find": "Unable to find", |
75 | 76 | "did_you_compile_first": "Did you compile first?", |
|
114 | 115 | "local_bootloader_not_found": `Файл "bootloader-local.bin" не найден.`, |
115 | 116 | "downloading_bootloader": "Скачивание загрузчика...", |
116 | 117 | "downloading_kernel": "Скачивание ядра...", |
| 118 | + "downloading_kexts": "Скачивание расширений ядра...", |
117 | 119 | "applying_fixes": "Принятие исправлений...", |
118 | 120 | "unable_to_find": "Не удалось найти", |
119 | 121 | "did_you_compile_first": "Вы скомпилировали перед этим?", |
|
278 | 280 | versions.unshift("./kernel-local"); |
279 | 281 | } |
280 | 282 | if (config.dev && fs.existsSync("../kernel/dist")) { |
281 | | - versions.unshift(...fs.readdirSync("../kernel/dist").map(version => `../kernel/dist/${version}`)); |
| 283 | + versions.unshift(...fs.readdirSync("../kernel/dist").filter(version => version != "kexts").map(version => `../kernel/dist/${version}`)); |
282 | 284 | } |
283 | 285 | document.querySelector("#kernels").innerHTML = versions.map(version => `<option value="${version}">${version}</option>`).join(""); |
284 | 286 | if (versions.includes(config.kernel)) { |
|
711 | 713 | fs.writeFileSync("kernel-cache", Buffer.from(await fetch(`https://github.com/CatCoreV/catcore/releases/download/${config.kernel}/kernel-${config.kernel.replace("v", "")}${targetMappings[config.target]}-${config.arch}`).then(res => res.arrayBuffer()))); |
712 | 714 | fs.writeFileSync("catcore.d.ts", Buffer.from(await fetch(`https://github.com/CatCoreV/catcore/releases/download/${config.kernel}/catcore.d.ts`).then(res => res.arrayBuffer()))); |
713 | 715 | } catch {} |
714 | | - fs.copyFileSync("kernel-cache", path.join(process.cwd(), "dist", "fs", "boot", "kernel")); |
| 716 | + fs.copyFileSync("kernel-cache", path.join(process.cwd(), "dist", "fs", "boot", `kernel-${config.kernel.replace("v", "")}${targetMappings[config.target]}-${config.arch}`)); |
| 717 | + fs.linkSync(path.join(process.cwd(), "dist", "fs", "boot", `kernel-${config.kernel.replace("v", "")}${targetMappings[config.target]}-${config.arch}`), path.join(process.cwd(), "dist", "fs", "boot", "kernel")); |
| 718 | + } |
| 719 | + fs.mkdirSync(path.join(process.cwd(), "dist", "fs", "boot", "kexts")); |
| 720 | + if (config.kernel.startsWith(".")) { |
| 721 | + fs.readdirSync(path.join(path.dirname(config.kernel), "kexts")).forEach(kext => { |
| 722 | + fs.copyFileSync(path.join(path.dirname(config.kernel), "kexts", kext), path.join(process.cwd(), "dist", "fs", "boot", "kexts", kext)); |
| 723 | + }); |
| 724 | + } else { |
| 725 | + document.querySelector("#status").innerText = text("downloading_kexts"); |
| 726 | + document.querySelector("#status").style.color = "yellow"; |
| 727 | + try { |
| 728 | + if (quick) { |
| 729 | + throw ""; |
| 730 | + } |
| 731 | + fs.writeFileSync("kexts-cache.zip", Buffer.from(await fetch(`https://github.com/CatCoreV/catcore/releases/download/${config.kernel}/kexts-${targetMappings[config.target]}-${config.arch}.zip`).then(res => res.arrayBuffer()))); |
| 732 | + } catch {} |
| 733 | + await new Promise(res => { |
| 734 | + child_process.exec(`${(process.platform == "win32") ? "tar -xf" : "unzip"} ../../../../kexts-cache.zip`, { |
| 735 | + "cwd": path.join(process.cwd(), "dist", "fs", "boot", "kexts") |
| 736 | + }, res); |
| 737 | + }); |
| 738 | + } |
| 739 | + for (var excludedKext of (system.excludeKexts || [])) { |
| 740 | + fs.unlinkSync(path.join(process.cwd(), "dist", "fs", "boot", "kexts", excludedKext)); |
715 | 741 | } |
716 | 742 | if (!quick && config.target == "macos-app") { |
717 | 743 | document.querySelector("#status").innerText = text("applying_fixes"); |
|
0 commit comments