Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NanoKVM support #44

Open
wants to merge 141 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
97cd8f7
add support for partition based usb disk
scpcom Aug 30, 2024
5d0d4d0
set initial rootfs resize to 25%, allow to choose between partition o…
scpcom Aug 30, 2024
2373dd2
add support for usb hid
scpcom Aug 30, 2024
62ebc6c
buildroot: add nanokvm app
scpcom Aug 30, 2024
f8c8c4e
add support for eth static ip address configuration
scpcom Sep 1, 2024
0975bff
buildroot: nanokvm: set default res and fps, remove version
scpcom Sep 3, 2024
db04eb6
buildroot: add maix-cdk
scpcom Sep 3, 2024
fbfdfce
buildroot: add tailscale-riscv64
scpcom Sep 3, 2024
16613cc
buildroot: maix-cdk: copy uapi headers from osdrv
scpcom Sep 3, 2024
0e92712
buildroot: maix-cdk: build camera_display example
scpcom Sep 4, 2024
453b91a
Revert "add support for usb hid"
scpcom Sep 8, 2024
6189380
Revert "set initial rootfs resize to 25%, allow to choose between par…
scpcom Sep 8, 2024
5c42844
Revert "add support for partition based usb disk"
scpcom Sep 8, 2024
2005f98
buildroot: nanokvm: sync init.d scripts
scpcom Sep 8, 2024
b8c6ed0
add host python3 ssl
scpcom Sep 8, 2024
2daa961
buildroot: nanokvm: sync init.d scripts to everlay
scpcom Sep 9, 2024
80310e1
package/go: security bump to go1.21.8
paralin Mar 6, 2024
948344d
package/go-bootstrap-stage2: bump version to go1.19.13
paralin Mar 7, 2024
5824639
package/go-bootstrap-stage3: add stage3 for go1.22 support
paralin Mar 7, 2024
b6085ce
package/go: bump to version go1.22.1
paralin Mar 7, 2024
adaa4c0
package/go: security bump to go1.22.2
paralin Apr 3, 2024
3e73cd6
package/go: security bump version to go1.22.3
paralin May 7, 2024
7894455
package/go-bootstrap-stage3: fix go-bootstrap when parent dir contain…
RomainNaour May 17, 2024
bd7afd1
package/go: security bump to go1.22.4
paralin Jun 4, 2024
6c51e91
package/go: security bump version to go1.22.5
paralin Jul 3, 2024
e6a8cc2
buildroot: maix-cdk: take care of renamed dnvqe lib
scpcom Sep 21, 2024
d51c212
buildroot: maix-cdk: take care of splitted vpu lib
scpcom Sep 22, 2024
fc43111
buildroot: maix-cdk: make compatible with latest cvi_mpi
scpcom Sep 22, 2024
5429929
buildroot: add nanokvm server
scpcom Oct 8, 2024
3c1acf1
buildroot: add nanokvm web
scpcom Oct 9, 2024
9b04fb6
buildroot: nanokvm-server: fix typo
scpcom Oct 10, 2024
1b3686d
buildroot: nanokvm: remove pre-built ko
scpcom Oct 10, 2024
25d24ba
buildroot: nanokvm-server: lib: add flag to force download
scpcom Oct 10, 2024
c0c0785
buildroot: nanokvm-server: tailscale: add flag to disable
scpcom Oct 10, 2024
b8b3034
buildroot: nanokvm-server: maixcam_lib: copy from middleware/sample/t…
scpcom Oct 12, 2024
8247fa4
buildroot: nanokvm-server: lib: do not set flag to force download
scpcom Oct 13, 2024
23e25e8
buildroot: nanokvm: prepare /kvmapp/kvm_stream
scpcom Oct 15, 2024
39b4112
nanokvm-server: update 20241014
scpcom Oct 15, 2024
d20d0cb
buildroot: nanokvm: copy required libs from middleware, symlink unuse…
scpcom Oct 15, 2024
3338b12
nanokvm-server: update 20241018
scpcom Oct 18, 2024
2dfafd6
buildroot: nanokvm: kvm_system: copy from middleware/sample/kvm_system
scpcom Oct 19, 2024
25e4254
buildroot: nanokvm: prepare /kvmapp/kvm
scpcom Oct 20, 2024
f87b557
buildroot: nanokvm: kvm_stream: copy from middleware/sample/kvm_stream
scpcom Oct 23, 2024
df93a96
buildroot: maix-cdk: update defines and includes in components/3rd_pa…
scpcom Oct 26, 2024
116750f
buildroot: maix-cdk: maixcam_lib: copy from middleware/sample/test_mmf
scpcom Oct 26, 2024
d4b7327
buildroot: maix-cdk: build all examples and projects without nn
scpcom Oct 27, 2024
a95d945
buildroot: maix-cdk: genconfig: disable menuconfig
scpcom Oct 29, 2024
49f146e
nanokvm-server: update 20241021
scpcom Oct 27, 2024
50bfbe2
cvitek-riscv64-musl-sysroot: copy musl interpreter from host-tools
scpcom Nov 11, 2024
9066617
buildroot: nanokvm: only download non-binary skeleton
scpcom Nov 11, 2024
f6160e1
nanokvm-server: update 20241105
scpcom Nov 11, 2024
3750841
buildroot: nanokvm: build 2.1.0
scpcom Nov 11, 2024
f96359d
buildroot: nanokvm: kvm_vision: copy from middleware/sample/test_mmf/…
scpcom Nov 13, 2024
d2b7eb6
buildroot: nanokvm: fix ntp
scpcom Nov 13, 2024
4649b5d
nanokvm-server: keep lib symlinks
scpcom Nov 15, 2024
7a731af
nanokvm-server: update 20241114
scpcom Nov 16, 2024
4bb1f19
buildroot: nanokvm: replaced closed source with dummy libs
scpcom Nov 17, 2024
d29e757
buildroot: nanokvm: use isp_light libs
scpcom Nov 18, 2024
660df7f
buildroot: nanokvm: cleanup kvm_system/dl_lib if unused
scpcom Nov 20, 2024
da96c4c
buildroot: maix-cdk: update 20241108
scpcom Nov 25, 2024
e1e3185
buildroot: maix-cdk: do not copy maixcam_lib to kvm_system
scpcom Nov 25, 2024
c38c6de
buildroot: nanokvm: set executable attribute on libkvm.so
scpcom Nov 25, 2024
827d38e
buildroot: maix-cdk: update 20241201
scpcom Dec 1, 2024
87fe693
buildroot: maix-cdk: use TOOLCHAIN_EXTERNAL_BIN as bin_path
scpcom Dec 4, 2024
2d26e38
buildroot: maix-cdk: always use HOST_DIR python3
scpcom Dec 4, 2024
29ae1cd
nanokvm-server: update 20241126
scpcom Dec 10, 2024
afec959
buildroot: nanokvm: build 2.1.2
scpcom Dec 10, 2024
07a1cae
nanokvm-server: update 20241204
scpcom Dec 10, 2024
190c357
buildroot: tailscale: build from source
scpcom Dec 11, 2024
c093b3b
buildroot: maix-cdk: update 20241210
scpcom Dec 16, 2024
454d782
buildroot: maix-cdk: fix a53 build
scpcom Dec 26, 2024
78f5b07
buildroot: maix-cdk: fix gcc 13 compiler error
scpcom Dec 26, 2024
1a19d7c
tailscale: use HOST_GO_CROSS_ENV
scpcom Dec 26, 2024
2b2cb3f
nanokvm-server: fix a53 build
scpcom Dec 26, 2024
fa59491
maix-cdk: omv: fmath: disable asm on aarch64
scpcom Dec 28, 2024
728d930
buildroot: maix-cdk: move toolchain setup to MAIX_CDK_BUILD_CMDS
scpcom Dec 29, 2024
176e78b
cvitek-riscv64-musl-sysroot: TOOLCHAIN_EXTERNAL_BIN to get sysroot path
scpcom Dec 29, 2024
f30a92a
buildroot: maix-cdk: use TOPDIR to get middleware and osdrv path
scpcom Dec 29, 2024
326bf58
nanokvm-server: use TOPDIR to get middleware path
scpcom Dec 29, 2024
283b823
nanokvm: use TOPDIR to get middleware path
scpcom Dec 29, 2024
5db2cd9
buildroot: maix-cdk: update 20241221
scpcom Dec 30, 2024
2eb0bd9
nanokvm-server: update 20241227
scpcom Dec 29, 2024
77d65dc
buildroot: nanokvm: build 2.1.3
scpcom Dec 29, 2024
9b763b0
buildroot: maix-cdk: make libcli.so optional
scpcom Jan 1, 2025
9c85206
buildroot: maix-cdk: app_uvc_camera: add -lrt on glibc builds
scpcom Jan 1, 2025
f5a5bc5
buildroot: maix-cdk: uvc_demo: add -lrt on glibc builds
scpcom Jan 1, 2025
2629015
buildroot: maix-cdk: add support for gc2083
scpcom Jan 6, 2025
d9125ee
buildroot: maix-cdk: remove obsolete patch 0103
scpcom Jan 11, 2025
7bee859
buildroot: maix-cdk: update support for gc2083
scpcom Jan 11, 2025
eb066e5
buildroot: maix-cdk: update 20250110
scpcom Jan 11, 2025
b2028c6
buildroot: maix-cdk: [mlx90640] fix compile error
scpcom Jan 12, 2025
b4b33ab
buildroot: maix-cdk: update 20250111
scpcom Jan 12, 2025
b0b9c09
nanokvm-server: update 20250110
scpcom Jan 13, 2025
a9afbe4
buildroot: nanokvm: build 2.1.4
scpcom Jan 13, 2025
f08a5ca
nanokvm-server: update 20250114
scpcom Jan 15, 2025
5b1d77d
buildroot: nanokvm: build 2.1.5
scpcom Jan 15, 2025
f87948f
nanokvm-server: update 20250117
scpcom Jan 18, 2025
9645697
nanokvm-server: download image fixups
scpcom Jan 18, 2025
21d0ab7
buildroot: nanokvm: use kvm_system built with maixcdk if available
scpcom Jan 18, 2025
09976eb
nanokvm-server: storage: set device flags
scpcom Jan 18, 2025
68408a5
buildroot: maix-cdk: do not build all examples by default
scpcom Jan 19, 2025
972cbe2
nanokvm-server: install kvm_system to /kvmapp/kvm_system/
scpcom Jan 19, 2025
1f68347
buildroot: nanokvm: do not install kvm_system twice
scpcom Jan 19, 2025
7c2fb06
Revert "buildroot: maix-cdk: [mlx90640] fix compile error"
scpcom Jan 19, 2025
253797e
buildroot: maix-cdk: update 20250113
scpcom Jan 19, 2025
2cdf406
nanokvm-server: remove opencv4 dependency
scpcom Jan 27, 2025
56038ea
Revert "nanokvm-server: storage: set device flags"
scpcom Feb 2, 2025
c13e6e9
Revert "nanokvm-server: download image fixups"
scpcom Feb 2, 2025
82d5e3a
nanokvm-server: update 20250122
scpcom Feb 2, 2025
1e48889
buildroot: maix-cdk: add BR_PATH to maixcdk build
scpcom Feb 2, 2025
1c81edc
nanokvm-server: add BR_PATH to maixcdk build
scpcom Feb 2, 2025
c075c16
nanokvm-server: lock pnpm to 9.15.5
scpcom Feb 2, 2025
cf663dc
nanokvm-server: update 20250207
scpcom Feb 7, 2025
58426c8
nanokvm-server: update 20250214
scpcom Feb 14, 2025
f0013f6
buildroot: nanokvm: build 2.1.6
scpcom Feb 14, 2025
88aa22e
nanokvm-server: kvm_system: do not start NanoKVM-Server
scpcom Feb 4, 2025
a6e31de
nanokvm-server: use libkvm_mmf.so
scpcom Feb 15, 2025
0a727bd
nanokvm: use libkvm_mmf.so
scpcom Feb 15, 2025
71872d9
nanokvm-server: update 20250217
scpcom Feb 18, 2025
f36c987
buildroot: nanokvm: build 2.2.0
scpcom Feb 18, 2025
83abc8e
Revert "nanokvm-server: kvm_system: do not start NanoKVM-Server"
scpcom Feb 19, 2025
f4cb5ce
nanokvm-server: update 20250219
scpcom Feb 19, 2025
fc00a85
buildroot: nanokvm: do not overwrite kvm libs if built with maixcdk
scpcom Feb 20, 2025
dd14b02
nanokvm-server: kvm_mmf: reduce vi pool size
scpcom Feb 20, 2025
7ba4fdf
nanokvm-server: kvm_vision: cleanup venc on type change
scpcom Feb 20, 2025
b85c216
nanokvm-server: kvm_mmf: remove unused middleware libs
scpcom Feb 20, 2025
bc2d41e
nanokvm-server: update 20250221
scpcom Feb 21, 2025
38b1eb0
buildroot: nanokvm: build 2.2.1
scpcom Feb 21, 2025
bf126d7
nanokvm-server: kvm_vision: show test picture if no input signal is d…
scpcom Feb 22, 2025
98a3a35
nanokvm: enable lt_int
scpcom Feb 23, 2025
5954667
nanokvm-server: kvm_vision: use mmf_vi_aligned_width
scpcom Feb 23, 2025
97fc8bb
Remove "nanokvm-server: kvm_mmf: remove unused middleware libs"
scpcom Feb 26, 2025
17002cb
Revert "nanokvm-server: kvm_mmf: reduce vi pool size"
scpcom Feb 26, 2025
e74a668
Revert "nanokvm-server: kvm_vision: cleanup venc on type change"
scpcom Feb 26, 2025
b2107a9
nanokvm-server: kvm_vision: enable venc_auto_recyc by default
scpcom Feb 26, 2025
b922bac
nanokvm-server: update 20250225
scpcom Feb 26, 2025
12ccb80
nanokvm-server: restore kvm_system
scpcom Feb 28, 2025
31d2bbd
nanokvm-server: update 20250227
scpcom Feb 28, 2025
a81ec23
nanokvm-server: kvm_system: add return value to get_ping_allow_state …
scpcom Mar 1, 2025
72a417d
Revert "nanokvm-server: restore kvm_system"
scpcom Mar 3, 2025
dbe8e35
nanokvm-server: update 20250303
scpcom Mar 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions buildroot/DEVELOPERS
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ F: package/fuse-overlayfs/
F: package/go/
F: package/go-bootstrap-stage1/
F: package/go-bootstrap-stage2/
F: package/go-bootstrap-stage3/
F: package/gocryptfs/
F: package/mbpfan/
F: package/moby-buildkit/
Expand Down
42 changes: 41 additions & 1 deletion buildroot/board/cvitek/SG200X/overlay/etc/init.d/S30eth
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,56 @@

