This repository has been archived by the owner on Mar 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 87
/
main.go
105 lines (100 loc) · 2.39 KB
/
main.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
package main
import (
_ "embed"
"github.com/dan-v/rattlesnakeos-stack/cmd"
"github.com/dan-v/rattlesnakeos-stack/internal/devices"
"github.com/dan-v/rattlesnakeos-stack/internal/templates"
"log"
)
var (
//go:embed AOSP_VERSION
aospVersion string
//go:embed VERSION
stackVersion string
//go:embed templates/build.sh
buildScript string
//go:embed templates/generated_vars_and_funcs.sh
buildScriptVars string
//go:embed templates/lambda.py
lambdaTemplate string
//go:embed templates/terraform.tf
terraformTemplate string
)
var allDevices = []*devices.Device{
&devices.Device{
Name: "blueline",
Friendly: "Pixel 3",
Family: "crosshatch",
AVBMode: devices.AVBModeChained,
ExtraOTA: devices.ExtraOTARetrofitDynamicPartitions,
},
&devices.Device{
Name: "crosshatch",
Friendly: "Pixel 3 XL",
Family: "crosshatch",
AVBMode: devices.AVBModeChained,
ExtraOTA: devices.ExtraOTARetrofitDynamicPartitions,
},
&devices.Device{
Name: "sargo",
Friendly: "Pixel 3a",
Family: "bonito",
AVBMode: devices.AVBModeChained,
ExtraOTA: devices.ExtraOTARetrofitDynamicPartitions,
},
&devices.Device{
Name: "bonito",
Friendly: "Pixel 3a XL",
Family: "bonito",
AVBMode: devices.AVBModeChained,
ExtraOTA: devices.ExtraOTARetrofitDynamicPartitions,
},
&devices.Device{
Name: "flame",
Friendly: "Pixel 4",
Family: "coral",
AVBMode: devices.AVBModeChainedV2,
},
&devices.Device{
Name: "coral",
Friendly: "Pixel 4 XL",
Family: "coral",
AVBMode: devices.AVBModeChainedV2,
},
&devices.Device{
Name: "sunfish",
Friendly: "Pixel 4a",
Family: "sunfish",
AVBMode: devices.AVBModeChainedV2,
},
&devices.Device{
Name: "bramble",
Friendly: "Pixel 4a 5G",
Family: "bramble",
AVBMode: devices.AVBModeChainedV2,
},
&devices.Device{
Name: "redfin",
Friendly: "Pixel 5",
Family: "redfin",
AVBMode: devices.AVBModeChainedV2,
},
&devices.Device{
Name: "barbet",
Friendly: "Pixel 5a",
Family: "barbet",
AVBMode: devices.AVBModeChainedV2,
},
}
func main() {
supportedDevices, err := devices.NewSupportedDevices(allDevices...)
if err != nil {
log.Fatal(err)
}
cmd.Execute(supportedDevices, aospVersion, stackVersion, &templates.TemplateFiles{
BuildScript: buildScript,
BuildScriptVars: buildScriptVars,
LambdaTemplate: lambdaTemplate,
TerraformTemplate: terraformTemplate,
})
}