diff --git a/.gitignore b/.gitignore index 4e5f808..e2d40fa 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ rootfs.qcow2 fireactions *.ext4 vmlinux.bin +node_modules/ diff --git a/rootfs/build.js b/rootfs/build.js index bbccf44..23bfea4 100644 --- a/rootfs/build.js +++ b/rootfs/build.js @@ -15,7 +15,7 @@ import { join } from "node:path"; import { promisify } from "node:util"; const execFile = promisify(_execFile); -const root = await mkdtemp(join(tmpdir(), "tmp.fireactions-rootfs.")); +const root = await mkdtemp(join(tmpdir(), "fireactions-rootfs.")); const alpine = await init(root); await alpine.install(["dropbear", "util-linux", "dropbear-dbclient", "dhcpcd"]); @@ -23,20 +23,25 @@ await alpine.install(["dropbear", "util-linux", "dropbear-dbclient", "dhcpcd"]); await append(r("/etc/rc.conf"), 'rc_parallel="YES"'); await mkdirp(r("/usr/local/sbin")); -await execFile("go", [ - "build", - "-tags=netgo", - "-o", - r("/usr/local/sbin/fireactions-agent"), - "./agent", -]); +console.debug( + await execFile("go", [ + "build", + "-tags=netgo", + "-o", + r("/usr/local/sbin/fireactions-agent"), + "./agent", + ]) +); // https://github.com/OpenRC/openrc/blob/master/service-script-guide.md await writeFile( r("/etc/init.d/fireactions-agent"), `#!/sbin/openrc-run pidfile="/run/\${RC_SVCNAME}.pid" command_background=true -command=/usr/local/sbin/fireactions-agent` +command=/usr/local/sbin/fireactions-agent +output_log=/dev/stdout +error_log=/dev/stdout +` ); await chmod(r("/etc/init.d/fireactions-agent"), 0o700); await alpine.rcUpdate("default", "fireactions-agent"); diff --git a/rootfs/package.json b/rootfs/package.json index a29052e..d41ca0e 100644 --- a/rootfs/package.json +++ b/rootfs/package.json @@ -11,7 +11,7 @@ "author": "", "license": "ISC", "dependencies": { - "@nulo/apkit": "https://gitea.nulo.in/Nulo/apkit" + "@nulo/apkit": "https://gitea.nulo.in/Nulo/apkit/archive/hackyshit.tar.gz" }, "devDependencies": { "@tsconfig/node16": "^1.0.4", diff --git a/rootfs/pnpm-lock.yaml b/rootfs/pnpm-lock.yaml index 7e4ca0b..f61a021 100644 --- a/rootfs/pnpm-lock.yaml +++ b/rootfs/pnpm-lock.yaml @@ -1,4 +1,13 @@ -lockfileVersion: '6.0' +lockfileVersion: '6.1' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +dependencies: + '@nulo/apkit': + specifier: https://gitea.nulo.in/Nulo/apkit/archive/hackyshit.tar.gz + version: '@gitea.nulo.in/Nulo/apkit/archive/hackyshit.tar.gz' devDependencies: '@tsconfig/node16': @@ -17,3 +26,9 @@ packages: /@types/node@20.2.5: resolution: {integrity: sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ==} dev: true + + '@gitea.nulo.in/Nulo/apkit/archive/hackyshit.tar.gz': + resolution: {tarball: https://gitea.nulo.in/Nulo/apkit/archive/hackyshit.tar.gz} + name: '@nulo/apkit' + version: 0.0.1 + dev: false