GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — vm2api/scripts/seed-crag.mjs at dev · dofastted/vm2api Expand file tree/ Copy pathseed-crag.mjsMore file actions 29 lines (27 loc) · 1.43 KB / Copy pathseed-crag.mjsFile metadata and controls29 lines (27 loc) · 1.43 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 #!/usr/bin/env node import fs from 'node:fs' import path from 'node:path' import { pathToFileURL } from 'node:url' import { cragV2Arch, stageCragV2Tree } from '../src/lib/vm/wrap-cli-runtime.mjs' export function seedCragFactory(root, imageRoot, { arch = cragV2Arch() } = {}) { if (arch !== 'amd64') return { ok: true, seeded: false, reason: 'unsupported_arch' } if (String(process.env.KIN_CRAG_V2_ROOT || '').trim()) return { ok: true, seeded: false, reason: 'custom_package' } const destination = path.join(root, 'share/crag/kernels/v2', arch) // An existing issuer and any downloaded selection belong to the installation. if (fs.existsSync(destination)) return { ok: true, seeded: false, reason: 'factory_exists' } fs.mkdirSync(path.dirname(destination), { recursive: true }) const staged = stageCragV2Tree(path.join(imageRoot, 'kernels/v2', arch), destination, { arch }) if (!staged.ok) throw new Error(staged.code) staged.commit() return { ok: true, seeded: true } } if (process.argv[1] && import.meta.url === pathToFileURL(path.resolve(process.argv[1])).href) { const root = path.resolve(process.argv[2] || process.env.KIN_PROJECT_ROOT || '/opt/vm2api') const imageRoot = path.resolve(process.argv[3] || '/opt/vm2api/image-crag') try { console.log(JSON.stringify(seedCragFactory(root, imageRoot))) } catch (error) { console.error(`CRAG factory initialization failed: ${error.message}`) process.exitCode = 1 } } |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |