-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathidea.conf
More file actions
172 lines (147 loc) · 4.94 KB
/
idea.conf
File metadata and controls
172 lines (147 loc) · 4.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
// system.conf — example Atlas system configuration (ACL2)
// - explicit types
// - arrays (type[])
// - named/repeated blocks (interface "eth0" { ... })
// - expressions, casts, and references ($ = global, $. = local, ^ = parent)
// - semicolons required
System {
// identity
string name = "Atlas";
string version = "0.1.0";
int build = 42;
// runtime behaviour
bool debug = true;
int boot_delay = 200; // milliseconds
int max_procs = (int)(1.5 * 256); // explicit cast example
// composite string via expression
string motd = "Welcome to " + name + " v" + version + "!";
// where the real init binary lives inside the image
string init_path = "/sbin/init";
}
Kernel {
string image = "/boot/vmlinuz";
string cmdline = "console=tty0";
// these flags should match kernel config (prefer builtin for boot-time reliability)
bool ext4_builtin = true;
bool loop_builtin = true;
}
Init {
// how many getty ttys the init should spawn
int spawn_getty_ttys = 3;
// console device for interactive login
string console = "/dev/tty1";
// derive a debug flag from global System.debug
bool debug_mode = $System.debug;
}
Logging {
bool enabled = true;
string level = "INFO"; // "DEBUG" | "INFO" | "WARN" | "ERROR"
string path = "/var/log/init.log";
int max_size_kb = 10240; // 10 MiB
}
// Network configuration: multiple interface blocks (repeatable)
Network {
// named interface block (label is "eth0")
interface "eth0" {
string name = "eth0";
bool dhcp = true;
string gateway = "192.168.1.1";
string mtu = "1500";
}
interface "wlan0" {
string name = "wlan0";
bool dhcp = false;
string ip = "192.168.1.100";
string netmask = "255.255.255.0";
// reference the eth0 gateway (global reference)
string gateway = $Network.interface["eth0"].gateway;
}
// static route example, referencing global values
route "default" {
string dest = "0.0.0.0/0";
string via = $Network.interface["eth0"].gateway;
}
}
// Modules to preload at early boot
Modules {
string[] load = { "virtio", "virtio_net", "e1000", "snd_hda_intel" };
}
// Filesystems to mount after pivot/chroot
Filesystems {
mount "/" {
string device = "/dev/loop0";
string fstype = "ext4";
string opts = "rw";
}
mount "/boot" {
string device = "/dev/sda1";
string fstype = "vfat";
string opts = "ro";
}
// tmpfs example
tmpfs "/run" {
int size_kb = 16384; // 16 MiB
string opts = "mode=0755";
}
}
// Services to be supervised by init (simple restart policy)
Services {
service "netd" {
string exec = "/sbin/netd";
bool enable = true;
int restart_delay_ms = 2000;
// can refer to modules array length for a derived value
int start_order = (int)(1 + 0); // trivial example expression
}
service "getty" {
string exec = "/sbin/getty";
bool enable = true;
int ttys = $Init.spawn_getty_ttys; // global ref to Init block
}
service "sshd" {
string exec = "/usr/sbin/sshd";
bool enable = true;
int restart_delay_ms = 5000;
// demonstrate local reference usage ($.field refers to same service block)
string log_path = $Logging.path;
}
}
// Users: repeated user blocks keyed by login name
Users {
user "root" {
string name = "root";
int uid = 0;
int gid = 0;
string home = "/root";
string shell = "/bin/sh";
string passwd_hash = "<hashed-password-placeholder>";
bool locked = false;
}
user "alice" {
string name = "alice";
int uid = 1000;
int gid = 1000;
string home = "/home/alice";
string shell = "/bin/sh";
// demonstrate expression and local reference:
string welcome_msg = "Hello, " + $.name + " — welcome to " + $System.name + "!";
bool locked = false;
}
}
// Build/system settings (for self-hosting / in-OS build control)
Build {
bool self_host = true;
string build_cmd = "/usr/bin/make -j4";
string repo_path = "/usr/src";
string image_path = "/atlas.img";
// a derived rebuild threshold (just to demonstrate expression + cast)
int rebuild_threshold_kb = (int)(1024 * 2); // 2 MiB
int rebuild_timeout_ms = $System.boot_delay * 5;
}
// Simple package manager config (minimal)
PkgManager {
string db_path = "/var/lib/atlas/pkgdb";
string cache_dir = "/var/cache/atlas";
bool auto_upgrade = false;
string default_repo = "https://packages.atlas.local"; // informational only
}