fixes #2
This commit is contained in:
Cat /dev/Nulo 2023-02-08 15:05:53 -03:00
parent 265b3843bf
commit ff95f2fdfc
2 changed files with 18 additions and 0 deletions

View file

@ -10,6 +10,7 @@ import { sudoChownToRunningUser } from "./helpers/sudo.js";
import { setupKernel } from "./kernel.js"; import { setupKernel } from "./kernel.js";
import { runQemu } from "./qemu.js"; import { runQemu } from "./qemu.js";
import { Runit } from "./runit/index.js"; import { Runit } from "./runit/index.js";
import { setupDhcpcd } from "./services/dhcpcd.js";
if (process.argv[2] === "generate-secrets") { if (process.argv[2] === "generate-secrets") {
await generateForgejoSecretsFile(); await generateForgejoSecretsFile();
@ -30,6 +31,7 @@ if (process.argv[2] === "generate-secrets") {
await alpine.addPackages(["helix", "iproute2-ss", "socat"]); await alpine.addPackages(["helix", "iproute2-ss", "socat"]);
const runit = await Runit.setup(alpine); const runit = await Runit.setup(alpine);
await setupDhcpcd(alpine, runit);
await setupForgejo(alpine, runit); await setupForgejo(alpine, runit);
const kernel = await setupKernel(alpine, kernelDir); const kernel = await setupKernel(alpine, kernelDir);

16
services/dhcpcd.ts Normal file
View file

@ -0,0 +1,16 @@
import { Alpine } from "../alpine.js";
import { Runit } from "../runit/index.js";
export async function setupDhcpcd(alpine: Alpine, runit: Runit) {
await alpine.addPackages(["dhcpcd"]);
await alpine.symlink("/run/resolv.conf", "/etc/resolv.conf");
await alpine.fstab.addTmpfs("/var/lib/dhcpcd");
await runit.addService(
"dhcpcd",
`#!/bin/sh
exec dhcpcd --nobackground
`
);
}