Mount + proper init + sys/proc/tmp

This commit is contained in:
Marc
2021-12-01 21:26:11 +01:00
parent eedb9c067f
commit fbdabd66a5
16 changed files with 351 additions and 17 deletions
+20
View File
@@ -0,0 +1,20 @@
//@ts-check
const { cmount, mount, flags } = require('../../chibrax/mount.js')
async function init() {
cmount("dummy", "/proc", "proc",
flags.MS_NODEV | flags.MS_RDONLY | flags.MS_NOSUID | flags.MS_RELATIME
, "")
mount("dummy", "/sys", "sysfs", flags.MS_NODEV | flags.MS_NOSUID | flags.MS_RELATIME, "")
mount("dummy", "/tmp", "tmpfs", flags.MS_NODEV, "")
}
const after = [] // list of init script to load before
const before = []
module.exports = {
init,
after,
before
}
@@ -0,0 +1,13 @@
//async is optional but recomended for optimisation (optimisations are yet to be implemented)
async function init() {
//code to execute
}
const after = [] // list of init script to load before
const before = []
module.exports = {
init,
after,
before
}
@@ -0,0 +1,14 @@
const audio = require('/chibrax/audio.js')
async function init() {
audio('/chibrax/sheeebr.wav')
}
const after = [ "filesystem.js" ] // list of init script to load before
const before = []
module.exports = {
init,
after,
before
}