Skip to content

Commit a6ff39e

Browse files
authored
Add initial RISC-V support (#2206)
It depends upon IceWhaleTech/github#3 resolved #1669
1 parent 23eb739 commit a6ff39e

File tree

3 files changed

+83
-0
lines changed

3 files changed

+83
-0
lines changed

.goreleaser.debug.yaml

+35
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,22 @@ builds:
5959
- arm
6060
goarm:
6161
- "7"
62+
- id: casaos-riscv64
63+
binary: build/sysroot/usr/bin/casaos
64+
env:
65+
- CC=riscv64-linux-gnu-gcc
66+
gcflags:
67+
- all=-N -l
68+
ldflags:
69+
- -extldflags "-static"
70+
tags:
71+
- musl
72+
- netgo
73+
- osusergo
74+
goos:
75+
- linux
76+
goarch:
77+
- riscv64
6278
- id: casaos-migration-tool-amd64
6379
binary: build/sysroot/usr/bin/casaos-migration-tool
6480
main: ./cmd/migration-tool
@@ -112,6 +128,23 @@ builds:
112128
- arm
113129
goarm:
114130
- "7"
131+
- id: casaos-migration-tool-riscv64
132+
binary: build/sysroot/usr/bin/casaos-migration-tool
133+
main: ./cmd/migration-tool
134+
env:
135+
- CC=riscv64-linux-gnu-gcc
136+
gcflags:
137+
- all=-N -l
138+
ldflags:
139+
- -extldflags "-static"
140+
tags:
141+
- musl
142+
- netgo
143+
- osusergo
144+
goos:
145+
- linux
146+
goarch:
147+
- riscv64
115148
archives:
116149
- name_template: >-
117150
{{ .Os }}-{{- if eq .Arch "arm" }}arm-7{{- else }}{{ .Arch }}{{- end }}-{{ .ProjectName }}-v{{ .Version }}
@@ -120,6 +153,7 @@ archives:
120153
- casaos-amd64
121154
- casaos-arm64
122155
- casaos-arm-7
156+
- casaos-riscv64
123157
files:
124158
- build/**/*
125159
- name_template: >-
@@ -129,6 +163,7 @@ archives:
129163
- casaos-migration-tool-amd64
130164
- casaos-migration-tool-arm64
131165
- casaos-migration-tool-arm-7
166+
- casaos-migration-tool-riscv64
132167
files:
133168
- build/sysroot/etc/**/*
134169
checksum:

.goreleaser.yaml

+45
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,30 @@ builds:
9292
- arm
9393
goarm:
9494
- "7"
95+
- id: casaos-riscv64
96+
binary: build/sysroot/usr/bin/casaos
97+
env:
98+
- CC=riscv64-linux-gnu-gcc
99+
ldflags:
100+
- -X main.commit={{.Commit}}
101+
- -X main.date={{.Date}}
102+
- -X github.com/IceWhaleTech/CasaOS/drivers/google_drive.client_id={{.Env.GoogleID}}
103+
- -X github.com/IceWhaleTech/CasaOS/drivers/google_drive.client_secret={{.Env.GoogleSecret}}
104+
- -X github.com/IceWhaleTech/CasaOS/drivers/onedrive.client_id={{.Env.OneDriveID}}
105+
- -X github.com/IceWhaleTech/CasaOS/drivers/onedrive.client_secret={{.Env.OneDriveSecret}}
106+
- -X github.com/IceWhaleTech/CasaOS/drivers/dropbox.app_key={{.Env.DropboxKey}}
107+
- -X github.com/IceWhaleTech/CasaOS/drivers/dropbox.app_secret={{.Env.DropboxSecret}}
108+
- -s
109+
- -w
110+
- -extldflags "-static"
111+
tags:
112+
- musl
113+
- netgo
114+
- osusergo
115+
goos:
116+
- linux
117+
goarch:
118+
- riscv64
95119
- id: casaos-migration-tool-amd64
96120
binary: build/sysroot/usr/bin/casaos-migration-tool
97121
hooks:
@@ -160,6 +184,25 @@ builds:
160184
- arm
161185
goarm:
162186
- "7"
187+
- id: casaos-migration-tool-riscv64
188+
binary: build/sysroot/usr/bin/casaos-migration-tool
189+
main: ./cmd/migration-tool
190+
env:
191+
- CC=riscv64-linux-gnu-gcc
192+
ldflags:
193+
- -X main.commit={{.Commit}}
194+
- -X main.date={{.Date}}
195+
- -s
196+
- -w
197+
- -extldflags "-static"
198+
tags:
199+
- musl
200+
- netgo
201+
- osusergo
202+
goos:
203+
- linux
204+
goarch:
205+
- riscv64
163206
archives:
164207
- name_template: >-
165208
{{ .Os }}-{{- if eq .Arch "arm" }}arm-7{{- else }}{{ .Arch }}{{- end }}-{{ .ProjectName }}-v{{ .Version }}
@@ -168,6 +211,7 @@ archives:
168211
- casaos-amd64
169212
- casaos-arm64
170213
- casaos-arm-7
214+
- casaos-riscv64
171215
files:
172216
- build/**/*
173217
- name_template: >-
@@ -177,6 +221,7 @@ archives:
177221
- casaos-migration-tool-amd64
178222
- casaos-migration-tool-arm64
179223
- casaos-migration-tool-arm-7
224+
- casaos-migration-tool-riscv64
180225
files:
181226
- build/sysroot/etc/**/*
182227
checksum:

build/scripts/migration/script.d/03-migrate-casaos.sh

+3
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ aarch64)
111111
armv7l)
112112
ARCH="arm-7"
113113
;;
114+
riscv64)
115+
ARCH="riscv64"
116+
;;
114117
*)
115118
__error "Unsupported architecture"
116119
;;

0 commit comments

Comments
 (0)