Open KevinMX opened 4 months ago
Sigh. The MilkV people removed the repo for unknown reasons. I’ll have to rebase against the Sophgo repo instead. But I’m swamped with real life at the moment so might take me a while.
(Checking out the full buildroot at MilkV just for fsbl is a bit heavy!)
The reason is that many users have been complaining that the SDK is not fully open source, so Sophgo has gradually opened up some source codes, including fsbl. Sophgo changed fsbl to source code compilation, and we also synchronized Sophgo's source code.
Sigh. The MilkV people removed the repo for unknown reasons. I’ll have to rebase against the Sophgo repo instead. But I’m swamped with real life at the moment so might take me a while.
(Checking out the full buildroot at MilkV just for fsbl is a bit heavy!)
You can do something like a sparse clone to avoid cloning the whole repo, but only the specific folder inside the repo.
Since GitHub already deprecated svn so for now it's a bit more complicated:
# Clone a sub-directory of a git repository. Probably replaces "svn co" which is deprecated by GitHub.
# Usage: git_sparse_clone $repo_url $repo_branch $sub_directory $target_location
function git_sparse_clone() {
git clone --filter=blob:none --no-checkout --depth=1 -b $2 $1 upstream && cd upstream
git sparse-checkout init --cone
git sparse-checkout set $3
git checkout
mv $3 ../$4
cd ../ && rm -rf upstream
}
And BTW, your Docker image is failing to build ATM. You'l probably want to change from Debian sid to bookworm. The latter works for me.
Any fixes for this yet, or is there anything I can contribute here to fix it? Not entirely sure how the repo/scripts are set up, or where the FSBL we need actually is 😅
same problem
Hey guys I've been trying to get this to build for a day or so. I solved this particular fsbl repo being moved like so
First clone the milk-v SDK inside of your sophgo-sg200x-debian directory:
git clone git@github.com:milkv-duo/duo-buildroot-sdk.git
Then make these changes to the Makefile. They just switch from cloning these dead repos to using your local copy:
diff --git a/scripts/Makefile b/scripts/Makefile
index 24a59c7..23cb217 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -79,8 +79,8 @@ linux-clean:
$(BUILDDIR)/uboot-prepare-checkout-stamp:
@echo "$(COLOUR_GREEN)Checking out U-Boot for $(BOARD)$(END_COLOUR)"
@mkdir -p $(BUILDDIR)
- @git clone --depth 1 https://github.com/milkv-duo/u-boot-2021.10.git $(BUILDDIR)/u-boot
- @cd $(BUILDDIR)/u-boot && git checkout a57aa1f
+ @cp -r ./sdk/u-boot-2021.10 $(BUILDDIR)/u-boot
+ @cd $(BUILDDIR)/u-boot
@touch $@
$(BUILDDIR)/uboot-prepare-patch-stamp: $(BUILDDIR)/uboot-prepare-checkout-stamp
@@ -151,8 +151,8 @@ opensbi-clean:
$(BUILDDIR)/fsbl-prepare-checkout-stamp:
@echo "$(COLOUR_GREEN)Checking out FSBL for $(BOARD)$(END_COLOUR)"
@mkdir -p $(BUILDDIR)
- @git clone -b milkv --depth 1 https://github.com/milkv-duo/fsbl.git $(BUILDDIR)/fsbl
- @cd $(BUILDDIR)/fsbl && git checkout beb1483
+ @cp -r ./sdk/fsbl $(BUILDDIR)/fsbl
+ @cd $(BUILDDIR)/fsbl
@touch $@
Then modify the build_image script to include the sdk inside of the docker container
diff --git a/build_image.sh b/build_image.sh
index 2262526..9aef6f0 100755
--- a/build_image.sh
+++ b/build_image.sh
@@ -1,2 +1,6 @@
#!/bin/sh
-docker run --privileged -it --rm -v ./configs/:/configs -v ./image:/output builder make BOARD=licheervnano image
+docker run --privileged -it --rm \
+ -v ./configs/:/configs \
+ -v ./image:/output \
+ -v $(pwd)/duo-buildroot-sdk:/builder/sdk \
+ builder make BOARD=duos image
Then build like so:
./build_docker.sh
./build_image.sh
This fixes the original issue but the build still fails for me. There is an error complaining about GPG keys. I tried skipping those steps by commenting out those parts of the Makefile but we eventually run into more issues related to the patches here in configs/common/patches
.
I think the issue is that the repos that were originally cloned in this build script (fsbl, uboot, etc) differ pretty significantly from the current versions in the duo-buildroot-sdk repo.
If anyone has managed to build this Debian image please let me know how you managed to do it. Thanks!
If anyone has managed to build this Debian image please let me know how you managed to do it. Thanks!
Would require many changes. As Fishwaldo said and AFAIK many patches need to be rebased against the sophgo repo. You can't just apply those patches to the upstream sophgo repo for now. You'll need to changes some.
I some how managed to build an image for Duo S, however it's not booting up properly. Will investigate further.
Got it building for Duo-s. Also got the TPU working with the old buildroot-sdk libs. Check it out: https://github.com/nuha-inc/sophgo-sg200x-debian/
It's working well for me. Anyone using this give it a shot and let me know any comments/concerns. Thanks!
Seems the original milkv-duo/fsbl repo has moved/gone.
There is an fsbl repo at https://github.com/milkv-duo/duo-buildroot-sdk/tree/develop/fsbl though. I guess some changes might be needed?