define-alpine/modules/fstab.lua
2022-06-18 12:05:42 -03:00

18 lines
395 B
Lua

local utils = require "../utils"
local mounts = {
"tmpfs /tmp tmpfs defaults 0 0",
}
local function add_mount(mount)
table.insert(mounts, mount)
add_file("/etc/fstab", utils.join_table(mounts, "\n"))
end
local function add_tmpfs(path)
add_mount("tmpfs "..path.." tmpfs defaults,noexec,nosuid 0 0")
mkdir(path)
end
modules.fstab = {
add_mount = add_mount,
add_tmpfs = add_tmpfs,
}