define-alpine/modules/fstab.lua

19 lines
395 B
Lua
Raw Normal View History

2022-06-18 02:34:30 +00:00
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
2022-06-18 15:05:42 +00:00
local function add_tmpfs(path)
add_mount("tmpfs "..path.." tmpfs defaults,noexec,nosuid 0 0")
mkdir(path)
end
2022-06-18 02:34:30 +00:00
modules.fstab = {
add_mount = add_mount,
2022-06-18 15:05:42 +00:00
add_tmpfs = add_tmpfs,
2022-06-18 02:34:30 +00:00
}