. /etc/profile

# /boot/eth.nodhcp for example
# ipaddr/net gw[optional]
# 192.168.0.101/24 192.168.0.1
# 192.168.3.116/22

RESERVE_INET="192.168.0.1/24"

start() {
printf "start ethernet: "
if [ ! -e /boot/eth.nodhcp ]
if [ -e /boot/eth.nodhcp ]
then
cat /boot/eth.nodhcp | while read inet gw
do
addr=${inet%/*}
netid=${inet#*/}
[ -z $gw ] &&
gw=$( echo $addr| ( IFS='.' read a b c d; echo $((
(((((($a<<8)+$b)<<8)+$c)<<8)+$d)
& (((1<<$netid)-1)<<(32-$netid))
))
)) &&
gw=$(($gw>>24&0xff)).$(($gw>>16&0xff)).$(($gw>>8&0xff)).$((1+( $gw>>0&0xff )))

arping -Dqc2 -Ieth0 $addr || continue
ip a add $inet brd + dev eth0
ip r add default via $gw dev eth0
cat > /etc/resolve.conf << EOF
nameserver $gw
nameserver 8.8.8.8
nameserver 114.114.114.114
EOF
break
done &&
ip a show dev eth0|grep inet || (
udhcpc -i eth0 -t 3 -T 1 -A 5 -b -p /run/udhcpc.eth0.pid &>/dev/null
ip a show dev eth0|grep inet
) || (
# failed to apply dynamic addr, need a available static addr to visit the LAN
inet=$RESERVE_INET
addr=${inet%/*}
ip a add $inet brd + dev eth0
) || exit 1
else
(udhcpc -i eth0 -t 10 -T 1 -A 5 -b -p /run/udhcpc.eth0.pid) &
fi
echo "OK"
}

stop() {
[[ ! -e "/run/udhcpc.eth0.pid" ]] && echo "udhcpc is not running..." && exit 1
kill `cat /run/udhcpc.eth0.pid`
rm /run/udhcpc.eth0.pid
}
Expand Down
3 changes: 3 additions & 0 deletions buildroot/configs/cvitek_SG200X_musl_riscv64_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,9 @@ BR2_PACKAGE_PYTHON_XLWT=y
BR2_PACKAGE_PYTHON_XMODEM=y
BR2_PACKAGE_PYTHON_ZEROCONF=y

BR2_PACKAGE_HOST_PYTHON3=y
BR2_PACKAGE_HOST_PYTHON3_SSL=y

# BR2_PACKAGE_MGBA is not set
# BR2_PACKAGE_GB_TEST_ROMS is not set

Expand Down
4 changes: 4 additions & 0 deletions buildroot/package/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -2806,6 +2806,10 @@ menu "Sipeed"
source "package/aic8800-sdio-firmware/Config.in"
source "package/cvitek-riscv64-musl-sysroot/Config.in"
source "package/lcdtest/Config.in"
source "package/maix-cdk/Config.in"
source "package/nanokvm-server/Config.in"
source "package/nanokvm-sg200x/Config.in"
source "package/tailscale-riscv64/Config.in"
source "package/tpudemo-sg200x/Config.in"
source "package/xuantie-gdb/Config.in"
source "package/sg2002-codec-firmware/Config.in"
Expand Down
1 change: 1 addition & 0 deletions buildroot/package/Config.in.host
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ menu "Host utilities"
source "package/go/Config.in.host"
source "package/go-bootstrap-stage1/Config.in.host"
source "package/go-bootstrap-stage2/Config.in.host"
source "package/go-bootstrap-stage3/Config.in.host"
source "package/google-breakpad/Config.in.host"
source "package/gptfdisk/Config.in.host"
source "package/imagemagick/Config.in.host"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,21 @@
#
################################################################################

CVITEK_RISCV64_MUSL_SYSROOT_VERSION = fb0a6ac7409fb477c5f46ced75bf05527def7cb9
CVITEK_RISCV64_MUSL_SYSROOT_SITE = $(call github,0x754C,cvitek-riscv64-musl-sysroot,$(CVITEK_RISCV64_MUSL_SYSROOT_VERSION))
CVITEK_RISCV64_MUSL_SYSROOT_VERSION = 1.0.0
CVITEK_RISCV64_MUSL_SYSROOT_SITE = $(TOPDIR)/package/cvitek-riscv64-musl-sysroot
CVITEK_RISCV64_MUSL_SYSROOT_SITE_METHOD = local

define CVITEK_RISCV64_MUSL_SYSROOT_BUILD_CMDS
rm -f $(@D)/Config*
rm -f $(@D)/*.mk
mkdir -pv $(@D)/usr/lib/
if [ ! -e $(@D)/lib ]; then \
ln -s usr/lib $(@D)/lib ; \
fi
if [ -e $(realpath $(TOOLCHAIN_EXTERNAL_BIN)../sysroot/lib) ]; then \
rsync -r --verbose --copy-dirlinks --copy-links --hard-links $(realpath $(TOOLCHAIN_EXTERNAL_BIN)../sysroot/lib)/ld-*.so* $(@D)/usr/lib/ ; \
fi
endef

define CVITEK_RISCV64_MUSL_SYSROOT_INSTALL_TARGET_CMDS
rsync -av ${@D}/* $(TARGET_DIR)/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# From https://go.dev/dl
sha256 e25c9ab72d811142b7f41ff6da5165fec2d1be5feec3ef2c66bc0bdecb431489 go1.19.11.src.tar.gz
sha256 ccf36b53fb0024a017353c3ddb22c1f00bc7a8073c6aac79042da24ee34434d3 go1.19.13.src.tar.gz
sha256 2d36597f7117c38b006835ae7f537487207d8ec407aa9d9980794b2030cbc067 LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Use last Go version that go-bootstrap-stage1 can build: v1.19.x
# See https://golang.org/doc/install/source#bootstrapFromSource
GO_BOOTSTRAP_STAGE2_VERSION = 1.19.11
GO_BOOTSTRAP_STAGE2_VERSION = 1.19.13
GO_BOOTSTRAP_STAGE2_SITE = https://storage.googleapis.com/golang
GO_BOOTSTRAP_STAGE2_SOURCE = go$(GO_BOOTSTRAP_STAGE2_VERSION).src.tar.gz

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
From 6b05378097c6a386ed9912d2471976dc39504e86 Mon Sep 17 00:00:00 2001
From: Christian Stewart <[email protected]>
Date: Thu, 27 Jul 2023 21:28:47 -0700
Subject: [PATCH] cmd/dist: set buildvcs=false when building go-bootstrap

When building go-bootstrap as part of the make.bash process, the cmd/dist
invokes the bootstrap Go compiler to build the go_bootstrap tool:

${GOROOT_BOOTSTRAP}/bin/go install -tags=math_big_pure_go compiler_bootstrap purego bootstrap/cmd/...

If there is an invalid .git directory in a parent of ${GOROOT_BOOTSTRAP},
make.bash will fail. Reproduction of the issue:

mkdir go-issue-61620
cd ./go-issue-61620
wget https://go.dev/dl/go1.19.11.src.tar.gz
mkdir go-bootstrap
tar -xf go1.19.11.src.tar.gz -C ./go-bootstrap --strip-components=1
cd ./go-bootstrap/src/
bash make.bash
cd ../../
wget https://go.dev/dl/go1.20.6.src.tar.gz
mkdir go
tar -xf go1.20.6.src.tar.gz -C ./go/ --strip-components=1
printf "gitdir: ../../does/not/exist/.git" > ./.git
cd ./go/src/
GOROOT_BOOTSTRAP=$(pwd)/../../go-bootstrap/ bash make.bash

The build fails with the following error:

Building Go toolchain1 using [snip]/go-1.19.10.
error obtaining VCS status: exit status 128
Use -buildvcs=false to disable VCS stamping.
go tool dist: FAILED: [snip]/go-1.19.10/bin/go install -tags=math_big_pure_go \
compiler_bootstrap purego bootstrap/cmd/...: exit status 1

This change unconditionally sets -buildvcs=false when compiling go-bootstrap. We
don't need the revision information in those binaries anyway. Setting this flag
was previously not done as we were unsure if the go-bootstrap compiler would be
new enough to support the buildvcs build flag. Since Go 1.20.x, Go 1.19.x is the
minimum version for go-bootstrap, and supports -buildvcs=false. We can now set
-buildvcs=false without worrying about compatibility.

Related: https://github.com/golang/go/issues/54852
Fixes: https://github.com/golang/go/issues/61620

Upstream: https://github.com/golang/go/pull/61621

Signed-off-by: Christian Stewart <[email protected]>
Signed-off-by: Romain Naour <[email protected]>
---
src/cmd/dist/buildtool.go | 3 +++
1 file changed, 3 insertions(+)

diff --git a/src/cmd/dist/buildtool.go b/src/cmd/dist/buildtool.go
index a528d7aa76..3b411d6ebb 100644
--- a/src/cmd/dist/buildtool.go
+++ b/src/cmd/dist/buildtool.go
@@ -221,6 +221,9 @@ func bootstrapBuildTools() {
cmd := []string{
pathf("%s/bin/go", goroot_bootstrap),
"install",
+ // Fixes cases where an invalid .git is present in a parent of GOROOT_BOOTSTRAP.
+ // See: https://github.com/golang/go/issues/61620
+ "-buildvcs=false",
"-tags=math_big_pure_go compiler_bootstrap purego",
}
if vflag > 0 {
--
2.41.0

4 changes: 4 additions & 0 deletions buildroot/package/go-bootstrap-stage3/Config.in.host
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
config BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS
bool
default y
depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE2_ARCH_SUPPORTS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# From https://go.dev/dl
sha256 dc806cf75a87e1414b5b4c3dcb9dd3e9cc98f4cfccec42b7af617d5a658a3c43 go1.21.8.src.tar.gz
sha256 2d36597f7117c38b006835ae7f537487207d8ec407aa9d9980794b2030cbc067 LICENSE
54 changes: 54 additions & 0 deletions buildroot/package/go-bootstrap-stage3/go-bootstrap-stage3.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
################################################################################
#
# go-bootstrap-stage3
#
################################################################################

# Use last Go version that go-bootstrap-stage2 can build: v1.21.x
# See https://go.dev/doc/go1.22#bootstrap
GO_BOOTSTRAP_STAGE3_VERSION = 1.21.8
GO_BOOTSTRAP_STAGE3_SITE = https://storage.googleapis.com/golang
GO_BOOTSTRAP_STAGE3_SOURCE = go$(GO_BOOTSTRAP_STAGE3_VERSION).src.tar.gz

GO_BOOTSTRAP_STAGE3_LICENSE = BSD-3-Clause
GO_BOOTSTRAP_STAGE3_LICENSE_FILES = LICENSE

# Use go-bootstrap-stage2 to bootstrap.
HOST_GO_BOOTSTRAP_STAGE3_DEPENDENCIES = host-go-bootstrap-stage2

HOST_GO_BOOTSTRAP_STAGE3_ROOT = $(HOST_DIR)/lib/go-$(GO_BOOTSTRAP_STAGE3_VERSION)

# The go build system is not compatible with ccache, so use
# HOSTCC_NOCCACHE. See https://github.com/golang/go/issues/11685.
HOST_GO_BOOTSTRAP_STAGE3_MAKE_ENV = \
GO111MODULE=off \
GOCACHE=$(HOST_GO_HOST_CACHE) \
GOROOT_BOOTSTRAP=$(HOST_GO_BOOTSTRAP_STAGE2_ROOT) \
GOROOT_FINAL=$(HOST_GO_BOOTSTRAP_STAGE3_ROOT) \
GOROOT="$(@D)" \
GOBIN="$(@D)/bin" \
GOOS=linux \
CC=$(HOSTCC_NOCCACHE) \
CXX=$(HOSTCXX_NOCCACHE) \
CGO_ENABLED=0

define HOST_GO_BOOTSTRAP_STAGE3_BUILD_CMDS
cd $(@D)/src && \
$(HOST_GO_BOOTSTRAP_STAGE3_MAKE_ENV) ./make.bash $(if $(VERBOSE),-v)
endef

define HOST_GO_BOOTSTRAP_STAGE3_INSTALL_CMDS
$(INSTALL) -D -m 0755 $(@D)/bin/go $(HOST_GO_BOOTSTRAP_STAGE3_ROOT)/bin/go
$(INSTALL) -D -m 0755 $(@D)/bin/gofmt $(HOST_GO_BOOTSTRAP_STAGE3_ROOT)/bin/gofmt

cp -a $(@D)/lib $(HOST_GO_BOOTSTRAP_STAGE3_ROOT)/

mkdir -p $(HOST_GO_BOOTSTRAP_STAGE3_ROOT)/pkg
cp -a $(@D)/pkg/include $(HOST_GO_BOOTSTRAP_STAGE3_ROOT)/pkg/
cp -a $(@D)/pkg/tool $(HOST_GO_BOOTSTRAP_STAGE3_ROOT)/pkg/

# The Go sources must be installed to the host/ tree for the Go stdlib.
cp -a $(@D)/src $(HOST_GO_BOOTSTRAP_STAGE3_ROOT)/
endef

$(eval $(host-generic-package))
4 changes: 2 additions & 2 deletions buildroot/package/go/Config.in.host
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
config BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
bool
default y
depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE2_ARCH_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS
# See https://go.dev/doc/install/source#environment
# See src/go/build/syslist.go for the list of supported architectures
depends on (BR2_arm && BR2_TOOLCHAIN_SUPPORTS_PIE) || BR2_aarch64 \
Expand Down Expand Up @@ -30,4 +30,4 @@ config BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
config BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS
bool
default y
depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE2_ARCH_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS
2 changes: 1 addition & 1 deletion buildroot/package/go/go.hash
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# From https://go.dev/dl
sha256 00197ab20f33813832bff62fd93cca1c42a08cc689a32a6672ca49591959bff6 go1.21.7.src.tar.gz
sha256 ac9c723f224969aee624bc34fd34c9e13f2a212d75c71c807de644bb46e112f6 go1.22.5.src.tar.gz
sha256 2d36597f7117c38b006835ae7f537487207d8ec407aa9d9980794b2030cbc067 LICENSE
6 changes: 3 additions & 3 deletions buildroot/package/go/go.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
#
################################################################################

GO_VERSION = 1.21.7
GO_VERSION = 1.22.5
GO_SITE = https://storage.googleapis.com/golang
GO_SOURCE = go$(GO_VERSION).src.tar.gz

GO_LICENSE = BSD-3-Clause
GO_LICENSE_FILES = LICENSE
GO_CPE_ID_VENDOR = golang

HOST_GO_DEPENDENCIES = host-go-bootstrap-stage2
HOST_GO_DEPENDENCIES = host-go-bootstrap-stage3
HOST_GO_GOPATH = $(HOST_DIR)/share/go-path
HOST_GO_HOST_CACHE = $(HOST_DIR)/share/host-go-cache
HOST_GO_ROOT = $(HOST_DIR)/lib/go
Expand Down Expand Up @@ -128,7 +128,7 @@ HOST_GO_HOST_ENV = \
HOST_GO_MAKE_ENV = \
GO111MODULE=off \
GOCACHE=$(HOST_GO_HOST_CACHE) \
GOROOT_BOOTSTRAP=$(HOST_GO_BOOTSTRAP_STAGE2_ROOT) \
GOROOT_BOOTSTRAP=$(HOST_GO_BOOTSTRAP_STAGE3_ROOT) \
GOROOT_FINAL=$(HOST_GO_ROOT) \
GOROOT="$(@D)" \
GOBIN="$(@D)/bin" \
Expand Down
61 changes: 61 additions & 0 deletions buildroot/package/maix-cdk/0000-add-distapps.sh.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
From 41f213a4fff2ea878ee888c99d38ed47cbe93476 Mon Sep 17 00:00:00 2001
From: scpcom <[email protected]>
Date: Sun, 27 Oct 2024 07:24:26 +0100
Subject: [PATCH] add distapps.sh

---
distapps.sh | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
create mode 100755 distapps.sh

diff --git a/distapps.sh b/distapps.sh
new file mode 100755
index 0000000..723b1d7
--- /dev/null
+++ b/distapps.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+m=`dirname $0`
+t=${m}/dist
+rm -rf ${t}/maixapp/
+mkdir -p ${t}
+t=${t}/maixapp
+mkdir ${t}
+mkdir ${t}/lib
+mkdir ${t}/tmp
+l=${t}/lib
+echo "projects:"
+for d in $m/projects/app_* ; do
+ a=`dirname $d`
+ b=`basename $d | cut -d '_' -f 2-`
+ #if [ ! -e ${d}/dist/${b}_release/${b} ]; then
+ if [ -e ${a}/apps/${b}/${b} ]; then
+ echo $b
+ mkdir ${t}/${b}
+ rsync -avpPxH ${a}/apps/${b}/ ${t}/${b}/
+ chmod +x ${t}/${b}/${b}
+ if [ -d ${t}/${b}/dl_lib ]; then
+ rsync -avpPxH ${a}/apps/${b}/dl_lib/ ${l}/
+ rm -rf ${t}/${b}/dl_lib/
+ ln -s ../lib ${t}/${b}/dl_lib
+ fi
+ fi
+done
+echo "examples:"
+for d in $m/examples/* ; do
+ b=`basename $d`
+ if [ -e ${d}/dist/${b}_release/${b} ]; then
+ echo $b
+ mkdir ${t}/${b}
+ rsync -avpPxH ${d}/dist/${b}_release/ ${t}/${b}/
+ chmod +x ${t}/${b}/${b}
+ if [ -d ${t}/${b}/dl_lib ]; then
+ rsync -avpPxH ${d}/dist/${b}_release/dl_lib/ ${l}/
+ rm -rf ${t}/${b}/dl_lib/
+ ln -s ../lib ${t}/${b}/dl_lib
+ fi
+ fi
+done
--
2.34.1

Loading