-
Notifications
You must be signed in to change notification settings - Fork 0
/
goes.go
197 lines (190 loc) · 6.48 KB
/
goes.go
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
// Copyright © 2015-2020 Platina Systems, Inc. All rights reserved.
// Use of this source code is governed by the GPL-2 license described in the
// LICENSE file.
// +build !bootrom
package main
import (
"github.com/platinasystems/goes"
"github.com/platinasystems/goes-boot/cmd/recoveryd"
"github.com/platinasystems/goes/cmd"
"github.com/platinasystems/goes/cmd/bang"
"github.com/platinasystems/goes/cmd/buildid"
"github.com/platinasystems/goes/cmd/buildinfo"
"github.com/platinasystems/goes/cmd/cat"
"github.com/platinasystems/goes/cmd/cd"
"github.com/platinasystems/goes/cmd/chmod"
"github.com/platinasystems/goes/cmd/cli"
"github.com/platinasystems/goes/cmd/cmdline"
"github.com/platinasystems/goes/cmd/cp"
"github.com/platinasystems/goes/cmd/daemons"
"github.com/platinasystems/goes/cmd/dhcpcd"
"github.com/platinasystems/goes/cmd/dmesg"
"github.com/platinasystems/goes/cmd/echo"
"github.com/platinasystems/goes/cmd/elsecmd"
"github.com/platinasystems/goes/cmd/env"
"github.com/platinasystems/goes/cmd/exec"
"github.com/platinasystems/goes/cmd/exit"
"github.com/platinasystems/goes/cmd/export"
"github.com/platinasystems/goes/cmd/falsecmd"
"github.com/platinasystems/goes/cmd/femtocom"
"github.com/platinasystems/goes/cmd/ficmd"
"github.com/platinasystems/goes/cmd/function"
"github.com/platinasystems/goes/cmd/grep"
"github.com/platinasystems/goes/cmd/grub"
"github.com/platinasystems/goes/cmd/grubd"
"github.com/platinasystems/goes/cmd/hdel"
"github.com/platinasystems/goes/cmd/hdelta"
"github.com/platinasystems/goes/cmd/hexists"
"github.com/platinasystems/goes/cmd/hget"
"github.com/platinasystems/goes/cmd/hgetall"
"github.com/platinasystems/goes/cmd/hkeys"
"github.com/platinasystems/goes/cmd/hset"
"github.com/platinasystems/goes/cmd/ifcmd"
"github.com/platinasystems/goes/cmd/iminfo"
"github.com/platinasystems/goes/cmd/insmod"
"github.com/platinasystems/goes/cmd/install"
"github.com/platinasystems/goes/cmd/iocmd"
"github.com/platinasystems/goes/cmd/ip"
"github.com/platinasystems/goes/cmd/kexec"
"github.com/platinasystems/goes/cmd/keys"
"github.com/platinasystems/goes/cmd/kill"
"github.com/platinasystems/goes/cmd/ln"
"github.com/platinasystems/goes/cmd/log"
"github.com/platinasystems/goes/cmd/ls"
"github.com/platinasystems/goes/cmd/lsmod"
"github.com/platinasystems/goes/cmd/lsof"
"github.com/platinasystems/goes/cmd/mkdir"
"github.com/platinasystems/goes/cmd/mknod"
"github.com/platinasystems/goes/cmd/mount"
"github.com/platinasystems/goes/cmd/mountd"
"github.com/platinasystems/goes/cmd/ping"
"github.com/platinasystems/goes/cmd/platina/mk1/qspi"
"github.com/platinasystems/goes/cmd/platina/mk1/toggle"
"github.com/platinasystems/goes/cmd/ps"
"github.com/platinasystems/goes/cmd/pwd"
"github.com/platinasystems/goes/cmd/reboot"
"github.com/platinasystems/goes/cmd/reload"
"github.com/platinasystems/goes/cmd/restart"
"github.com/platinasystems/goes/cmd/rm"
"github.com/platinasystems/goes/cmd/rmmod"
"github.com/platinasystems/goes/cmd/slashinit"
"github.com/platinasystems/goes/cmd/sleep"
"github.com/platinasystems/goes/cmd/source"
"github.com/platinasystems/goes/cmd/start"
"github.com/platinasystems/goes/cmd/stop"
"github.com/platinasystems/goes/cmd/stty"
"github.com/platinasystems/goes/cmd/sync"
"github.com/platinasystems/goes/cmd/testcmd"
"github.com/platinasystems/goes/cmd/thencmd"
"github.com/platinasystems/goes/cmd/truecmd"
"github.com/platinasystems/goes/cmd/umount"
"github.com/platinasystems/goes/cmd/version"
"github.com/platinasystems/goes/cmd/wget"
"github.com/platinasystems/goes/lang"
)
var Version = "(devel)"
var Goes = &goes.Goes{
NAME: name,
APROPOS: Apropos,
ByName: map[string]cmd.Cmd{
"!": bang.Command{},
"cli": &cli.Command{},
"cat": cat.Command{},
"cd": &cd.Command{},
"chmod": chmod.Command{},
"cp": cp.Command{},
"daemons": daemons.Admin,
"dhcpcd": &dhcpcd.Command{},
"dmesg": dmesg.Command{},
"echo": echo.Command{},
"else": &elsecmd.Command{},
"env": &env.Command{},
"exec": exec.Command{},
"exit": exit.Command{},
"export": export.Command{},
"false": falsecmd.Command{},
"femtocom": femtocom.Command{},
"fi": &ficmd.Command{},
"function": &function.Command{},
"goes-daemons": &daemons.Server{
Init: [][]string{
[]string{"dhcpcd"},
[]string{"mountd"},
[]string{"grubd"},
},
},
"grep": grep.Command{},
"grub": &grub.Command{},
"grubd": &grubd.Command{},
"hdel": hdel.Command{},
"hdelta": &hdelta.Command{},
"hexists": hexists.Command{},
"hget": hget.Command{},
"hgetall": hgetall.Command{},
"hkeys": hkeys.Command{},
"hset": hset.Command{},
"if": &ifcmd.Command{},
"insmod": insmod.Command{},
"install": &install.Command{
Daemons: []string{
"mountd",
"grubd",
},
DefaultArchive: "https://platina.io/goes/rootfs.cpio.xz",
DefaultHostname: "platina-mk1",
DefaultRelease: "platina-mk1-release",
},
"io": iocmd.Command{},
"ip": ip.Goes,
"kexec": &kexec.Command{},
"keys": keys.Command{},
"kill": kill.Command{},
"ln": ln.Command{},
"log": log.Command{},
"ls": ls.Command{},
"lsmod": lsmod.Command{},
"lsof": lsof.Command{},
"mkdir": mkdir.Command{},
"mknod": mknod.Command{},
"mount": mount.Command{},
"mountd": &mountd.Command{},
"ping": ping.Command{},
"ps": ps.Command{},
"pwd": pwd.Command{},
"qspi": qspi.Command{},
"reboot": &reboot.Command{},
"recoveryd": &recoveryd.Command{Url: recoveryUrl},
"reload": reload.Command{},
"restart": &restart.Command{},
"rm": rm.Command{},
"rmmod": rmmod.Command{},
"show": &goes.Goes{
NAME: "show",
USAGE: "show OBJECT",
APROPOS: lang.Alt{
lang.EnUS: "print stuff",
},
ByName: map[string]cmd.Cmd{
"buildid": buildid.Command{},
"buildinfo": buildinfo.Command{},
"cmdline": cmdline.Command{},
"iminfo": iminfo.Command{},
"machine": Machine,
"version": &version.Command{V: Version},
},
},
"/init": &slashinit.Command{Hook: disableBootdog},
"sleep": sleep.Command{},
"source": &source.Command{},
"start": &start.Command{Gettys: consoles},
"stop": &stop.Command{},
"stty": stty.Command{},
"sync": sync.Command{},
"[": testcmd.Command{},
"then": &thencmd.Command{},
"toggle": &toggle.Command{},
"true": truecmd.Command{},
"umount": umount.Command{},
"wget": wget.Command{},
},
}