This commit is contained in:
parent
4533a6c3bf
commit
4b071f0253
3 changed files with 15 additions and 9 deletions
13
modules/fstab.lua
Normal file
13
modules/fstab.lua
Normal file
|
@ -0,0 +1,13 @@
|
|||
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
|
||||
|
||||
modules.fstab = {
|
||||
add_mount = add_mount,
|
||||
}
|
|
@ -23,7 +23,7 @@ modules.runit = {
|
|||
add_service = add_service,
|
||||
}
|
||||
|
||||
add_mount("tmpfs /var/log tmpfs defaults 0 0")
|
||||
modules.fstab.add_mount("tmpfs /var/log tmpfs defaults 0 0")
|
||||
|
||||
-- Estos scripts fueron robados de Void Linux
|
||||
add_executable("/etc/runit/functions", [[
|
||||
|
|
|
@ -10,9 +10,6 @@ local packages = {
|
|||
"libc-utils",
|
||||
"alpine-keys",
|
||||
}
|
||||
local mounts = {
|
||||
"tmpfs /tmp tmpfs defaults 0 0",
|
||||
}
|
||||
modules = {}
|
||||
|
||||
local root = "./root"
|
||||
|
@ -20,9 +17,6 @@ local root = "./root"
|
|||
function add_packages(new_packages)
|
||||
utils.table_concat(packages, new_packages)
|
||||
end
|
||||
function add_mount(new_mount)
|
||||
table.insert(mounts, new_mount)
|
||||
end
|
||||
function add_file(path, content)
|
||||
utils.expect_nil(alpine.write_file(root, path, content))
|
||||
end
|
||||
|
@ -43,13 +37,12 @@ local function module(name)
|
|||
print("=> Module: " .. name)
|
||||
require("modules/" .. name)
|
||||
end
|
||||
module "fstab"
|
||||
module "kernel"
|
||||
module "runit"
|
||||
module "hostname"
|
||||
module "dhcpcd"
|
||||
|
||||
print("=> Writing fstab...")
|
||||
add_file("/etc/fstab", utils.join_table(mounts, "\n"))
|
||||
print("=> Installing and upgrading packages...")
|
||||
utils.expect_nil(alpine.make_world(root, packages))
|
||||
print("=> Setting password...")
|
||||
|
|
Loading…
Reference in a new issue